Small tweaks

This commit is contained in:
Sam Potts
2018-01-22 23:39:09 +11:00
parent b298587c0b
commit ebf53d14b1
11 changed files with 25 additions and 20 deletions

View File

@ -18,10 +18,11 @@ class Ads {
this.player = player;
this.playing = false;
this.initialized = false;
this.enabled = utils.is.url(player.config.ads.tagUrl);
// Check if a tag URL is provided.
if (!utils.is.url(player.config.ads.tagUrl)) {
return this;
if (!this.enabled) {
return;
}
// Check if the Google IMA3 SDK is loaded
@ -456,7 +457,9 @@ class Ads {
*/
cancel() {
// Pause our video
this.resumeContent();
if (this.initialized) {
this.resumeContent();
}
// Tell our instance that we're done for now
this.handleEventListeners('ERROR');