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: 3, text: "Nice 'n Trick - Acidulescu (Nima Gorji Remix)", overlayText: "Buy on iTunesBuy on Beatport Track (01): Nice 'n Trick - Acidulescu (Nima Gorji Remix)"} , {time: 120, text: "Makcim & Levi - Jelmeratu", overlayText: "Buy on Discogs Track (02): Makcim & Levi - Jelmeratu"} , {time: 313, text: "Pap Inc - Six Bullets", overlayText: " Track (03): Pap Inc - Six Bullets"} , {time: 489, text: "not identified - yet", overlayText: " Track (04): not identified - yet"} , {time: 759, text: "not identified - yet", overlayText: " Track (05): not identified - yet"} , {time: 950, text: "not identified - yet", overlayText: " Track (06): not identified - yet"} , {time: 1334, text: "Audiothèque - Nevermind", overlayText: "Buy on Discogs Track (07): Audiothèque - Nevermind"} , {time: 1634, text: "not identified - yet", overlayText: " Track (08): not identified - yet"} , {time: 1769, text: "Heartz 4 - Intimacy Girl", overlayText: " Track (09): Heartz 4 - Intimacy Girl"} , {time: 1930, text: "Fulvio Ruffert & Gregorio Serasin - Methsoup (Nekow Remix)", overlayText: " Track (10): Fulvio Ruffert & Gregorio Serasin - Methsoup (Nekow Remix)"} , {time: 2072, text: "not identified - yet", overlayText: " Track (11): not identified - yet"} , {time: 2534, text: "Topper - Hight Red (Nima Gorji Remix)", overlayText: " Track (12): Topper - Hight Red (Nima Gorji Remix)"} , {time: 2754, text: "not identified - yet", overlayText: " Track (13): not identified - yet"} , {time: 2935, text: "not identified - yet", overlayText: " Track (14): 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): Nice \'n Trick - Acidulescu (Nima Gorji Remix)
' ) ); positionTrackButtons ('.vjs-break-overlay','.tracks-nav'); } , 5000 ); $(window).on("resize", function () { positionTrackButtons ('.vjs-break-overlay','.tracks-nav')}); setTimeout( function(){setDuration(player.duration(),7741)}, 4000 );