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: 3, text: "Acid Pauli, Nico Stojan - Call Of The Valley", overlayText: "Buy on iTunesBuy on Beatport Track (01): Acid Pauli, Nico Stojan - Call Of The Valley"} , {time: 315, text: "Lost Scripts - S.O.P.", overlayText: " Track (02): Lost Scripts - S.O.P."} , {time: 613, text: "Robert Hood - Dancer (Robert Hood's Unreleased Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (03): Robert Hood - Dancer (Robert Hood's Unreleased Remix)"} , {time: 924, text: "Loco Dice - Seeing Through Shadows", overlayText: "Buy on iTunesBuy on Beatport Track (04): Loco Dice - Seeing Through Shadows"} , {time: 1281, text: "D-Nox & Beckers - Appetizer (DJ Zota Remix)", overlayText: " Track (05): D-Nox & Beckers - Appetizer (DJ Zota Remix)"} , {time: 1546, text: "Lost Scripts - A.F.K.", overlayText: " Track (06): Lost Scripts - A.F.K."} , {time: 1788, text: "Alma Negra - Mageko", overlayText: " Track (07): Alma Negra - Mageko"} , {time: 2138, text: "The Mountain People - Mountain 003", overlayText: "Buy on Beatport Track (08): The Mountain People - Mountain 003"} ] }); 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): Acid Pauli, Nico Stojan - Call Of The Valley
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),7733)}, 4000 );