|
|
@ -26,6 +26,7 @@ |
|
|
|
right: 0; |
|
|
|
width: 100%; |
|
|
|
height: 33%; |
|
|
|
pointer-events: all; |
|
|
|
} |
|
|
|
p { |
|
|
|
position: relative; |
|
|
@ -45,12 +46,9 @@ |
|
|
|
opacity: 0.6; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
#textoverlay, #controls, .stats-box { |
|
|
|
#textoverlay, .stats-box { |
|
|
|
pointer-events: none; |
|
|
|
} |
|
|
|
#controls canvas { |
|
|
|
pointer-events: all; |
|
|
|
} |
|
|
|
</style> |
|
|
|
</head> |
|
|
|
<body> |
|
|
@ -199,24 +197,26 @@ socket.on('battery', (data) => { |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
statsInterval = window.setInterval(getConnectionStats, 1000); |
|
|
|
function getConnectionStats() { |
|
|
|
if (webrtcPeerConnection) { |
|
|
|
webrtcPeerConnection.getStats(null).then(stats => { |
|
|
|
var statsOutput = ""; |
|
|
|
|
|
|
|
function getConnectionStats() { |
|
|
|
webrtcPeerConnection.getStats(null).then(stats => { |
|
|
|
var statsOutput = ""; |
|
|
|
|
|
|
|
stats.forEach(report => { |
|
|
|
if (report.type === "inbound-rtp" && report.kind === "video") { |
|
|
|
Object.keys(report).forEach(statName => { |
|
|
|
statsOutput += `<strong>${statName}:</strong> ${report[statName]}<br>\n`; |
|
|
|
}); |
|
|
|
} |
|
|
|
stats.forEach(report => { |
|
|
|
if (report.type === "inbound-rtp" && report.kind === "video") { |
|
|
|
Object.keys(report).forEach(statName => { |
|
|
|
statsOutput += `<strong>${statName}:</strong> ${report[statName]}<br>\n`; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
document.querySelector(".stats-box").innerHTML = statsOutput; |
|
|
|
}); |
|
|
|
|
|
|
|
document.querySelector(".stats-box").innerHTML = statsOutput; |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var statsInterval = window.setInterval(getConnectionStats, 1000); |
|
|
|
|
|
|
|
</script> |
|
|
|
|
|
|
|
<script src="{{ url_for('frontend.gamepad_js') }}"></script> |
|
|
|