瀏覽代碼

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 年之前
父節點
當前提交
a0806716ae
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. 7
    0
      react/features/stream-effects/presenter/JitsiStreamPresenterEffect.js

+ 7
- 0
react/features/stream-effects/presenter/JitsiStreamPresenterEffect.js 查看文件

@@ -59,6 +59,9 @@ export default class JitsiStreamPresenterEffect {
59 59
         this._videoElement.autoplay = true;
60 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 65
         // set the style attribute of the div to make it invisible
63 66
         videoDiv.style.display = 'none';
64 67
 
@@ -132,6 +135,10 @@ export default class JitsiStreamPresenterEffect {
132 135
         this._desktopElement.height = parseInt(height, 10);
133 136
         this._desktopElement.autoplay = true;
134 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 142
         this._canvas.width = parseInt(width, 10);
136 143
         this._canvas.height = parseInt(height, 10);
137 144
         this._videoFrameTimerWorker = new Worker(timerWorkerScript, { name: 'Presenter effect worker' });

Loading…
取消
儲存