src/vendor/sketch.js
// Function that get called when a song is loaded
Function that get called when a song is loaded
Function that get called when a song is loaded
function loaded() {
            volume = props.volume;
            song.setVolume(parseFloat(volume));
            song.playMode('restart');
            if (
                parseInt(props.currentTime) !== parseInt(song.currentTime()) &&
                parseInt(props.currentTime) <= parseInt(song.duration())
            ) {
                song.jump(props.currentTime);
                audio.currentTime = props.currentTime;
                jumpedSong = true;
            } else {
                jumpedSong = false;
            }
            if (!playPressed && jumpedSong) {
                pauseAllMedia();
            }
            p.togglePlaying(song);
        }
function loaded ( ) { volume = props . volume ; song . setVolume ( parseFloat ( volume ) ) ; song . playMode ( 'restart' ) ; if ( parseInt ( props . currentTime ) !== parseInt ( song . currentTime ( ) ) && parseInt ( props . currentTime ) <= parseInt ( song . duration ( ) ) ) { song . jump ( props . currentTime ) ; audio . currentTime = props . currentTime ; jumpedSong = true ; } else { jumpedSong = false ; } if ( ! playPressed && jumpedSong ) { pauseAllMedia ( ) ; } p . togglePlaying ( song ) ; }
Function that get called when a song is loaded
Function that get called when a song is loaded
// Restart song where it was stopped if the user jump the song // Jump song to desired time // When jump func is called the song start playing automatically // Pause song if song was on pause before the jump function was called