Browse Source

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.
master
Pawel Domas 4 years ago
parent
commit
a0806716ae

+ 7
- 0
react/features/stream-effects/presenter/JitsiStreamPresenterEffect.js View File

59
         this._videoElement.autoplay = true;
59
         this._videoElement.autoplay = true;
60
         this._videoElement.srcObject = videoStream;
60
         this._videoElement.srcObject = videoStream;
61
 
61
 
62
+        // autoplay is not enough to start the video on Safari, it's fine to call play() on other platforms as well
63
+        this._videoElement.play();
64
+
62
         // set the style attribute of the div to make it invisible
65
         // set the style attribute of the div to make it invisible
63
         videoDiv.style.display = 'none';
66
         videoDiv.style.display = 'none';
64
 
67
 
132
         this._desktopElement.height = parseInt(height, 10);
135
         this._desktopElement.height = parseInt(height, 10);
133
         this._desktopElement.autoplay = true;
136
         this._desktopElement.autoplay = true;
134
         this._desktopElement.srcObject = desktopStream;
137
         this._desktopElement.srcObject = desktopStream;
138
+
139
+        // autoplay is not enough to start the video on Safari, it's fine to call play() on other platforms as well
140
+        this._desktopElement.play();
141
+
135
         this._canvas.width = parseInt(width, 10);
142
         this._canvas.width = parseInt(width, 10);
136
         this._canvas.height = parseInt(height, 10);
143
         this._canvas.height = parseInt(height, 10);
137
         this._videoFrameTimerWorker = new Worker(timerWorkerScript, { name: 'Presenter effect worker' });
144
         this._videoFrameTimerWorker = new Worker(timerWorkerScript, { name: 'Presenter effect worker' });

Loading…
Cancel
Save