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: "DJ Gregory & Gregor Salto - Canoa", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (01): DJ Gregory & Gregor Salto - Canoa"} , {time: 428, text: "Javi Colors - Stompin'", overlayText: "Buy on iTunesBuy on Beatport Track (02): Javi Colors - Stompin'"} , {time: 776, text: "Manuel de la Mare, Fabricio Pecanha - Praia do Rosa", overlayText: "Buy on iTunesBuy on Beatport Track (03): Manuel de la Mare, Fabricio Pecanha - Praia do Rosa"} , {time: 1159, text: "Landmark - Myself", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (04): Landmark - Myself"} , {time: 1530, text: "Christian Smith - Blast Off (Victor Ruiz Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (05): Christian Smith - Blast Off (Victor Ruiz Remix)"} , {time: 1839, text: "Wigbert - Airplane", overlayText: "Buy on iTunesBuy on Beatport Track (06): Wigbert - Airplane"} , {time: 2335, text: "Marcus Meinhardt - Felecity (Atlantik Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (07): Marcus Meinhardt - Felecity (Atlantik Remix)"} , {time: 2695, text: "Siwell - Stardust", overlayText: "Buy on Beatport Track (08): Siwell - Stardust"} , {time: 3034, text: "Thankyou City - Desert Fathers (Out Of Sorts Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (09): Thankyou City - Desert Fathers (Out Of Sorts Remix)"} ] }); 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): DJ Gregory & Gregor Salto - Canoa
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8514)}, 4000 );