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: "not identified - yet", overlayText: " Track (01): not identified - yet"} , {time: 155, text: "not identified - yet", overlayText: " Track (02): not identified - yet"} , {time: 310, text: "Compass - Unknown", overlayText: "Buy on Beatport Track (03): Compass - Unknown"} , {time: 949, text: "Mattia Trani - Over The Future (Ilario Alicante Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (04): Mattia Trani - Over The Future (Ilario Alicante Remix)"} , {time: 1224, text: "Bodyjack - Disrespect", overlayText: " Track (05): Bodyjack - Disrespect"} , {time: 1496, text: "not identified - yet", overlayText: " Track (06): not identified - yet"} , {time: 1748, text: "not identified - yet", overlayText: " Track (07): not identified - yet"} , {time: 1991, text: "L.B. Dub Corp - Nearly Africa Dub", overlayText: "Buy on iTunesBuy on Beatport Track (08): L.B. Dub Corp - Nearly Africa Dub"} , {time: 2145, text: "Cabin Fever Trax Vol. 34 - Cheryl From The River", overlayText: " Track (09): Cabin Fever Trax Vol. 34 - Cheryl From The River"} , {time: 2378, text: "Mr. G - Exit?", overlayText: "Buy on Beatport Track (10): Mr. G - Exit?"} , {time: 2573, text: "Vinyl Speed Adjust - Expozed", overlayText: " Track (11): Vinyl Speed Adjust - Expozed"} , {time: 2895, text: "Bartolomeo - Cassettino", overlayText: " Track (12): Bartolomeo - Cassettino"} ] }); 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(),7693)}, 4000 );