var player = videojs('video-player', {plugins: {videoJsResolutionSwitcher: {default: 'high'}}}, function(){ var player = this; player.on('resolutionchange', function(){ // console.info('Source changed to %s', player.src()); // console.log(player.currentResolution()); }) }); var trackLikesArray = []; player.markers({ markerStyle: {'width':'7px', 'height':'9px', 'margin-bottom':'6px', 'background-color': '#ca588a' }, markerTip:{display: true, text: function(marker) { return marker.text; } }, breakOverlay:{ display: true, displayTime: 1000, text: function(marker) {return marker.overlayText;} } , markers: [ {time: 0, text: "", overlayText: "Track information"} , {time: 4, text: "Soundopamine - Maybe (Live)", overlayText: "Buy on iTunesBuy on Beatport Track (01): Soundopamine - Maybe (Live)"} , {time: 224, text: "Soundopamine - Up To My Heart (Unreleased) (Live)", overlayText: " Track (02): Soundopamine - Up To My Heart (Unreleased) (Live)"} , {time: 484, text: "Soundopamine - Please Me (Jazz Improv) (Live)", overlayText: " Track (03): Soundopamine - Please Me (Jazz Improv) (Live)"} , {time: 752, text: "Soundopamine - Sunshine (Unreleased) (Live)", overlayText: " Track (04): Soundopamine - Sunshine (Unreleased) (Live)"} , {time: 1163, text: "Soundopamine - Yes I Do (Unreleased) (Live)", overlayText: " Track (05): Soundopamine - Yes I Do (Unreleased) (Live)"} , {time: 1395, text: "Soundopamine - Hey Jupiter (Improv) (Live)", overlayText: " Track (06): Soundopamine - Hey Jupiter (Improv) (Live)"} , {time: 1634, text: "Soundopamine - Can't Say No (Unreleased) (Live)", overlayText: " Track (07): Soundopamine - Can't Say No (Unreleased) (Live)"} , {time: 1956, text: "Soundopamine - Cruising (Live)", overlayText: " Track (08): Soundopamine - Cruising (Live)"} , {time: 2235, text: "Soundopamine - Dancing Shoes (Unreleased) (Live)", overlayText: " Track (09): Soundopamine - Dancing Shoes (Unreleased) (Live)"} , {time: 2545, text: "Soundopamine - Stai Blana (Edit) (Live)", overlayText: " Track (10): Soundopamine - Stai Blana (Edit) (Live)"} , {time: 2823, text: "Soundopamine - Lose Control (Live)", overlayText: " Track (11): Soundopamine - Lose Control (Live)"} ] }); var positionTrackButtons = function(el, trackbuttons) { var pos = $(el).offset(); var eWidth = $(el).outerWidth(); if (!eWidth) {setTimeout( function(){ positionTrackButtons(el, trackbuttons) }, 1000 );} else { var mWidth = $(trackbuttons).outerWidth(); var left = 1 + "px"; var width = eWidth -2 + "px"; var top = -14 + "px"; $(trackbuttons).css( { opacity: '1', position: 'absolute', zIndex: 150000, width: width, left: left, top: top } ); $(trackbuttons).fadeIn(); } }; setTimeout( function(){ $('.vjs-break-overlay').wrap('
'); $( ".tracks-nav" ).append( $( '
Track (01): Soundopamine - Maybe (Live)
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8547)}, 4000 );