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: 0, text: "not identified - yet", overlayText: " Track (01): not identified - yet"} , {time: 282, text: "Nima Gorji & Kevin Cook - Capish", overlayText: " Track (02): Nima Gorji & Kevin Cook - Capish"} , {time: 681, text: "Felix Rupprecht - Swirly (Cristi Cons Remix)", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (03): Felix Rupprecht - Swirly (Cristi Cons Remix)"} , {time: 997, text: "Deep Square - Inspuna", overlayText: "Buy on iTunesBuy on Beatport Track (04): Deep Square - Inspuna"} , {time: 1345, text: "Transformation - Transform ((Tobi Neumann Matthew Styles mix))", overlayText: " Track (05): Transformation - Transform ((Tobi Neumann Matthew Styles mix))"} , {time: 1584, text: "Transform - Transformation (Tobi Neumann and Matthew Styles Analog Memory Remix )", overlayText: "Buy on Beatport Track (06): Transform - Transformation (Tobi Neumann and Matthew Styles Analog Memory Remix )"} , {time: 1974, text: "not identified - yet", overlayText: " Track (07): not identified - yet"} , {time: 2123, text: "Dan Farserelli - Lemons And Limes", overlayText: "Buy on Beatport Track (08): Dan Farserelli - Lemons And Limes"} , {time: 2450, text: "Psykoloco - ", overlayText: " Track (09): Psykoloco - "} , {time: 2735, text: "Suolo - Kamadeva", overlayText: " Track (10): Suolo - Kamadeva"} , {time: 2949, text: "not identified - yet", overlayText: " Track (11): not identified - yet"} , {time: 3146, text: "Archie Hamilton - The Message", overlayText: " Track (12): Archie Hamilton - The Message"} , {time: 3393, text: "Afriqua - Nadeleine", overlayText: " Track (13): Afriqua - Nadeleine"} ] }); 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): not identified - yet
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8436)}, 4000 );