Added checks in video player methods which may get executed after the player has been destroyed.
This commit is contained in:
@@ -70,7 +70,10 @@ function (HTML5Video, Resizer) {
|
||||
function _makeFunctionsPublic(state) {
|
||||
var debouncedF = _.debounce(
|
||||
function (params) {
|
||||
return onSeek.call(this, params);
|
||||
// Can't cancel a queued debounced function on destroy
|
||||
if (state.videoPlayer) {
|
||||
return onSeek.call(this, params);
|
||||
}
|
||||
}.bind(state),
|
||||
300
|
||||
);
|
||||
|
||||
@@ -49,6 +49,9 @@ function () {
|
||||
});
|
||||
|
||||
this.el.off('controls:show');
|
||||
if (this.controlHideTimeout) {
|
||||
clearTimeout(this.controlHideTimeout);
|
||||
}
|
||||
delete this.videoControl;
|
||||
}
|
||||
|
||||
|
||||
@@ -86,7 +86,9 @@ define('video/09_bumper.js',[], function () {
|
||||
if (this.doNotShowAgain) {
|
||||
_.extend(info, {bumper_do_not_show_again: true});
|
||||
}
|
||||
this.state.videoSaveStatePlugin.saveState(true, info);
|
||||
if (this.state.videoSaveStatePlugin) {
|
||||
this.state.videoSaveStatePlugin.saveState(true, info);
|
||||
}
|
||||
},
|
||||
|
||||
destroy: function () {
|
||||
|
||||
Reference in New Issue
Block a user