text: jQuery.webshims.register("track-ui",function(f,h){var i=h.cfg.track,l={subtitles:1,captions:1},j=h.mediaelement,k={update:function(a,c){if(a.activeCues.length){if(!this.compareArray(a.displayedActiveCues,a.activeCues)){a.displayedActiveCues=a.activeCues;if(!a.trackDisplay)a.trackDisplay=f('<div class="cue-display"></div>').insertAfter(c),this.addEvents(a,c);a.hasDirtyTrackDisplay&&c.triggerHandler("forceupdatetrackdisplay");this.showCues(a)}}else this.hide(a)},showCues:function(a){var c=f('<span class="cue-wrapper" />');
  f.each(a.displayedActiveCues,function(a,b){c.append(f("<span "+(b.id?'id="cue-id-'+b.id+'"':"")+' class="cue" />').html(b.getCueAsHTML()))});a.trackDisplay.html(c)},compareArray:function(a,c){var d=!0,b=0,e=a.length;if(e!=c.length)d=!1;else for(;b<e;b++)if(a[b]!=c[b]){d=!1;break}return d},addEvents:function(a,c){if(i.positionDisplay){var d,b=function(b){if(a.displayedActiveCues.length||!0===b){a.trackDisplay.css({display:"none"});var d=c.getShadowElement();d.offsetParent();var b=d.innerHeight(),e=
  d.innerWidth(),d=d.position();a.trackDisplay.css({left:d.left,width:e,height:b-45,top:d.top,display:"block"});a.trackDisplay.css("fontSize",Math.max(Math.round(b/30),7));a.hasDirtyTrackDisplay=!1}else a.hasDirtyTrackDisplay=!0},e=function(){b(!0)};c.bind("updateshadowdom playerdimensionchange mediaelementapichange updatetrackdisplay updatemediaelementdimensions swfstageresize",function(){clearTimeout(d);d=setTimeout(b,0)});c.bind("forceupdatetrackdisplay",e);e()}},hide:function(a){if(a.trackDisplay&&
  a.displayedActiveCues.length)a.displayedActiveCues=[],a.trackDisplay.empty()}};f.extend(f.event.customEvent,{updatetrackdisplay:!0,forceupdatetrackdisplay:!0});j.trackDisplay=k;if(!j.createCueList){var m={getCueById:function(a){for(var c=null,d=0,b=this.length;d<b;d++)if(this[d].id===a){c=this[d];break}return c}};j.createCueList=function(){return f.extend([],m)}}j.getActiveCue=function(a,c,d,b){if(!a._lastFoundCue)a._lastFoundCue={index:0,time:0};if(Modernizr.track&&!i.override&&!a._shimActiveCues)a._shimActiveCues=
  j.createCueList();for(var e=0,g;e<a.shimActiveCues.length;e++)g=a.shimActiveCues[e],g.startTime>d||g.endTime<d?(a.shimActiveCues.splice(e,1),e--,g.pauseOnExit&&f(c).pause(),f(a).triggerHandler("cuechange"),f(g).triggerHandler("exit")):"showing"==a.mode&&l[a.kind]&&-1==f.inArray(g,b.activeCues)&&b.activeCues.push(g);c=a.cues.length;for(e=a._lastFoundCue.time<d?a._lastFoundCue.index:0;e<c;e++){g=a.cues[e];if(g.startTime<=d&&g.endTime>=d&&-1==f.inArray(g,a.shimActiveCues))a.shimActiveCues.push(g),"showing"==
  a.mode&&l[a.kind]&&b.activeCues.push(g),f(a).triggerHandler("cuechange"),f(g).triggerHandler("enter"),a._lastFoundCue.time=d,a._lastFoundCue.index=e;if(g.startTime>d)break}};!i.override&&Modernizr.track&&function(){var a,c=function(b){a||setTimeout(function(){a=!0;f(b).triggerHandler("updatetrackdisplay");a=!1},9)},d=h.defineNodeNameProperty("track","track",{prop:{get:function(){c(f(this).parent("audio, video"));return d.prop._supget.apply(this,arguments)}}});["audio","video"].forEach(function(a){var d,
  g;g=h.defineNodeNameProperty(a,"textTracks",{prop:{get:function(){c(this);return g.prop._supget.apply(this,arguments)}}});d=h.defineNodeNameProperty(a,"addTextTrack",{prop:{value:function(){c(this);return d.prop._supvalue.apply(this,arguments)}}})})}();h.addReady(function(a,c){f("video, audio",a).add(c.filter("video, audio")).each(function(){var a,b=f(this),e,c=function(){b.unbind(".trackview").bind("play.trackview timeupdate.trackview updatetrackdisplay.trackview",function(){var c,f;if(!a||!e)if(a=
  b.prop("textTracks"),e=h.data(b[0],"mediaelementBase")||h.data(b[0],"mediaelementBase",{}),!e.displayedActiveCues)e.displayedActiveCues=[];if(a&&((f=b.prop("currentTime"))||0===f)){e.activeCues=[];for(var g=0,i=a.length;g<i;g++)c=a[g],"disabled"!=c.mode&&c.cues&&c.cues.length&&j.getActiveCue(c,b,f,e);k.update(e,b)}})};!i.override&&Modernizr.track?b.bind("mediaelementapichange trackapichange",function(){i.override||!Modernizr.track||b.is(".nonnative-api-active")?c():(a=b.prop("textTracks"),e=h.data(b[0],
  "mediaelementBase")||h.data(b[0],"mediaelementBase",{}),f.each(a,function(a,b){b._shimActiveCues&&delete b._shimActiveCues}),k.hide(e),b.unbind(".trackview"))}):c()})})});
  