Testing new audio player

This commit is contained in:
Eduard Urbach 2018-03-11 16:42:49 +01:00
parent 950155bdd2
commit 99a0e9217a
2 changed files with 5 additions and 4 deletions

View File

@ -23,7 +23,6 @@ component SoundTrackContent(track *arn.SoundTrack, media *arn.ExternalMedia)
.visualizer-box.visualizer-box-1 .visualizer-box.visualizer-box-1
.visualizer-box.visualizer-box-2 .visualizer-box.visualizer-box-2
.visualizer-box.visualizer-box-3 .visualizer-box.visualizer-box-3
else else
ExternalMedia(media) ExternalMedia(media)

View File

@ -76,10 +76,12 @@ export function stopAudio(arn: AnimeNotifier) {
// Toggle audio // Toggle audio
export function toggleAudio(arn: AnimeNotifier, element: HTMLElement) { export function toggleAudio(arn: AnimeNotifier, element: HTMLElement) {
if(!arn.currentSoundTrackId) { // If we're clicking on the same track again, stop playing.
playAudio(arn, element) // Otherwise, start the track we clicked on.
} else { if(arn.currentSoundTrackId && element.dataset.soundtrackId === arn.currentSoundTrackId) {
stopAudio(arn) stopAudio(arn)
} else {
playAudio(arn, element)
} }
} }