htdocs/js/jukebox.js
/**
 * Although there is a playout_controls.sh command "playerprevchapter" it is implemented manually to keep the ui responsive
 */
Although there is a playout_controls.sh command "playerprevchapter" it is implemented manually to keep the ui responsive
Although there is a playout_controls . sh command " playerprevchapter " it is implemented manually to keep the ui responsive
function previousChapter() {
    var timerSeconds = 5;
    var playerInfo = JUKEBOX.playerInfo;
    var elapsed = +playerInfo.elapsed;
    var $selectedChapter = $('#chapters-select').find('option:selected');
    var selectedChapterStart = +$selectedChapter.data('start');
    if(elapsed - selectedChapterStart > timerSeconds && !this.timerActive) {
        gotoChapter($selectedChapter);
        this.timerActive = true;
        window.setTimeout(() => {
            this.timerActive = false;
        }, timerSeconds*1000 + 1);
    } else {
        gotoChapter($selectedChapter.prev());
    }
}
function previousChapter ( ) { var timerSeconds = 5 ; var playerInfo = JUKEBOX . playerInfo ; var elapsed = + playerInfo . elapsed ; var $selectedChapter = $ ( '#chapters-select' ) . find ( 'option:selected' ) ; var selectedChapterStart = + $selectedChapter . data ( 'start' ) ; if ( elapsed - selectedChapterStart > timerSeconds && ! this . timerActive ) { gotoChapter ( $selectedChapter ) ; this . timerActive = true ; window . setTimeout ( ( ) => { this . timerActive = false ; } , timerSeconds * 1000 + 1 ) ; } else { gotoChapter ( $selectedChapter . prev ( ) ) ; } }
Although there is a playout_controls.sh command "playerprevchapter" it is implemented manually to keep the ui responsive
Although there is a playout_controls . sh command " playerprevchapter " it is implemented manually to keep the ui responsive
// if chapter is playing for more than 5 seconds return to start of chapter instead of going to the previous one // to keep responsive during the ajax requests, set a timer that blocks this behavior after the first trigger