(audio: HTMLAudioElement)
| 82 | } |
| 83 | |
| 84 | private bindAudio(audio: HTMLAudioElement): void { |
| 85 | if (this.audioElement === audio) { |
| 86 | return; |
| 87 | } |
| 88 | this.unbindAudio(); |
| 89 | this.audioElement = audio; |
| 90 | audio.addEventListener('timeupdate', this.updateCursor); |
| 91 | audio.addEventListener('durationchange', this.updateCursor); |
| 92 | audio.addEventListener('seeked', this.updateCursor); |
| 93 | } |
| 94 | |
| 95 | private unbindAudio(): void { |
| 96 | if (!this.audioElement) { |
no test coverage detected