Make the delay a configurable member on the webRtcPlayerObj

This commit is contained in:
William Belcher 2022-08-19 11:27:50 +10:00
parent 3b1b841722
commit 84a095eb01
No known key found for this signature in database
GPG Key ID: 7BF4576B59CBDA2D
2 changed files with 6 additions and 2 deletions

View File

@ -1148,7 +1148,7 @@ function showFreezeFrame() {
}
setTimeout(() => {
webRtcPlayerObj.setVideoEnabled(false);
}, 50);
}, webRtcPlayerObj.freezeFrameDelay);
};
}
@ -1685,7 +1685,7 @@ function invalidateFreezeFrameOverlay() {
freezeFrameOverlay.style.display = 'none';
freezeFrame.valid = false;
freezeFrameOverlay.classList.remove("freezeframeBackground");
}, 50);
}, webRtcPlayerObj.freezeFrameDelay);
if (webRtcPlayerObj) {
webRtcPlayerObj.setVideoEnabled(true);

View File

@ -80,6 +80,10 @@ function webRtcPlayer(parOptions) {
"The browser will signal it would prefer an SFU connection. Remove ?preferSFU from the url to signal for P2P usage." :
"The browser will signal for a P2P connection. Pass ?preferSFU in the url to signal for SFU usage.");
// The delay between the showing/unshowing of a freeze frame and when the stream will stop/start
// eg showing freeze frame -> delay -> stop stream OR show stream -> delay -> unshow freeze frame
this.freezeFrameDelay = 50; // ms
// Latency tester
this.latencyTestTimings =
{