Added null checks

This commit is contained in:
2019-04-19 22:50:52 +09:00
parent 707233a422
commit d16197340d
8 changed files with 31 additions and 18 deletions

View File

@ -6,7 +6,7 @@ export default class AudioPlayer {
// Web audio
audioContext: AudioContext
audioNode: AudioBufferSourceNode
audioNode: AudioBufferSourceNode | null
gainNode: GainNode
// Parameters
@ -30,7 +30,7 @@ export default class AudioPlayer {
constructor(arn: AnimeNotifier) {
this.arn = arn
this.audioPlayer = document.getElementById("audio-player")
this.audioPlayer = document.getElementById("audio-player") as HTMLElement
this.audioPlayerPlay = document.getElementById("audio-player-play") as HTMLButtonElement
this.audioPlayerPause = document.getElementById("audio-player-pause") as HTMLButtonElement
this.trackLink = document.getElementById("audio-player-track-title") as HTMLLinkElement