Uses RTCUIHelper class from lib-jitsi-meet to select video elements.

This commit is contained in:
paweldomas 2016-02-02 11:37:06 -06:00
parent a6ff9f8ee2
commit 8144201636
1 changed files with 3 additions and 27 deletions

View File

@ -5,6 +5,8 @@ import UIUtil from "../util/UIUtil";
var RTCBrowserType = require("../../RTC/RTCBrowserType"); var RTCBrowserType = require("../../RTC/RTCBrowserType");
const RTCUIHelper = JitsiMeetJS.util.RTCUIHelper;
function SmallVideo() { function SmallVideo() {
this.isMuted = false; this.isMuted = false;
this.hasAvatar = false; this.hasAvatar = false;
@ -296,33 +298,7 @@ SmallVideo.prototype.createModeratorIndicatorElement = function () {
}; };
SmallVideo.prototype.selectVideoElement = function () { SmallVideo.prototype.selectVideoElement = function () {
var videoElemName; return $(RTCUIHelper.findVideoElement($('#' + this.videoSpanId)[0]));
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 $([]);
}
}; };
SmallVideo.prototype.focus = function(isFocused) { SmallVideo.prototype.focus = function(isFocused) {