Started using custom video controls

This commit is contained in:
2018-12-07 09:54:17 +09:00
parent da716fc3aa
commit 11865a6500
13 changed files with 126 additions and 54 deletions

View File

@ -2,7 +2,7 @@ import AnimeNotifier from "../AnimeNotifier"
// Play audio
export function playAudio(arn: AnimeNotifier, element: HTMLElement) {
arn.audioPlayer.play(element.dataset.soundtrackId, element.dataset.audioSrc)
arn.audioPlayer.play(element.dataset.mediaId, element.dataset.audioSrc)
}
// Pause audio
@ -45,7 +45,7 @@ export function playPauseAudio(arn: AnimeNotifier) {
export function toggleAudio(arn: AnimeNotifier, element: HTMLElement) {
// 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) {
if(arn.currentMediaId && element.dataset.mediaId === arn.currentMediaId) {
stopAudio(arn)
} else {
playAudio(arn, element)