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: "Ost & Kjex - ", overlayText: " Track (01): Ost & Kjex - "} , {time: 298, text: "Ost & Kjex - Movie Box", overlayText: "Buy on Beatport Track (02): Ost & Kjex - Movie Box"} , {time: 611, text: "Ost & Kjex - The Baker's Daughter", overlayText: "Buy on Beatport Track (03): Ost & Kjex - The Baker's Daughter"} , {time: 1187, text: "Ost & Kjex - Fur Gurrik", overlayText: "Buy on Beatport Track (04): Ost & Kjex - Fur Gurrik"} , {time: 1628, text: "Ost & Kjex - ", overlayText: " Track (05): Ost & Kjex - "} , {time: 2267, text: "Ost & Kjex feat. Mung - Dirty Mind", overlayText: "Buy on Beatport Track (06): Ost & Kjex feat. Mung - Dirty Mind"} ] }); 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): Ost & Kjex -
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8510)}, 4000 );