]> _ Git - fluidbook-html5.git/commitdiff
wait #4129 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 13:40:20 +0000 (14:40 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 14 Jan 2021 13:40:20 +0000 (14:40 +0100)
js/libs/fluidbook/fluidbook.audioplayer.js
style/audioplayer.less

index 0a5fcb8c844700450ff48ad01dd6270f8199204d..0987e4068bf5d9528ae948aaa0f2041cc1b8f8fd 100644 (file)
@@ -6,14 +6,15 @@ function FluidbookAudioPlayer(fluidbook) {
 FluidbookAudioPlayer.prototype = {
     init: function () {
         var $this = this;
-        $(document).on('click', "audio:not([controls])", function () {
-            console.log(this);
-            if (this.paused) {
-                this.play();
-                $(this).addClass('playing');
+        $(document).on('click', "audio + .visualPlayer", function () {
+            var audio=$(this).prev('audio').get(0);
+            console.log(audio);
+            if (audio.paused) {
+                audio.play();
+                $(audio).addClass('playing');
             } else {
-                this.pause();
-                $(this).removeClass('playing');
+                audio.pause();
+                $(audio).removeClass('playing');
             }
             return false;
         });
index 30f7fe285cd0e7fac91a33e48b8e7ec312ea37e0..410589f4739996314e49a4ac7933e7206d54061b 100644 (file)
@@ -1,17 +1,16 @@
 audio {
   &.invisible, &.redbull {
     opacity: 0;
-    cursor: pointer;
   }
 
   &.redbull {
     + .visualPlayer {
-      pointer-events: none;
       position: absolute;
       top: 0;
       left: 0;
       width: 100%;
       height: 100%;
+      cursor: pointer;
 
       .icon {
         position: absolute;
@@ -28,7 +27,7 @@ audio {
         top: 7px;
         left: 7px;
         width: ~"calc(100% - 14px)";
-        height:  ~"calc(100% - 14px)";
+        height: ~"calc(100% - 14px)";
         background-color: #224d8d;
         border-radius: 50% 50%;
       }