Bug 1154868-Log exceptions in bufferedUpdateVideo callbacks,r=mikedeboer

This commit is contained in:
Dan Mosedale 2015-04-16 11:54:49 -07:00
Родитель bc69601a40
Коммит ef67a02b15
1 изменённых файлов: 37 добавлений и 28 удалений

Просмотреть файл

@ -436,35 +436,44 @@ loop.shared.mixins = (function() {
}
this._bufferedUpdateVideo = rootObject.setTimeout(function() {
this._bufferedUpdateVideo = null;
var localStreamParent = this._getElement(".local .OT_publisher");
var remoteStreamParent = this._getElement(".remote .OT_subscriber");
var screenShareStreamParent = this._getElement('.screen .OT_subscriber');
if (localStreamParent) {
localStreamParent.style.width = "100%";
}
if (remoteStreamParent) {
remoteStreamParent.style.height = "100%";
}
if (screenShareStreamParent) {
screenShareStreamParent.style.height = "100%";
}
// Since this is being called from setTimeout, any exceptions thrown
// will propagate upwards into nothingness, unless we go out of our
// way to catch and log them explicitly, so...
try {
this._bufferedUpdateVideo = null;
var localStreamParent = this._getElement(".local .OT_publisher");
var remoteStreamParent = this._getElement(".remote .OT_subscriber");
var screenShareStreamParent = this._getElement('.screen .OT_subscriber');
if (localStreamParent) {
localStreamParent.style.width = "100%";
}
if (remoteStreamParent) {
remoteStreamParent.style.height = "100%";
}
if (screenShareStreamParent) {
screenShareStreamParent.style.height = "100%";
}
// Update the position and dimensions of the containers of local and remote
// video streams, if necessary. The consumer of this mixin should implement
// the actual updating mechanism.
Object.keys(this._videoDimensionsCache.local).forEach(function(videoType) {
var ratio = this._videoDimensionsCache.local[videoType].aspectRatio;
if (videoType == "camera" && this.updateLocalCameraPosition) {
this.updateLocalCameraPosition(ratio);
}
}, this);
Object.keys(this._videoDimensionsCache.remote).forEach(function(videoType) {
var ratio = this._videoDimensionsCache.remote[videoType].aspectRatio;
if (videoType == "camera" && this.updateRemoteCameraPosition) {
this.updateRemoteCameraPosition(ratio);
}
}, this);
// Update the position and dimensions of the containers of local and
// remote video streams, if necessary. The consumer of this mixin
// should implement the actual updating mechanism.
Object.keys(this._videoDimensionsCache.local).forEach(
function (videoType) {
var ratio = this._videoDimensionsCache.local[videoType].aspectRatio;
if (videoType == "camera" && this.updateLocalCameraPosition) {
this.updateLocalCameraPosition(ratio);
}
}, this);
Object.keys(this._videoDimensionsCache.remote).forEach(
function (videoType) {
var ratio = this._videoDimensionsCache.remote[videoType].aspectRatio;
if (videoType == "camera" && this.updateRemoteCameraPosition) {
this.updateRemoteCameraPosition(ratio);
}
}, this);
} catch (ex) {
console.error("updateVideoContainer: _bufferedVideoUpdate exception:", ex);
}
}.bind(this), 0);
},