瀏覽代碼

JitsiTrack#attach method will show back hidden stream element if Temasys plugin is in use.

dev1
paweldomas 9 年之前
父節點
當前提交
c412071839
共有 1 個檔案被更改,包括 15 行新增2 行删除
  1. 15
    2
      modules/RTC/JitsiTrack.js

+ 15
- 2
modules/RTC/JitsiTrack.js 查看文件

1
+var logger = require("jitsi-meet-logger").getLogger(__filename);
1
 var RTCBrowserType = require("./RTCBrowserType");
2
 var RTCBrowserType = require("./RTCBrowserType");
2
 var JitsiTrackEvents = require("../../JitsiTrackEvents");
3
 var JitsiTrackEvents = require("../../JitsiTrackEvents");
3
 var EventEmitter = require("events");
4
 var EventEmitter = require("events");
154
  * Note that Temasys plugin will replace original audio/video element with
155
  * Note that Temasys plugin will replace original audio/video element with
155
  * 'object' when stream is being attached to the container for the first time.
156
  * 'object' when stream is being attached to the container for the first time.
156
  *
157
  *
158
+ * * NOTE * if given container element is not visible when the stream is being
159
+ * attached it will be shown back given that Temasys plugin is currently in use.
160
+ *
157
  * @param container the HTML container which can be 'video' or 'audio' element.
161
  * @param container the HTML container which can be 'video' or 'audio' element.
158
  *        It can also be 'object' element if Temasys plugin is in use and this
162
  *        It can also be 'object' element if Temasys plugin is in use and this
159
  *        method has been called previously on video or audio HTML element.
163
  *        method has been called previously on video or audio HTML element.
162
  *          library. That's the case when Temasys plugin is in use.
166
  *          library. That's the case when Temasys plugin is in use.
163
  */
167
  */
164
 JitsiTrack.prototype.attach = function (container) {
168
 JitsiTrack.prototype.attach = function (container) {
165
-    if(this.stream)
166
-        container = require("./RTCUtils").attachMediaStream(container, this.stream);
169
+    if(this.stream) {
170
+        // The container must be visible in order to play or attach the stream
171
+        // when Temasys plugin is in use
172
+        var containerSel = $(container);
173
+        if (RTCBrowserType.isTemasysPluginUsed() &&
174
+            !containerSel.is(':visible')) {
175
+            containerSel.show();
176
+        }
177
+        container
178
+            = require("./RTCUtils").attachMediaStream(container, this.stream);
179
+    }
167
     this.containers.push(container);
180
     this.containers.push(container);
168
     return container;
181
     return container;
169
 }
182
 }

Loading…
取消
儲存