From 81442016369b7b2ffa133255b0e91e6cbfc6ea6d Mon Sep 17 00:00:00 2001 From: paweldomas Date: Tue, 2 Feb 2016 11:37:06 -0600 Subject: [PATCH] Uses RTCUIHelper class from lib-jitsi-meet to select video elements. --- modules/UI/videolayout/SmallVideo.js | 30 +++------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/modules/UI/videolayout/SmallVideo.js b/modules/UI/videolayout/SmallVideo.js index 9b2e26485..b6aa04d88 100644 --- a/modules/UI/videolayout/SmallVideo.js +++ b/modules/UI/videolayout/SmallVideo.js @@ -5,6 +5,8 @@ import UIUtil from "../util/UIUtil"; var RTCBrowserType = require("../../RTC/RTCBrowserType"); +const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper; + function SmallVideo() { this.isMuted = false; this.hasAvatar = false; @@ -296,33 +298,7 @@ SmallVideo.prototype.createModeratorIndicatorElement = function () { }; SmallVideo.prototype.selectVideoElement = function () { - var videoElemName; - if (!RTCBrowserType.isTemasysPluginUsed()) { - videoElemName = 'video'; - return $('#' + this.videoSpanId).find(videoElemName); - } else { - videoElemName = 'object'; - var matching = $('#' + this.videoSpanId + - (this.isLocal ? '>>' : '>') + - videoElemName + '>param[value="video"]'); - if (matching.length < 2) { - return matching.parent(); - } - - // there are 2 video objects from FF - // object with id which ends with '_default' (like 'remoteVideo_default') - // doesn't contain video, so we ignore it - for (var i = 0; i < matching.length; i += 1) { - var el = matching[i].parentNode; - - // check id suffix - if (el.id.substr(-8) !== '_default') { - return $(el); - } - } - - return $([]); - } + return $(RTCUIHelper.findVideoElement($('#' + this.videoSpanId)[0])); }; SmallVideo.prototype.focus = function(isFocused) {