From 4b5a8a30bafbd89f126506ce2e0fd9146b2ba575 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 14 Jan 2021 14:40:20 +0100 Subject: [PATCH] wait #4129 @0.5 --- js/libs/fluidbook/fluidbook.audioplayer.js | 15 ++++++++------- style/audioplayer.less | 5 ++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.audioplayer.js b/js/libs/fluidbook/fluidbook.audioplayer.js index 0a5fcb8c..0987e406 100644 --- a/js/libs/fluidbook/fluidbook.audioplayer.js +++ b/js/libs/fluidbook/fluidbook.audioplayer.js @@ -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; }); diff --git a/style/audioplayer.less b/style/audioplayer.less index 30f7fe28..410589f4 100644 --- a/style/audioplayer.less +++ b/style/audioplayer.less @@ -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%; } -- 2.39.5