Skip to content

Commit

Permalink
Merge pull request #196 from hyperaudio/195-accurate-clip-play
Browse files Browse the repository at this point in the history
195 accurate clip play
  • Loading branch information
maboa authored Oct 18, 2023
2 parents 2600580 + b72d49c commit 8e57cfb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- (C) The Hyperaudio Project. AGPL 3.0 @license: https://www.gnu.org/licenses/agpl-3.0.en.html -->
<!-- Hyperaudio Lite Editor - Version 0.2.16 -->
<!-- Hyperaudio Lite Editor - Version 0.2.17 -->

<!-- Hyperaudio Lite Editor's source code is provided under a dual license model.
Expand Down Expand Up @@ -989,9 +989,12 @@ <h3 class="font-bold text-lg">Load from Local Storage</h3>
document.querySelector('video').currentTime = startTime;
document.querySelector('video').play();

setTimeout(() => {
document.querySelector('video').pause();
}, duration*1000);
let clipTimer = setInterval(function(){
if(document.querySelector('video').currentTime > endTime){
document.querySelector('video').pause();
clearInterval(clipTimer);
}
},100);
}

function seekTo(elem) {
Expand Down

0 comments on commit 8e57cfb

Please sign in to comment.