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: 5, text: "Sebastian Mullaert - Ode To Be", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (01): Sebastian Mullaert - Ode To Be"} , {time: 228, text: "Söllscher und Siech - Pulse Train", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (02): Söllscher und Siech - Pulse Train"} , {time: 463, text: "T.raumschmiere - Jaguar", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (03): T.raumschmiere - Jaguar"} , {time: 752, text: "Musumeci - Mood Organs", overlayText: " Track (04): Musumeci - Mood Organs"} , {time: 1084, text: "not identified - yet", overlayText: " Track (05): not identified - yet"} , {time: 1546, text: "David August - Moving Day", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (06): David August - Moving Day"} , {time: 1986, text: "Rodriguez Jr. - Monticello", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (07): Rodriguez Jr. - Monticello"} , {time: 2356, text: "Musumeci - Hey Mama", overlayText: " Track (08): Musumeci - Hey Mama"} , {time: 2727, text: "Jay Haze Feat Laila Tov - I Wait For You", overlayText: "Buy on iTunesBuy on BeatportBuy on Discogs Track (09): Jay Haze Feat Laila Tov - I Wait For You"} ] }); 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): Sebastian Mullaert - Ode To Be
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8513)}, 4000 );