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: "&ME - Avalon", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (01): &ME - Avalon"} , {time: 172, text: "andhim feat. Super Flu - Mr. Bass", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (02): andhim feat. Super Flu - Mr. Bass"} , {time: 479, text: "andhim - Huso", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (03): andhim - Huso"} , {time: 840, text: "Mele - Sunshowers (Matthias Tanzmann Remix)", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (04): Mele - Sunshowers (Matthias Tanzmann Remix)"} , {time: 1044, text: "Fort Romeau - C.E.M", overlayText: "Buy on iTunesBuy on Beatport Track (05): Fort Romeau - C.E.M"} , {time: 1374, text: "andhim - Donner", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (06): andhim - Donner"} , {time: 1654, text: "Manoo and Raoul K feat. Ahmed Sosso - Toukan (Dixon Rework)", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (07): Manoo and Raoul K feat. Ahmed Sosso - Toukan (Dixon Rework)"} ] }); 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): &ME - Avalon
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8698)}, 4000 );