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