Commit 7bb96f66 by Usman Khalid

Added checks in video player methods which may get executed after the player has been destroyed.

parent 9cbfea2e
...@@ -70,7 +70,10 @@ function (HTML5Video, Resizer) { ...@@ -70,7 +70,10 @@ function (HTML5Video, Resizer) {
function _makeFunctionsPublic(state) { function _makeFunctionsPublic(state) {
var debouncedF = _.debounce( var debouncedF = _.debounce(
function (params) { 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), }.bind(state),
300 300
); );
......
...@@ -49,6 +49,9 @@ function () { ...@@ -49,6 +49,9 @@ function () {
}); });
this.el.off('controls:show'); this.el.off('controls:show');
if (this.controlHideTimeout) {
clearTimeout(this.controlHideTimeout);
}
delete this.videoControl; delete this.videoControl;
} }
......
...@@ -86,7 +86,9 @@ define('video/09_bumper.js',[], function () { ...@@ -86,7 +86,9 @@ define('video/09_bumper.js',[], function () {
if (this.doNotShowAgain) { if (this.doNotShowAgain) {
_.extend(info, {bumper_do_not_show_again: true}); _.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 () { destroy: function () {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment