From 27e8d44db02bfc323ee8634e4bb63dc3ae5b82e6 Mon Sep 17 00:00:00 2001 From: Sanjay Bhangar Date: Sat, 17 Mar 2018 18:21:39 +0530 Subject: [PATCH] fix isReady() for documents --- example/example.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/example/example.js b/example/example.js index 1b8aa15..852a6d9 100644 --- a/example/example.js +++ b/example/example.js @@ -7,6 +7,9 @@ class Slide { const video = slide.querySelector('.video') if (video) { this.video = load_urls(video.dataset) + if (this.video.length > 1 || this.video[0].includes('document')) { + this.isDocument = true + } this.videoVolume = video.dataset.volume ? parseFloat(video.dataset.volume) : 1 this.videoContainer = video if (this.video.length > 1) { @@ -32,7 +35,14 @@ class Slide { container: this.videoContainer }) + videoEmbed.on('init', () => { + if (this.isDocument) { + this.isVideoLoaded = true + } + }) + videoEmbed.on('loaded', () => { + console.log('loaded called on embed') this.isVideoLoaded = true }) @@ -51,6 +61,7 @@ class Slide { }) audioEmbed.on('loaded', () => { + console.log('loaded called on audio embed') this.isAudioLoaded = true })