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: "Denis Horvat - Lodi", overlayText: "Buy on iTunesBuy on BeatportBuy on TraxSource Track (01): Denis Horvat - Lodi"} , {time: 97, text: "not identified - yet", overlayText: " Track (02): not identified - yet"} , {time: 310, text: "not identified - yet", overlayText: " Track (03): not identified - yet"} , {time: 516, text: "Quentin Harris - EP #6", overlayText: "Buy on BeatportBuy on DiscogsBuy on TraxSource Track (04): Quentin Harris - EP #6"} , {time: 837, text: "Mano Negra - Sueño De Solentiname", overlayText: "Buy on iTunesBuy on Discogs Track (05): Mano Negra - Sueño De Solentiname"} , {time: 1182, text: "Lehar - Dream", overlayText: "Buy on iTunesBuy on BeatportBuy on DiscogsBuy on TraxSource Track (06): Lehar - Dream"} , {time: 1650, text: "Tabu - Artbat", overlayText: "Buy on BeatportBuy on DiscogsBuy on TraxSource Track (07): Tabu - Artbat"} , {time: 1990, text: "Toto Ciavetta - Amuchina Bar", overlayText: "Buy on BeatportBuy on DiscogsBuy on TraxSource Track (08): Toto Ciavetta - Amuchina Bar"} , {time: 2323, text: "Toto Ciavetta - Nothing Really Matters", overlayText: "Buy on BeatportBuy on DiscogsBuy on TraxSource Track (09): Toto Ciavetta - Nothing Really Matters"} , {time: 2720, text: "Musumeci - Hey Mama", overlayText: "Buy on iTunesBuy on BeatportBuy on DiscogsBuy on TraxSource Track (10): Musumeci - Hey Mama"} , {time: 3165, text: "Musumeci - Mood Organs", overlayText: "Buy on iTunesBuy on BeatportBuy on DiscogsBuy on TraxSource Track (11): Musumeci - Mood Organs"} , {time: 3541, text: "Lehar - The Last Track", overlayText: "Buy on iTunesBuy on BeatportBuy on DiscogsBuy on TraxSource Track (12): Lehar - The Last Track"} ] }); 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): Denis Horvat - Lodi
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),8509)}, 4000 );