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: "Jan Ritter - melancholic moog (Alfred Heinrichs Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (01): Jan Ritter - melancholic moog (Alfred Heinrichs Remix)"} , {time: 219, text: "not identified - yet", overlayText: " Track (02): not identified - yet"} , {time: 552, text: "not identified - yet", overlayText: " Track (03): not identified - yet"} , {time: 745, text: "Martin Books - nikita (Alfred Heinrichs Remix)", overlayText: "Buy on Beatport Track (04): Martin Books - nikita (Alfred Heinrichs Remix)"} , {time: 1014, text: "not identified - yet", overlayText: " Track (05): not identified - yet"} , {time: 1335, text: "not identified - yet", overlayText: " Track (06): not identified - yet"} , {time: 1493, text: "Alfred Heinrichs - Raveheart", overlayText: "Buy on Beatport Track (07): Alfred Heinrichs - Raveheart"} , {time: 1762, text: "not identified - yet", overlayText: " Track (08): not identified - yet"} , {time: 1851, text: "T78 - Buzz-Off", overlayText: "Buy on iTunesBuy on Beatport Track (09): T78 - Buzz-Off"} , {time: 1943, text: "Micronaut - prism (Alfred Heinrichs Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (10): Micronaut - prism (Alfred Heinrichs Remix)"} , {time: 2358, text: "Analog Agenda - Cloud By Cloud", overlayText: "Buy on iTunesBuy on Beatport Track (11): Analog Agenda - Cloud By Cloud"} , {time: 2579, text: "Moby - Feeling So Real (Alfred Heinrichs Remix)", overlayText: " Track (12): Moby - Feeling So Real (Alfred Heinrichs Remix)"} , {time: 2749, text: "Torsten Kanzler - eve (Alfred Heinrichs Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (13): Torsten Kanzler - eve (Alfred Heinrichs 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): Jan Ritter - melancholic moog (Alfred Heinrichs Remix)
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8550)}, 4000 );