]> _ Git - fluidbook-html5.git/commitdiff
wait #4157 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 4 Jan 2021 19:16:32 +0000 (20:16 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 4 Jan 2021 19:18:04 +0000 (20:18 +0100)
js/libs/fluidbook/fluidbook.links.js
js/libs/fluidbook/fluidbook.video.js
style/audioplayer.less

index ed8a7825a7e498c18d2ea27f6e1094e516f0d6c9..6f15bc721bd8f729a89a3dc76b4daa408f41a656 100644 (file)
@@ -302,6 +302,25 @@ FluidbookLinks.prototype = {
         return u.href;
     },
 
+    showLinkById(id) {
+        var s = $('div.link[data-id="' + id + '"]');
+        s.show();
+        setTimeout(function () {
+            s.addClass('show');
+        }, 10);
+
+    },
+
+    hideLinkById(id) {
+        var s = $('div.link[data-id="' + id + '"]');
+        if ($(s).attr('data-hidden') != '1') {
+            $(s).attr('data-hidden', '1').addClass('show');
+        }
+        setTimeout(function () {
+            $(s).removeClass('show');
+        }, 10);
+    },
+
     hidePlacedLink: function (p, timeout) {
         if ($(p).length === 0) {
             return;
@@ -310,7 +329,6 @@ FluidbookLinks.prototype = {
             timeout = 0;
         }
         setTimeout(function () {
-
             $(p).removeClass('show');
             $(p).find('.linkshowclose').remove();
             setTimeout(function () {
index 6ea4590eebc7066c61b8dfafb4ee89a7d17d20b7..e14ae465566211d4d2cd9395223ab7ab4389c777 100644 (file)
@@ -109,6 +109,8 @@ FluidbookVideo.prototype = {
             poster,
             html,
             player;
+        var hidelinksonplay = $(e).data('hidelinksonplay') === '' ? [] : $(e).data('hidelinksonplay').split(',');
+        console.log('to hide', hidelinksonplay);
 
         //console.log('Initialising video ID: ' + id);
 
@@ -238,9 +240,15 @@ FluidbookVideo.prototype = {
                         setTimeout(function () {
                             player.pause();
                         }, 100);
+                    } else {
+                        console.log('hide ', hidelinksonplay);
+                        $.each(hidelinksonplay, function (k, id) {
+                            $this.fluidbook.links.hideLinkById(id);
+                        });
                     }
                 });
 
+
                 player.play(); // Start player to go to current position - necessary even if it will be paused immediately
                 if (settings.paused) {
                     player.pause();
@@ -264,6 +272,12 @@ FluidbookVideo.prototype = {
 
         });
 
+        player.on('play', function () {
+            $.each(hidelinksonplay, function (k, id) {
+                $this.fluidbook.links.hideLinkById(id);
+            });
+        });
+
         player.on('pause', function () {
             // console.log(id + ' player paused');
 
@@ -275,6 +289,11 @@ FluidbookVideo.prototype = {
             player.one('play', function () {
                 this.bigPlayButton.hide();
             });
+
+
+            $.each(hidelinksonplay, function (k, id) {
+                $this.fluidbook.links.showLinkById(id);
+            });
         });
 
         // player.on('fullscreenchange', function() {
index a340e520bd205dd8ad1a0666e941b762736958a9..30f7fe285cd0e7fac91a33e48b8e7ec312ea37e0 100644 (file)
@@ -16,7 +16,7 @@ audio {
       .icon {
         position: absolute;
         top: 0;
-        left: 0;
+        left: 2px;
         width: 100%;
         height: 100%;
         color: #fff;