Testing new audio player
This commit is contained in:
parent
950155bdd2
commit
99a0e9217a
@ -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)
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user