From a6db57b8e8adf7dde3e6ebc0c3b632db16d8f762 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 14 Nov 2018 12:04:29 +0100 Subject: [PATCH] wip #2342 @1 --- js/libs/fluidbook/fluidbook.sound.js | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.sound.js b/js/libs/fluidbook/fluidbook.sound.js index ee76dcf2..8d0daa7d 100644 --- a/js/libs/fluidbook/fluidbook.sound.js +++ b/js/libs/fluidbook/fluidbook.sound.js @@ -84,7 +84,6 @@ FluidbookSound.prototype = { this.on = false; $(".icon-sound-on").hide(); $(".icon-sound-off").show(); - this.stopAllSounds(); }, playSoundForPage: function (data) { @@ -92,7 +91,6 @@ FluidbookSound.prototype = { return; } - this.stopAllSounds(); var page = data.page; if (page % 2 === 1) { @@ -110,23 +108,14 @@ FluidbookSound.prototype = { } else { sound = 'page-flip-' + (Math.round(Math.random() + 1)); } + + console.log(sound); try { this.audios[sound].volume = 1; + this.audios[sound].fastSeek(0); this.audios[sound].play(); - this.playing = this.audios[sound]; } catch (e) { console.log(e); } }, - - stopAllSounds: function () { - try { - if (this.playing !== null) { - this.playing.pause(); - this.playing = null; - } - } catch (e) { - - } - }, }; \ No newline at end of file -- 2.39.5