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: "Traumer - Classroom", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (01): Traumer - Classroom"} , {time: 182, text: "Masomenos - Percute", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (02): Masomenos - Percute"} , {time: 490, text: "Francesca Lombardo - Terra", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (03): Francesca Lombardo - Terra"} , {time: 954, text: "Dubfound - Little Helper 86-5", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (04): Dubfound - Little Helper 86-5"} , {time: 1049, text: "Tamer Malki - Steel Breeze", overlayText: "Buy on Beatport Track (05): Tamer Malki - Steel Breeze"} , {time: 1333, text: "Africanism pres. Soha - Les Enfants Du Bled", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (06): Africanism pres. Soha - Les Enfants Du Bled"} , {time: 1849, text: "not identified - yet", overlayText: " Track (07): not identified - yet"} , {time: 2364, text: "Leman & Dieckmann - B-Stick (Aaaron Remix)", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (08): Leman & Dieckmann - B-Stick (Aaaron Remix)"} , {time: 2723, text: "Stimming - Sunday Morning", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (09): Stimming - Sunday Morning"} , {time: 3187, text: "Gab Rhome - The Spice Trade (The Mekanism Remix)", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (10): Gab Rhome - The Spice Trade (The Mekanism 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): Traumer - Classroom
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8544)}, 4000 );