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-2
.visualizer-box.visualizer-box-3
else
ExternalMedia(media)

View File

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