From: Vincent Vanwaelscappel Date: Thu, 25 Mar 2021 14:45:42 +0000 (+0100) Subject: wait #4373 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=dc4ce4efff47042e0b89a7a4b00816f1307a05c4;p=fluidbook-html5.git wait #4373 @1 --- diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index 5b382abb..9ceb4600 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -211,6 +211,18 @@ FluidbookVideo.prototype = { $this.resizeControls(); // Make sure player controls are the right size + if(autoplay=='1') { + var promise = player.play(); + + if (promise !== undefined) { + promise.then(function () { + // Autoplay started! + }).catch(function (error) { + // Autoplay was prevented. + }); + } + } + if (fluidbook.video.players[id]) { //console.log('found saved settings for player ID ' + id); var settings = fluidbook.video.players[id]; @@ -257,18 +269,6 @@ FluidbookVideo.prototype = { setTimeout(function () { $this.fluidbook.contentlock.addAction(linkid, 'complete'); }, (player.duration() - 5) * 1000); - }else{ - if(autoplay=='1') { - var promise = player.play(); - - if (promise !== undefined) { - promise.then(function () { - // Autoplay started! - }).catch(function (error) { - // Autoplay was prevented. - }); - } - } } });