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-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)
|
||||||
|
|
||||||
|
@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user