aboutsummaryrefslogtreecommitdiffstats
path: root/src/js/plugins
diff options
context:
space:
mode:
authorferdiemmen <fjemmen@gmail.com>2018-01-17 08:31:36 +0100
committerferdiemmen <fjemmen@gmail.com>2018-01-17 08:31:36 +0100
commit8348f79742a40ac465affff7527e7c22dc34cb83 (patch)
tree178a33974b7ef1691ff09e50791a3bfedeab1434 /src/js/plugins
parentec73d34bd3061c2b512dda97765e4f38db4619c3 (diff)
downloadplyr-8348f79742a40ac465affff7527e7c22dc34cb83.tar.lz
plyr-8348f79742a40ac465affff7527e7c22dc34cb83.tar.xz
plyr-8348f79742a40ac465affff7527e7c22dc34cb83.zip
Fix loading/playing of the ads when there is no valid ads.tagUrl
Diffstat (limited to 'src/js/plugins')
-rw-r--r--src/js/plugins/ads.js25
1 files changed, 3 insertions, 22 deletions
diff --git a/src/js/plugins/ads.js b/src/js/plugins/ads.js
index 091ee80d..ceb00ee4 100644
--- a/src/js/plugins/ads.js
+++ b/src/js/plugins/ads.js
@@ -21,8 +21,8 @@ const getStartEvents = () => {
class Ads {
constructor(player) {
this.player = player;
- this.isPlaying = false;
- this.isInitialized = false;
+ this.playing = false;
+ this.initialized = false;
// Check if a tag URL is provided.
if (!utils.is.url(player.config.ads.tagUrl)) {
@@ -39,22 +39,6 @@ class Ads {
}
}
- set playing(bool = false) {
- this.isPlaying = bool;
- }
-
- get playing() {
- return this.isPlaying;
- }
-
- set initialized(bool = false) {
- this.isInitialized = bool;
- }
-
- get initialized() {
- return this.isInitialized;
- }
-
ready() {
this.time = Date.now();
this.startEvents = getStartEvents();
@@ -298,10 +282,7 @@ class Ads {
onAdError(adErrorEvent) {
this.cancel();
-
- if (this.player.debug) {
- throw new Error(adErrorEvent);
- }
+ this.player.debug.log(`[${(Date.now() - this.time) / 1000}s][IMA SDK] ERROR |`, adErrorEvent);
}
setupAdDisplayContainer() {