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,6 +436,10 @@ loop.shared.mixins = (function() {
} }
this._bufferedUpdateVideo = rootObject.setTimeout(function() { this._bufferedUpdateVideo = rootObject.setTimeout(function() {
// 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; this._bufferedUpdateVideo = null;
var localStreamParent = this._getElement(".local .OT_publisher"); var localStreamParent = this._getElement(".local .OT_publisher");
var remoteStreamParent = this._getElement(".remote .OT_subscriber"); var remoteStreamParent = this._getElement(".remote .OT_subscriber");
@ -450,21 +454,26 @@ loop.shared.mixins = (function() {
screenShareStreamParent.style.height = "100%"; 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(
function (videoType) {
var ratio = this._videoDimensionsCache.local[videoType].aspectRatio; var ratio = this._videoDimensionsCache.local[videoType].aspectRatio;
if (videoType == "camera" && this.updateLocalCameraPosition) { if (videoType == "camera" && this.updateLocalCameraPosition) {
this.updateLocalCameraPosition(ratio); this.updateLocalCameraPosition(ratio);
} }
}, this); }, this);
Object.keys(this._videoDimensionsCache.remote).forEach(function(videoType) { Object.keys(this._videoDimensionsCache.remote).forEach(
function (videoType) {
var ratio = this._videoDimensionsCache.remote[videoType].aspectRatio; var ratio = this._videoDimensionsCache.remote[videoType].aspectRatio;
if (videoType == "camera" && this.updateRemoteCameraPosition) { if (videoType == "camera" && this.updateRemoteCameraPosition) {
this.updateRemoteCameraPosition(ratio); this.updateRemoteCameraPosition(ratio);
} }
}, this); }, this);
} catch (ex) {
console.error("updateVideoContainer: _bufferedVideoUpdate exception:", ex);
}
}.bind(this), 0); }.bind(this), 0);
}, },