From 53610808bf6ab978914c322e053a84330a521d59 Mon Sep 17 00:00:00 2001 From: Bui Date: Mon, 27 Aug 2018 02:09:04 +0100 Subject: [PATCH] loop from preview position --- src/js/songselect.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/js/songselect.js b/src/js/songselect.js index a484917..ca37626 100644 --- a/src/js/songselect.js +++ b/src/js/songselect.js @@ -20,8 +20,12 @@ function SongSelect(){ var no_delay = first_open ? 0 : 300; _preview.currentTime = _preview.duration/2-10; - _preview.loop = true; _preview.volume = 0.5; + + _preview.addEventListener('ended', function(){ + this.currentTime = this.duration/2-10; + this.play(); + }, false); _preview_to = setTimeout(function(){ _preview.play();