Skip to content

Commit

Permalink
Rewind action #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Quentin Vallat committed Nov 9, 2019
1 parent 07f6304 commit 3d52f5e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion app/js/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,16 @@ document.querySelector('#audio-next').addEventListener('click', (evt) =>
// Click on previous audio file
document.querySelector('#audio-previous').addEventListener('click', (evt) =>
{
playNextAudioFile(AudioPlayerActions.PREVIOUS);
// Rewinds audio file
if ($$.audioPlayer.currentTime > PLAYER_REWIND_TIME)
{
$$.audioPlayer.currentTime = 0;
}
// Plays previous audio file
else
{
playNextAudioFile(AudioPlayerActions.PREVIOUS);
}
});
// On ended audio player
Expand Down

0 comments on commit 3d52f5e

Please sign in to comment.