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