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: "YYY - 161A", overlayText: "Buy on Discogs Track (01): YYY - 161A"} , {time: 28, text: "not identified - yet", overlayText: " Track (02): not identified - yet"} , {time: 301, text: "not identified - yet", overlayText: " Track (03): not identified - yet"} , {time: 449, text: "not identified - yet", overlayText: " Track (04): not identified - yet"} , {time: 750, text: "Per Hammar - Red Echo", overlayText: "Buy on BeatportBuy on DiscogsBuy on TraxSource Track (05): Per Hammar - Red Echo"} , {time: 1024, text: "not identified - yet", overlayText: " Track (06): not identified - yet"} , {time: 1251, text: "A. Pola - Triangle", overlayText: " Track (07): A. Pola - Triangle"} , {time: 1550, text: "Pola - Reunion", overlayText: "Buy on Discogs Track (08): Pola - Reunion"} , {time: 1883, text: "Franco Cinelli - Latin Morph", overlayText: "Buy on Beatport Track (09): Franco Cinelli - Latin Morph"} , {time: 2224, text: "not identified - yet", overlayText: " Track (10): not identified - yet"} , {time: 2422, text: "not identified - yet", overlayText: " Track (11): not identified - yet"} , {time: 2660, text: "not identified - yet", overlayText: " Track (12): not identified - yet"} ] }); 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): YYY - 161A
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8707)}, 4000 );