in TTML");n=t(og(d,"div"));for(q=n.next();!q.done;q=n.next())if(og(q.value,"span").length)throw new O(2,2,2001,"
can only be inside in TTML");if(b=kz(d,b,f,g,h,e,k,m,l,null,!1,c))b.backgroundColor||(b.backgroundColor="transparent"),a.push(b);return a};
-function kz(a,b,c,d,e,f,g,h,k,l,m,n){var q=a.parentNode;if(a.nodeType==Node.COMMENT_NODE)return null;if(a.nodeType==Node.TEXT_NODE){if(!m)return null;var p=document.createElement("span");p.textContent=a.textContent}else p=a;for(var u=null,v=t(lz),y=v.next();!y.done&&!(u=mz(p,"backgroundImage",d,"#",y.value)[0]);y=v.next());v=null;var z=tg(p,lz,"backgroundImage");n&&z&&!z.startsWith("#")&&(y=new fc(n),z=new fc(z),(y=y.resolve(z).toString())&&(v=y));if("p"==a.nodeName||u||v)m=!0;a=m;y="default"==(p.getAttribute("xml:space")||
-(h?"default":"preserve"));z=Array.from(p.childNodes).every(function(D){return D.nodeType==Node.TEXT_NODE});h=[];if(!z)for(var x=t(p.childNodes),B=x.next();!B.done;B=x.next())(B=kz(B.value,b,c,d,e,f,g,y,k,p,m,n))&&h.push(B);d=null!=l;n=/\S/.test(p.textContent);B=p.hasAttribute("begin")||p.hasAttribute("end")||p.hasAttribute("dur");if(!(B||n||"br"==p.tagName||0!=h.length||d&&!y))return null;x=nz(p,c);n=x.start;for(x=x.end;q&&q.nodeType==Node.ELEMENT_NODE&&"tt"!=q.tagName;)x=oz(q,c,n,x),n=x.start,x=
-x.end,q=q.parentNode;null==n&&(n=0);n+=b.periodStart;x=null==x?Infinity:x+b.periodStart;n=Math.max(n,b.segmentStart);x=Math.min(x,b.segmentEnd);if(!B&&0c.length)return f;var g=a;for(a=null;g&&!(a=e?sg(g,e,b):g.getAttribute(b))&&(g=g.parentNode,g instanceof Element););if(b=a)for(b=t(b.split(" ")),e=b.next();!e.done;e=b.next())for(e=e.value,a=t(c),g=a.next();!g.done;g=a.next())if(g=g.value,d+g.getAttribute("xml:id")==e){f.push(g);break}return f}function oz(a,b,c,d){a=nz(a,b);null==c?c=a.start:null!=a.start&&(c+=a.start);null==d?d=a.end:null!=a.start&&(d+=a.start);return{start:c,end:d}}
-function nz(a,b){var c=yz(a.getAttribute("begin"),b),d=yz(a.getAttribute("end"),b);a=yz(a.getAttribute("dur"),b);null==d&&null!=a&&(d=c+a);return{start:c,end:d}}
-function yz(a,b){var c=null;if(zz.test(a)){a=zz.exec(a);c=Number(a[1]);var d=Number(a[2]),e=Number(a[3]),f=Number(a[4]);f+=(Number(a[5])||0)/b.h;e+=f/b.frameRate;c=e+60*d+3600*c}else if(Az.test(a))c=Bz(Az,a);else if(Cz.test(a))c=Bz(Cz,a);else if(Dz.test(a))a=Dz.exec(a),c=Number(a[1])/b.frameRate;else if(Ez.test(a))a=Ez.exec(a),c=Number(a[1])/b.g;else if(Fz.test(a))c=Bz(Fz,a);else if(a)throw new O(2,2,2001,"Could not parse cue time range in TTML");return c}
-function Bz(a,b){a=a.exec(b);return null==a||""==a[0]?null:(Number(a[4])||0)/1E3+(Number(a[3])||0)+60*(Number(a[2])||0)+3600*(Number(a[1])||0)}M("shaka.text.TtmlTextParser",dz);dz.prototype.parseMedia=dz.prototype.parseMedia;dz.prototype.setManifestType=dz.prototype.setManifestType;dz.prototype.setSequenceMode=dz.prototype.setSequenceMode;dz.prototype.parseInit=dz.prototype.parseInit;
-function gz(a,b,c,d){this.frameRate=Number(a)||30;this.h=Number(b)||1;this.g=Number(d);0==this.g&&(this.g=a?this.frameRate*this.h:1);c&&(a=/^(\d+) (\d+)$/g.exec(c))&&(this.frameRate*=Number(a[1])/Number(a[2]))}
-var hz=/^(\d{1,2}(?:\.\d+)?|100(?:\.0+)?)% (\d{1,2}(?:\.\d+)?|100(?:\.0+)?)%$/,uz=/^(\d{1,2}(?:\.\d+)?|100)%$/,tz=/^(\d+px|\d+em|\d*\.?\d+c)$/,iz=/^(\d+)px (\d+)px$/,zz=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,Az=/^(?:(\d{2,}):)?(\d{2}):(\d{2})$/,Cz=/^(?:(\d{2,}):)?(\d{2}):(\d{2}\.\d{2,})$/,Dz=/^(\d*(?:\.\d*)?)f$/,Ez=/^(\d*(?:\.\d*)?)t$/,Fz=RegExp("^(?:(\\d*(?:\\.\\d*)?)h)?(?:(\\d*(?:\\.\\d*)?)m)?(?:(\\d*(?:\\.\\d*)?)s)?(?:(\\d*(?:\\.\\d*)?)ms)?$"),sz={left:Gb,center:"center",right:"end",start:Gb,
-end:"end"},rz={left:"line-left",center:"center",right:"line-right"},ez=["http://www.w3.org/ns/ttml#parameter","http://www.w3.org/2006/10/ttaf1#parameter"],fz=["http://www.w3.org/ns/ttml#styling","http://www.w3.org/2006/10/ttaf1#styling"],lz=["http://www.smpte-ra.org/schemas/2052-1/2010/smpte-tt","http://www.smpte-ra.org/schemas/2052-1/2013/smpte-tt"];Rc["application/ttml+xml"]=function(){return new dz};function Gz(){this.g=new dz}Gz.prototype.parseInit=function(a){var b=!1;(new Vf).box("moov",$f).box("trak",$f).box("mdia",$f).box("minf",$f).box("stbl",$f).P("stsd",bg).box("stpp",function(c){b=!0;c.parser.stop()}).parse(a);if(!b)throw new O(2,2,2007);};Gz.prototype.setSequenceMode=function(){};Gz.prototype.setManifestType=function(){};
-Gz.prototype.parseMedia=function(a,b,c){var d=this,e=!1,f=[];(new Vf).box("mdat",dg(function(g){e=!0;f=f.concat(d.g.parseMedia(g,b,c))})).parse(a,!1);if(!e)throw new O(2,2,2007);return f};M("shaka.text.Mp4TtmlParser",Gz);Gz.prototype.parseMedia=Gz.prototype.parseMedia;Gz.prototype.setManifestType=Gz.prototype.setManifestType;Gz.prototype.setSequenceMode=Gz.prototype.setSequenceMode;Gz.prototype.parseInit=Gz.prototype.parseInit;Rc['application/mp4; codecs="stpp"']=function(){return new Gz};
-Rc['application/mp4; codecs="stpp.ttml"']=function(){return new Gz};Rc['application/mp4; codecs="stpp.ttml.im1t"']=function(){return new Gz};Rc['application/mp4; codecs="stpp.TTML.im1t"']=function(){return new Gz};function Hz(){this.h=!1;this.g="UNKNOWN"}Hz.prototype.parseInit=function(){};Hz.prototype.setSequenceMode=function(a){this.h=a};Hz.prototype.setManifestType=function(a){this.g=a};
-Hz.prototype.parseMedia=function(a,b){a=Kf(a);a=a.replace(/\r\n|\r(?=[^\n]|$)/gm,"\n");var c=a.split(/\n{2,}/m);if(!/^WEBVTT($|[ \t\n])/m.test(c[0]))throw new O(2,2,2E3);a=b.vttOffset;if(c[0].includes("X-TIMESTAMP-MAP")&&this.h){var d=c[0].match(/LOCAL:((?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{3}))/m),e=c[0].match(/MPEGTS:(\d+)/m);if(d&&e){a=Iz(new Zs(d[1]));if(null==a)throw new O(2,2,2E3);e=Number(e[1]);for(d=b.segmentStart-b.periodStart;95443.7176888889<=d;)d-=95443.7176888889,e+=8589934592;a=b.periodStart+
-e/9E4-a}}else c[0].includes("X-TIMESTAMP-MAP")&&"HLS"==this.g&&(a=b.segmentStart);b=[];e=t(c[0].split("\n"));for(d=e.next();!d.done;d=e.next())if(d=d.value,/^Region:/.test(d)){d=new Zs(d);var f=new zb;bt(d);$s(d);for(var g=bt(d);g;){var h=f,k=g;(g=/^id=(.*)$/.exec(k))?h.id=g[1]:(g=/^width=(\d{1,2}|100)%$/.exec(k))?h.width=Number(g[1]):(g=/^lines=(\d+)$/.exec(k))?(h.height=Number(g[1]),h.heightUnits=2):(g=/^regionanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.regionAnchorX=Number(g[1]),h.regionAnchorY=
-Number(g[2])):(g=/^viewportanchor=(\d{1,2}|100)%,(\d{1,2}|100)%$/.exec(k))?(h.viewportAnchorX=Number(g[1]),h.viewportAnchorY=Number(g[2])):/^scroll=up$/.exec(k)&&(h.scroll="up");$s(d);g=bt(d)}b.push(f)}e=new Map;Jz(e);d=[];c=t(c.slice(1));for(f=c.next();!f.done;f=c.next()){f=f.value.split("\n");if((1!=f.length||f[0])&&!/^NOTE($|[ \t])/.test(f[0])&&"STYLE"==f[0]){h=[];g=-1;for(k=1;k",g);if(h<=g)break a;if((h=a.substring(g+1,h))&&"c"===h){var k=d.pop();k?k===h?(f+="/"+h+">",g+=h.length+1):k.startsWith("c.")?(g+=h.length+1,f+="/"+k+">"):f+=a[g]:f+=a[g]}else f+=a[g]}else"<"===a[g]?(e=g+1,"c"!=a[e]&&(e=-1)):">"===a[g]&&0"===d[e]&&
-0",''),d+="
";a=d;a:{e=a;f=[];g=-1;a="";d=!1;for(h=0;h",h);if(-1===k){a=e;break a}if((k=e.substring(h+1,k))&&"v"==k){d=!0;var l=null;f.length&&(l=f[f.length-1]);if(l){if(l===k)a+="/"+k+">";else{if(!l.startsWith("v")){a+=e[h];continue}a+="/"+l+">"}h+=k.length+1}else a+=e[h]}else a+=e[h]}else"<"===e[h]?(g=h+1,"v"!=
-e[g]&&(g=-1)):">"===e[h]&&0","<"+g+">"),a=a.replace(""+f+">",""+g+">"),d||(a+=""+g+">")}if(d=Gg(""+a+"","span")){d=d.childNodes;if(1==d.length&&(e=d[0],e.nodeType==Node.TEXT_NODE||e.nodeType==Node.CDATA_SECTION_NODE)){b.payload=Nz(a);return}a=t(d);for(d=a.next();!d.done;d=a.next())Oz(d.value,b,c)}else b.payload=Nz(a)}else b.payload=Nz(a)}
-function Pz(a,b){return a&&0",""":'"',"'":"'"," ":"\u00a0","":"\u200e","":"\u200f"},c=/&(?:amp|lt|gt|quot|#(0+)?39|nbsp|lrm|rlm);/g,d=RegExp(c.source);return a&&d.test(a)?a.replace(c,function(e){return b[e]||"'"}):a||""}M("shaka.text.VttTextParser",Hz);Hz.prototype.parseMedia=Hz.prototype.parseMedia;Hz.prototype.setManifestType=Hz.prototype.setManifestType;Hz.prototype.setSequenceMode=Hz.prototype.setSequenceMode;Hz.prototype.parseInit=Hz.prototype.parseInit;
-var Mz=/(?:(\d{1,}):)?(\d{2}):(\d{2})\.(\d{2,3})/g;Rc["text/vtt"]=function(){return new Hz};Rc['text/vtt; codecs="vtt"']=function(){return new Hz};Rc['text/vtt; codecs="wvtt"']=function(){return new Hz};function Rz(){this.g=null}Rz.prototype.parseInit=function(a){var b=this,c=!1;(new Vf).box("moov",$f).box("trak",$f).box("mdia",$f).P("mdhd",function(d){d=Xh(d.reader,d.version);b.g=d.timescale}).box("minf",$f).box("stbl",$f).P("stsd",bg).box("wvtt",function(){c=!0}).parse(a);if(!this.g)throw new O(2,2,2008);if(!c)throw new O(2,2,2008);};Rz.prototype.setSequenceMode=function(){};Rz.prototype.setManifestType=function(){};
-Rz.prototype.parseMedia=function(a,b){if(!a.length)return[];if(!this.g)throw new O(2,2,2008);var c=0,d=[],e,f=[],g=!1,h=!1,k=!1,l=null;(new Vf).box("moof",$f).box("traf",$f).P("tfdt",function(B){g=!0;c=Wh(B.reader,B.version).baseMediaDecodeTime}).P("tfhd",function(B){l=Vh(B.reader,B.flags).If}).P("trun",function(B){h=!0;d=Yh(B.reader,B.version,B.flags).gg}).box("mdat",dg(function(B){k=!0;e=B})).parse(a,!1);if(!k&&!g&&!h)throw new O(2,2,2008);a=c;for(var m=new Sf(e,0),n=t(d),q=n.next();!q.done;q=n.next()){q=
-q.value;var p=q.ff||l,u=q.Td?c+q.Td:a;a=u+(p||0);var v=0;do{var y=m.L();v+=y;var z=m.L(),x=null;"vttc"==Zf(z)?8").replace(/{\/b}/g,"").replace(/{i}/g,"").replace(/{\/i}/g,"").replace(/{u}/g,"").replace(/{\/u}/g,"")+"\n\n";return b}M("shaka.text.SrtTextParser",Wz);Wz.srt2webvtt=Xz;Wz.prototype.parseMedia=Wz.prototype.parseMedia;
-Wz.prototype.setManifestType=Wz.prototype.setManifestType;Wz.prototype.setSequenceMode=Wz.prototype.setSequenceMode;Wz.prototype.parseInit=Wz.prototype.parseInit;Rc["text/srt"]=function(){return new Wz};function Yz(){}Yz.prototype.parseInit=function(){};Yz.prototype.setSequenceMode=function(){};Yz.prototype.setManifestType=function(){};
-Yz.prototype.parseMedia=function(a){var b="",c="";a=Kf(a).split(/\r?\n\s*\r?\n/);a=t(a);for(var d=a.next();!d.done;d=a.next()){var e=Zz.exec(d.value);e&&(d=e[1],e=e[2],"V4 Styles"==d||"V4+ Styles"==d?b=e:"Events"==d&&(c=e))}a=[];d=null;b=t(b.split(/\r?\n/));for(var f=b.next();!f.done;f=b.next())if(e=f.value,!/^\s*;/.test(e)&&(f=$z.exec(e)))if(e=f[1].trim(),f=f[2].trim(),"Format"==e)d=f.split(aA);else if("Style"==e){e=f.split(aA);f={};for(var g=0;g>8&255)+","+(a>>16&255)+","+(a>>24&255^255)/255+")":null}function bA(a){a=eA.exec(a);return 3600*(a[1]?parseInt(a[1].replace(":",""),10):0)+60*parseInt(a[2],10)+parseFloat(a[3])}M("shaka.text.SsaTextParser",Yz);Yz.prototype.parseMedia=Yz.prototype.parseMedia;Yz.prototype.setManifestType=Yz.prototype.setManifestType;Yz.prototype.setSequenceMode=Yz.prototype.setSequenceMode;Yz.prototype.parseInit=Yz.prototype.parseInit;
-var Zz=/^\s*\[([^\]]+)\]\r?\n([\s\S]*)/,$z=/^\s*([^:]+):\s*(.*)/,aA=/\s*,\s*/,eA=/^(\d+:)?(\d{1,2}):(\d{1,2}(?:[.]\d{1,3})?)?$/;Rc["text/x-ssa"]=function(){return new Yz};function fA(a,b){var c=a[b+1]&1?7:9;return b+c<=a.length&&(a=((a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5)-c,0>>2;if(d>c.length-1)return null;var e=((a[b+2]&192)>>>6)+1,f=(a[b+2]&1)<<2;f|=(a[b+3]&192)>>>6;return{sampleRate:c[d],channelCount:f,ha:"mp4a.40."+e}}
-function hA(a,b){if(b+1=a.length)return!1;var d=(a[b+3]&3)<<11|a[b+4]<<3|(a[b+5]&224)>>>5;if(d<=c)return!1;b+=d;return b===a.length||b+1a.length||11!==a[b]||119!==a[b+1])return null;var c=a[b+4]>>6;if(3<=c)return null;var d=a[b+4]&63,e=2*[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,
-1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][3*d+c];if(b+e>a.length)return null;var f=a[b+6]>>5,g=0;2===f?g+=2:(f&1&&1!==f&&(g+=2),f&4&&(g+=2));g=(a[b+6]<<8|a[b+7])>>12-g&1;var h=a[b+5]&7;a=new Uint8Array([c<<6|a[b+5]>>3<<1|h>>2,(h&3)<<6|f<<3|g<<2|d>>4,d<<4&224]);return{sampleRate:[48E3,44100,32E3][c],channelCount:[2,1,2,3,3,4,4,5][f]+g,fa:a,S:e}}
-function lA(a,b){if(11===a[b]&&119===a[b+1]){var c=0,d=5;b+=d;for(var e,f;0>>24+h<>h;c=c?c<c)return!0}return!1};function mA(a){this.i=a;this.h=0;this.g=new Map}r=mA.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ac3"==a.toLowerCase().split(";")[0]?Za(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ac3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ac-3"':b};r.getOriginalMimeType=function(){return this.i};
-r.transmux=function(a,b,c,d){a=hb(a);for(var e=Uh(a),f=e.length;fa.length||2935!==(a[b]<<8|a[b+1]<<0))return null;var c=new ci(a.subarray(b+2));ei(c,2);ei(c,3);var d=fi(c,11)+1<<1,e=fi(c,2);if(3==e){e=fi(c,2);e=[24E3,22060,16E3][e];var f=3}else e=[48E3,44100,32E3][e],f=fi(c,2);var g=fi(c,3),h=fi(c,1);c=fi(c,5);if(b+d>a.byteLength)return null;a=Math.floor(d*e/(16*[1,2,3,6][f]));a=new Uint8Array([(a&8160)>>5,(a&31)<<3,e<<6|c<<1|0,0|g<<1|h<<0,0]);return{sampleRate:e,channelCount:[2,1,2,3,3,4,4,5][g]+h,fa:a,S:d}};function oA(a){this.i=a;this.h=0;this.g=new Map}r=oA.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/ec3"==a.toLowerCase().split(";")[0]?Za(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/ec3"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="ec-3"':b};r.getOriginalMimeType=function(){return this.i};
-r.transmux=function(a,b,c,d){a=hb(a);for(var e=Uh(a),f=e.length;fe?ki(c,16):ki(c,64))}hi(c);d=T(c);if(0===d)T(c);else if(1===d)for(ei(c,1),hi(c),hi(c),d=T(c),e=0;e>>8&255);e.push(b.byteLength&255);e=e.concat.apply(e,w(b));b=[];a=a.fullData;b.push(a.byteLength>>>8&255);b.push(a.byteLength&255);b=b.concat.apply(b,w(a));a=new Uint8Array([1,e[3],e[4],e[5],255,225].concat(e,[1],b));return{height:c,width:d,la:a}}
-function rA(a){var b=!1,c=[],d=a.find(function(k){return 7==k.type}),e=!1;a=t(a);for(var f=a.next();!f.done;f=a.next()){f=f.value;var g=!1;switch(f.type){case 1:g=e=!0;var h=f.data;d&&4>24&255,h[1]=g>>16&255,h[2]=g>>8&255,h[3]=g&255,c.push(kg(h,
-f.fullData)))}return c.length?{data:kg.apply(eg,w(c)),Tc:b}:null}var qA=[100,110,122,244,44,83,86,118,128,138,139,134];function sA(a){if(!a.length)return null;var b=a.find(function(g){return 32==g.type}),c=a.find(function(g){return 33==g.type}),d=a.find(function(g){return 34==g.type});if(!b||!c||!d)return null;var e=tA(b.fullData);a=uA(c.fullData);var f=vA(d.fullData);b=wA(b.fullData,c.fullData,d.fullData,{Xe:e.Xe,rf:e.rf,Ae:a.Ae,Be:a.Be,ue:a.ue,ze:a.ze,ve:a.ve,we:a.we,xe:a.xe,ye:a.ye,oe:a.oe,pe:a.pe,qe:a.qe,re:a.re,se:a.se,te:a.te,le:a.le,Od:a.Od,ke:a.ke,je:a.je,ie:a.ie,$e:f.$e});return{height:a.height,width:a.width,
-la:b}}function tA(a){var b=new ci(a,!0);ji(b);ji(b);fi(b,4);fi(b,2);fi(b,6);a=fi(b,3);b=U(b);return{Xe:a+1,rf:b}}
-function uA(a){a=new ci(a,!0);ji(a);ji(a);var b=0,c=0,d=0,e=0;fi(a,4);var f=fi(a,3);U(a);for(var g=fi(a,2),h=fi(a,1),k=fi(a,5),l=ji(a),m=ji(a),n=ji(a),q=ji(a),p=ji(a),u=ji(a),v=ji(a),y=ji(a),z=ji(a),x=ji(a),B=ji(a),A=[],D=[],F=0;FF;F++)fi(a,2);for(F=0;FI;I++)for(var L=0;L<(3===I?2:6);L++)if(U(a)){var N=Math.min(64,1<<4+(I<<1));1>8;e[14]=d.Od&255;e[15]=252|d.$e&3;e[16]=252|d.ke&3;e[17]=248|d.je&7;e[18]=248|d.ie&7;e[19]=0;e[20]=0;e[21]=(d.le&3)<<6|(d.Xe&7)<<3|(d.rf?1:0)<<2|3;e[22]=3;e[23]=160;e[24]=0;e[25]=1;e[26]=(a.byteLength&65280)>>8;e[27]=(a.byteLength&
-255)>>0;e.set(a,28);e[23+(5+a.byteLength)]=161;e[a.byteLength+29]=0;e[a.byteLength+30]=1;e[a.byteLength+31]=(b.byteLength&65280)>>8;e[a.byteLength+32]=(b.byteLength&255)>>0;e.set(b,a.byteLength+33);e[23+(a.byteLength+10+b.byteLength)]=162;e[a.byteLength+10+b.byteLength+24]=0;e[a.byteLength+10+b.byteLength+25]=1;e[a.byteLength+10+b.byteLength+26]=(c.byteLength&65280)>>8;e[a.byteLength+10+b.byteLength+27]=(c.byteLength&255)>>0;e.set(c,a.byteLength+10+b.byteLength+28);return e};function xA(a,b){var c=a[b+1]>>3&3,d=a[b+1]>>1&3,e=a[b+2]>>4&15,f=a[b+2]>>2&3;if(1!==c&&0!==e&&15!==e&&3!==f){var g=a[b+3]>>6;e=1E3*yA[14*(3===c?3-d:3===d?3:4)+e-1];f=zA[3*(3===c?0:2===c?1:2)+f];c=AA[c][d];var h=BA[d],k=Math.floor(c*e/f+(a[b+2]>>1&1))*h,l=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);(l=l?parseInt(l[1],10):0)&&87>=l&&2===d&&224E3<=e&&0===g&&(a[b+3]|=128);return{sampleRate:f,channelCount:3===g?1:2,S:k,Qh:8*c*h}}return null}
-function CA(a,b){return 255===a[b]&&224===(a[b+1]&224)&&0!==(a[b+1]&6)}var yA=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],zA=[44100,48E3,32E3,22050,24E3,16E3,11025,12E3,8E3],AA=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],BA=[0,1,1,4];function DA(a){this.i=a;this.h=0;this.g=new Map}r=DA.prototype;r.destroy=function(){this.g.clear()};r.isSupported=function(a){return"audio/mpeg"==a.toLowerCase().split(";")[0]?Za(this.convertCodecs("audio",a)):!1};r.convertCodecs=function(a,b){return"audio/mpeg"==b.toLowerCase().split(";")[0]?'audio/mp4; codecs="mp3"':b};r.getOriginalMimeType=function(){return this.i};
-r.transmux=function(a,b,c,d){a=hb(a);for(c=Uh(a).length;cd;d++)this.usertype[d]!==HA[d]&&(c=!1);c&&(this._parsing&&(this.type="sepiff"),b.call(this))})}r=FA.prototype;r.destroy=function(){};
-r.isSupported=function(a,b){var c=a.startsWith("mss/");if(!this.g||!c)return!1;if(b)return Za(this.convertCodecs(b,a));b=this.convertCodecs("audio",a);a=this.convertCodecs("video",a);return Za(b)||Za(a)};r.convertCodecs=function(a,b){return b.replace("mss/","")};r.getOriginalMimeType=function(){return this.h};
-r.transmux=function(a,b,c){if(!c)return Promise.resolve(hb(a));if(!b.mssPrivateData)return Promise.reject(new O(2,3,3020));try{var d,e=this.g.parseBuffer(a),f=e.fetch("tfhd");f.track_ID=b.id+1;var g=e.fetch("tfdt"),h=e.fetch("traf");null===g&&(g=this.g.createFullBox("tfdt",h,f),g.version=1,g.flags=0,g.baseMediaDecodeTime=Math.floor(c.startTime*b.mssPrivateData.timescale));var k=e.fetch("trun"),l=e.fetch("tfxd");l&&l._parent.boxes.splice(l._parent.boxes.indexOf(l),1);var m=e.fetch("tfrf");m&&m._parent.boxes.splice(m._parent.boxes.indexOf(m),
-1);var n=e.fetch("sepiff");if(null!==n){n.type="senc";n.usertype=void 0;var q=e.fetch("saio");if(null===q){q=this.g.createFullBox("saio",h);q.version=0;q.flags=0;q.entry_count=1;q.offset=[0];var p=this.g.createFullBox("saiz",h);p.version=0;p.flags=0;p.sample_count=n.sample_count;p.default_sample_info_size=0;p.sample_info_size=[];if(n.flags&2)for(d=0;d>24&255;J[1]=F>>16&255;J[2]=F>>8&255;J[3]=F&255;x.push(kg(J,A.fullData))}}var G=x.length?{data:kg.apply(eg,w(x)),Tc:z}:null;G&&(null==p&&null!=
-l.dts&&(p=l.dts),z=void 0,z=v+1
+
+
+
+
diff --git a/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/iosApp.xcscheme b/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/iosApp.xcscheme
new file mode 100644
index 0000000..19ce4b0
--- /dev/null
+++ b/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/iosApp.xcscheme
@@ -0,0 +1,32 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/xcschememanagement.plist b/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/xcschememanagement.plist
new file mode 100644
index 0000000..fa59f97
--- /dev/null
+++ b/iosApp/iosApp.xcodeproj/xcuserdata/neo.chang.xcuserdatad/xcschemes/xcschememanagement.plist
@@ -0,0 +1,14 @@
+
+
+
+
+ SchemeUserState
+
+ iosApp.xcscheme
+
+ orderHint
+ 0
+
+
+
+
diff --git a/kotlin-js-store/wasm/yarn.lock b/kotlin-js-store/wasm/yarn.lock
new file mode 100644
index 0000000..85e59fb
--- /dev/null
+++ b/kotlin-js-store/wasm/yarn.lock
@@ -0,0 +1,23 @@
+# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
+# yarn lockfile v1
+
+
+"@js-joda/core@3.2.0":
+ version "3.2.0"
+ resolved "https://registry.yarnpkg.com/@js-joda/core/-/core-3.2.0.tgz#3e61e21b7b2b8a6be746df1335cf91d70db2a273"
+ integrity sha512-PMqgJ0sw5B7FKb2d5bWYIoxjri+QlW/Pys7+Rw82jSH0QN3rB05jZ/VrrsUdh1w4+i2kw9JOejXGq/KhDOX7Kg==
+
+format-util@^1.0.5:
+ version "1.0.5"
+ resolved "https://registry.yarnpkg.com/format-util/-/format-util-1.0.5.tgz#1ffb450c8a03e7bccffe40643180918cc297d271"
+ integrity sha512-varLbTj0e0yVyRpqQhuWV+8hlePAgaoFRhNFj50BNjEIrw1/DphHSObtqwskVCPWNgzwPoQrZAbfa/SBiicNeg==
+
+ws@8.18.0:
+ version "8.18.0"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-8.18.0.tgz#0d7505a6eafe2b0e712d232b42279f53bc289bbc"
+ integrity sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==
+
+ws@8.20.1:
+ version "8.20.1"
+ resolved "https://registry.yarnpkg.com/ws/-/ws-8.20.1.tgz#91a9ae2b312ccf98e0a85ec499b48cef45ab0ddb"
+ integrity sha512-It4dO0K5v//JtTXuPkfEOaI3uUN87iYPnqo/ZzqCoG3g8uhA66QUMs/SrM0YK7/NAu+r4LMh/9dq2A7k+rHs+w==
diff --git a/settings.gradle.kts b/settings.gradle.kts
index 6083652..651e1a4 100644
--- a/settings.gradle.kts
+++ b/settings.gradle.kts
@@ -1,20 +1,104 @@
-rootProject.name = "ReelsDemo"
-include(":composeApp")
-
pluginManagement {
repositories {
- google()
gradlePluginPortal()
+ maven(url = "https://plugins.gradle.org/m2/")
mavenCentral()
+ google {
+ content {
+ includeGroupByRegex("com\\.android.*")
+ includeGroupByRegex("com\\.google.*")
+ includeGroupByRegex("androidx.*")
+ }
+ }
+ maven {
+ url = uri("https://oss.sonatype.org/content/repositories/snapshots")
+ name = "SonatypeSnapshots"
+ mavenContent {
+ snapshotsOnly()
+ }
+ }
+ maven(url = "https://maven.aliyun.com/repository/gradle-plugin/")
+ maven(url = "https://maven.aliyun.com/repository/spring-plugin/")
+ maven(url = "https://jitpack.io")
+ maven(url = "https://s3.amazonaws.com/repo.commonsware.com")
+ maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
+ maven(url = "https://api.xposed.info/")
+ maven(url = "https://jogamp.org/deployment/maven")
+ maven(url = "https://developer.huawei.com/repo/")
+ maven(url = "https://raw.githubusercontent.com/cybernhl/maven-repository/master/")
+ maven(url = "https://maven.aliyun.com/repository/jcenter")
+ maven(url = "https://maven.aliyun.com/repository/public/")
+ maven(url = "https://maven.aliyun.com/repository/spring/")
+ maven(url = "https://maven.aliyun.com/repository/google/")
+ maven(url = "https://maven.aliyun.com/repository/grails-core/")
+ maven(url = "https://maven.aliyun.com/repository/apache-snapshots/")
+ maven(url = "https://packages.jetbrains.team/maven/p/skija/maven")
+ }
+ plugins {
+
}
}
+plugins {
+ id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
+}
+
+val fullVersion = System.getProperty("java.version", "8.0.0")
+val versionComponents = fullVersion
+ .split(".")
+ .take(2)
+ .filter { it.isNotBlank() }
+ .map { Integer.parseInt(it) }
+
+val currentJdk = if (versionComponents[0] == 1) versionComponents[1] else versionComponents[0]
+
+
+@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositories {
- google()
mavenCentral()
- mavenLocal()
- maven("https://jogamp.org/deployment/maven")
- maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
+ google()
+ maven {
+ url = uri("https://oss.sonatype.org/content/repositories/snapshots")
+ name = "SonatypeSnapshots"
+ mavenContent {
+ snapshotsOnly()
+ }
+ }
+ maven(url = "https://jitpack.io")
+ maven(url = "https://s3.amazonaws.com/repo.commonsware.com")
+ maven(url = "https://maven.pkg.jetbrains.space/public/p/compose/dev")
+ maven(url = "https://api.xposed.info/")
+ maven(url = "https://jogamp.org/deployment/maven")
+ maven(url = "https://raw.githubusercontent.com/cybernhl/maven-repository/master/")
+ maven(url = "https://maven.aliyun.com/repository/jcenter")
+ maven(url = "https://maven.aliyun.com/repository/public/")
+ maven(url = "https://maven.aliyun.com/repository/spring/")
+ maven(url = "https://maven.aliyun.com/repository/google/")
+ maven(url = "https://packages.jetbrains.team/maven/p/skija/maven")
}
}
+
+rootProject.name = "ReelsDemo"
+include(":shared")
+project(":shared").projectDir = file("./composeApp")
+
+include(":desktopApp")
+include(":androidApp")
+include(":webApp")
+
+//include(":compose-multiplatform-media-player")
+//project(":compose-multiplatform-media-player").projectDir = file("./compose-multiplatform-media-player/media_player")
+
+//include(":core")
+//project(":core").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core")
+//include(":core-video-swing")
+//project(":core-video-swing").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core-video-swing")
+//include(":core_ui_compose")
+//project(":core_ui_compose").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core_ui_compose")
+//include(":core-video-javafx")
+//project(":core-video-javafx").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core-video-javafx")
+//include(":core-video-compose-jvm")
+//project(":core-video-compose-jvm").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core-video-compose-jvm")
+//include(":core-video-skia")
+//project(":core-video-skia").projectDir = file("./compose-multiplatform-media-player/JavaCvPlayer/core-video-skia")
\ No newline at end of file
diff --git a/webApp/build.gradle.kts b/webApp/build.gradle.kts
new file mode 100644
index 0000000..62499f2
--- /dev/null
+++ b/webApp/build.gradle.kts
@@ -0,0 +1,45 @@
+import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
+
+plugins {
+ alias(libs.plugins.kotlin.multiplatform)
+ alias(libs.plugins.compose.compiler)
+ alias(libs.plugins.jetbrains.compose)
+}
+
+kotlin {
+ @OptIn(ExperimentalWasmDsl::class)
+ wasmJs {
+ browser {
+ commonWebpackConfig {
+ cssSupport {
+ enabled = true
+ }
+ }
+ }
+ binaries.executable()
+ }
+
+ sourceSets {
+ commonMain.dependencies {
+ implementation(project(":shared"))
+ implementation(libs.jetbrains.compose.ui)
+ implementation(libs.jetbrains.compose.runtime)
+ implementation(libs.jetbrains.compose.foundation)
+ implementation(libs.jetbrains.compose.material3)
+ implementation(libs.chaintech.media.player)
+ }
+
+ val wasmJsMain by getting {
+ resources.srcDirs(
+ "src/wasmJsMain/resources",
+ "../assets", // 連結根目錄 assets (提供 /git_banner.jpg 等)
+ "../assets/wasmJs", // 連結根目錄 assets/wasmJs (提供 shaka 腳本到根目錄)
+ "../composeApp/src/androidMain/assets" // 提供影片資源 1.mp4 等到根目錄
+ )
+ }
+ }
+}
+
+tasks.withType().configureEach {
+ duplicatesStrategy = DuplicatesStrategy.EXCLUDE
+}
diff --git a/composeApp/src/wasmJsMain/kotlin/main.kt b/webApp/src/wasmJsMain/kotlin/main.kt
similarity index 64%
rename from composeApp/src/wasmJsMain/kotlin/main.kt
rename to webApp/src/wasmJsMain/kotlin/main.kt
index 0da9632..4f8f3b8 100644
--- a/composeApp/src/wasmJsMain/kotlin/main.kt
+++ b/webApp/src/wasmJsMain/kotlin/main.kt
@@ -1,12 +1,11 @@
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.ComposeViewport
-import kotlinx.browser.document
import org.chaintech.app.MainView
@OptIn(ExperimentalComposeUiApi::class)
fun main() {
- val body = document.body ?: return
- ComposeViewport(body) {
+ // 將 Compose 渲染到指定的 HTML 容器,以便透過 CSS 控制層級
+ ComposeViewport("compose-target") {
MainView()
}
}
diff --git a/webApp/src/wasmJsMain/resources/index.html b/webApp/src/wasmJsMain/resources/index.html
new file mode 100644
index 0000000..5e1aba6
--- /dev/null
+++ b/webApp/src/wasmJsMain/resources/index.html
@@ -0,0 +1,52 @@
+
+
+
+
+
+ Media Player
+
+
+
+
+
+
+
+
+
+
+
+
+