vendor/assets/javascripts/webshims/minified/shims/track.js in webshims-rails-0.4.4 vs vendor/assets/javascripts/webshims/minified/shims/track.js in webshims-rails-0.4.5

- old
+ new

@@ -1,21 +2 @@ -jQuery.webshims.register("track",function(d,h,r,s){var i=h.mediaelement;(new Date).getTime();var u={subtitles:1,captions:1,descriptions:1},v=d("<track />"),m=Modernizr.ES5&&Modernizr.objectAccessor,p=function(a){var b={};a.addEventListener=function(a,g){b[a]&&h.error("always use $.on to the shimed event: "+a+" already bound fn was: "+b[a]+" your fn was: "+g);b[a]=g};a.removeEventListener=function(a,g){b[a]&&b[a]!=g&&h.error("always use $.on/$.off to the shimed event: "+a+" already bound fn was: "+ -b[a]+" your fn was: "+g);b[a]&&delete b[a]};return a},w={getCueById:function(a){for(var b=null,e=0,g=this.length;e<g;e++)if(this[e].id===a){b=this[e];break}return b}},x={"0":"disabled",1:"hidden",2:"showing"},y={shimActiveCues:null,_shimActiveCues:null,activeCues:null,cues:null,kind:"subtitles",label:"",language:"",mode:"disabled",readyState:0,oncuechange:null,toString:function(){return"[object TextTrack]"},addCue:function(a){if(this.cues){var b=this.cues[this.cues.length-1];b&&b.startTime>a.startTime&& -h.error("cue startTime higher than previous cue's startTime")}else this.cues=i.createCueList();a.track&&a.track.removeCue&&a.track.removeCue(a);a.track=this;this.cues.push(a)},removeCue:function(a){var b=this.cues||[],e=0,g=b.length;if(a.track!=this)h.error("cue not part of track");else{for(;e<g;e++)if(b[e]===a){b.splice(e,1);a.track=null;break}a.track&&h.error("cue not part of track")}},DISABLED:"disabled",OFF:"disabled",HIDDEN:"hidden",SHOWING:"showing",ERROR:3,LOADED:2,LOADING:1,NONE:0},n=["kind", -"label","srclang"],o={srclang:"language"},z=Function.prototype.call.bind(Object.prototype.hasOwnProperty),l=function(a,b){var e=[],g=[],c=[],f,j;a||(a=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{}));if(!b)a.blockTrackListUpdate=!0,b=d.prop(this,"textTracks"),a.blockTrackListUpdate=!1;clearTimeout(a.updateTrackListTimer);d("track",this).each(function(){var a=d.prop(this,"track");c.push(a);-1==b.indexOf(a)&&g.push(a)});if(a.scriptedTextTracks)for(f=0,j=a.scriptedTextTracks.length;f< -j;f++)c.push(a.scriptedTextTracks[f]),-1==b.indexOf(a.scriptedTextTracks[f])&&g.push(a.scriptedTextTracks[f]);for(f=0,j=b.length;f<j;f++)-1==c.indexOf(b[f])&&e.push(b[f]);if(e.length||g.length){b.splice(0);for(f=0,j=c.length;f<j;f++)b.push(c[f]);for(f=0,j=e.length;f<j;f++)d([b]).triggerHandler(d.Event({type:"removetrack",track:e[f]}));for(f=0,j=g.length;f<j;f++)d([b]).triggerHandler(d.Event({type:"addtrack",track:g[f]}));(a.scriptedTextTracks||e.length)&&d(this).triggerHandler("updatetrackdisplay")}}, -t=function(a,b){b||(b=h.data(a,"trackData"));if(b&&!b.isTriggering)b.isTriggering=!0,setTimeout(function(){(b.track||{}).readyState?d(a).closest("audio, video").triggerHandler("updatetrackdisplay"):d(a).triggerHandler("checktrackmode");b.isTriggering=!1},1)},q=d("<div />")[0];r.TextTrackCue=function(a,b,e){3!=arguments.length&&h.error("wrong arguments.length for TextTrackCue.constructor");this.startTime=a;this.endTime=b;this.text=e;this.id="";this.pauseOnExit=!1;p(this)};r.TextTrackCue.prototype= -{onenter:null,onexit:null,pauseOnExit:!1,getCueAsHTML:function(){var a="",b="",e=s.createDocumentFragment(),g;if(!z(this,"getCueAsHTML"))g=this.getCueAsHTML=function(){var c,f;if(a!=this.text){a=this.text;b=i.parseCueTextToHTML(a);q.innerHTML=b;for(c=0,f=q.childNodes.length;c<f;c++)e.appendChild(q.childNodes[c].cloneNode(!0))}return e.cloneNode(!0)};return g?g.apply(this,arguments):e.cloneNode(!0)},track:null,id:""};i.createCueList=function(){return d.extend([],w)};i.parseCueTextToHTML=function(){var a= -/(<\/?[^>]+>)/ig,b=/^(?:c|v|ruby|rt|b|i|u)/,e=/\<\s*\//,g=function(a,b,c,g){e.test(g)?a="</"+a+">":(c.splice(0,1),a="<"+a+" "+b+'="'+c.join(" ").replace(/\"/g,"&#34;")+'">');return a},c=function(a){var c=a.replace(/[<\/>]+/ig,"").split(/[\s\.]+/);c[0]&&(c[0]=c[0].toLowerCase(),b.test(c[0])?"c"==c[0]?a=g("span","class",c,a):"v"==c[0]&&(a=g("q","title",c,a)):a="");return a};return function(b){return b.replace(a,c)}}();i.loadTextTrack=function(a,b,e,g){var c=e.track,f=function(){var e=d.prop(b,"src"), -g,k;if("disabled"!=c.mode&&e&&d.attr(b,"src")&&(d(a).unbind("play playing timeupdate updatetrackdisplay",f),d(b).unbind("checktrackmode",f),!c.readyState)){g=function(){c.readyState=3;c.cues=null;c.activeCues=c.shimActiveCues=c._shimActiveCues=null;d(b).triggerHandler("error")};c.readyState=1;try{c.cues=i.createCueList(),c.activeCues=c.shimActiveCues=c._shimActiveCues=i.createCueList(),k=d.ajax({dataType:"text",url:e,success:function(f){"text/vtt"!=k.getResponseHeader("content-type")&&h.error("set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt"); -i.parseCaptions(f,c,function(f){f&&"length"in f?(c.readyState=2,d(b).triggerHandler("load"),d(a).triggerHandler("updatetrackdisplay")):g()})},error:g})}catch(l){g(),h.warn(l)}}};c.readyState=0;c.shimActiveCues=null;c._shimActiveCues=null;c.activeCues=null;c.cues=null;d(a).unbind("play playing timeupdate updatetrackdisplay",f);d(b).unbind("checktrackmode",f);d(a).on("play playing timeupdate updatetrackdisplay",f);d(b).on("checktrackmode",f);if(g)c.mode=u[c.kind]?"showing":"hidden",f()};i.createTextTrack= -function(a,b){var e,g;if(b.nodeName&&(g=h.data(b,"trackData")))t(b,g),e=g.track;if(!e)e=p(h.objectCreate(y)),m||n.forEach(function(a){var f=d.prop(b,a);f&&(e[o[a]||a]=f)}),b.nodeName?(m&&n.forEach(function(a){h.defineProperty(e,o[a]||a,{get:function(){return d.prop(b,a)}})}),g=h.data(b,"trackData",{track:e}),i.loadTextTrack(a,b,g,d.prop(b,"default")&&d(b).siblings("track[default]").andSelf()[0]==b)):(m&&n.forEach(function(a){h.defineProperty(e,o[a]||a,{value:b[a],writeable:!1})}),e.cues=i.createCueList(), -e.activeCues=e._shimActiveCues=e.shimActiveCues=i.createCueList(),e.mode="hidden",e.readyState=2);return e};i.parseCaptionChunk=function(){var a=/^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/,b=/^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g,e=/^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g,g=/^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g;return function(c){var f,d,i,k;if(b.exec(c)||e.exec(c)||g.exec(c))return null;for(c=c.split(/\n/g);!c[0].replace(/\s+/ig,"").length&&0<c.length;)c.shift(); -for(c[0].match(/^\s*[a-z0-9-\_]+\s*$/ig)&&(i=""+c.shift().replace(/\s*/ig,""));0<c.length;){if(k=a.exec(c[0]))d=k.slice(1),f=parseInt(3600*(d[0]||0),10)+parseInt(60*(d[1]||0),10)+parseInt(d[2]||0,10)+parseFloat("0."+(d[3]||0)),d=parseInt(3600*(d[4]||0),10)+parseInt(60*(d[5]||0),10)+parseInt(d[6]||0,10)+parseFloat("0."+(d[7]||0));c=c.slice(0,0).concat(c.slice(1));break}if(!f&&!d)return h.warn("couldn't extract time information: "+[f,d,c.join("\n"),i].join(" ; ")),null;c=c.join("\n");f=new TextTrackCue(f, -d,c);if(i)f.id=i;return f}}();i.parseCaptions=function(a,b,d){i.createCueList();var g,c,f,j,l;a?(f=/^WEBVTT(\s*FILE)?/ig,c=function(k,m){for(;k<m;k++){g=a[k];if(f.test(g))l=!0;else if(g.replace(/\s*/ig,"").length){if(!l){h.error("please use WebVTT format. This is the standard");d(null);break}(g=i.parseCaptionChunk(g,k))&&b.addCue(g)}if(j<(new Date).getTime()-30){k++;setTimeout(function(){j=(new Date).getTime();c(k,m)},90);break}}k>=m&&(l||h.error("please use WebVTT format. This is the standard"), -d(b.cues))},a=a.replace(/\r\n/g,"\n"),setTimeout(function(){a=a.replace(/\r/g,"\n");setTimeout(function(){j=(new Date).getTime();a=a.split(/\n\n+/g);c(0,a.length)},9)},9)):h.error("Required parameter captionData not supplied.")};i.createTrackList=function(a,b){b=b||h.data(a,"mediaelementBase")||h.data(a,"mediaelementBase",{});if(!b.textTracks)b.textTracks=[],h.defineProperties(b.textTracks,{onaddtrack:{value:null},onremovetrack:{value:null}}),p(b.textTracks);return b.textTracks};Modernizr.track|| -(h.defineNodeNamesBooleanProperty(["track"],"default"),h.reflectProperties(["track"],["srclang","label"]),h.defineNodeNameProperties("track",{src:{reflect:!0,propType:"src"}}));h.defineNodeNameProperties("track",{kind:{attr:Modernizr.track?{set:function(a){var b=h.data(this,"trackData");this.setAttribute("data-kind",a);if(b)b.attrKind=a},get:function(){var a=h.data(this,"trackData");return a&&"attrKind"in a?a.attrKind:this.getAttribute("kind")}}:{},reflect:!0,propType:"enumarated",defaultValue:"subtitles", -limitedTo:["subtitles","captions","descriptions","chapters","metadata"]}});d.each(n,function(a,b){var e=o[b]||b;h.onNodeNamesPropertyModify("track",b,function(){var a=h.data(this,"trackData"),c=this;if(a)"kind"==b&&t(this,a),m||(a.track[e]=d.prop(this,b)),clearTimeout(a.changedTrackPropTimer),a.changedTrackPropTimer=setTimeout(function(){d(c).trigger("updatesubtitlestate")},1)})});h.onNodeNamesPropertyModify("track","src",function(a){if(a){var a=h.data(this,"trackData"),b;a&&(b=d(this).closest("video, audio"), -b[0]&&i.loadTextTrack(b,this,a))}});h.defineNodeNamesProperties(["track"],{ERROR:{value:3},LOADED:{value:2},LOADING:{value:1},NONE:{value:0},readyState:{get:function(){return(d.prop(this,"track")||{readyState:0}).readyState},writeable:!1},track:{get:function(){return i.createTextTrack(d(this).closest("audio, video")[0],this)},writeable:!1}},"prop");h.defineNodeNamesProperties(["audio","video"],{textTracks:{get:function(){var a=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{}),b= -i.createTrackList(this,a);a.blockTrackListUpdate||l.call(this,a,b);return b},writeable:!1},addTextTrack:{value:function(a,b,d){a=i.createTextTrack(this,{kind:v.prop("kind",a||"").prop("kind"),label:b||"",srclang:d||""});b=h.data(this,"mediaelementBase")||h.data(this,"mediaelementBase",{});if(!b.scriptedTextTracks)b.scriptedTextTracks=[];b.scriptedTextTracks.push(a);l.call(this);return a}}},"prop");d(s).on("emptied ended updatetracklist",function(a){if(d(a.target).is("audio, video")){var b=h.data(a.target, -"mediaelementBase");if(b)clearTimeout(b.updateTrackListTimer),b.updateTrackListTimer=setTimeout(function(){l.call(a.target,b)},0)}});h.addReady(function(a,b){var e=b.filter("video, audio, track").closest("audio, video");d("video, audio",a).add(e).each(function(){l.call(this)}).each(function(){if(Modernizr.track){var a=this.textTracks;d.prop(this,"textTracks").length!=a.length&&h.error("textTracks couldn't be copied");d("track",this).each(function(){var a=d.prop(this,"track"),b=this.track,e,g;if(b){e= -d.prop(this,"kind");g=b.readyState||this.readyState;if(b.mode||g)a.mode=x[b.mode]||b.mode;if("descriptions"!=e)b.mode="string"==typeof b.mode?"disabled":0,this.kind="metadata",d(this).attr({kind:e})}}).on("load error",function(a){a.originalEvent&&a.stopImmediatePropagation()})}});e.each(function(){var a=this,b=h.data(a,"mediaelementBase");if(b)clearTimeout(b.updateTrackListTimer),b.updateTrackListTimer=setTimeout(function(){l.call(a,b)},9)})});Modernizr.track&&d("video, audio").trigger("trackapichange")}); +jQuery.webshims.register("track",function(e,t,n,r,i){"use strict";var s=t.mediaelement,o=(new Date).getTime(),u={subtitles:1,captions:1,descriptions:1},a=function(){t.error("not implemented yet")},f=e("<track />"),l=Modernizr.ES5&&Modernizr.objectAccessor,c=function(e){var n={};return e.addEventListener=function(e,r){n[e]&&t.error("always use $.on to the shimed event: "+e+" already bound fn was: "+n[e]+" your fn was: "+r),n[e]=r},e.removeEventListener=function(e,r){n[e]&&n[e]!=r&&t.error("always use $.on/$.off to the shimed event: "+e+" already bound fn was: "+n[e]+" your fn was: "+r),n[e]&&delete n[e]},e},h={getCueById:function(e){var t=null;for(var n=0,r=this.length;n<r;n++)if(this[n].id===e){t=this[n];break}return t}},p={0:"disabled",1:"hidden",2:"showing"},d={shimActiveCues:null,_shimActiveCues:null,activeCues:null,cues:null,kind:"subtitles",label:"",language:"",mode:"disabled",readyState:0,oncuechange:null,toString:function(){return"[object TextTrack]"},addCue:function(e){if(!this.cues)this.cues=s.createCueList();else{var n=this.cues[this.cues.length-1];n&&n.startTime>e.startTime&&t.error("cue startTime higher than previous cue's startTime")}e.track&&e.track.removeCue&&e.track.removeCue(e),e.track=this,this.cues.push(e)},removeCue:function(e){var n=this.cues||[],r=0,i=n.length;if(e.track!=this){t.error("cue not part of track");return}for(;r<i;r++)if(n[r]===e){n.splice(r,1),e.track=null;break}if(e.track){t.error("cue not part of track");return}},DISABLED:"disabled",OFF:"disabled",HIDDEN:"hidden",SHOWING:"showing",ERROR:3,LOADED:2,LOADING:1,NONE:0},v=["kind","label","srclang"],m={srclang:"language"},g=Function.prototype.call.bind(Object.prototype.hasOwnProperty),y=function(n,r){var i=[],s=[],o=[],u,a;n||(n=t.data(this,"mediaelementBase")||t.data(this,"mediaelementBase",{})),r||(n.blockTrackListUpdate=!0,r=e.prop(this,"textTracks"),n.blockTrackListUpdate=!1),clearTimeout(n.updateTrackListTimer),e("track",this).each(function(){var t=e.prop(this,"track");o.push(t),r.indexOf(t)==-1&&s.push(t)});if(n.scriptedTextTracks)for(u=0,a=n.scriptedTextTracks.length;u<a;u++)o.push(n.scriptedTextTracks[u]),r.indexOf(n.scriptedTextTracks[u])==-1&&s.push(n.scriptedTextTracks[u]);for(u=0,a=r.length;u<a;u++)o.indexOf(r[u])==-1&&i.push(r[u]);if(i.length||s.length){r.splice(0);for(u=0,a=o.length;u<a;u++)r.push(o[u]);for(u=0,a=i.length;u<a;u++)e([r]).triggerHandler(e.Event({type:"removetrack",track:i[u]}));for(u=0,a=s.length;u<a;u++)e([r]).triggerHandler(e.Event({type:"addtrack",track:s[u]}));(n.scriptedTextTracks||i.length)&&e(this).triggerHandler("updatetrackdisplay")}},b=function(n,r){r||(r=t.data(n,"trackData")),r&&!r.isTriggering&&(r.isTriggering=!0,setTimeout(function(){(r.track||{}).readyState?e(n).closest("audio, video").triggerHandler("updatetrackdisplay"):e(n).triggerHandler("checktrackmode"),r.isTriggering=!1},1))},w=e("<div />")[0];n.TextTrackCue=function(e,n,r){arguments.length!=3&&t.error("wrong arguments.length for TextTrackCue.constructor"),this.startTime=e,this.endTime=n,this.text=r,this.id="",this.pauseOnExit=!1,c(this)},n.TextTrackCue.prototype={onenter:null,onexit:null,pauseOnExit:!1,getCueAsHTML:function(){var e="",t="",n=r.createDocumentFragment(),i;return g(this,"getCueAsHTML")||(i=this.getCueAsHTML=function(){var r,i;if(e!=this.text){e=this.text,t=s.parseCueTextToHTML(e),w.innerHTML=t;for(r=0,i=w.childNodes.length;r<i;r++)n.appendChild(w.childNodes[r].cloneNode(!0))}return n.cloneNode(!0)}),i?i.apply(this,arguments):n.cloneNode(!0)},track:null,id:""},s.createCueList=function(){return e.extend([],h)},s.parseCueTextToHTML=function(){var e=/(<\/?[^>]+>)/ig,t=/^(?:c|v|ruby|rt|b|i|u)/,n=/\<\s*\//,r=function(e,t,r,i){var s;return n.test(i)?s="</"+e+">":(r.splice(0,1),s="<"+e+" "+t+'="'+r.join(" ").replace(/\"/g,"&#34;")+'">'),s},i=function(e){var n=e.replace(/[<\/>]+/ig,"").split(/[\s\.]+/);return n[0]&&(n[0]=n[0].toLowerCase(),t.test(n[0])?n[0]=="c"?e=r("span","class",n,e):n[0]=="v"&&(e=r("q","title",n,e)):e=""),e};return function(t){return t.replace(e,i)}}(),s.loadTextTrack=function(n,r,i,o){var a="play playing timeupdate updatetrackdisplay",f=i.track,l=function(){var i=e.prop(r,"src"),o,u;if(f.mode!="disabled"&&i&&e.attr(r,"src")){e(n).unbind(a,l),e(r).unbind("checktrackmode",l);if(!f.readyState){o=function(){f.readyState=3,f.cues=null,f.activeCues=f.shimActiveCues=f._shimActiveCues=null,e(r).triggerHandler("error")},f.readyState=1;try{f.cues=s.createCueList(),f.activeCues=f.shimActiveCues=f._shimActiveCues=s.createCueList(),u=e.ajax({dataType:"text",url:i,success:function(i){u.getResponseHeader("content-type")!="text/vtt"&&t.error("set the mime-type of your WebVTT files to text/vtt. see: http://dev.w3.org/html5/webvtt/#text/vtt"),s.parseCaptions(i,f,function(t){t&&"length"in t?(f.readyState=2,e(r).triggerHandler("load"),e(n).triggerHandler("updatetrackdisplay")):o()})},error:o})}catch(c){o(),t.warn(c)}}}};f.readyState=0,f.shimActiveCues=null,f._shimActiveCues=null,f.activeCues=null,f.cues=null,e(n).unbind(a,l),e(r).unbind("checktrackmode",l),e(n).on(a,l),e(r).on("checktrackmode",l),o&&(f.mode=u[f.kind]?"showing":"hidden",l())},s.createTextTrack=function(n,r){var i,o;return r.nodeName&&(o=t.data(r,"trackData"),o&&(b(r,o),i=o.track)),i||(i=c(t.objectCreate(d)),l||v.forEach(function(t){var n=e.prop(r,t);n&&(i[m[t]||t]=n)}),r.nodeName?(l&&v.forEach(function(n){t.defineProperty(i,m[n]||n,{get:function(){return e.prop(r,n)}})}),o=t.data(r,"trackData",{track:i}),s.loadTextTrack(n,r,o,e.prop(r,"default")&&e(r).siblings("track[default]").andSelf()[0]==r)):(l&&v.forEach(function(e){t.defineProperty(i,m[e]||e,{value:r[e],writeable:!1})}),i.cues=s.createCueList(),i.activeCues=i._shimActiveCues=i.shimActiveCues=s.createCueList(),i.mode="hidden",i.readyState=2)),i},s.parseCaptionChunk=function(){var e=/^(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s+\-\-\>\s+(\d{2})?:?(\d{2}):(\d{2})\.(\d+)\s*(.*)/,n=/^([\d\.]+)\s+\+([\d\.]+)\s*(.*)/,r=/^(DEFAULTS|DEFAULT)\s+\-\-\>\s+(.*)/g,i=/^(STYLE|STYLES)\s+\-\-\>\s*\n([\s\S]*)/g,s=/^(COMMENT|COMMENTS)\s+\-\-\>\s+(.*)/g;return function(n,o){var u=[],a,f,l,c,h,p,d="",v,m,g,y;if(m=r.exec(n))return null;if(m=i.exec(n))return null;if(m=s.exec(n))return null;a=n.split(/\n/g);while(!a[0].replace(/\s+/ig,"").length&&a.length>0)a.shift();a[0].match(/^\s*[a-z0-9-\_]+\s*$/ig)&&(v=String(a.shift().replace(/\s*/ig,"")));for(p=0;p<a.length;p++){var b=a[p];if(g=e.exec(b))h=g.slice(1),f=parseInt((h[0]||0)*60*60,10)+parseInt((h[1]||0)*60,10)+parseInt(h[2]||0,10)+parseFloat("0."+(h[3]||0)),l=parseInt((h[4]||0)*60*60,10)+parseInt((h[5]||0)*60,10)+parseInt(h[6]||0,10)+parseFloat("0."+(h[7]||0));a=a.slice(0,p).concat(a.slice(p+1));break}return!f&&!l?(t.warn("couldn't extract time information: "+[f,l,a.join("\n"),v].join(" ; ")),null):(c=a.join("\n"),y=new TextTrackCue(f,l,c),v&&(y.id=v),y)}}(),s.parseCaptions=function(e,n,r){var i=s.createCueList(),o,u,a,f,l;e?(a=/^WEBVTT(\s*FILE)?/ig,u=function(i,c){for(;i<c;i++){o=e[i];if(a.test(o))l=!0;else if(o.replace(/\s*/ig,"").length){if(!l){t.error("please use WebVTT format. This is the standard"),r(null);break}o=s.parseCaptionChunk(o,i),o&&n.addCue(o)}if(f<(new Date).getTime()-30){i++,setTimeout(function(){f=(new Date).getTime(),u(i,c)},90);break}}i>=c&&(l||t.error("please use WebVTT format. This is the standard"),r(n.cues))},e=e.replace(/\r\n/g,"\n"),setTimeout(function(){e=e.replace(/\r/g,"\n"),setTimeout(function(){f=(new Date).getTime(),e=e.split(/\n\n+/g),u(0,e.length)},9)},9)):t.error("Required parameter captionData not supplied.")},s.createTrackList=function(e,n){return n=n||t.data(e,"mediaelementBase")||t.data(e,"mediaelementBase",{}),n.textTracks||(n.textTracks=[],t.defineProperties(n.textTracks,{onaddtrack:{value:null},onremovetrack:{value:null}}),c(n.textTracks)),n.textTracks},Modernizr.track||(t.defineNodeNamesBooleanProperty(["track"],"default"),t.reflectProperties(["track"],["srclang","label"]),t.defineNodeNameProperties("track",{src:{reflect:!0,propType:"src"}})),t.defineNodeNameProperties("track",{kind:{attr:Modernizr.track?{set:function(e){var n=t.data(this,"trackData");this.setAttribute("data-kind",e),n&&(n.attrKind=e)},get:function(){var e=t.data(this,"trackData");return e&&"attrKind"in e?e.attrKind:this.getAttribute("kind")}}:{},reflect:!0,propType:"enumarated",defaultValue:"subtitles",limitedTo:["subtitles","captions","descriptions","chapters","metadata"]}}),e.each(v,function(n,r){var i=m[r]||r;t.onNodeNamesPropertyModify("track",r,function(){var n=t.data(this,"trackData"),s=this;n&&(r=="kind"&&b(this,n),l||(n.track[i]=e.prop(this,r)),clearTimeout(n.changedTrackPropTimer),n.changedTrackPropTimer=setTimeout(function(){e(s).trigger("updatesubtitlestate")},1))})}),t.onNodeNamesPropertyModify("track","src",function(n){if(n){var r=t.data(this,"trackData"),i;r&&(i=e(this).closest("video, audio"),i[0]&&s.loadTextTrack(i,this,r))}}),t.defineNodeNamesProperties(["track"],{ERROR:{value:3},LOADED:{value:2},LOADING:{value:1},NONE:{value:0},readyState:{get:function(){return(e.prop(this,"track")||{readyState:0}).readyState},writeable:!1},track:{get:function(){return s.createTextTrack(e(this).closest("audio, video")[0],this)},writeable:!1}},"prop"),t.defineNodeNamesProperties(["audio","video"],{textTracks:{get:function(){var e=this,n=t.data(e,"mediaelementBase")||t.data(e,"mediaelementBase",{}),r=s.createTrackList(e,n);return n.blockTrackListUpdate||y.call(e,n,r),r},writeable:!1},addTextTrack:{value:function(e,n,r){var i=s.createTextTrack(this,{kind:f.prop("kind",e||"").prop("kind"),label:n||"",srclang:r||""}),o=t.data(this,"mediaelementBase")||t.data(this,"mediaelementBase",{});return o.scriptedTextTracks||(o.scriptedTextTracks=[]),o.scriptedTextTracks.push(i),y.call(this),i}}},"prop"),e(r).on("emptied ended updatetracklist",function(n){if(e(n.target).is("audio, video")){var r=t.data(n.target,"mediaelementBase");r&&(clearTimeout(r.updateTrackListTimer),r.updateTrackListTimer=setTimeout(function(){y.call(n.target,r)},0))}});var E=function(e,t){return t.readyState||e.readyState};t.addReady(function(n,r){var i=r.filter("video, audio, track").closest("audio, video");e("video, audio",n).add(i).each(function(){y.call(this)}).each(function(){if(Modernizr.track){var n=e.prop(this,"textTracks"),r=this.textTracks;n.length!=r.length&&t.error("textTracks couldn't be copied"),e("track",this).each(function(){var t=e.prop(this,"track"),n=this.track,r,i;if(n){r=e.prop(this,"kind"),i=E(this,n);if(n.mode||i)t.mode=p[n.mode]||n.mode;r!="descriptions"&&(n.mode=typeof n.mode=="string"?"disabled":0,this.kind="metadata",e(this).attr({kind:r}))}}).on("load error",function(e){e.originalEvent&&e.stopImmediatePropagation()})}}),i.each(function(){var e=this,n=t.data(e,"mediaelementBase");n&&(clearTimeout(n.updateTrackListTimer),n.updateTrackListTimer=setTimeout(function(){y.call(e,n)},9))})}),Modernizr.track&&e("video, audio").trigger("trackapichange")}); \ No newline at end of file