class PlaybackController {
constructor () {
this.div = document.getElementById('playerDiv');
this.player = document.getElementById('audioPlayer');
this.progressCanvas = document.getElementById
this.playingCall = undefined;
audioPlayer.addEventListener('ended', this.clipFinished);
}
pauseToggle () {
if (audioPlayer.paused) {
audioPlayer.play();
} else {
audioPlayer.pause();
}
}
displayUpdate () {
if (this.playingCall) {
playbackProgressPlayedSeconds.innerText = audioPlayer.currentTime.toFixed(1);
playbackProgressTotalSeconds.innerText = audioPlayer.duration.toFixed(1);
playbackTimestamp.innerText = ptime(this.playingCall['start_time'] + audioPlayer.currentTime);
playbackTalker.innerHTML = '' + this.playingCall['talker_id'] + '';
playbackTalkgroup.innerText = this.playingCall['tg_name'];
playbackTranscription.innerText = this.playingCall['transcription'];
horizBarChart(playbackProgressBarCanvas, [audioPlayer.currentTime], audioPlayer.duration);
}
}
playCall (group, tgId, callId) {
const calls = abc.filteredCalls[group][tgId];
let i;
for (i=0; i