From d5dd34dedeae6853d4e79f4c4f238c4f048e7c53 Mon Sep 17 00:00:00 2001 From: isymchych Date: Mon, 25 Jan 2016 18:31:56 +0200 Subject: [PATCH] fix switching Large video on Safari --- modules/UI/videolayout/LargeVideo.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/modules/UI/videolayout/LargeVideo.js b/modules/UI/videolayout/LargeVideo.js index 703d73e07..43120257b 100644 --- a/modules/UI/videolayout/LargeVideo.js +++ b/modules/UI/videolayout/LargeVideo.js @@ -165,7 +165,6 @@ class VideoContainer extends LargeContainer { get id () { return getStreamOwnerId(this.stream); - return getStreamId(this.stream); } constructor (onPlay) { @@ -275,7 +274,27 @@ class VideoContainer extends LargeContainer { this.stream = stream; this.videoType = videoType; - stream.attach(this.$video); + if (RTCBrowserType.isTemasysPluginUsed()) { + // when Temasys plugin is in use stream.attach fails + // if element is not visible + // so we need to make it visible, but opaque + + this.$wrapper.show().css({ + opacity: 0 + }); + + try { + stream.attach(this.$video); + } catch (e) { + console.error('failed to attach stream', e); + } + + this.$wrapper.hide().css({ + opacity: '' + }); + } else { + stream.attach(this.$video); + } let flipX = stream.isLocal() && !this.isScreenSharing(); this.$video.css({