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: "Mark Knight - In The Pocket", overlayText: "Buy on iTunesBuy on Beatport Track (01): Mark Knight - In The Pocket"} , {time: 234, text: "Mark Knight & Prok & Fitch - Into My Life", overlayText: "Buy on iTunesBuy on Beatport Track (02): Mark Knight & Prok & Fitch - Into My Life"} , {time: 533, text: "Mark Knight & Adrian Hour - Freak Out", overlayText: "Buy on iTunesBuy on Beatport Track (03): Mark Knight & Adrian Hour - Freak Out"} , {time: 778, text: "Chus & Ceballos Vs Adrian Hour - Beat Pirates", overlayText: "Buy on iTunesBuy on Beatport Track (04): Chus & Ceballos Vs Adrian Hour - Beat Pirates"} , {time: 993, text: "Technasia - Obsession (Hombre Lowdown's French Kissed Edit)", overlayText: "Buy on iTunesBuy on Beatport Track (05): Technasia - Obsession (Hombre Lowdown's French Kissed Edit)"} , {time: 1185, text: "Mark Knight & Alan Banjo - Bang!", overlayText: "Buy on Beatport Track (06): Mark Knight & Alan Banjo - Bang!"} , {time: 1430, text: "Mark Knight & Adrian Hour - Chaos Theory", overlayText: "Buy on iTunesBuy on Beatport Track (07): Mark Knight & Adrian Hour - Chaos Theory"} , {time: 1869, text: "Tuff London - Sending Love", overlayText: "Buy on iTunesBuy on Beatport Track (08): Tuff London - Sending Love"} , {time: 2025, text: "Krankbrother - Circular Thing (Hot Since 82 Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (09): Krankbrother - Circular Thing (Hot Since 82 Remix)"} , {time: 2317, text: "DJ Boris - Make You Do", overlayText: "Buy on iTunesBuy on Beatport Track (10): DJ Boris - Make You Do"} , {time: 2502, text: "Audion - Mouth To Mouth (Riva Starr Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (11): Audion - Mouth To Mouth (Riva Starr Remix)"} , {time: 2824, text: "Joe Red, Luca Gaeta - Alegria", overlayText: "Buy on iTunesBuy on Beatport Track (12): Joe Red, Luca Gaeta - Alegria"} , {time: 3124, text: "DJ Fronter - Wanted", overlayText: "Buy on iTunesBuy on Beatport Track (13): DJ Fronter - Wanted"} ] }); 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): Mark Knight - In The Pocket
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),4138)}, 4000 );