]> _ Git - fluidbook-html5.git/commitdiff
wait #4373 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Mar 2021 14:45:42 +0000 (15:45 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 25 Mar 2021 14:45:42 +0000 (15:45 +0100)
js/libs/fluidbook/fluidbook.video.js

index 5b382abbb46261475d459208d0d2b3f9b6f7604c..9ceb46003a886e1118c058b0a1e6fa0797657822 100644 (file)
@@ -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.
-                        });
-                    }
-                }
             }
         });