fix(JitsiStreamPresenterEffect): frozen on Safari

Canvas rendering does not work as expected on Safari - the image stays
still on the first frame. Calling play() on the video tags seems to help.
This commit is contained in:
Pawel Domas 2021-01-07 09:20:47 -06:00 committed by Jaya Allamsetty
parent 3677a2f769
commit a0806716ae
1 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,9 @@ export default class JitsiStreamPresenterEffect {
this._videoElement.autoplay = true;
this._videoElement.srcObject = videoStream;
// autoplay is not enough to start the video on Safari, it's fine to call play() on other platforms as well
this._videoElement.play();
// set the style attribute of the div to make it invisible
videoDiv.style.display = 'none';
@ -132,6 +135,10 @@ export default class JitsiStreamPresenterEffect {
this._desktopElement.height = parseInt(height, 10);
this._desktopElement.autoplay = true;
this._desktopElement.srcObject = desktopStream;
// autoplay is not enough to start the video on Safari, it's fine to call play() on other platforms as well
this._desktopElement.play();
this._canvas.width = parseInt(width, 10);
this._canvas.height = parseInt(height, 10);
this._videoFrameTimerWorker = new Worker(timerWorkerScript, { name: 'Presenter effect worker' });