flv.min.js 323 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106
  1. !(function (e, t) {
  2. 'object' == typeof exports && 'object' == typeof module
  3. ? (module.exports = t())
  4. : 'function' == typeof define && define.amd
  5. ? define([], t)
  6. : 'object' == typeof exports
  7. ? (exports.flvjs = t())
  8. : (e.flvjs = t());
  9. })(self, function () {
  10. return (function () {
  11. var e = {
  12. 264: function (e, t, i) {
  13. /*!
  14. * @overview es6-promise - a tiny implementation of Promises/A+.
  15. * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
  16. * @license Licensed under MIT license
  17. * See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
  18. * @version v4.2.8+1e68dce6
  19. */
  20. e.exports = (function () {
  21. 'use strict';
  22. function e(e) {
  23. var t = typeof e;
  24. return null !== e && ('object' === t || 'function' === t);
  25. }
  26. function t(e) {
  27. return 'function' == typeof e;
  28. }
  29. var n = Array.isArray
  30. ? Array.isArray
  31. : function (e) {
  32. return (
  33. '[object Array]' === Object.prototype.toString.call(e)
  34. );
  35. },
  36. r = 0,
  37. s = void 0,
  38. o = void 0,
  39. a = function (e, t) {
  40. (b[r] = e), (b[r + 1] = t), 2 === (r += 2) && (o ? o(E) : A());
  41. };
  42. function h(e) {
  43. o = e;
  44. }
  45. function u(e) {
  46. a = e;
  47. }
  48. var l = 'undefined' != typeof window ? window : void 0,
  49. d = l || {},
  50. c = d.MutationObserver || d.WebKitMutationObserver,
  51. f =
  52. 'undefined' == typeof self &&
  53. 'undefined' != typeof process &&
  54. '[object process]' === {}.toString.call(process),
  55. _ =
  56. 'undefined' != typeof Uint8ClampedArray &&
  57. 'undefined' != typeof importScripts &&
  58. 'undefined' != typeof MessageChannel;
  59. function p() {
  60. return function () {
  61. return process.nextTick(E);
  62. };
  63. }
  64. function m() {
  65. return void 0 !== s
  66. ? function () {
  67. s(E);
  68. }
  69. : y();
  70. }
  71. function g() {
  72. var e = 0,
  73. t = new c(E),
  74. i = document.createTextNode('');
  75. return (
  76. t.observe(i, { characterData: !0 }),
  77. function () {
  78. i.data = e = ++e % 2;
  79. }
  80. );
  81. }
  82. function v() {
  83. var e = new MessageChannel();
  84. return (
  85. (e.port1.onmessage = E),
  86. function () {
  87. return e.port2.postMessage(0);
  88. }
  89. );
  90. }
  91. function y() {
  92. var e = setTimeout;
  93. return function () {
  94. return e(E, 1);
  95. };
  96. }
  97. var b = new Array(1e3);
  98. function E() {
  99. for (var e = 0; e < r; e += 2)
  100. (0, b[e])(b[e + 1]), (b[e] = void 0), (b[e + 1] = void 0);
  101. r = 0;
  102. }
  103. function S() {
  104. try {
  105. var e = Function('return this')().require('vertx');
  106. return (s = e.runOnLoop || e.runOnContext), m();
  107. } catch (e) {
  108. return y();
  109. }
  110. }
  111. var A = void 0;
  112. function L(e, t) {
  113. var i = this,
  114. n = new this.constructor(O);
  115. void 0 === n[w] && W(n);
  116. var r = i._state;
  117. if (r) {
  118. var s = arguments[r - 1];
  119. a(function () {
  120. return V(r, n, s, i._result);
  121. });
  122. } else G(i, n, e, t);
  123. return n;
  124. }
  125. function R(e) {
  126. var t = this;
  127. if (e && 'object' == typeof e && e.constructor === t) return e;
  128. var i = new t(O);
  129. return U(i, e), i;
  130. }
  131. A = f ? p() : c ? g() : _ ? v() : void 0 === l ? S() : y();
  132. var w = Math.random().toString(36).substring(2);
  133. function O() {}
  134. var T = void 0,
  135. C = 1,
  136. k = 2;
  137. function D() {
  138. return new TypeError('You cannot resolve a promise with itself');
  139. }
  140. function I() {
  141. return new TypeError(
  142. 'A promises callback cannot return that same promise.'
  143. );
  144. }
  145. function M(e, t, i, n) {
  146. try {
  147. e.call(t, i, n);
  148. } catch (e) {
  149. return e;
  150. }
  151. }
  152. function B(e, t, i) {
  153. a(function (e) {
  154. var n = !1,
  155. r = M(
  156. i,
  157. t,
  158. function (i) {
  159. n || ((n = !0), t !== i ? U(e, i) : Z(e, i));
  160. },
  161. function (t) {
  162. n || ((n = !0), F(e, t));
  163. },
  164. 'Settle: ' + (e._label || ' unknown promise')
  165. );
  166. !n && r && ((n = !0), F(e, r));
  167. }, e);
  168. }
  169. function x(e, t) {
  170. t._state === C
  171. ? Z(e, t._result)
  172. : t._state === k
  173. ? F(e, t._result)
  174. : G(
  175. t,
  176. void 0,
  177. function (t) {
  178. return U(e, t);
  179. },
  180. function (t) {
  181. return F(e, t);
  182. }
  183. );
  184. }
  185. function P(e, i, n) {
  186. i.constructor === e.constructor &&
  187. n === L &&
  188. i.constructor.resolve === R
  189. ? x(e, i)
  190. : void 0 === n
  191. ? Z(e, i)
  192. : t(n)
  193. ? B(e, i, n)
  194. : Z(e, i);
  195. }
  196. function U(t, i) {
  197. if (t === i) F(t, D());
  198. else if (e(i)) {
  199. var n = void 0;
  200. try {
  201. n = i.then;
  202. } catch (e) {
  203. return void F(t, e);
  204. }
  205. P(t, i, n);
  206. } else Z(t, i);
  207. }
  208. function N(e) {
  209. e._onerror && e._onerror(e._result), j(e);
  210. }
  211. function Z(e, t) {
  212. e._state === T &&
  213. ((e._result = t),
  214. (e._state = C),
  215. 0 !== e._subscribers.length && a(j, e));
  216. }
  217. function F(e, t) {
  218. e._state === T && ((e._state = k), (e._result = t), a(N, e));
  219. }
  220. function G(e, t, i, n) {
  221. var r = e._subscribers,
  222. s = r.length;
  223. (e._onerror = null),
  224. (r[s] = t),
  225. (r[s + C] = i),
  226. (r[s + k] = n),
  227. 0 === s && e._state && a(j, e);
  228. }
  229. function j(e) {
  230. var t = e._subscribers,
  231. i = e._state;
  232. if (0 !== t.length) {
  233. for (
  234. var n = void 0, r = void 0, s = e._result, o = 0;
  235. o < t.length;
  236. o += 3
  237. )
  238. (n = t[o]), (r = t[o + i]), n ? V(i, n, r, s) : r(s);
  239. e._subscribers.length = 0;
  240. }
  241. }
  242. function V(e, i, n, r) {
  243. var s = t(n),
  244. o = void 0,
  245. a = void 0,
  246. h = !0;
  247. if (s) {
  248. try {
  249. o = n(r);
  250. } catch (e) {
  251. (h = !1), (a = e);
  252. }
  253. if (i === o) return void F(i, I());
  254. } else o = r;
  255. i._state !== T ||
  256. (s && h
  257. ? U(i, o)
  258. : !1 === h
  259. ? F(i, a)
  260. : e === C
  261. ? Z(i, o)
  262. : e === k && F(i, o));
  263. }
  264. function z(e, t) {
  265. try {
  266. t(
  267. function (t) {
  268. U(e, t);
  269. },
  270. function (t) {
  271. F(e, t);
  272. }
  273. );
  274. } catch (t) {
  275. F(e, t);
  276. }
  277. }
  278. var K = 0;
  279. function H() {
  280. return K++;
  281. }
  282. function W(e) {
  283. (e[w] = K++),
  284. (e._state = void 0),
  285. (e._result = void 0),
  286. (e._subscribers = []);
  287. }
  288. function q() {
  289. return new Error('Array Methods must be provided an Array');
  290. }
  291. var Y = (function () {
  292. function e(e, t) {
  293. (this._instanceConstructor = e),
  294. (this.promise = new e(O)),
  295. this.promise[w] || W(this.promise),
  296. n(t)
  297. ? ((this.length = t.length),
  298. (this._remaining = t.length),
  299. (this._result = new Array(this.length)),
  300. 0 === this.length
  301. ? Z(this.promise, this._result)
  302. : ((this.length = this.length || 0),
  303. this._enumerate(t),
  304. 0 === this._remaining &&
  305. Z(this.promise, this._result)))
  306. : F(this.promise, q());
  307. }
  308. return (
  309. (e.prototype._enumerate = function (e) {
  310. for (var t = 0; this._state === T && t < e.length; t++)
  311. this._eachEntry(e[t], t);
  312. }),
  313. (e.prototype._eachEntry = function (e, t) {
  314. var i = this._instanceConstructor,
  315. n = i.resolve;
  316. if (n === R) {
  317. var r = void 0,
  318. s = void 0,
  319. o = !1;
  320. try {
  321. r = e.then;
  322. } catch (e) {
  323. (o = !0), (s = e);
  324. }
  325. if (r === L && e._state !== T)
  326. this._settledAt(e._state, t, e._result);
  327. else if ('function' != typeof r)
  328. this._remaining--, (this._result[t] = e);
  329. else if (i === te) {
  330. var a = new i(O);
  331. o ? F(a, s) : P(a, e, r), this._willSettleAt(a, t);
  332. } else
  333. this._willSettleAt(
  334. new i(function (t) {
  335. return t(e);
  336. }),
  337. t
  338. );
  339. } else this._willSettleAt(n(e), t);
  340. }),
  341. (e.prototype._settledAt = function (e, t, i) {
  342. var n = this.promise;
  343. n._state === T &&
  344. (this._remaining--,
  345. e === k ? F(n, i) : (this._result[t] = i)),
  346. 0 === this._remaining && Z(n, this._result);
  347. }),
  348. (e.prototype._willSettleAt = function (e, t) {
  349. var i = this;
  350. G(
  351. e,
  352. void 0,
  353. function (e) {
  354. return i._settledAt(C, t, e);
  355. },
  356. function (e) {
  357. return i._settledAt(k, t, e);
  358. }
  359. );
  360. }),
  361. e
  362. );
  363. })();
  364. function X(e) {
  365. return new Y(this, e).promise;
  366. }
  367. function J(e) {
  368. var t = this;
  369. return n(e)
  370. ? new t(function (i, n) {
  371. for (var r = e.length, s = 0; s < r; s++)
  372. t.resolve(e[s]).then(i, n);
  373. })
  374. : new t(function (e, t) {
  375. return t(new TypeError('You must pass an array to race.'));
  376. });
  377. }
  378. function Q(e) {
  379. var t = new this(O);
  380. return F(t, e), t;
  381. }
  382. function $() {
  383. throw new TypeError(
  384. 'You must pass a resolver function as the first argument to the promise constructor'
  385. );
  386. }
  387. function ee() {
  388. throw new TypeError(
  389. "Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function."
  390. );
  391. }
  392. var te = (function () {
  393. function e(t) {
  394. (this[w] = H()),
  395. (this._result = this._state = void 0),
  396. (this._subscribers = []),
  397. O !== t &&
  398. ('function' != typeof t && $(),
  399. this instanceof e ? z(this, t) : ee());
  400. }
  401. return (
  402. (e.prototype.catch = function (e) {
  403. return this.then(null, e);
  404. }),
  405. (e.prototype.finally = function (e) {
  406. var i = this,
  407. n = i.constructor;
  408. return t(e)
  409. ? i.then(
  410. function (t) {
  411. return n.resolve(e()).then(function () {
  412. return t;
  413. });
  414. },
  415. function (t) {
  416. return n.resolve(e()).then(function () {
  417. throw t;
  418. });
  419. }
  420. )
  421. : i.then(e, e);
  422. }),
  423. e
  424. );
  425. })();
  426. function ie() {
  427. var e = void 0;
  428. if (void 0 !== i.g) e = i.g;
  429. else if ('undefined' != typeof self) e = self;
  430. else
  431. try {
  432. e = Function('return this')();
  433. } catch (e) {
  434. throw new Error(
  435. 'polyfill failed because global object is unavailable in this environment'
  436. );
  437. }
  438. var t = e.Promise;
  439. if (t) {
  440. var n = null;
  441. try {
  442. n = Object.prototype.toString.call(t.resolve());
  443. } catch (e) {}
  444. if ('[object Promise]' === n && !t.cast) return;
  445. }
  446. e.Promise = te;
  447. }
  448. return (
  449. (te.prototype.then = L),
  450. (te.all = X),
  451. (te.race = J),
  452. (te.resolve = R),
  453. (te.reject = Q),
  454. (te._setScheduler = h),
  455. (te._setAsap = u),
  456. (te._asap = a),
  457. (te.polyfill = ie),
  458. (te.Promise = te),
  459. te
  460. );
  461. })();
  462. },
  463. 716: function (e) {
  464. 'use strict';
  465. var t,
  466. i = 'object' == typeof Reflect ? Reflect : null,
  467. n =
  468. i && 'function' == typeof i.apply
  469. ? i.apply
  470. : function (e, t, i) {
  471. return Function.prototype.apply.call(e, t, i);
  472. };
  473. t =
  474. i && 'function' == typeof i.ownKeys
  475. ? i.ownKeys
  476. : Object.getOwnPropertySymbols
  477. ? function (e) {
  478. return Object.getOwnPropertyNames(e).concat(
  479. Object.getOwnPropertySymbols(e)
  480. );
  481. }
  482. : function (e) {
  483. return Object.getOwnPropertyNames(e);
  484. };
  485. var r =
  486. Number.isNaN ||
  487. function (e) {
  488. return e != e;
  489. };
  490. function s() {
  491. s.init.call(this);
  492. }
  493. (e.exports = s),
  494. (e.exports.once = function (e, t) {
  495. return new Promise(function (i, n) {
  496. function r(i) {
  497. e.removeListener(t, s), n(i);
  498. }
  499. function s() {
  500. 'function' == typeof e.removeListener &&
  501. e.removeListener('error', r),
  502. i([].slice.call(arguments));
  503. }
  504. p(e, t, s, { once: !0 }),
  505. 'error' !== t &&
  506. (function (e, t, i) {
  507. 'function' == typeof e.on && p(e, 'error', t, i);
  508. })(e, r, { once: !0 });
  509. });
  510. }),
  511. (s.EventEmitter = s),
  512. (s.prototype._events = void 0),
  513. (s.prototype._eventsCount = 0),
  514. (s.prototype._maxListeners = void 0);
  515. var o = 10;
  516. function a(e) {
  517. if ('function' != typeof e)
  518. throw new TypeError(
  519. 'The "listener" argument must be of type Function. Received type ' +
  520. typeof e
  521. );
  522. }
  523. function h(e) {
  524. return void 0 === e._maxListeners
  525. ? s.defaultMaxListeners
  526. : e._maxListeners;
  527. }
  528. function u(e, t, i, n) {
  529. var r, s, o, u;
  530. if (
  531. (a(i),
  532. void 0 === (s = e._events)
  533. ? ((s = e._events = Object.create(null)), (e._eventsCount = 0))
  534. : (void 0 !== s.newListener &&
  535. (e.emit('newListener', t, i.listener ? i.listener : i),
  536. (s = e._events)),
  537. (o = s[t])),
  538. void 0 === o)
  539. )
  540. (o = s[t] = i), ++e._eventsCount;
  541. else if (
  542. ('function' == typeof o
  543. ? (o = s[t] = n ? [i, o] : [o, i])
  544. : n
  545. ? o.unshift(i)
  546. : o.push(i),
  547. (r = h(e)) > 0 && o.length > r && !o.warned)
  548. ) {
  549. o.warned = !0;
  550. var l = new Error(
  551. 'Possible EventEmitter memory leak detected. ' +
  552. o.length +
  553. ' ' +
  554. String(t) +
  555. ' listeners added. Use emitter.setMaxListeners() to increase limit'
  556. );
  557. (l.name = 'MaxListenersExceededWarning'),
  558. (l.emitter = e),
  559. (l.type = t),
  560. (l.count = o.length),
  561. (u = l),
  562. console && console.warn && console.warn(u);
  563. }
  564. return e;
  565. }
  566. function l() {
  567. if (!this.fired)
  568. return (
  569. this.target.removeListener(this.type, this.wrapFn),
  570. (this.fired = !0),
  571. 0 === arguments.length
  572. ? this.listener.call(this.target)
  573. : this.listener.apply(this.target, arguments)
  574. );
  575. }
  576. function d(e, t, i) {
  577. var n = {
  578. fired: !1,
  579. wrapFn: void 0,
  580. target: e,
  581. type: t,
  582. listener: i,
  583. },
  584. r = l.bind(n);
  585. return (r.listener = i), (n.wrapFn = r), r;
  586. }
  587. function c(e, t, i) {
  588. var n = e._events;
  589. if (void 0 === n) return [];
  590. var r = n[t];
  591. return void 0 === r
  592. ? []
  593. : 'function' == typeof r
  594. ? i
  595. ? [r.listener || r]
  596. : [r]
  597. : i
  598. ? (function (e) {
  599. for (var t = new Array(e.length), i = 0; i < t.length; ++i)
  600. t[i] = e[i].listener || e[i];
  601. return t;
  602. })(r)
  603. : _(r, r.length);
  604. }
  605. function f(e) {
  606. var t = this._events;
  607. if (void 0 !== t) {
  608. var i = t[e];
  609. if ('function' == typeof i) return 1;
  610. if (void 0 !== i) return i.length;
  611. }
  612. return 0;
  613. }
  614. function _(e, t) {
  615. for (var i = new Array(t), n = 0; n < t; ++n) i[n] = e[n];
  616. return i;
  617. }
  618. function p(e, t, i, n) {
  619. if ('function' == typeof e.on) n.once ? e.once(t, i) : e.on(t, i);
  620. else {
  621. if ('function' != typeof e.addEventListener)
  622. throw new TypeError(
  623. 'The "emitter" argument must be of type EventEmitter. Received type ' +
  624. typeof e
  625. );
  626. e.addEventListener(t, function r(s) {
  627. n.once && e.removeEventListener(t, r), i(s);
  628. });
  629. }
  630. }
  631. Object.defineProperty(s, 'defaultMaxListeners', {
  632. enumerable: !0,
  633. get: function () {
  634. return o;
  635. },
  636. set: function (e) {
  637. if ('number' != typeof e || e < 0 || r(e))
  638. throw new RangeError(
  639. 'The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' +
  640. e +
  641. '.'
  642. );
  643. o = e;
  644. },
  645. }),
  646. (s.init = function () {
  647. (void 0 !== this._events &&
  648. this._events !== Object.getPrototypeOf(this)._events) ||
  649. ((this._events = Object.create(null)), (this._eventsCount = 0)),
  650. (this._maxListeners = this._maxListeners || void 0);
  651. }),
  652. (s.prototype.setMaxListeners = function (e) {
  653. if ('number' != typeof e || e < 0 || r(e))
  654. throw new RangeError(
  655. 'The value of "n" is out of range. It must be a non-negative number. Received ' +
  656. e +
  657. '.'
  658. );
  659. return (this._maxListeners = e), this;
  660. }),
  661. (s.prototype.getMaxListeners = function () {
  662. return h(this);
  663. }),
  664. (s.prototype.emit = function (e) {
  665. for (var t = [], i = 1; i < arguments.length; i++)
  666. t.push(arguments[i]);
  667. var r = 'error' === e,
  668. s = this._events;
  669. if (void 0 !== s) r = r && void 0 === s.error;
  670. else if (!r) return !1;
  671. if (r) {
  672. var o;
  673. if ((t.length > 0 && (o = t[0]), o instanceof Error)) throw o;
  674. var a = new Error(
  675. 'Unhandled error.' + (o ? ' (' + o.message + ')' : '')
  676. );
  677. throw ((a.context = o), a);
  678. }
  679. var h = s[e];
  680. if (void 0 === h) return !1;
  681. if ('function' == typeof h) n(h, this, t);
  682. else {
  683. var u = h.length,
  684. l = _(h, u);
  685. for (i = 0; i < u; ++i) n(l[i], this, t);
  686. }
  687. return !0;
  688. }),
  689. (s.prototype.addListener = function (e, t) {
  690. return u(this, e, t, !1);
  691. }),
  692. (s.prototype.on = s.prototype.addListener),
  693. (s.prototype.prependListener = function (e, t) {
  694. return u(this, e, t, !0);
  695. }),
  696. (s.prototype.once = function (e, t) {
  697. return a(t), this.on(e, d(this, e, t)), this;
  698. }),
  699. (s.prototype.prependOnceListener = function (e, t) {
  700. return a(t), this.prependListener(e, d(this, e, t)), this;
  701. }),
  702. (s.prototype.removeListener = function (e, t) {
  703. var i, n, r, s, o;
  704. if ((a(t), void 0 === (n = this._events))) return this;
  705. if (void 0 === (i = n[e])) return this;
  706. if (i === t || i.listener === t)
  707. 0 == --this._eventsCount
  708. ? (this._events = Object.create(null))
  709. : (delete n[e],
  710. n.removeListener &&
  711. this.emit('removeListener', e, i.listener || t));
  712. else if ('function' != typeof i) {
  713. for (r = -1, s = i.length - 1; s >= 0; s--)
  714. if (i[s] === t || i[s].listener === t) {
  715. (o = i[s].listener), (r = s);
  716. break;
  717. }
  718. if (r < 0) return this;
  719. 0 === r
  720. ? i.shift()
  721. : (function (e, t) {
  722. for (; t + 1 < e.length; t++) e[t] = e[t + 1];
  723. e.pop();
  724. })(i, r),
  725. 1 === i.length && (n[e] = i[0]),
  726. void 0 !== n.removeListener &&
  727. this.emit('removeListener', e, o || t);
  728. }
  729. return this;
  730. }),
  731. (s.prototype.off = s.prototype.removeListener),
  732. (s.prototype.removeAllListeners = function (e) {
  733. var t, i, n;
  734. if (void 0 === (i = this._events)) return this;
  735. if (void 0 === i.removeListener)
  736. return (
  737. 0 === arguments.length
  738. ? ((this._events = Object.create(null)),
  739. (this._eventsCount = 0))
  740. : void 0 !== i[e] &&
  741. (0 == --this._eventsCount
  742. ? (this._events = Object.create(null))
  743. : delete i[e]),
  744. this
  745. );
  746. if (0 === arguments.length) {
  747. var r,
  748. s = Object.keys(i);
  749. for (n = 0; n < s.length; ++n)
  750. 'removeListener' !== (r = s[n]) && this.removeAllListeners(r);
  751. return (
  752. this.removeAllListeners('removeListener'),
  753. (this._events = Object.create(null)),
  754. (this._eventsCount = 0),
  755. this
  756. );
  757. }
  758. if ('function' == typeof (t = i[e])) this.removeListener(e, t);
  759. else if (void 0 !== t)
  760. for (n = t.length - 1; n >= 0; n--)
  761. this.removeListener(e, t[n]);
  762. return this;
  763. }),
  764. (s.prototype.listeners = function (e) {
  765. return c(this, e, !0);
  766. }),
  767. (s.prototype.rawListeners = function (e) {
  768. return c(this, e, !1);
  769. }),
  770. (s.listenerCount = function (e, t) {
  771. return 'function' == typeof e.listenerCount
  772. ? e.listenerCount(t)
  773. : f.call(e, t);
  774. }),
  775. (s.prototype.listenerCount = f),
  776. (s.prototype.eventNames = function () {
  777. return this._eventsCount > 0 ? t(this._events) : [];
  778. });
  779. },
  780. 397: function (e, t, i) {
  781. function n(e) {
  782. var t = {};
  783. function i(n) {
  784. if (t[n]) return t[n].exports;
  785. var r = (t[n] = { i: n, l: !1, exports: {} });
  786. return (
  787. e[n].call(r.exports, r, r.exports, i), (r.l = !0), r.exports
  788. );
  789. }
  790. (i.m = e),
  791. (i.c = t),
  792. (i.i = function (e) {
  793. return e;
  794. }),
  795. (i.d = function (e, t, n) {
  796. i.o(e, t) ||
  797. Object.defineProperty(e, t, {
  798. configurable: !1,
  799. enumerable: !0,
  800. get: n,
  801. });
  802. }),
  803. (i.r = function (e) {
  804. Object.defineProperty(e, '__esModule', { value: !0 });
  805. }),
  806. (i.n = function (e) {
  807. var t =
  808. e && e.__esModule
  809. ? function () {
  810. return e.default;
  811. }
  812. : function () {
  813. return e;
  814. };
  815. return i.d(t, 'a', t), t;
  816. }),
  817. (i.o = function (e, t) {
  818. return Object.prototype.hasOwnProperty.call(e, t);
  819. }),
  820. (i.p = '/'),
  821. (i.oe = function (e) {
  822. throw (console.error(e), e);
  823. });
  824. var n = i((i.s = ENTRY_MODULE));
  825. return n.default || n;
  826. }
  827. var r = '[\\.|\\-|\\+|\\w|/|@]+',
  828. s = '\\(\\s*(/\\*.*?\\*/)?\\s*.*?([\\.|\\-|\\+|\\w|/|@]+).*?\\)';
  829. function o(e) {
  830. return (e + '').replace(/[.?*+^$[\]\\(){}|-]/g, '\\$&');
  831. }
  832. function a(e, t, n) {
  833. var a = {};
  834. a[n] = [];
  835. var h = t.toString(),
  836. u = h.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);
  837. if (!u) return a;
  838. for (
  839. var l, d = u[1], c = new RegExp('(\\\\n|\\W)' + o(d) + s, 'g');
  840. (l = c.exec(h));
  841. )
  842. 'dll-reference' !== l[3] && a[n].push(l[3]);
  843. for (
  844. c = new RegExp(
  845. '\\(' + o(d) + '\\("(dll-reference\\s(' + r + '))"\\)\\)' + s,
  846. 'g'
  847. );
  848. (l = c.exec(h));
  849. )
  850. e[l[2]] || (a[n].push(l[1]), (e[l[2]] = i(l[1]).m)),
  851. (a[l[2]] = a[l[2]] || []),
  852. a[l[2]].push(l[4]);
  853. for (var f, _ = Object.keys(a), p = 0; p < _.length; p++)
  854. for (var m = 0; m < a[_[p]].length; m++)
  855. (f = a[_[p]][m]), isNaN(1 * f) || (a[_[p]][m] = 1 * a[_[p]][m]);
  856. return a;
  857. }
  858. function h(e) {
  859. return Object.keys(e).reduce(function (t, i) {
  860. return t || e[i].length > 0;
  861. }, !1);
  862. }
  863. e.exports = function (e, t) {
  864. t = t || {};
  865. var r = { main: i.m },
  866. s = t.all
  867. ? { main: Object.keys(r.main) }
  868. : (function (e, t) {
  869. for (
  870. var i = { main: [t] }, n = { main: [] }, r = { main: {} };
  871. h(i);
  872. )
  873. for (var s = Object.keys(i), o = 0; o < s.length; o++) {
  874. var u = s[o],
  875. l = i[u].pop();
  876. if (((r[u] = r[u] || {}), !r[u][l] && e[u][l])) {
  877. (r[u][l] = !0), (n[u] = n[u] || []), n[u].push(l);
  878. for (
  879. var d = a(e, e[u][l], u), c = Object.keys(d), f = 0;
  880. f < c.length;
  881. f++
  882. )
  883. (i[c[f]] = i[c[f]] || []),
  884. (i[c[f]] = i[c[f]].concat(d[c[f]]));
  885. }
  886. }
  887. return n;
  888. })(r, e),
  889. o = '';
  890. Object.keys(s)
  891. .filter(function (e) {
  892. return 'main' !== e;
  893. })
  894. .forEach(function (e) {
  895. for (var t = 0; s[e][t]; ) t++;
  896. s[e].push(t),
  897. (r[e][t] =
  898. '(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })'),
  899. (o =
  900. o +
  901. 'var ' +
  902. e +
  903. ' = (' +
  904. n.toString().replace('ENTRY_MODULE', JSON.stringify(t)) +
  905. ')({' +
  906. s[e]
  907. .map(function (t) {
  908. return JSON.stringify(t) + ': ' + r[e][t].toString();
  909. })
  910. .join(',') +
  911. '});\n');
  912. }),
  913. (o =
  914. o +
  915. 'new ((' +
  916. n.toString().replace('ENTRY_MODULE', JSON.stringify(e)) +
  917. ')({' +
  918. s.main
  919. .map(function (e) {
  920. return JSON.stringify(e) + ': ' + r.main[e].toString();
  921. })
  922. .join(',') +
  923. '}))(self);');
  924. var u = new window.Blob([o], { type: 'text/javascript' });
  925. if (t.bare) return u;
  926. var l = (
  927. window.URL ||
  928. window.webkitURL ||
  929. window.mozURL ||
  930. window.msURL
  931. ).createObjectURL(u),
  932. d = new window.Worker(l);
  933. return (d.objectURL = l), d;
  934. };
  935. },
  936. 118: function (e, t) {
  937. 'use strict';
  938. var i = (function () {
  939. function e() {
  940. (this.mimeType = null),
  941. (this.duration = null),
  942. (this.hasAudio = null),
  943. (this.hasVideo = null),
  944. (this.audioCodec = null),
  945. (this.videoCodec = null),
  946. (this.audioDataRate = null),
  947. (this.videoDataRate = null),
  948. (this.audioSampleRate = null),
  949. (this.audioChannelCount = null),
  950. (this.width = null),
  951. (this.height = null),
  952. (this.fps = null),
  953. (this.profile = null),
  954. (this.level = null),
  955. (this.refFrames = null),
  956. (this.chromaFormat = null),
  957. (this.sarNum = null),
  958. (this.sarDen = null),
  959. (this.metadata = null),
  960. (this.segments = null),
  961. (this.segmentCount = null),
  962. (this.hasKeyframesIndex = null),
  963. (this.keyframesIndex = null);
  964. }
  965. return (
  966. (e.prototype.isComplete = function () {
  967. var e =
  968. !1 === this.hasAudio ||
  969. (!0 === this.hasAudio &&
  970. null != this.audioCodec &&
  971. null != this.audioSampleRate &&
  972. null != this.audioChannelCount),
  973. t =
  974. !1 === this.hasVideo ||
  975. (!0 === this.hasVideo &&
  976. null != this.videoCodec &&
  977. null != this.width &&
  978. null != this.height &&
  979. null != this.fps &&
  980. null != this.profile &&
  981. null != this.level &&
  982. null != this.refFrames &&
  983. null != this.chromaFormat &&
  984. null != this.sarNum &&
  985. null != this.sarDen);
  986. return (
  987. null != this.mimeType &&
  988. null != this.duration &&
  989. null != this.metadata &&
  990. null != this.hasKeyframesIndex &&
  991. e &&
  992. t
  993. );
  994. }),
  995. (e.prototype.isSeekable = function () {
  996. return !0 === this.hasKeyframesIndex;
  997. }),
  998. (e.prototype.getNearestKeyframe = function (e) {
  999. if (null == this.keyframesIndex) return null;
  1000. var t = this.keyframesIndex,
  1001. i = this._search(t.times, e);
  1002. return {
  1003. index: i,
  1004. milliseconds: t.times[i],
  1005. fileposition: t.filepositions[i],
  1006. };
  1007. }),
  1008. (e.prototype._search = function (e, t) {
  1009. var i = 0,
  1010. n = e.length - 1,
  1011. r = 0,
  1012. s = 0,
  1013. o = n;
  1014. for (t < e[0] && ((i = 0), (s = o + 1)); s <= o; ) {
  1015. if (
  1016. (r = s + Math.floor((o - s) / 2)) === n ||
  1017. (t >= e[r] && t < e[r + 1])
  1018. ) {
  1019. i = r;
  1020. break;
  1021. }
  1022. e[r] < t ? (s = r + 1) : (o = r - 1);
  1023. }
  1024. return i;
  1025. }),
  1026. e
  1027. );
  1028. })();
  1029. t.Z = i;
  1030. },
  1031. 51: function (e, t, i) {
  1032. 'use strict';
  1033. i.d(t, {
  1034. Wk: function () {
  1035. return n;
  1036. },
  1037. Yy: function () {
  1038. return r;
  1039. },
  1040. Vn: function () {
  1041. return s;
  1042. },
  1043. J1: function () {
  1044. return o;
  1045. },
  1046. });
  1047. var n = function (e, t, i, n, r) {
  1048. (this.dts = e),
  1049. (this.pts = t),
  1050. (this.duration = i),
  1051. (this.originalDts = n),
  1052. (this.isSyncPoint = r),
  1053. (this.fileposition = null);
  1054. },
  1055. r = (function () {
  1056. function e() {
  1057. (this.beginDts = 0),
  1058. (this.endDts = 0),
  1059. (this.beginPts = 0),
  1060. (this.endPts = 0),
  1061. (this.originalBeginDts = 0),
  1062. (this.originalEndDts = 0),
  1063. (this.syncPoints = []),
  1064. (this.firstSample = null),
  1065. (this.lastSample = null);
  1066. }
  1067. return (
  1068. (e.prototype.appendSyncPoint = function (e) {
  1069. (e.isSyncPoint = !0), this.syncPoints.push(e);
  1070. }),
  1071. e
  1072. );
  1073. })(),
  1074. s = (function () {
  1075. function e() {
  1076. this._list = [];
  1077. }
  1078. return (
  1079. (e.prototype.clear = function () {
  1080. this._list = [];
  1081. }),
  1082. (e.prototype.appendArray = function (e) {
  1083. var t = this._list;
  1084. 0 !== e.length &&
  1085. (t.length > 0 &&
  1086. e[0].originalDts < t[t.length - 1].originalDts &&
  1087. this.clear(),
  1088. Array.prototype.push.apply(t, e));
  1089. }),
  1090. (e.prototype.getLastSyncPointBeforeDts = function (e) {
  1091. if (0 == this._list.length) return null;
  1092. var t = this._list,
  1093. i = 0,
  1094. n = t.length - 1,
  1095. r = 0,
  1096. s = 0,
  1097. o = n;
  1098. for (e < t[0].dts && ((i = 0), (s = o + 1)); s <= o; ) {
  1099. if (
  1100. (r = s + Math.floor((o - s) / 2)) === n ||
  1101. (e >= t[r].dts && e < t[r + 1].dts)
  1102. ) {
  1103. i = r;
  1104. break;
  1105. }
  1106. t[r].dts < e ? (s = r + 1) : (o = r - 1);
  1107. }
  1108. return this._list[i];
  1109. }),
  1110. e
  1111. );
  1112. })(),
  1113. o = (function () {
  1114. function e(e) {
  1115. (this._type = e),
  1116. (this._list = []),
  1117. (this._lastAppendLocation = -1);
  1118. }
  1119. return (
  1120. Object.defineProperty(e.prototype, 'type', {
  1121. get: function () {
  1122. return this._type;
  1123. },
  1124. enumerable: !1,
  1125. configurable: !0,
  1126. }),
  1127. Object.defineProperty(e.prototype, 'length', {
  1128. get: function () {
  1129. return this._list.length;
  1130. },
  1131. enumerable: !1,
  1132. configurable: !0,
  1133. }),
  1134. (e.prototype.isEmpty = function () {
  1135. return 0 === this._list.length;
  1136. }),
  1137. (e.prototype.clear = function () {
  1138. (this._list = []), (this._lastAppendLocation = -1);
  1139. }),
  1140. (e.prototype._searchNearestSegmentBefore = function (e) {
  1141. var t = this._list;
  1142. if (0 === t.length) return -2;
  1143. var i = t.length - 1,
  1144. n = 0,
  1145. r = 0,
  1146. s = i,
  1147. o = 0;
  1148. if (e < t[0].originalBeginDts) return (o = -1);
  1149. for (; r <= s; ) {
  1150. if (
  1151. (n = r + Math.floor((s - r) / 2)) === i ||
  1152. (e > t[n].lastSample.originalDts &&
  1153. e < t[n + 1].originalBeginDts)
  1154. ) {
  1155. o = n;
  1156. break;
  1157. }
  1158. t[n].originalBeginDts < e ? (r = n + 1) : (s = n - 1);
  1159. }
  1160. return o;
  1161. }),
  1162. (e.prototype._searchNearestSegmentAfter = function (e) {
  1163. return this._searchNearestSegmentBefore(e) + 1;
  1164. }),
  1165. (e.prototype.append = function (e) {
  1166. var t = this._list,
  1167. i = e,
  1168. n = this._lastAppendLocation,
  1169. r = 0;
  1170. -1 !== n &&
  1171. n < t.length &&
  1172. i.originalBeginDts >= t[n].lastSample.originalDts &&
  1173. (n === t.length - 1 ||
  1174. (n < t.length - 1 &&
  1175. i.originalBeginDts < t[n + 1].originalBeginDts))
  1176. ? (r = n + 1)
  1177. : t.length > 0 &&
  1178. (r =
  1179. this._searchNearestSegmentBefore(i.originalBeginDts) +
  1180. 1),
  1181. (this._lastAppendLocation = r),
  1182. this._list.splice(r, 0, i);
  1183. }),
  1184. (e.prototype.getLastSegmentBefore = function (e) {
  1185. var t = this._searchNearestSegmentBefore(e);
  1186. return t >= 0 ? this._list[t] : null;
  1187. }),
  1188. (e.prototype.getLastSampleBefore = function (e) {
  1189. var t = this.getLastSegmentBefore(e);
  1190. return null != t ? t.lastSample : null;
  1191. }),
  1192. (e.prototype.getLastSyncPointBefore = function (e) {
  1193. for (
  1194. var t = this._searchNearestSegmentBefore(e),
  1195. i = this._list[t].syncPoints;
  1196. 0 === i.length && t > 0;
  1197. )
  1198. t--, (i = this._list[t].syncPoints);
  1199. return i.length > 0 ? i[i.length - 1] : null;
  1200. }),
  1201. e
  1202. );
  1203. })();
  1204. },
  1205. 949: function (e, t, i) {
  1206. 'use strict';
  1207. i.d(t, {
  1208. Z: function () {
  1209. return R;
  1210. },
  1211. });
  1212. var n = i(716),
  1213. r = i.n(n),
  1214. s = i(300),
  1215. o = i(538),
  1216. a = i(118);
  1217. function h(e, t, i) {
  1218. var n = e;
  1219. if (t + i < n.length) {
  1220. for (; i--; ) if (128 != (192 & n[++t])) return !1;
  1221. return !0;
  1222. }
  1223. return !1;
  1224. }
  1225. var u,
  1226. l = function (e) {
  1227. for (var t = [], i = e, n = 0, r = e.length; n < r; )
  1228. if (i[n] < 128) t.push(String.fromCharCode(i[n])), ++n;
  1229. else {
  1230. if (i[n] < 192);
  1231. else if (i[n] < 224) {
  1232. if (h(i, n, 1))
  1233. if ((s = ((31 & i[n]) << 6) | (63 & i[n + 1])) >= 128) {
  1234. t.push(String.fromCharCode(65535 & s)), (n += 2);
  1235. continue;
  1236. }
  1237. } else if (i[n] < 240) {
  1238. if (h(i, n, 2))
  1239. if (
  1240. (s =
  1241. ((15 & i[n]) << 12) |
  1242. ((63 & i[n + 1]) << 6) |
  1243. (63 & i[n + 2])) >= 2048 &&
  1244. 55296 != (63488 & s)
  1245. ) {
  1246. t.push(String.fromCharCode(65535 & s)), (n += 3);
  1247. continue;
  1248. }
  1249. } else if (i[n] < 248) {
  1250. var s;
  1251. if (h(i, n, 3))
  1252. if (
  1253. (s =
  1254. ((7 & i[n]) << 18) |
  1255. ((63 & i[n + 1]) << 12) |
  1256. ((63 & i[n + 2]) << 6) |
  1257. (63 & i[n + 3])) > 65536 &&
  1258. s < 1114112
  1259. ) {
  1260. (s -= 65536),
  1261. t.push(String.fromCharCode((s >>> 10) | 55296)),
  1262. t.push(String.fromCharCode((1023 & s) | 56320)),
  1263. (n += 4);
  1264. continue;
  1265. }
  1266. }
  1267. t.push(String.fromCharCode(65533)), ++n;
  1268. }
  1269. return t.join('');
  1270. },
  1271. d = i(29),
  1272. c =
  1273. ((u = new ArrayBuffer(2)),
  1274. new DataView(u).setInt16(0, 256, !0),
  1275. 256 === new Int16Array(u)[0]),
  1276. f = (function () {
  1277. function e() {}
  1278. return (
  1279. (e.parseScriptData = function (t, i, n) {
  1280. var r = {};
  1281. try {
  1282. var o = e.parseValue(t, i, n),
  1283. a = e.parseValue(t, i + o.size, n - o.size);
  1284. r[o.data] = a.data;
  1285. } catch (e) {
  1286. s.Z.e('AMF', e.toString());
  1287. }
  1288. return r;
  1289. }),
  1290. (e.parseObject = function (t, i, n) {
  1291. if (n < 3)
  1292. throw new d.rT(
  1293. 'Data not enough when parse ScriptDataObject'
  1294. );
  1295. var r = e.parseString(t, i, n),
  1296. s = e.parseValue(t, i + r.size, n - r.size),
  1297. o = s.objectEnd;
  1298. return {
  1299. data: { name: r.data, value: s.data },
  1300. size: r.size + s.size,
  1301. objectEnd: o,
  1302. };
  1303. }),
  1304. (e.parseVariable = function (t, i, n) {
  1305. return e.parseObject(t, i, n);
  1306. }),
  1307. (e.parseString = function (e, t, i) {
  1308. if (i < 2)
  1309. throw new d.rT('Data not enough when parse String');
  1310. var n = new DataView(e, t, i).getUint16(0, !c);
  1311. return {
  1312. data: n > 0 ? l(new Uint8Array(e, t + 2, n)) : '',
  1313. size: 2 + n,
  1314. };
  1315. }),
  1316. (e.parseLongString = function (e, t, i) {
  1317. if (i < 4)
  1318. throw new d.rT('Data not enough when parse LongString');
  1319. var n = new DataView(e, t, i).getUint32(0, !c);
  1320. return {
  1321. data: n > 0 ? l(new Uint8Array(e, t + 4, n)) : '',
  1322. size: 4 + n,
  1323. };
  1324. }),
  1325. (e.parseDate = function (e, t, i) {
  1326. if (i < 10)
  1327. throw new d.rT('Data size invalid when parse Date');
  1328. var n = new DataView(e, t, i),
  1329. r = n.getFloat64(0, !c),
  1330. s = n.getInt16(8, !c);
  1331. return { data: new Date((r += 60 * s * 1e3)), size: 10 };
  1332. }),
  1333. (e.parseValue = function (t, i, n) {
  1334. if (n < 1) throw new d.rT('Data not enough when parse Value');
  1335. var r,
  1336. o = new DataView(t, i, n),
  1337. a = 1,
  1338. h = o.getUint8(0),
  1339. u = !1;
  1340. try {
  1341. switch (h) {
  1342. case 0:
  1343. (r = o.getFloat64(1, !c)), (a += 8);
  1344. break;
  1345. case 1:
  1346. (r = !!o.getUint8(1)), (a += 1);
  1347. break;
  1348. case 2:
  1349. var l = e.parseString(t, i + 1, n - 1);
  1350. (r = l.data), (a += l.size);
  1351. break;
  1352. case 3:
  1353. r = {};
  1354. var f = 0;
  1355. for (
  1356. 9 == (16777215 & o.getUint32(n - 4, !c)) && (f = 3);
  1357. a < n - 4;
  1358. ) {
  1359. var _ = e.parseObject(t, i + a, n - a - f);
  1360. if (_.objectEnd) break;
  1361. (r[_.data.name] = _.data.value), (a += _.size);
  1362. }
  1363. if (a <= n - 3)
  1364. 9 === (16777215 & o.getUint32(a - 1, !c)) && (a += 3);
  1365. break;
  1366. case 8:
  1367. (r = {}), (a += 4);
  1368. f = 0;
  1369. for (
  1370. 9 == (16777215 & o.getUint32(n - 4, !c)) && (f = 3);
  1371. a < n - 8;
  1372. ) {
  1373. var p = e.parseVariable(t, i + a, n - a - f);
  1374. if (p.objectEnd) break;
  1375. (r[p.data.name] = p.data.value), (a += p.size);
  1376. }
  1377. if (a <= n - 3)
  1378. 9 === (16777215 & o.getUint32(a - 1, !c)) && (a += 3);
  1379. break;
  1380. case 9:
  1381. (r = void 0), (a = 1), (u = !0);
  1382. break;
  1383. case 10:
  1384. r = [];
  1385. var m = o.getUint32(1, !c);
  1386. a += 4;
  1387. for (var g = 0; g < m; g++) {
  1388. var v = e.parseValue(t, i + a, n - a);
  1389. r.push(v.data), (a += v.size);
  1390. }
  1391. break;
  1392. case 11:
  1393. var y = e.parseDate(t, i + 1, n - 1);
  1394. (r = y.data), (a += y.size);
  1395. break;
  1396. case 12:
  1397. var b = e.parseString(t, i + 1, n - 1);
  1398. (r = b.data), (a += b.size);
  1399. break;
  1400. default:
  1401. (a = n),
  1402. s.Z.w('AMF', 'Unsupported AMF value type ' + h);
  1403. }
  1404. } catch (e) {
  1405. s.Z.e('AMF', e.toString());
  1406. }
  1407. return { data: r, size: a, objectEnd: u };
  1408. }),
  1409. e
  1410. );
  1411. })(),
  1412. _ = (function () {
  1413. function e(e) {
  1414. (this.TAG = 'ExpGolomb'),
  1415. (this._buffer = e),
  1416. (this._buffer_index = 0),
  1417. (this._total_bytes = e.byteLength),
  1418. (this._total_bits = 8 * e.byteLength),
  1419. (this._current_word = 0),
  1420. (this._current_word_bits_left = 0);
  1421. }
  1422. return (
  1423. (e.prototype.destroy = function () {
  1424. this._buffer = null;
  1425. }),
  1426. (e.prototype._fillCurrentWord = function () {
  1427. var e = this._total_bytes - this._buffer_index;
  1428. if (e <= 0)
  1429. throw new d.rT(
  1430. 'ExpGolomb: _fillCurrentWord() but no bytes available'
  1431. );
  1432. var t = Math.min(4, e),
  1433. i = new Uint8Array(4);
  1434. i.set(
  1435. this._buffer.subarray(
  1436. this._buffer_index,
  1437. this._buffer_index + t
  1438. )
  1439. ),
  1440. (this._current_word = new DataView(i.buffer).getUint32(
  1441. 0,
  1442. !1
  1443. )),
  1444. (this._buffer_index += t),
  1445. (this._current_word_bits_left = 8 * t);
  1446. }),
  1447. (e.prototype.readBits = function (e) {
  1448. if (e > 32)
  1449. throw new d.OC(
  1450. 'ExpGolomb: readBits() bits exceeded max 32bits!'
  1451. );
  1452. if (e <= this._current_word_bits_left) {
  1453. var t = this._current_word >>> (32 - e);
  1454. return (
  1455. (this._current_word <<= e),
  1456. (this._current_word_bits_left -= e),
  1457. t
  1458. );
  1459. }
  1460. var i = this._current_word_bits_left ? this._current_word : 0;
  1461. i >>>= 32 - this._current_word_bits_left;
  1462. var n = e - this._current_word_bits_left;
  1463. this._fillCurrentWord();
  1464. var r = Math.min(n, this._current_word_bits_left),
  1465. s = this._current_word >>> (32 - r);
  1466. return (
  1467. (this._current_word <<= r),
  1468. (this._current_word_bits_left -= r),
  1469. (i = (i << r) | s)
  1470. );
  1471. }),
  1472. (e.prototype.readBool = function () {
  1473. return 1 === this.readBits(1);
  1474. }),
  1475. (e.prototype.readByte = function () {
  1476. return this.readBits(8);
  1477. }),
  1478. (e.prototype._skipLeadingZero = function () {
  1479. var e;
  1480. for (e = 0; e < this._current_word_bits_left; e++)
  1481. if (0 != (this._current_word & (2147483648 >>> e)))
  1482. return (
  1483. (this._current_word <<= e),
  1484. (this._current_word_bits_left -= e),
  1485. e
  1486. );
  1487. return this._fillCurrentWord(), e + this._skipLeadingZero();
  1488. }),
  1489. (e.prototype.readUEG = function () {
  1490. var e = this._skipLeadingZero();
  1491. return this.readBits(e + 1) - 1;
  1492. }),
  1493. (e.prototype.readSEG = function () {
  1494. var e = this.readUEG();
  1495. return 1 & e ? (e + 1) >>> 1 : -1 * (e >>> 1);
  1496. }),
  1497. e
  1498. );
  1499. })(),
  1500. p = (function () {
  1501. function e() {}
  1502. return (
  1503. (e._ebsp2rbsp = function (e) {
  1504. for (
  1505. var t = e,
  1506. i = t.byteLength,
  1507. n = new Uint8Array(i),
  1508. r = 0,
  1509. s = 0;
  1510. s < i;
  1511. s++
  1512. )
  1513. (s >= 2 &&
  1514. 3 === t[s] &&
  1515. 0 === t[s - 1] &&
  1516. 0 === t[s - 2]) ||
  1517. ((n[r] = t[s]), r++);
  1518. return new Uint8Array(n.buffer, 0, r);
  1519. }),
  1520. (e.parseSPS = function (t) {
  1521. var i = e._ebsp2rbsp(t),
  1522. n = new _(i);
  1523. n.readByte();
  1524. var r = n.readByte();
  1525. n.readByte();
  1526. var s = n.readByte();
  1527. n.readUEG();
  1528. var o = e.getProfileString(r),
  1529. a = e.getLevelString(s),
  1530. h = 1,
  1531. u = 420,
  1532. l = 8;
  1533. if (
  1534. (100 === r ||
  1535. 110 === r ||
  1536. 122 === r ||
  1537. 244 === r ||
  1538. 44 === r ||
  1539. 83 === r ||
  1540. 86 === r ||
  1541. 118 === r ||
  1542. 128 === r ||
  1543. 138 === r ||
  1544. 144 === r) &&
  1545. (3 === (h = n.readUEG()) && n.readBits(1),
  1546. h <= 3 && (u = [0, 420, 422, 444][h]),
  1547. (l = n.readUEG() + 8),
  1548. n.readUEG(),
  1549. n.readBits(1),
  1550. n.readBool())
  1551. )
  1552. for (var d = 3 !== h ? 8 : 12, c = 0; c < d; c++)
  1553. n.readBool() &&
  1554. (c < 6
  1555. ? e._skipScalingList(n, 16)
  1556. : e._skipScalingList(n, 64));
  1557. n.readUEG();
  1558. var f = n.readUEG();
  1559. if (0 === f) n.readUEG();
  1560. else if (1 === f) {
  1561. n.readBits(1), n.readSEG(), n.readSEG();
  1562. var p = n.readUEG();
  1563. for (c = 0; c < p; c++) n.readSEG();
  1564. }
  1565. var m = n.readUEG();
  1566. n.readBits(1);
  1567. var g = n.readUEG(),
  1568. v = n.readUEG(),
  1569. y = n.readBits(1);
  1570. 0 === y && n.readBits(1), n.readBits(1);
  1571. var b = 0,
  1572. E = 0,
  1573. S = 0,
  1574. A = 0;
  1575. n.readBool() &&
  1576. ((b = n.readUEG()),
  1577. (E = n.readUEG()),
  1578. (S = n.readUEG()),
  1579. (A = n.readUEG()));
  1580. var L = 1,
  1581. R = 1,
  1582. w = 0,
  1583. O = !0,
  1584. T = 0,
  1585. C = 0;
  1586. if (n.readBool()) {
  1587. if (n.readBool()) {
  1588. var k = n.readByte();
  1589. k > 0 && k < 16
  1590. ? ((L = [
  1591. 1, 12, 10, 16, 40, 24, 20, 32, 80, 18, 15, 64, 160,
  1592. 4, 3, 2,
  1593. ][k - 1]),
  1594. (R = [
  1595. 1, 11, 11, 11, 33, 11, 11, 11, 33, 11, 11, 33, 99,
  1596. 3, 2, 1,
  1597. ][k - 1]))
  1598. : 255 === k &&
  1599. ((L = (n.readByte() << 8) | n.readByte()),
  1600. (R = (n.readByte() << 8) | n.readByte()));
  1601. }
  1602. if (
  1603. (n.readBool() && n.readBool(),
  1604. n.readBool() &&
  1605. (n.readBits(4), n.readBool() && n.readBits(24)),
  1606. n.readBool() && (n.readUEG(), n.readUEG()),
  1607. n.readBool())
  1608. ) {
  1609. var D = n.readBits(32),
  1610. I = n.readBits(32);
  1611. (O = n.readBool()), (w = (T = I) / (C = 2 * D));
  1612. }
  1613. }
  1614. var M = 1;
  1615. (1 === L && 1 === R) || (M = L / R);
  1616. var B = 0,
  1617. x = 0;
  1618. 0 === h
  1619. ? ((B = 1), (x = 2 - y))
  1620. : ((B = 3 === h ? 1 : 2),
  1621. (x = (1 === h ? 2 : 1) * (2 - y)));
  1622. var P = 16 * (g + 1),
  1623. U = 16 * (v + 1) * (2 - y);
  1624. (P -= (b + E) * B), (U -= (S + A) * x);
  1625. var N = Math.ceil(P * M);
  1626. return (
  1627. n.destroy(),
  1628. (n = null),
  1629. {
  1630. profile_string: o,
  1631. level_string: a,
  1632. bit_depth: l,
  1633. ref_frames: m,
  1634. chroma_format: u,
  1635. chroma_format_string: e.getChromaFormatString(u),
  1636. frame_rate: { fixed: O, fps: w, fps_den: C, fps_num: T },
  1637. sar_ratio: { width: L, height: R },
  1638. codec_size: { width: P, height: U },
  1639. present_size: { width: N, height: U },
  1640. }
  1641. );
  1642. }),
  1643. (e._skipScalingList = function (e, t) {
  1644. for (var i = 8, n = 8, r = 0; r < t; r++)
  1645. 0 !== n && (n = (i + e.readSEG() + 256) % 256),
  1646. (i = 0 === n ? i : n);
  1647. }),
  1648. (e.getProfileString = function (e) {
  1649. switch (e) {
  1650. case 66:
  1651. return 'Baseline';
  1652. case 77:
  1653. return 'Main';
  1654. case 88:
  1655. return 'Extended';
  1656. case 100:
  1657. return 'High';
  1658. case 110:
  1659. return 'High10';
  1660. case 122:
  1661. return 'High422';
  1662. case 244:
  1663. return 'High444';
  1664. default:
  1665. return 'Unknown';
  1666. }
  1667. }),
  1668. (e.getLevelString = function (e) {
  1669. return (e / 10).toFixed(1);
  1670. }),
  1671. (e.getChromaFormatString = function (e) {
  1672. switch (e) {
  1673. case 420:
  1674. return '4:2:0';
  1675. case 422:
  1676. return '4:2:2';
  1677. case 444:
  1678. return '4:4:4';
  1679. default:
  1680. return 'Unknown';
  1681. }
  1682. }),
  1683. e
  1684. );
  1685. })(),
  1686. m = i(600);
  1687. var g = (function () {
  1688. function e(e, t) {
  1689. (this.TAG = 'FLVDemuxer'),
  1690. (this._config = t),
  1691. (this._onError = null),
  1692. (this._onMediaInfo = null),
  1693. (this._onMetaDataArrived = null),
  1694. (this._onScriptDataArrived = null),
  1695. (this._onTrackMetadata = null),
  1696. (this._onDataAvailable = null),
  1697. (this._dataOffset = e.dataOffset),
  1698. (this._firstParse = !0),
  1699. (this._dispatch = !1),
  1700. (this._hasAudio = e.hasAudioTrack),
  1701. (this._hasVideo = e.hasVideoTrack),
  1702. (this._hasAudioFlagOverrided = !1),
  1703. (this._hasVideoFlagOverrided = !1),
  1704. (this._audioInitialMetadataDispatched = !1),
  1705. (this._videoInitialMetadataDispatched = !1),
  1706. (this._mediaInfo = new a.Z()),
  1707. (this._mediaInfo.hasAudio = this._hasAudio),
  1708. (this._mediaInfo.hasVideo = this._hasVideo),
  1709. (this._metadata = null),
  1710. (this._audioMetadata = null),
  1711. (this._videoMetadata = null),
  1712. (this._naluLengthSize = 4),
  1713. (this._timestampBase = 0),
  1714. (this._timescale = 1e3),
  1715. (this._duration = 0),
  1716. (this._durationOverrided = !1),
  1717. (this._referenceFrameRate = {
  1718. fixed: !0,
  1719. fps: 23.976,
  1720. fps_num: 23976,
  1721. fps_den: 1e3,
  1722. }),
  1723. (this._flvSoundRateTable = [5500, 11025, 22050, 44100, 48e3]),
  1724. (this._mpegSamplingRates = [
  1725. 96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3,
  1726. 12e3, 11025, 8e3, 7350,
  1727. ]),
  1728. (this._mpegAudioV10SampleRateTable = [44100, 48e3, 32e3, 0]),
  1729. (this._mpegAudioV20SampleRateTable = [22050, 24e3, 16e3, 0]),
  1730. (this._mpegAudioV25SampleRateTable = [11025, 12e3, 8e3, 0]),
  1731. (this._mpegAudioL1BitRateTable = [
  1732. 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384,
  1733. 416, 448, -1,
  1734. ]),
  1735. (this._mpegAudioL2BitRateTable = [
  1736. 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256,
  1737. 320, 384, -1,
  1738. ]),
  1739. (this._mpegAudioL3BitRateTable = [
  1740. 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256,
  1741. 320, -1,
  1742. ]),
  1743. (this._videoTrack = {
  1744. type: 'video',
  1745. id: 1,
  1746. sequenceNumber: 0,
  1747. samples: [],
  1748. length: 0,
  1749. }),
  1750. (this._audioTrack = {
  1751. type: 'audio',
  1752. id: 2,
  1753. sequenceNumber: 0,
  1754. samples: [],
  1755. length: 0,
  1756. }),
  1757. (this._littleEndian = (function () {
  1758. var e = new ArrayBuffer(2);
  1759. return (
  1760. new DataView(e).setInt16(0, 256, !0),
  1761. 256 === new Int16Array(e)[0]
  1762. );
  1763. })());
  1764. }
  1765. return (
  1766. (e.prototype.destroy = function () {
  1767. (this._mediaInfo = null),
  1768. (this._metadata = null),
  1769. (this._audioMetadata = null),
  1770. (this._videoMetadata = null),
  1771. (this._videoTrack = null),
  1772. (this._audioTrack = null),
  1773. (this._onError = null),
  1774. (this._onMediaInfo = null),
  1775. (this._onMetaDataArrived = null),
  1776. (this._onScriptDataArrived = null),
  1777. (this._onTrackMetadata = null),
  1778. (this._onDataAvailable = null);
  1779. }),
  1780. (e.probe = function (e) {
  1781. var t = new Uint8Array(e),
  1782. i = { match: !1 };
  1783. if (70 !== t[0] || 76 !== t[1] || 86 !== t[2] || 1 !== t[3])
  1784. return i;
  1785. var n,
  1786. r,
  1787. s = (4 & t[4]) >>> 2 != 0,
  1788. o = 0 != (1 & t[4]),
  1789. a =
  1790. ((n = t)[(r = 5)] << 24) |
  1791. (n[r + 1] << 16) |
  1792. (n[r + 2] << 8) |
  1793. n[r + 3];
  1794. return a < 9
  1795. ? i
  1796. : {
  1797. match: !0,
  1798. consumed: a,
  1799. dataOffset: a,
  1800. hasAudioTrack: s,
  1801. hasVideoTrack: o,
  1802. };
  1803. }),
  1804. (e.prototype.bindDataSource = function (e) {
  1805. return (e.onDataArrival = this.parseChunks.bind(this)), this;
  1806. }),
  1807. Object.defineProperty(e.prototype, 'onTrackMetadata', {
  1808. get: function () {
  1809. return this._onTrackMetadata;
  1810. },
  1811. set: function (e) {
  1812. this._onTrackMetadata = e;
  1813. },
  1814. enumerable: !1,
  1815. configurable: !0,
  1816. }),
  1817. Object.defineProperty(e.prototype, 'onMediaInfo', {
  1818. get: function () {
  1819. return this._onMediaInfo;
  1820. },
  1821. set: function (e) {
  1822. this._onMediaInfo = e;
  1823. },
  1824. enumerable: !1,
  1825. configurable: !0,
  1826. }),
  1827. Object.defineProperty(e.prototype, 'onMetaDataArrived', {
  1828. get: function () {
  1829. return this._onMetaDataArrived;
  1830. },
  1831. set: function (e) {
  1832. this._onMetaDataArrived = e;
  1833. },
  1834. enumerable: !1,
  1835. configurable: !0,
  1836. }),
  1837. Object.defineProperty(e.prototype, 'onScriptDataArrived', {
  1838. get: function () {
  1839. return this._onScriptDataArrived;
  1840. },
  1841. set: function (e) {
  1842. this._onScriptDataArrived = e;
  1843. },
  1844. enumerable: !1,
  1845. configurable: !0,
  1846. }),
  1847. Object.defineProperty(e.prototype, 'onError', {
  1848. get: function () {
  1849. return this._onError;
  1850. },
  1851. set: function (e) {
  1852. this._onError = e;
  1853. },
  1854. enumerable: !1,
  1855. configurable: !0,
  1856. }),
  1857. Object.defineProperty(e.prototype, 'onDataAvailable', {
  1858. get: function () {
  1859. return this._onDataAvailable;
  1860. },
  1861. set: function (e) {
  1862. this._onDataAvailable = e;
  1863. },
  1864. enumerable: !1,
  1865. configurable: !0,
  1866. }),
  1867. Object.defineProperty(e.prototype, 'timestampBase', {
  1868. get: function () {
  1869. return this._timestampBase;
  1870. },
  1871. set: function (e) {
  1872. this._timestampBase = e;
  1873. },
  1874. enumerable: !1,
  1875. configurable: !0,
  1876. }),
  1877. Object.defineProperty(e.prototype, 'overridedDuration', {
  1878. get: function () {
  1879. return this._duration;
  1880. },
  1881. set: function (e) {
  1882. (this._durationOverrided = !0),
  1883. (this._duration = e),
  1884. (this._mediaInfo.duration = e);
  1885. },
  1886. enumerable: !1,
  1887. configurable: !0,
  1888. }),
  1889. Object.defineProperty(e.prototype, 'overridedHasAudio', {
  1890. set: function (e) {
  1891. (this._hasAudioFlagOverrided = !0),
  1892. (this._hasAudio = e),
  1893. (this._mediaInfo.hasAudio = e);
  1894. },
  1895. enumerable: !1,
  1896. configurable: !0,
  1897. }),
  1898. Object.defineProperty(e.prototype, 'overridedHasVideo', {
  1899. set: function (e) {
  1900. (this._hasVideoFlagOverrided = !0),
  1901. (this._hasVideo = e),
  1902. (this._mediaInfo.hasVideo = e);
  1903. },
  1904. enumerable: !1,
  1905. configurable: !0,
  1906. }),
  1907. (e.prototype.resetMediaInfo = function () {
  1908. this._mediaInfo = new a.Z();
  1909. }),
  1910. (e.prototype._isInitialMetadataDispatched = function () {
  1911. return this._hasAudio && this._hasVideo
  1912. ? this._audioInitialMetadataDispatched &&
  1913. this._videoInitialMetadataDispatched
  1914. : this._hasAudio && !this._hasVideo
  1915. ? this._audioInitialMetadataDispatched
  1916. : !(this._hasAudio || !this._hasVideo) &&
  1917. this._videoInitialMetadataDispatched;
  1918. }),
  1919. (e.prototype.parseChunks = function (t, i) {
  1920. if (
  1921. !(
  1922. this._onError &&
  1923. this._onMediaInfo &&
  1924. this._onTrackMetadata &&
  1925. this._onDataAvailable
  1926. )
  1927. )
  1928. throw new d.rT(
  1929. 'Flv: onError & onMediaInfo & onTrackMetadata & onDataAvailable callback must be specified'
  1930. );
  1931. var n = 0,
  1932. r = this._littleEndian;
  1933. if (0 === i) {
  1934. if (!(t.byteLength > 13)) return 0;
  1935. n = e.probe(t).dataOffset;
  1936. }
  1937. this._firstParse &&
  1938. ((this._firstParse = !1),
  1939. i + n !== this._dataOffset &&
  1940. s.Z.w(
  1941. this.TAG,
  1942. 'First time parsing but chunk byteStart invalid!'
  1943. ),
  1944. 0 !== (o = new DataView(t, n)).getUint32(0, !r) &&
  1945. s.Z.w(this.TAG, 'PrevTagSize0 !== 0 !!!'),
  1946. (n += 4));
  1947. for (; n < t.byteLength; ) {
  1948. this._dispatch = !0;
  1949. var o = new DataView(t, n);
  1950. if (n + 11 + 4 > t.byteLength) break;
  1951. var a = o.getUint8(0),
  1952. h = 16777215 & o.getUint32(0, !r);
  1953. if (n + 11 + h + 4 > t.byteLength) break;
  1954. if (8 === a || 9 === a || 18 === a) {
  1955. var u = o.getUint8(4),
  1956. l = o.getUint8(5),
  1957. c =
  1958. o.getUint8(6) |
  1959. (l << 8) |
  1960. (u << 16) |
  1961. (o.getUint8(7) << 24);
  1962. 0 !== (16777215 & o.getUint32(7, !r)) &&
  1963. s.Z.w(this.TAG, 'Meet tag which has StreamID != 0!');
  1964. var f = n + 11;
  1965. switch (a) {
  1966. case 8:
  1967. this._parseAudioData(t, f, h, c);
  1968. break;
  1969. case 9:
  1970. this._parseVideoData(t, f, h, c, i + n);
  1971. break;
  1972. case 18:
  1973. this._parseScriptData(t, f, h);
  1974. }
  1975. var _ = o.getUint32(11 + h, !r);
  1976. _ !== 11 + h &&
  1977. s.Z.w(this.TAG, 'Invalid PrevTagSize ' + _),
  1978. (n += 11 + h + 4);
  1979. } else
  1980. s.Z.w(
  1981. this.TAG,
  1982. 'Unsupported tag type ' + a + ', skipped'
  1983. ),
  1984. (n += 11 + h + 4);
  1985. }
  1986. return (
  1987. this._isInitialMetadataDispatched() &&
  1988. this._dispatch &&
  1989. (this._audioTrack.length || this._videoTrack.length) &&
  1990. this._onDataAvailable(this._audioTrack, this._videoTrack),
  1991. n
  1992. );
  1993. }),
  1994. (e.prototype._parseScriptData = function (e, t, i) {
  1995. var n = f.parseScriptData(e, t, i);
  1996. if (n.hasOwnProperty('onMetaData')) {
  1997. if (null == n.onMetaData || 'object' != typeof n.onMetaData)
  1998. return void s.Z.w(
  1999. this.TAG,
  2000. 'Invalid onMetaData structure!'
  2001. );
  2002. this._metadata &&
  2003. s.Z.w(this.TAG, 'Found another onMetaData tag!'),
  2004. (this._metadata = n);
  2005. var r = this._metadata.onMetaData;
  2006. if (
  2007. (this._onMetaDataArrived &&
  2008. this._onMetaDataArrived(Object.assign({}, r)),
  2009. 'boolean' == typeof r.hasAudio &&
  2010. !1 === this._hasAudioFlagOverrided &&
  2011. ((this._hasAudio = r.hasAudio),
  2012. (this._mediaInfo.hasAudio = this._hasAudio)),
  2013. 'boolean' == typeof r.hasVideo &&
  2014. !1 === this._hasVideoFlagOverrided &&
  2015. ((this._hasVideo = r.hasVideo),
  2016. (this._mediaInfo.hasVideo = this._hasVideo)),
  2017. 'number' == typeof r.audiodatarate &&
  2018. (this._mediaInfo.audioDataRate = r.audiodatarate),
  2019. 'number' == typeof r.videodatarate &&
  2020. (this._mediaInfo.videoDataRate = r.videodatarate),
  2021. 'number' == typeof r.width &&
  2022. (this._mediaInfo.width = r.width),
  2023. 'number' == typeof r.height &&
  2024. (this._mediaInfo.height = r.height),
  2025. 'number' == typeof r.duration)
  2026. ) {
  2027. if (!this._durationOverrided) {
  2028. var o = Math.floor(r.duration * this._timescale);
  2029. (this._duration = o), (this._mediaInfo.duration = o);
  2030. }
  2031. } else this._mediaInfo.duration = 0;
  2032. if ('number' == typeof r.framerate) {
  2033. var a = Math.floor(1e3 * r.framerate);
  2034. if (a > 0) {
  2035. var h = a / 1e3;
  2036. (this._referenceFrameRate.fixed = !0),
  2037. (this._referenceFrameRate.fps = h),
  2038. (this._referenceFrameRate.fps_num = a),
  2039. (this._referenceFrameRate.fps_den = 1e3),
  2040. (this._mediaInfo.fps = h);
  2041. }
  2042. }
  2043. if ('object' == typeof r.keyframes) {
  2044. this._mediaInfo.hasKeyframesIndex = !0;
  2045. var u = r.keyframes;
  2046. (this._mediaInfo.keyframesIndex =
  2047. this._parseKeyframesIndex(u)),
  2048. (r.keyframes = null);
  2049. } else this._mediaInfo.hasKeyframesIndex = !1;
  2050. (this._dispatch = !1),
  2051. (this._mediaInfo.metadata = r),
  2052. s.Z.v(this.TAG, 'Parsed onMetaData'),
  2053. this._mediaInfo.isComplete() &&
  2054. this._onMediaInfo(this._mediaInfo);
  2055. }
  2056. Object.keys(n).length > 0 &&
  2057. this._onScriptDataArrived &&
  2058. this._onScriptDataArrived(Object.assign({}, n));
  2059. }),
  2060. (e.prototype._parseKeyframesIndex = function (e) {
  2061. for (var t = [], i = [], n = 1; n < e.times.length; n++) {
  2062. var r = this._timestampBase + Math.floor(1e3 * e.times[n]);
  2063. t.push(r), i.push(e.filepositions[n]);
  2064. }
  2065. return { times: t, filepositions: i };
  2066. }),
  2067. (e.prototype._parseAudioData = function (e, t, i, n) {
  2068. if (i <= 1)
  2069. s.Z.w(
  2070. this.TAG,
  2071. 'Flv: Invalid audio packet, missing SoundData payload!'
  2072. );
  2073. else if (
  2074. !0 !== this._hasAudioFlagOverrided ||
  2075. !1 !== this._hasAudio
  2076. ) {
  2077. this._littleEndian;
  2078. var r = new DataView(e, t, i).getUint8(0),
  2079. o = r >>> 4;
  2080. if (2 === o || 10 === o) {
  2081. var a = 0,
  2082. h = (12 & r) >>> 2;
  2083. if (h >= 0 && h <= 4) {
  2084. a = this._flvSoundRateTable[h];
  2085. var u = 1 & r,
  2086. l = this._audioMetadata,
  2087. d = this._audioTrack;
  2088. if (
  2089. (l ||
  2090. (!1 === this._hasAudio &&
  2091. !1 === this._hasAudioFlagOverrided &&
  2092. ((this._hasAudio = !0),
  2093. (this._mediaInfo.hasAudio = !0)),
  2094. ((l = this._audioMetadata = {}).type = 'audio'),
  2095. (l.id = d.id),
  2096. (l.timescale = this._timescale),
  2097. (l.duration = this._duration),
  2098. (l.audioSampleRate = a),
  2099. (l.channelCount = 0 === u ? 1 : 2)),
  2100. 10 === o)
  2101. ) {
  2102. var c = this._parseAACAudioData(e, t + 1, i - 1);
  2103. if (null == c) return;
  2104. if (0 === c.packetType) {
  2105. l.config &&
  2106. s.Z.w(
  2107. this.TAG,
  2108. 'Found another AudioSpecificConfig!'
  2109. );
  2110. var f = c.data;
  2111. (l.audioSampleRate = f.samplingRate),
  2112. (l.channelCount = f.channelCount),
  2113. (l.codec = f.codec),
  2114. (l.originalCodec = f.originalCodec),
  2115. (l.config = f.config),
  2116. (l.refSampleDuration =
  2117. (1024 / l.audioSampleRate) * l.timescale),
  2118. s.Z.v(this.TAG, 'Parsed AudioSpecificConfig'),
  2119. this._isInitialMetadataDispatched()
  2120. ? this._dispatch &&
  2121. (this._audioTrack.length ||
  2122. this._videoTrack.length) &&
  2123. this._onDataAvailable(
  2124. this._audioTrack,
  2125. this._videoTrack
  2126. )
  2127. : (this._audioInitialMetadataDispatched = !0),
  2128. (this._dispatch = !1),
  2129. this._onTrackMetadata('audio', l),
  2130. ((g = this._mediaInfo).audioCodec =
  2131. l.originalCodec),
  2132. (g.audioSampleRate = l.audioSampleRate),
  2133. (g.audioChannelCount = l.channelCount),
  2134. g.hasVideo
  2135. ? null != g.videoCodec &&
  2136. (g.mimeType =
  2137. 'video/x-flv; codecs="' +
  2138. g.videoCodec +
  2139. ',' +
  2140. g.audioCodec +
  2141. '"')
  2142. : (g.mimeType =
  2143. 'video/x-flv; codecs="' +
  2144. g.audioCodec +
  2145. '"'),
  2146. g.isComplete() && this._onMediaInfo(g);
  2147. } else if (1 === c.packetType) {
  2148. var _ = this._timestampBase + n,
  2149. p = {
  2150. unit: c.data,
  2151. length: c.data.byteLength,
  2152. dts: _,
  2153. pts: _,
  2154. };
  2155. d.samples.push(p), (d.length += c.data.length);
  2156. } else
  2157. s.Z.e(
  2158. this.TAG,
  2159. 'Flv: Unsupported AAC data type ' + c.packetType
  2160. );
  2161. } else if (2 === o) {
  2162. if (!l.codec) {
  2163. var g;
  2164. if (
  2165. null ==
  2166. (f = this._parseMP3AudioData(e, t + 1, i - 1, !0))
  2167. )
  2168. return;
  2169. (l.audioSampleRate = f.samplingRate),
  2170. (l.channelCount = f.channelCount),
  2171. (l.codec = f.codec),
  2172. (l.originalCodec = f.originalCodec),
  2173. (l.refSampleDuration =
  2174. (1152 / l.audioSampleRate) * l.timescale),
  2175. s.Z.v(this.TAG, 'Parsed MPEG Audio Frame Header'),
  2176. (this._audioInitialMetadataDispatched = !0),
  2177. this._onTrackMetadata('audio', l),
  2178. ((g = this._mediaInfo).audioCodec = l.codec),
  2179. (g.audioSampleRate = l.audioSampleRate),
  2180. (g.audioChannelCount = l.channelCount),
  2181. (g.audioDataRate = f.bitRate),
  2182. g.hasVideo
  2183. ? null != g.videoCodec &&
  2184. (g.mimeType =
  2185. 'video/x-flv; codecs="' +
  2186. g.videoCodec +
  2187. ',' +
  2188. g.audioCodec +
  2189. '"')
  2190. : (g.mimeType =
  2191. 'video/x-flv; codecs="' +
  2192. g.audioCodec +
  2193. '"'),
  2194. g.isComplete() && this._onMediaInfo(g);
  2195. }
  2196. var v = this._parseMP3AudioData(e, t + 1, i - 1, !1);
  2197. if (null == v) return;
  2198. _ = this._timestampBase + n;
  2199. var y = {
  2200. unit: v,
  2201. length: v.byteLength,
  2202. dts: _,
  2203. pts: _,
  2204. };
  2205. d.samples.push(y), (d.length += v.length);
  2206. }
  2207. } else
  2208. this._onError(
  2209. m.Z.FORMAT_ERROR,
  2210. 'Flv: Invalid audio sample rate idx: ' + h
  2211. );
  2212. } else
  2213. this._onError(
  2214. m.Z.CODEC_UNSUPPORTED,
  2215. 'Flv: Unsupported audio codec idx: ' + o
  2216. );
  2217. }
  2218. }),
  2219. (e.prototype._parseAACAudioData = function (e, t, i) {
  2220. if (!(i <= 1)) {
  2221. var n = {},
  2222. r = new Uint8Array(e, t, i);
  2223. return (
  2224. (n.packetType = r[0]),
  2225. 0 === r[0]
  2226. ? (n.data = this._parseAACAudioSpecificConfig(
  2227. e,
  2228. t + 1,
  2229. i - 1
  2230. ))
  2231. : (n.data = r.subarray(1)),
  2232. n
  2233. );
  2234. }
  2235. s.Z.w(
  2236. this.TAG,
  2237. 'Flv: Invalid AAC packet, missing AACPacketType or/and Data!'
  2238. );
  2239. }),
  2240. (e.prototype._parseAACAudioSpecificConfig = function (e, t, i) {
  2241. var n,
  2242. r,
  2243. s = new Uint8Array(e, t, i),
  2244. o = null,
  2245. a = 0,
  2246. h = null;
  2247. if (
  2248. ((a = n = s[0] >>> 3),
  2249. (r = ((7 & s[0]) << 1) | (s[1] >>> 7)) < 0 ||
  2250. r >= this._mpegSamplingRates.length)
  2251. )
  2252. this._onError(
  2253. m.Z.FORMAT_ERROR,
  2254. 'Flv: AAC invalid sampling frequency index!'
  2255. );
  2256. else {
  2257. var u = this._mpegSamplingRates[r],
  2258. l = (120 & s[1]) >>> 3;
  2259. if (!(l < 0 || l >= 8)) {
  2260. 5 === a &&
  2261. ((h = ((7 & s[1]) << 1) | (s[2] >>> 7)),
  2262. (124 & s[2]) >>> 2);
  2263. var d = self.navigator.userAgent.toLowerCase();
  2264. return (
  2265. -1 !== d.indexOf('firefox')
  2266. ? r >= 6
  2267. ? ((a = 5), (o = new Array(4)), (h = r - 3))
  2268. : ((a = 2), (o = new Array(2)), (h = r))
  2269. : -1 !== d.indexOf('android')
  2270. ? ((a = 2), (o = new Array(2)), (h = r))
  2271. : ((a = 5),
  2272. (h = r),
  2273. (o = new Array(4)),
  2274. r >= 6
  2275. ? (h = r - 3)
  2276. : 1 === l &&
  2277. ((a = 2), (o = new Array(2)), (h = r))),
  2278. (o[0] = a << 3),
  2279. (o[0] |= (15 & r) >>> 1),
  2280. (o[1] = (15 & r) << 7),
  2281. (o[1] |= (15 & l) << 3),
  2282. 5 === a &&
  2283. ((o[1] |= (15 & h) >>> 1),
  2284. (o[2] = (1 & h) << 7),
  2285. (o[2] |= 8),
  2286. (o[3] = 0)),
  2287. {
  2288. config: o,
  2289. samplingRate: u,
  2290. channelCount: l,
  2291. codec: 'mp4a.40.' + a,
  2292. originalCodec: 'mp4a.40.' + n,
  2293. }
  2294. );
  2295. }
  2296. this._onError(
  2297. m.Z.FORMAT_ERROR,
  2298. 'Flv: AAC invalid channel configuration'
  2299. );
  2300. }
  2301. }),
  2302. (e.prototype._parseMP3AudioData = function (e, t, i, n) {
  2303. if (!(i < 4)) {
  2304. this._littleEndian;
  2305. var r = new Uint8Array(e, t, i),
  2306. o = null;
  2307. if (n) {
  2308. if (255 !== r[0]) return;
  2309. var a = (r[1] >>> 3) & 3,
  2310. h = (6 & r[1]) >> 1,
  2311. u = (240 & r[2]) >>> 4,
  2312. l = (12 & r[2]) >>> 2,
  2313. d = 3 !== ((r[3] >>> 6) & 3) ? 2 : 1,
  2314. c = 0,
  2315. f = 0;
  2316. switch (a) {
  2317. case 0:
  2318. c = this._mpegAudioV25SampleRateTable[l];
  2319. break;
  2320. case 2:
  2321. c = this._mpegAudioV20SampleRateTable[l];
  2322. break;
  2323. case 3:
  2324. c = this._mpegAudioV10SampleRateTable[l];
  2325. }
  2326. switch (h) {
  2327. case 1:
  2328. 34,
  2329. u < this._mpegAudioL3BitRateTable.length &&
  2330. (f = this._mpegAudioL3BitRateTable[u]);
  2331. break;
  2332. case 2:
  2333. 33,
  2334. u < this._mpegAudioL2BitRateTable.length &&
  2335. (f = this._mpegAudioL2BitRateTable[u]);
  2336. break;
  2337. case 3:
  2338. 32,
  2339. u < this._mpegAudioL1BitRateTable.length &&
  2340. (f = this._mpegAudioL1BitRateTable[u]);
  2341. }
  2342. o = {
  2343. bitRate: f,
  2344. samplingRate: c,
  2345. channelCount: d,
  2346. codec: 'mp3',
  2347. originalCodec: 'mp3',
  2348. };
  2349. } else o = r;
  2350. return o;
  2351. }
  2352. s.Z.w(this.TAG, 'Flv: Invalid MP3 packet, header missing!');
  2353. }),
  2354. (e.prototype._parseVideoData = function (e, t, i, n, r) {
  2355. if (i <= 1)
  2356. s.Z.w(
  2357. this.TAG,
  2358. 'Flv: Invalid video packet, missing VideoData payload!'
  2359. );
  2360. else if (
  2361. !0 !== this._hasVideoFlagOverrided ||
  2362. !1 !== this._hasVideo
  2363. ) {
  2364. var o = new Uint8Array(e, t, i)[0],
  2365. a = (240 & o) >>> 4,
  2366. h = 15 & o;
  2367. 7 === h
  2368. ? this._parseAVCVideoPacket(e, t + 1, i - 1, n, r, a)
  2369. : this._onError(
  2370. m.Z.CODEC_UNSUPPORTED,
  2371. 'Flv: Unsupported codec in video frame: ' + h
  2372. );
  2373. }
  2374. }),
  2375. (e.prototype._parseAVCVideoPacket = function (
  2376. e,
  2377. t,
  2378. i,
  2379. n,
  2380. r,
  2381. o
  2382. ) {
  2383. if (i < 4)
  2384. s.Z.w(
  2385. this.TAG,
  2386. 'Flv: Invalid AVC packet, missing AVCPacketType or/and CompositionTime'
  2387. );
  2388. else {
  2389. var a = this._littleEndian,
  2390. h = new DataView(e, t, i),
  2391. u = h.getUint8(0),
  2392. l = ((16777215 & h.getUint32(0, !a)) << 8) >> 8;
  2393. if (0 === u)
  2394. this._parseAVCDecoderConfigurationRecord(e, t + 4, i - 4);
  2395. else if (1 === u)
  2396. this._parseAVCVideoData(e, t + 4, i - 4, n, r, o, l);
  2397. else if (2 !== u)
  2398. return void this._onError(
  2399. m.Z.FORMAT_ERROR,
  2400. 'Flv: Invalid video packet type ' + u
  2401. );
  2402. }
  2403. }),
  2404. (e.prototype._parseAVCDecoderConfigurationRecord = function (
  2405. e,
  2406. t,
  2407. i
  2408. ) {
  2409. if (i < 7)
  2410. s.Z.w(
  2411. this.TAG,
  2412. 'Flv: Invalid AVCDecoderConfigurationRecord, lack of data!'
  2413. );
  2414. else {
  2415. var n = this._videoMetadata,
  2416. r = this._videoTrack,
  2417. o = this._littleEndian,
  2418. a = new DataView(e, t, i);
  2419. n
  2420. ? void 0 !== n.avcc &&
  2421. s.Z.w(
  2422. this.TAG,
  2423. 'Found another AVCDecoderConfigurationRecord!'
  2424. )
  2425. : (!1 === this._hasVideo &&
  2426. !1 === this._hasVideoFlagOverrided &&
  2427. ((this._hasVideo = !0),
  2428. (this._mediaInfo.hasVideo = !0)),
  2429. ((n = this._videoMetadata = {}).type = 'video'),
  2430. (n.id = r.id),
  2431. (n.timescale = this._timescale),
  2432. (n.duration = this._duration));
  2433. var h = a.getUint8(0),
  2434. u = a.getUint8(1);
  2435. a.getUint8(2), a.getUint8(3);
  2436. if (1 === h && 0 !== u)
  2437. if (
  2438. ((this._naluLengthSize = 1 + (3 & a.getUint8(4))),
  2439. 3 === this._naluLengthSize ||
  2440. 4 === this._naluLengthSize)
  2441. ) {
  2442. var l = 31 & a.getUint8(5);
  2443. if (0 !== l) {
  2444. l > 1 &&
  2445. s.Z.w(
  2446. this.TAG,
  2447. 'Flv: Strange AVCDecoderConfigurationRecord: SPS Count = ' +
  2448. l
  2449. );
  2450. for (var d = 6, c = 0; c < l; c++) {
  2451. var f = a.getUint16(d, !o);
  2452. if (((d += 2), 0 !== f)) {
  2453. var _ = new Uint8Array(e, t + d, f);
  2454. d += f;
  2455. var g = p.parseSPS(_);
  2456. if (0 === c) {
  2457. (n.codecWidth = g.codec_size.width),
  2458. (n.codecHeight = g.codec_size.height),
  2459. (n.presentWidth = g.present_size.width),
  2460. (n.presentHeight = g.present_size.height),
  2461. (n.profile = g.profile_string),
  2462. (n.level = g.level_string),
  2463. (n.bitDepth = g.bit_depth),
  2464. (n.chromaFormat = g.chroma_format),
  2465. (n.sarRatio = g.sar_ratio),
  2466. (n.frameRate = g.frame_rate),
  2467. (!1 !== g.frame_rate.fixed &&
  2468. 0 !== g.frame_rate.fps_num &&
  2469. 0 !== g.frame_rate.fps_den) ||
  2470. (n.frameRate = this._referenceFrameRate);
  2471. var v = n.frameRate.fps_den,
  2472. y = n.frameRate.fps_num;
  2473. n.refSampleDuration = n.timescale * (v / y);
  2474. for (
  2475. var b = _.subarray(1, 4), E = 'avc1.', S = 0;
  2476. S < 3;
  2477. S++
  2478. ) {
  2479. var A = b[S].toString(16);
  2480. A.length < 2 && (A = '0' + A), (E += A);
  2481. }
  2482. n.codec = E;
  2483. var L = this._mediaInfo;
  2484. (L.width = n.codecWidth),
  2485. (L.height = n.codecHeight),
  2486. (L.fps = n.frameRate.fps),
  2487. (L.profile = n.profile),
  2488. (L.level = n.level),
  2489. (L.refFrames = g.ref_frames),
  2490. (L.chromaFormat = g.chroma_format_string),
  2491. (L.sarNum = n.sarRatio.width),
  2492. (L.sarDen = n.sarRatio.height),
  2493. (L.videoCodec = E),
  2494. L.hasAudio
  2495. ? null != L.audioCodec &&
  2496. (L.mimeType =
  2497. 'video/x-flv; codecs="' +
  2498. L.videoCodec +
  2499. ',' +
  2500. L.audioCodec +
  2501. '"')
  2502. : (L.mimeType =
  2503. 'video/x-flv; codecs="' +
  2504. L.videoCodec +
  2505. '"'),
  2506. L.isComplete() && this._onMediaInfo(L);
  2507. }
  2508. }
  2509. }
  2510. var R = a.getUint8(d);
  2511. if (0 !== R) {
  2512. R > 1 &&
  2513. s.Z.w(
  2514. this.TAG,
  2515. 'Flv: Strange AVCDecoderConfigurationRecord: PPS Count = ' +
  2516. R
  2517. ),
  2518. d++;
  2519. for (c = 0; c < R; c++) {
  2520. f = a.getUint16(d, !o);
  2521. (d += 2), 0 !== f && (d += f);
  2522. }
  2523. (n.avcc = new Uint8Array(i)),
  2524. n.avcc.set(new Uint8Array(e, t, i), 0),
  2525. s.Z.v(
  2526. this.TAG,
  2527. 'Parsed AVCDecoderConfigurationRecord'
  2528. ),
  2529. this._isInitialMetadataDispatched()
  2530. ? this._dispatch &&
  2531. (this._audioTrack.length ||
  2532. this._videoTrack.length) &&
  2533. this._onDataAvailable(
  2534. this._audioTrack,
  2535. this._videoTrack
  2536. )
  2537. : (this._videoInitialMetadataDispatched = !0),
  2538. (this._dispatch = !1),
  2539. this._onTrackMetadata('video', n);
  2540. } else
  2541. this._onError(
  2542. m.Z.FORMAT_ERROR,
  2543. 'Flv: Invalid AVCDecoderConfigurationRecord: No PPS'
  2544. );
  2545. } else
  2546. this._onError(
  2547. m.Z.FORMAT_ERROR,
  2548. 'Flv: Invalid AVCDecoderConfigurationRecord: No SPS'
  2549. );
  2550. } else
  2551. this._onError(
  2552. m.Z.FORMAT_ERROR,
  2553. 'Flv: Strange NaluLengthSizeMinusOne: ' +
  2554. (this._naluLengthSize - 1)
  2555. );
  2556. else
  2557. this._onError(
  2558. m.Z.FORMAT_ERROR,
  2559. 'Flv: Invalid AVCDecoderConfigurationRecord'
  2560. );
  2561. }
  2562. }),
  2563. (e.prototype._parseAVCVideoData = function (
  2564. e,
  2565. t,
  2566. i,
  2567. n,
  2568. r,
  2569. o,
  2570. a
  2571. ) {
  2572. for (
  2573. var h = this._littleEndian,
  2574. u = new DataView(e, t, i),
  2575. l = [],
  2576. d = 0,
  2577. c = 0,
  2578. f = this._naluLengthSize,
  2579. _ = this._timestampBase + n,
  2580. p = 1 === o;
  2581. c < i;
  2582. ) {
  2583. if (c + 4 >= i) {
  2584. s.Z.w(
  2585. this.TAG,
  2586. 'Malformed Nalu near timestamp ' +
  2587. _ +
  2588. ', offset = ' +
  2589. c +
  2590. ', dataSize = ' +
  2591. i
  2592. );
  2593. break;
  2594. }
  2595. var m = u.getUint32(c, !h);
  2596. if ((3 === f && (m >>>= 8), m > i - f))
  2597. return void s.Z.w(
  2598. this.TAG,
  2599. 'Malformed Nalus near timestamp ' +
  2600. _ +
  2601. ', NaluSize > DataSize!'
  2602. );
  2603. var g = 31 & u.getUint8(c + f);
  2604. 5 === g && (p = !0);
  2605. var v = new Uint8Array(e, t + c, f + m),
  2606. y = { type: g, data: v };
  2607. l.push(y), (d += v.byteLength), (c += f + m);
  2608. }
  2609. if (l.length) {
  2610. var b = this._videoTrack,
  2611. E = {
  2612. units: l,
  2613. length: d,
  2614. isKeyframe: p,
  2615. dts: _,
  2616. cts: a,
  2617. pts: _ + a,
  2618. };
  2619. p && (E.fileposition = r),
  2620. b.samples.push(E),
  2621. (b.length += d);
  2622. }
  2623. }),
  2624. e
  2625. );
  2626. })(),
  2627. v = (function () {
  2628. function e() {}
  2629. return (
  2630. (e.init = function () {
  2631. for (var t in ((e.types = {
  2632. avc1: [],
  2633. avcC: [],
  2634. btrt: [],
  2635. dinf: [],
  2636. dref: [],
  2637. esds: [],
  2638. ftyp: [],
  2639. hdlr: [],
  2640. mdat: [],
  2641. mdhd: [],
  2642. mdia: [],
  2643. mfhd: [],
  2644. minf: [],
  2645. moof: [],
  2646. moov: [],
  2647. mp4a: [],
  2648. mvex: [],
  2649. mvhd: [],
  2650. sdtp: [],
  2651. stbl: [],
  2652. stco: [],
  2653. stsc: [],
  2654. stsd: [],
  2655. stsz: [],
  2656. stts: [],
  2657. tfdt: [],
  2658. tfhd: [],
  2659. traf: [],
  2660. trak: [],
  2661. trun: [],
  2662. trex: [],
  2663. tkhd: [],
  2664. vmhd: [],
  2665. smhd: [],
  2666. '.mp3': [],
  2667. }),
  2668. e.types))
  2669. e.types.hasOwnProperty(t) &&
  2670. (e.types[t] = [
  2671. t.charCodeAt(0),
  2672. t.charCodeAt(1),
  2673. t.charCodeAt(2),
  2674. t.charCodeAt(3),
  2675. ]);
  2676. var i = (e.constants = {});
  2677. (i.FTYP = new Uint8Array([
  2678. 105, 115, 111, 109, 0, 0, 0, 1, 105, 115, 111, 109, 97, 118,
  2679. 99, 49,
  2680. ])),
  2681. (i.STSD_PREFIX = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1])),
  2682. (i.STTS = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  2683. (i.STSC = i.STCO = i.STTS),
  2684. (i.STSZ = new Uint8Array([
  2685. 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  2686. ])),
  2687. (i.HDLR_VIDEO = new Uint8Array([
  2688. 0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0,
  2689. 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110,
  2690. 100, 108, 101, 114, 0,
  2691. ])),
  2692. (i.HDLR_AUDIO = new Uint8Array([
  2693. 0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0,
  2694. 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110,
  2695. 100, 108, 101, 114, 0,
  2696. ])),
  2697. (i.DREF = new Uint8Array([
  2698. 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0,
  2699. 0, 0, 1,
  2700. ])),
  2701. (i.SMHD = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  2702. (i.VMHD = new Uint8Array([
  2703. 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
  2704. ]));
  2705. }),
  2706. (e.box = function (e) {
  2707. for (
  2708. var t = 8,
  2709. i = null,
  2710. n = Array.prototype.slice.call(arguments, 1),
  2711. r = n.length,
  2712. s = 0;
  2713. s < r;
  2714. s++
  2715. )
  2716. t += n[s].byteLength;
  2717. ((i = new Uint8Array(t))[0] = (t >>> 24) & 255),
  2718. (i[1] = (t >>> 16) & 255),
  2719. (i[2] = (t >>> 8) & 255),
  2720. (i[3] = 255 & t),
  2721. i.set(e, 4);
  2722. var o = 8;
  2723. for (s = 0; s < r; s++)
  2724. i.set(n[s], o), (o += n[s].byteLength);
  2725. return i;
  2726. }),
  2727. (e.generateInitSegment = function (t) {
  2728. var i = e.box(e.types.ftyp, e.constants.FTYP),
  2729. n = e.moov(t),
  2730. r = new Uint8Array(i.byteLength + n.byteLength);
  2731. return r.set(i, 0), r.set(n, i.byteLength), r;
  2732. }),
  2733. (e.moov = function (t) {
  2734. var i = e.mvhd(t.timescale, t.duration),
  2735. n = e.trak(t),
  2736. r = e.mvex(t);
  2737. return e.box(e.types.moov, i, n, r);
  2738. }),
  2739. (e.mvhd = function (t, i) {
  2740. return e.box(
  2741. e.types.mvhd,
  2742. new Uint8Array([
  2743. 0,
  2744. 0,
  2745. 0,
  2746. 0,
  2747. 0,
  2748. 0,
  2749. 0,
  2750. 0,
  2751. 0,
  2752. 0,
  2753. 0,
  2754. 0,
  2755. (t >>> 24) & 255,
  2756. (t >>> 16) & 255,
  2757. (t >>> 8) & 255,
  2758. 255 & t,
  2759. (i >>> 24) & 255,
  2760. (i >>> 16) & 255,
  2761. (i >>> 8) & 255,
  2762. 255 & i,
  2763. 0,
  2764. 1,
  2765. 0,
  2766. 0,
  2767. 1,
  2768. 0,
  2769. 0,
  2770. 0,
  2771. 0,
  2772. 0,
  2773. 0,
  2774. 0,
  2775. 0,
  2776. 0,
  2777. 0,
  2778. 0,
  2779. 0,
  2780. 1,
  2781. 0,
  2782. 0,
  2783. 0,
  2784. 0,
  2785. 0,
  2786. 0,
  2787. 0,
  2788. 0,
  2789. 0,
  2790. 0,
  2791. 0,
  2792. 0,
  2793. 0,
  2794. 0,
  2795. 0,
  2796. 1,
  2797. 0,
  2798. 0,
  2799. 0,
  2800. 0,
  2801. 0,
  2802. 0,
  2803. 0,
  2804. 0,
  2805. 0,
  2806. 0,
  2807. 0,
  2808. 0,
  2809. 0,
  2810. 0,
  2811. 64,
  2812. 0,
  2813. 0,
  2814. 0,
  2815. 0,
  2816. 0,
  2817. 0,
  2818. 0,
  2819. 0,
  2820. 0,
  2821. 0,
  2822. 0,
  2823. 0,
  2824. 0,
  2825. 0,
  2826. 0,
  2827. 0,
  2828. 0,
  2829. 0,
  2830. 0,
  2831. 0,
  2832. 0,
  2833. 0,
  2834. 0,
  2835. 0,
  2836. 0,
  2837. 0,
  2838. 0,
  2839. 255,
  2840. 255,
  2841. 255,
  2842. 255,
  2843. ])
  2844. );
  2845. }),
  2846. (e.trak = function (t) {
  2847. return e.box(e.types.trak, e.tkhd(t), e.mdia(t));
  2848. }),
  2849. (e.tkhd = function (t) {
  2850. var i = t.id,
  2851. n = t.duration,
  2852. r = t.presentWidth,
  2853. s = t.presentHeight;
  2854. return e.box(
  2855. e.types.tkhd,
  2856. new Uint8Array([
  2857. 0,
  2858. 0,
  2859. 0,
  2860. 7,
  2861. 0,
  2862. 0,
  2863. 0,
  2864. 0,
  2865. 0,
  2866. 0,
  2867. 0,
  2868. 0,
  2869. (i >>> 24) & 255,
  2870. (i >>> 16) & 255,
  2871. (i >>> 8) & 255,
  2872. 255 & i,
  2873. 0,
  2874. 0,
  2875. 0,
  2876. 0,
  2877. (n >>> 24) & 255,
  2878. (n >>> 16) & 255,
  2879. (n >>> 8) & 255,
  2880. 255 & n,
  2881. 0,
  2882. 0,
  2883. 0,
  2884. 0,
  2885. 0,
  2886. 0,
  2887. 0,
  2888. 0,
  2889. 0,
  2890. 0,
  2891. 0,
  2892. 0,
  2893. 0,
  2894. 0,
  2895. 0,
  2896. 0,
  2897. 0,
  2898. 1,
  2899. 0,
  2900. 0,
  2901. 0,
  2902. 0,
  2903. 0,
  2904. 0,
  2905. 0,
  2906. 0,
  2907. 0,
  2908. 0,
  2909. 0,
  2910. 0,
  2911. 0,
  2912. 0,
  2913. 0,
  2914. 1,
  2915. 0,
  2916. 0,
  2917. 0,
  2918. 0,
  2919. 0,
  2920. 0,
  2921. 0,
  2922. 0,
  2923. 0,
  2924. 0,
  2925. 0,
  2926. 0,
  2927. 0,
  2928. 0,
  2929. 64,
  2930. 0,
  2931. 0,
  2932. 0,
  2933. (r >>> 8) & 255,
  2934. 255 & r,
  2935. 0,
  2936. 0,
  2937. (s >>> 8) & 255,
  2938. 255 & s,
  2939. 0,
  2940. 0,
  2941. ])
  2942. );
  2943. }),
  2944. (e.mdia = function (t) {
  2945. return e.box(e.types.mdia, e.mdhd(t), e.hdlr(t), e.minf(t));
  2946. }),
  2947. (e.mdhd = function (t) {
  2948. var i = t.timescale,
  2949. n = t.duration;
  2950. return e.box(
  2951. e.types.mdhd,
  2952. new Uint8Array([
  2953. 0,
  2954. 0,
  2955. 0,
  2956. 0,
  2957. 0,
  2958. 0,
  2959. 0,
  2960. 0,
  2961. 0,
  2962. 0,
  2963. 0,
  2964. 0,
  2965. (i >>> 24) & 255,
  2966. (i >>> 16) & 255,
  2967. (i >>> 8) & 255,
  2968. 255 & i,
  2969. (n >>> 24) & 255,
  2970. (n >>> 16) & 255,
  2971. (n >>> 8) & 255,
  2972. 255 & n,
  2973. 85,
  2974. 196,
  2975. 0,
  2976. 0,
  2977. ])
  2978. );
  2979. }),
  2980. (e.hdlr = function (t) {
  2981. var i = null;
  2982. return (
  2983. (i =
  2984. 'audio' === t.type
  2985. ? e.constants.HDLR_AUDIO
  2986. : e.constants.HDLR_VIDEO),
  2987. e.box(e.types.hdlr, i)
  2988. );
  2989. }),
  2990. (e.minf = function (t) {
  2991. var i = null;
  2992. return (
  2993. (i =
  2994. 'audio' === t.type
  2995. ? e.box(e.types.smhd, e.constants.SMHD)
  2996. : e.box(e.types.vmhd, e.constants.VMHD)),
  2997. e.box(e.types.minf, i, e.dinf(), e.stbl(t))
  2998. );
  2999. }),
  3000. (e.dinf = function () {
  3001. return e.box(
  3002. e.types.dinf,
  3003. e.box(e.types.dref, e.constants.DREF)
  3004. );
  3005. }),
  3006. (e.stbl = function (t) {
  3007. return e.box(
  3008. e.types.stbl,
  3009. e.stsd(t),
  3010. e.box(e.types.stts, e.constants.STTS),
  3011. e.box(e.types.stsc, e.constants.STSC),
  3012. e.box(e.types.stsz, e.constants.STSZ),
  3013. e.box(e.types.stco, e.constants.STCO)
  3014. );
  3015. }),
  3016. (e.stsd = function (t) {
  3017. return 'audio' === t.type
  3018. ? 'mp3' === t.codec
  3019. ? e.box(e.types.stsd, e.constants.STSD_PREFIX, e.mp3(t))
  3020. : e.box(e.types.stsd, e.constants.STSD_PREFIX, e.mp4a(t))
  3021. : e.box(e.types.stsd, e.constants.STSD_PREFIX, e.avc1(t));
  3022. }),
  3023. (e.mp3 = function (t) {
  3024. var i = t.channelCount,
  3025. n = t.audioSampleRate,
  3026. r = new Uint8Array([
  3027. 0,
  3028. 0,
  3029. 0,
  3030. 0,
  3031. 0,
  3032. 0,
  3033. 0,
  3034. 1,
  3035. 0,
  3036. 0,
  3037. 0,
  3038. 0,
  3039. 0,
  3040. 0,
  3041. 0,
  3042. 0,
  3043. 0,
  3044. i,
  3045. 0,
  3046. 16,
  3047. 0,
  3048. 0,
  3049. 0,
  3050. 0,
  3051. (n >>> 8) & 255,
  3052. 255 & n,
  3053. 0,
  3054. 0,
  3055. ]);
  3056. return e.box(e.types['.mp3'], r);
  3057. }),
  3058. (e.mp4a = function (t) {
  3059. var i = t.channelCount,
  3060. n = t.audioSampleRate,
  3061. r = new Uint8Array([
  3062. 0,
  3063. 0,
  3064. 0,
  3065. 0,
  3066. 0,
  3067. 0,
  3068. 0,
  3069. 1,
  3070. 0,
  3071. 0,
  3072. 0,
  3073. 0,
  3074. 0,
  3075. 0,
  3076. 0,
  3077. 0,
  3078. 0,
  3079. i,
  3080. 0,
  3081. 16,
  3082. 0,
  3083. 0,
  3084. 0,
  3085. 0,
  3086. (n >>> 8) & 255,
  3087. 255 & n,
  3088. 0,
  3089. 0,
  3090. ]);
  3091. return e.box(e.types.mp4a, r, e.esds(t));
  3092. }),
  3093. (e.esds = function (t) {
  3094. var i = t.config || [],
  3095. n = i.length,
  3096. r = new Uint8Array(
  3097. [
  3098. 0,
  3099. 0,
  3100. 0,
  3101. 0,
  3102. 3,
  3103. 23 + n,
  3104. 0,
  3105. 1,
  3106. 0,
  3107. 4,
  3108. 15 + n,
  3109. 64,
  3110. 21,
  3111. 0,
  3112. 0,
  3113. 0,
  3114. 0,
  3115. 0,
  3116. 0,
  3117. 0,
  3118. 0,
  3119. 0,
  3120. 0,
  3121. 0,
  3122. 5,
  3123. ]
  3124. .concat([n])
  3125. .concat(i)
  3126. .concat([6, 1, 2])
  3127. );
  3128. return e.box(e.types.esds, r);
  3129. }),
  3130. (e.avc1 = function (t) {
  3131. var i = t.avcc,
  3132. n = t.codecWidth,
  3133. r = t.codecHeight,
  3134. s = new Uint8Array([
  3135. 0,
  3136. 0,
  3137. 0,
  3138. 0,
  3139. 0,
  3140. 0,
  3141. 0,
  3142. 1,
  3143. 0,
  3144. 0,
  3145. 0,
  3146. 0,
  3147. 0,
  3148. 0,
  3149. 0,
  3150. 0,
  3151. 0,
  3152. 0,
  3153. 0,
  3154. 0,
  3155. 0,
  3156. 0,
  3157. 0,
  3158. 0,
  3159. (n >>> 8) & 255,
  3160. 255 & n,
  3161. (r >>> 8) & 255,
  3162. 255 & r,
  3163. 0,
  3164. 72,
  3165. 0,
  3166. 0,
  3167. 0,
  3168. 72,
  3169. 0,
  3170. 0,
  3171. 0,
  3172. 0,
  3173. 0,
  3174. 0,
  3175. 0,
  3176. 1,
  3177. 10,
  3178. 120,
  3179. 113,
  3180. 113,
  3181. 47,
  3182. 102,
  3183. 108,
  3184. 118,
  3185. 46,
  3186. 106,
  3187. 115,
  3188. 0,
  3189. 0,
  3190. 0,
  3191. 0,
  3192. 0,
  3193. 0,
  3194. 0,
  3195. 0,
  3196. 0,
  3197. 0,
  3198. 0,
  3199. 0,
  3200. 0,
  3201. 0,
  3202. 0,
  3203. 0,
  3204. 0,
  3205. 0,
  3206. 0,
  3207. 0,
  3208. 0,
  3209. 0,
  3210. 24,
  3211. 255,
  3212. 255,
  3213. ]);
  3214. return e.box(e.types.avc1, s, e.box(e.types.avcC, i));
  3215. }),
  3216. (e.mvex = function (t) {
  3217. return e.box(e.types.mvex, e.trex(t));
  3218. }),
  3219. (e.trex = function (t) {
  3220. var i = t.id,
  3221. n = new Uint8Array([
  3222. 0,
  3223. 0,
  3224. 0,
  3225. 0,
  3226. (i >>> 24) & 255,
  3227. (i >>> 16) & 255,
  3228. (i >>> 8) & 255,
  3229. 255 & i,
  3230. 0,
  3231. 0,
  3232. 0,
  3233. 1,
  3234. 0,
  3235. 0,
  3236. 0,
  3237. 0,
  3238. 0,
  3239. 0,
  3240. 0,
  3241. 0,
  3242. 0,
  3243. 1,
  3244. 0,
  3245. 1,
  3246. ]);
  3247. return e.box(e.types.trex, n);
  3248. }),
  3249. (e.moof = function (t, i) {
  3250. return e.box(
  3251. e.types.moof,
  3252. e.mfhd(t.sequenceNumber),
  3253. e.traf(t, i)
  3254. );
  3255. }),
  3256. (e.mfhd = function (t) {
  3257. var i = new Uint8Array([
  3258. 0,
  3259. 0,
  3260. 0,
  3261. 0,
  3262. (t >>> 24) & 255,
  3263. (t >>> 16) & 255,
  3264. (t >>> 8) & 255,
  3265. 255 & t,
  3266. ]);
  3267. return e.box(e.types.mfhd, i);
  3268. }),
  3269. (e.traf = function (t, i) {
  3270. var n = t.id,
  3271. r = e.box(
  3272. e.types.tfhd,
  3273. new Uint8Array([
  3274. 0,
  3275. 0,
  3276. 0,
  3277. 0,
  3278. (n >>> 24) & 255,
  3279. (n >>> 16) & 255,
  3280. (n >>> 8) & 255,
  3281. 255 & n,
  3282. ])
  3283. ),
  3284. s = e.box(
  3285. e.types.tfdt,
  3286. new Uint8Array([
  3287. 0,
  3288. 0,
  3289. 0,
  3290. 0,
  3291. (i >>> 24) & 255,
  3292. (i >>> 16) & 255,
  3293. (i >>> 8) & 255,
  3294. 255 & i,
  3295. ])
  3296. ),
  3297. o = e.sdtp(t),
  3298. a = e.trun(t, o.byteLength + 16 + 16 + 8 + 16 + 8 + 8);
  3299. return e.box(e.types.traf, r, s, a, o);
  3300. }),
  3301. (e.sdtp = function (t) {
  3302. for (
  3303. var i = t.samples || [],
  3304. n = i.length,
  3305. r = new Uint8Array(4 + n),
  3306. s = 0;
  3307. s < n;
  3308. s++
  3309. ) {
  3310. var o = i[s].flags;
  3311. r[s + 4] =
  3312. (o.isLeading << 6) |
  3313. (o.dependsOn << 4) |
  3314. (o.isDependedOn << 2) |
  3315. o.hasRedundancy;
  3316. }
  3317. return e.box(e.types.sdtp, r);
  3318. }),
  3319. (e.trun = function (t, i) {
  3320. var n = t.samples || [],
  3321. r = n.length,
  3322. s = 12 + 16 * r,
  3323. o = new Uint8Array(s);
  3324. (i += 8 + s),
  3325. o.set(
  3326. [
  3327. 0,
  3328. 0,
  3329. 15,
  3330. 1,
  3331. (r >>> 24) & 255,
  3332. (r >>> 16) & 255,
  3333. (r >>> 8) & 255,
  3334. 255 & r,
  3335. (i >>> 24) & 255,
  3336. (i >>> 16) & 255,
  3337. (i >>> 8) & 255,
  3338. 255 & i,
  3339. ],
  3340. 0
  3341. );
  3342. for (var a = 0; a < r; a++) {
  3343. var h = n[a].duration,
  3344. u = n[a].size,
  3345. l = n[a].flags,
  3346. d = n[a].cts;
  3347. o.set(
  3348. [
  3349. (h >>> 24) & 255,
  3350. (h >>> 16) & 255,
  3351. (h >>> 8) & 255,
  3352. 255 & h,
  3353. (u >>> 24) & 255,
  3354. (u >>> 16) & 255,
  3355. (u >>> 8) & 255,
  3356. 255 & u,
  3357. (l.isLeading << 2) | l.dependsOn,
  3358. (l.isDependedOn << 6) |
  3359. (l.hasRedundancy << 4) |
  3360. l.isNonSync,
  3361. 0,
  3362. 0,
  3363. (d >>> 24) & 255,
  3364. (d >>> 16) & 255,
  3365. (d >>> 8) & 255,
  3366. 255 & d,
  3367. ],
  3368. 12 + 16 * a
  3369. );
  3370. }
  3371. return e.box(e.types.trun, o);
  3372. }),
  3373. (e.mdat = function (t) {
  3374. return e.box(e.types.mdat, t);
  3375. }),
  3376. e
  3377. );
  3378. })();
  3379. v.init();
  3380. var y = v,
  3381. b = (function () {
  3382. function e() {}
  3383. return (
  3384. (e.getSilentFrame = function (e, t) {
  3385. if ('mp4a.40.2' === e) {
  3386. if (1 === t)
  3387. return new Uint8Array([0, 200, 0, 128, 35, 128]);
  3388. if (2 === t)
  3389. return new Uint8Array([
  3390. 33, 0, 73, 144, 2, 25, 0, 35, 128,
  3391. ]);
  3392. if (3 === t)
  3393. return new Uint8Array([
  3394. 0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 142,
  3395. ]);
  3396. if (4 === t)
  3397. return new Uint8Array([
  3398. 0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 128, 44,
  3399. 128, 8, 2, 56,
  3400. ]);
  3401. if (5 === t)
  3402. return new Uint8Array([
  3403. 0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48,
  3404. 4, 153, 0, 33, 144, 2, 56,
  3405. ]);
  3406. if (6 === t)
  3407. return new Uint8Array([
  3408. 0, 200, 0, 128, 32, 132, 1, 38, 64, 8, 100, 0, 130, 48,
  3409. 4, 153, 0, 33, 144, 2, 0, 178, 0, 32, 8, 224,
  3410. ]);
  3411. } else {
  3412. if (1 === t)
  3413. return new Uint8Array([
  3414. 1, 64, 34, 128, 163, 78, 230, 128, 186, 8, 0, 0, 0, 28,
  3415. 6, 241, 193, 10, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3416. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3417. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3418. 90, 90, 94,
  3419. ]);
  3420. if (2 === t)
  3421. return new Uint8Array([
  3422. 1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0,
  3423. 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90,
  3424. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3425. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3426. 90, 90, 94,
  3427. ]);
  3428. if (3 === t)
  3429. return new Uint8Array([
  3430. 1, 64, 34, 128, 163, 94, 230, 128, 186, 8, 0, 0, 0, 0,
  3431. 149, 0, 6, 241, 161, 10, 90, 90, 90, 90, 90, 90, 90, 90,
  3432. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3433. 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90,
  3434. 90, 90, 94,
  3435. ]);
  3436. }
  3437. return null;
  3438. }),
  3439. e
  3440. );
  3441. })(),
  3442. E = i(51),
  3443. S = (function () {
  3444. function e(e) {
  3445. (this.TAG = 'MP4Remuxer'),
  3446. (this._config = e),
  3447. (this._isLive = !0 === e.isLive),
  3448. (this._dtsBase = -1),
  3449. (this._dtsBaseInited = !1),
  3450. (this._audioDtsBase = 1 / 0),
  3451. (this._videoDtsBase = 1 / 0),
  3452. (this._audioNextDts = void 0),
  3453. (this._videoNextDts = void 0),
  3454. (this._audioStashedLastSample = null),
  3455. (this._videoStashedLastSample = null),
  3456. (this._audioMeta = null),
  3457. (this._videoMeta = null),
  3458. (this._audioSegmentInfoList = new E.J1('audio')),
  3459. (this._videoSegmentInfoList = new E.J1('video')),
  3460. (this._onInitSegment = null),
  3461. (this._onMediaSegment = null),
  3462. (this._forceFirstIDR = !(
  3463. !o.Z.chrome ||
  3464. !(
  3465. o.Z.version.major < 50 ||
  3466. (50 === o.Z.version.major && o.Z.version.build < 2661)
  3467. )
  3468. )),
  3469. (this._fillSilentAfterSeek = o.Z.msedge || o.Z.msie),
  3470. (this._mp3UseMpegAudio = !o.Z.firefox),
  3471. (this._fillAudioTimestampGap =
  3472. this._config.fixAudioTimestampGap);
  3473. }
  3474. return (
  3475. (e.prototype.destroy = function () {
  3476. (this._dtsBase = -1),
  3477. (this._dtsBaseInited = !1),
  3478. (this._audioMeta = null),
  3479. (this._videoMeta = null),
  3480. this._audioSegmentInfoList.clear(),
  3481. (this._audioSegmentInfoList = null),
  3482. this._videoSegmentInfoList.clear(),
  3483. (this._videoSegmentInfoList = null),
  3484. (this._onInitSegment = null),
  3485. (this._onMediaSegment = null);
  3486. }),
  3487. (e.prototype.bindDataSource = function (e) {
  3488. return (
  3489. (e.onDataAvailable = this.remux.bind(this)),
  3490. (e.onTrackMetadata =
  3491. this._onTrackMetadataReceived.bind(this)),
  3492. this
  3493. );
  3494. }),
  3495. Object.defineProperty(e.prototype, 'onInitSegment', {
  3496. get: function () {
  3497. return this._onInitSegment;
  3498. },
  3499. set: function (e) {
  3500. this._onInitSegment = e;
  3501. },
  3502. enumerable: !1,
  3503. configurable: !0,
  3504. }),
  3505. Object.defineProperty(e.prototype, 'onMediaSegment', {
  3506. get: function () {
  3507. return this._onMediaSegment;
  3508. },
  3509. set: function (e) {
  3510. this._onMediaSegment = e;
  3511. },
  3512. enumerable: !1,
  3513. configurable: !0,
  3514. }),
  3515. (e.prototype.insertDiscontinuity = function () {
  3516. this._audioNextDts = this._videoNextDts = void 0;
  3517. }),
  3518. (e.prototype.seek = function (e) {
  3519. (this._audioStashedLastSample = null),
  3520. (this._videoStashedLastSample = null),
  3521. this._videoSegmentInfoList.clear(),
  3522. this._audioSegmentInfoList.clear();
  3523. }),
  3524. (e.prototype.remux = function (e, t) {
  3525. if (!this._onMediaSegment)
  3526. throw new d.rT(
  3527. 'MP4Remuxer: onMediaSegment callback must be specificed!'
  3528. );
  3529. this._dtsBaseInited || this._calculateDtsBase(e, t),
  3530. this._remuxVideo(t),
  3531. this._remuxAudio(e);
  3532. }),
  3533. (e.prototype._onTrackMetadataReceived = function (e, t) {
  3534. var i = null,
  3535. n = 'mp4',
  3536. r = t.codec;
  3537. if ('audio' === e)
  3538. (this._audioMeta = t),
  3539. 'mp3' === t.codec && this._mp3UseMpegAudio
  3540. ? ((n = 'mpeg'), (r = ''), (i = new Uint8Array()))
  3541. : (i = y.generateInitSegment(t));
  3542. else {
  3543. if ('video' !== e) return;
  3544. (this._videoMeta = t), (i = y.generateInitSegment(t));
  3545. }
  3546. if (!this._onInitSegment)
  3547. throw new d.rT(
  3548. 'MP4Remuxer: onInitSegment callback must be specified!'
  3549. );
  3550. this._onInitSegment(e, {
  3551. type: e,
  3552. data: i.buffer,
  3553. codec: r,
  3554. container: e + '/' + n,
  3555. mediaDuration: t.duration,
  3556. });
  3557. }),
  3558. (e.prototype._calculateDtsBase = function (e, t) {
  3559. this._dtsBaseInited ||
  3560. (e.samples &&
  3561. e.samples.length &&
  3562. (this._audioDtsBase = e.samples[0].dts),
  3563. t.samples &&
  3564. t.samples.length &&
  3565. (this._videoDtsBase = t.samples[0].dts),
  3566. (this._dtsBase = Math.min(
  3567. this._audioDtsBase,
  3568. this._videoDtsBase
  3569. )),
  3570. (this._dtsBaseInited = !0));
  3571. }),
  3572. (e.prototype.flushStashedSamples = function () {
  3573. var e = this._videoStashedLastSample,
  3574. t = this._audioStashedLastSample,
  3575. i = {
  3576. type: 'video',
  3577. id: 1,
  3578. sequenceNumber: 0,
  3579. samples: [],
  3580. length: 0,
  3581. };
  3582. null != e && (i.samples.push(e), (i.length = e.length));
  3583. var n = {
  3584. type: 'audio',
  3585. id: 2,
  3586. sequenceNumber: 0,
  3587. samples: [],
  3588. length: 0,
  3589. };
  3590. null != t && (n.samples.push(t), (n.length = t.length)),
  3591. (this._videoStashedLastSample = null),
  3592. (this._audioStashedLastSample = null),
  3593. this._remuxVideo(i, !0),
  3594. this._remuxAudio(n, !0);
  3595. }),
  3596. (e.prototype._remuxAudio = function (e, t) {
  3597. if (null != this._audioMeta) {
  3598. var i,
  3599. n = e,
  3600. r = n.samples,
  3601. a = void 0,
  3602. h = -1,
  3603. u = this._audioMeta.refSampleDuration,
  3604. l =
  3605. 'mp3' === this._audioMeta.codec &&
  3606. this._mp3UseMpegAudio,
  3607. d = this._dtsBaseInited && void 0 === this._audioNextDts,
  3608. c = !1;
  3609. if (r && 0 !== r.length && (1 !== r.length || t)) {
  3610. var f = 0,
  3611. _ = null,
  3612. p = 0;
  3613. l
  3614. ? ((f = 0), (p = n.length))
  3615. : ((f = 8), (p = 8 + n.length));
  3616. var m = null;
  3617. if (
  3618. (r.length > 1 && (p -= (m = r.pop()).length),
  3619. null != this._audioStashedLastSample)
  3620. ) {
  3621. var g = this._audioStashedLastSample;
  3622. (this._audioStashedLastSample = null),
  3623. r.unshift(g),
  3624. (p += g.length);
  3625. }
  3626. null != m && (this._audioStashedLastSample = m);
  3627. var v = r[0].dts - this._dtsBase;
  3628. if (this._audioNextDts) a = v - this._audioNextDts;
  3629. else if (this._audioSegmentInfoList.isEmpty())
  3630. (a = 0),
  3631. this._fillSilentAfterSeek &&
  3632. !this._videoSegmentInfoList.isEmpty() &&
  3633. 'mp3' !== this._audioMeta.originalCodec &&
  3634. (c = !0);
  3635. else {
  3636. var S =
  3637. this._audioSegmentInfoList.getLastSampleBefore(v);
  3638. if (null != S) {
  3639. var A = v - (S.originalDts + S.duration);
  3640. A <= 3 && (A = 0), (a = v - (S.dts + S.duration + A));
  3641. } else a = 0;
  3642. }
  3643. if (c) {
  3644. var L = v - a,
  3645. R =
  3646. this._videoSegmentInfoList.getLastSegmentBefore(v);
  3647. if (null != R && R.beginDts < L) {
  3648. if (
  3649. (P = b.getSilentFrame(
  3650. this._audioMeta.originalCodec,
  3651. this._audioMeta.channelCount
  3652. ))
  3653. ) {
  3654. var w = R.beginDts,
  3655. O = L - R.beginDts;
  3656. s.Z.v(
  3657. this.TAG,
  3658. 'InsertPrefixSilentAudio: dts: ' +
  3659. w +
  3660. ', duration: ' +
  3661. O
  3662. ),
  3663. r.unshift({ unit: P, dts: w, pts: w }),
  3664. (p += P.byteLength);
  3665. }
  3666. } else c = !1;
  3667. }
  3668. for (var T = [], C = 0; C < r.length; C++) {
  3669. var k = (g = r[C]).unit,
  3670. D = g.dts - this._dtsBase,
  3671. I = ((w = D), !1),
  3672. M = null,
  3673. B = 0;
  3674. if (!(D < -0.001)) {
  3675. if ('mp3' !== this._audioMeta.codec) {
  3676. var x = D;
  3677. if (
  3678. (this._audioNextDts && (x = this._audioNextDts),
  3679. (a = D - x) <= -3 * u)
  3680. ) {
  3681. s.Z.w(
  3682. this.TAG,
  3683. 'Dropping 1 audio frame (originalDts: ' +
  3684. D +
  3685. ' ms ,curRefDts: ' +
  3686. x +
  3687. ' ms) due to dtsCorrection: ' +
  3688. a +
  3689. ' ms overlap.'
  3690. );
  3691. continue;
  3692. }
  3693. if (
  3694. a >= 3 * u &&
  3695. this._fillAudioTimestampGap &&
  3696. !o.Z.safari
  3697. ) {
  3698. I = !0;
  3699. var P,
  3700. U = Math.floor(a / u);
  3701. s.Z.w(
  3702. this.TAG,
  3703. 'Large audio timestamp gap detected, may cause AV sync to drift. Silent frames will be generated to avoid unsync.\noriginalDts: ' +
  3704. D +
  3705. ' ms, curRefDts: ' +
  3706. x +
  3707. ' ms, dtsCorrection: ' +
  3708. Math.round(a) +
  3709. ' ms, generate: ' +
  3710. U +
  3711. ' frames'
  3712. ),
  3713. (w = Math.floor(x)),
  3714. (B = Math.floor(x + u) - w),
  3715. null ==
  3716. (P = b.getSilentFrame(
  3717. this._audioMeta.originalCodec,
  3718. this._audioMeta.channelCount
  3719. )) &&
  3720. (s.Z.w(
  3721. this.TAG,
  3722. 'Unable to generate silent frame for ' +
  3723. this._audioMeta.originalCodec +
  3724. ' with ' +
  3725. this._audioMeta.channelCount +
  3726. ' channels, repeat last frame'
  3727. ),
  3728. (P = k)),
  3729. (M = []);
  3730. for (var N = 0; N < U; N++) {
  3731. x += u;
  3732. var Z = Math.floor(x),
  3733. F = Math.floor(x + u) - Z,
  3734. G = {
  3735. dts: Z,
  3736. pts: Z,
  3737. cts: 0,
  3738. unit: P,
  3739. size: P.byteLength,
  3740. duration: F,
  3741. originalDts: D,
  3742. flags: {
  3743. isLeading: 0,
  3744. dependsOn: 1,
  3745. isDependedOn: 0,
  3746. hasRedundancy: 0,
  3747. },
  3748. };
  3749. M.push(G), (p += G.size);
  3750. }
  3751. this._audioNextDts = x + u;
  3752. } else
  3753. (w = Math.floor(x)),
  3754. (B = Math.floor(x + u) - w),
  3755. (this._audioNextDts = x + u);
  3756. } else {
  3757. if (((w = D - a), C !== r.length - 1))
  3758. B = r[C + 1].dts - this._dtsBase - a - w;
  3759. else if (null != m)
  3760. B = m.dts - this._dtsBase - a - w;
  3761. else
  3762. B =
  3763. T.length >= 1
  3764. ? T[T.length - 1].duration
  3765. : Math.floor(u);
  3766. this._audioNextDts = w + B;
  3767. }
  3768. -1 === h && (h = w),
  3769. T.push({
  3770. dts: w,
  3771. pts: w,
  3772. cts: 0,
  3773. unit: g.unit,
  3774. size: g.unit.byteLength,
  3775. duration: B,
  3776. originalDts: D,
  3777. flags: {
  3778. isLeading: 0,
  3779. dependsOn: 1,
  3780. isDependedOn: 0,
  3781. hasRedundancy: 0,
  3782. },
  3783. }),
  3784. I && T.push.apply(T, M);
  3785. }
  3786. }
  3787. if (0 === T.length)
  3788. return (n.samples = []), void (n.length = 0);
  3789. l
  3790. ? (_ = new Uint8Array(p))
  3791. : (((_ = new Uint8Array(p))[0] = (p >>> 24) & 255),
  3792. (_[1] = (p >>> 16) & 255),
  3793. (_[2] = (p >>> 8) & 255),
  3794. (_[3] = 255 & p),
  3795. _.set(y.types.mdat, 4));
  3796. for (C = 0; C < T.length; C++) {
  3797. k = T[C].unit;
  3798. _.set(k, f), (f += k.byteLength);
  3799. }
  3800. var j = T[T.length - 1];
  3801. i = j.dts + j.duration;
  3802. var V = new E.Yy();
  3803. (V.beginDts = h),
  3804. (V.endDts = i),
  3805. (V.beginPts = h),
  3806. (V.endPts = i),
  3807. (V.originalBeginDts = T[0].originalDts),
  3808. (V.originalEndDts = j.originalDts + j.duration),
  3809. (V.firstSample = new E.Wk(
  3810. T[0].dts,
  3811. T[0].pts,
  3812. T[0].duration,
  3813. T[0].originalDts,
  3814. !1
  3815. )),
  3816. (V.lastSample = new E.Wk(
  3817. j.dts,
  3818. j.pts,
  3819. j.duration,
  3820. j.originalDts,
  3821. !1
  3822. )),
  3823. this._isLive || this._audioSegmentInfoList.append(V),
  3824. (n.samples = T),
  3825. n.sequenceNumber++;
  3826. var z = null;
  3827. (z = l ? new Uint8Array() : y.moof(n, h)),
  3828. (n.samples = []),
  3829. (n.length = 0);
  3830. var K = {
  3831. type: 'audio',
  3832. data: this._mergeBoxes(z, _).buffer,
  3833. sampleCount: T.length,
  3834. info: V,
  3835. };
  3836. l && d && (K.timestampOffset = h),
  3837. this._onMediaSegment('audio', K);
  3838. }
  3839. }
  3840. }),
  3841. (e.prototype._remuxVideo = function (e, t) {
  3842. if (null != this._videoMeta) {
  3843. var i,
  3844. n,
  3845. r = e,
  3846. s = r.samples,
  3847. o = void 0,
  3848. a = -1,
  3849. h = -1;
  3850. if (s && 0 !== s.length && (1 !== s.length || t)) {
  3851. var u = 8,
  3852. l = null,
  3853. d = 8 + e.length,
  3854. c = null;
  3855. if (
  3856. (s.length > 1 && (d -= (c = s.pop()).length),
  3857. null != this._videoStashedLastSample)
  3858. ) {
  3859. var f = this._videoStashedLastSample;
  3860. (this._videoStashedLastSample = null),
  3861. s.unshift(f),
  3862. (d += f.length);
  3863. }
  3864. null != c && (this._videoStashedLastSample = c);
  3865. var _ = s[0].dts - this._dtsBase;
  3866. if (this._videoNextDts) o = _ - this._videoNextDts;
  3867. else if (this._videoSegmentInfoList.isEmpty()) o = 0;
  3868. else {
  3869. var p =
  3870. this._videoSegmentInfoList.getLastSampleBefore(_);
  3871. if (null != p) {
  3872. var m = _ - (p.originalDts + p.duration);
  3873. m <= 3 && (m = 0), (o = _ - (p.dts + p.duration + m));
  3874. } else o = 0;
  3875. }
  3876. for (
  3877. var g = new E.Yy(), v = [], b = 0;
  3878. b < s.length;
  3879. b++
  3880. ) {
  3881. var S = (f = s[b]).dts - this._dtsBase,
  3882. A = f.isKeyframe,
  3883. L = S - o,
  3884. R = f.cts,
  3885. w = L + R;
  3886. -1 === a && ((a = L), (h = w));
  3887. var O = 0;
  3888. if (b !== s.length - 1)
  3889. O = s[b + 1].dts - this._dtsBase - o - L;
  3890. else if (null != c) O = c.dts - this._dtsBase - o - L;
  3891. else
  3892. O =
  3893. v.length >= 1
  3894. ? v[v.length - 1].duration
  3895. : Math.floor(this._videoMeta.refSampleDuration);
  3896. if (A) {
  3897. var T = new E.Wk(L, w, O, f.dts, !0);
  3898. (T.fileposition = f.fileposition),
  3899. g.appendSyncPoint(T);
  3900. }
  3901. v.push({
  3902. dts: L,
  3903. pts: w,
  3904. cts: R,
  3905. units: f.units,
  3906. size: f.length,
  3907. isKeyframe: A,
  3908. duration: O,
  3909. originalDts: S,
  3910. flags: {
  3911. isLeading: 0,
  3912. dependsOn: A ? 2 : 1,
  3913. isDependedOn: A ? 1 : 0,
  3914. hasRedundancy: 0,
  3915. isNonSync: A ? 0 : 1,
  3916. },
  3917. });
  3918. }
  3919. ((l = new Uint8Array(d))[0] = (d >>> 24) & 255),
  3920. (l[1] = (d >>> 16) & 255),
  3921. (l[2] = (d >>> 8) & 255),
  3922. (l[3] = 255 & d),
  3923. l.set(y.types.mdat, 4);
  3924. for (b = 0; b < v.length; b++)
  3925. for (var C = v[b].units; C.length; ) {
  3926. var k = C.shift().data;
  3927. l.set(k, u), (u += k.byteLength);
  3928. }
  3929. var D = v[v.length - 1];
  3930. if (
  3931. ((i = D.dts + D.duration),
  3932. (n = D.pts + D.duration),
  3933. (this._videoNextDts = i),
  3934. (g.beginDts = a),
  3935. (g.endDts = i),
  3936. (g.beginPts = h),
  3937. (g.endPts = n),
  3938. (g.originalBeginDts = v[0].originalDts),
  3939. (g.originalEndDts = D.originalDts + D.duration),
  3940. (g.firstSample = new E.Wk(
  3941. v[0].dts,
  3942. v[0].pts,
  3943. v[0].duration,
  3944. v[0].originalDts,
  3945. v[0].isKeyframe
  3946. )),
  3947. (g.lastSample = new E.Wk(
  3948. D.dts,
  3949. D.pts,
  3950. D.duration,
  3951. D.originalDts,
  3952. D.isKeyframe
  3953. )),
  3954. this._isLive || this._videoSegmentInfoList.append(g),
  3955. (r.samples = v),
  3956. r.sequenceNumber++,
  3957. this._forceFirstIDR)
  3958. ) {
  3959. var I = v[0].flags;
  3960. (I.dependsOn = 2), (I.isNonSync = 0);
  3961. }
  3962. var M = y.moof(r, a);
  3963. (r.samples = []),
  3964. (r.length = 0),
  3965. this._onMediaSegment('video', {
  3966. type: 'video',
  3967. data: this._mergeBoxes(M, l).buffer,
  3968. sampleCount: v.length,
  3969. info: g,
  3970. });
  3971. }
  3972. }
  3973. }),
  3974. (e.prototype._mergeBoxes = function (e, t) {
  3975. var i = new Uint8Array(e.byteLength + t.byteLength);
  3976. return i.set(e, 0), i.set(t, e.byteLength), i;
  3977. }),
  3978. e
  3979. );
  3980. })(),
  3981. A = i(191),
  3982. L = i(257),
  3983. R = (function () {
  3984. function e(e, t) {
  3985. (this.TAG = 'TransmuxingController'),
  3986. (this._emitter = new (r())()),
  3987. (this._config = t),
  3988. e.segments ||
  3989. (e.segments = [
  3990. {
  3991. duration: e.duration,
  3992. filesize: e.filesize,
  3993. url: e.url,
  3994. },
  3995. ]),
  3996. 'boolean' != typeof e.cors && (e.cors = !0),
  3997. 'boolean' != typeof e.withCredentials &&
  3998. (e.withCredentials = !1),
  3999. (this._mediaDataSource = e),
  4000. (this._currentSegmentIndex = 0);
  4001. var i = 0;
  4002. this._mediaDataSource.segments.forEach(function (n) {
  4003. (n.timestampBase = i),
  4004. (i += n.duration),
  4005. (n.cors = e.cors),
  4006. (n.withCredentials = e.withCredentials),
  4007. t.referrerPolicy && (n.referrerPolicy = t.referrerPolicy);
  4008. }),
  4009. isNaN(i) ||
  4010. this._mediaDataSource.duration === i ||
  4011. (this._mediaDataSource.duration = i),
  4012. (this._mediaInfo = null),
  4013. (this._demuxer = null),
  4014. (this._remuxer = null),
  4015. (this._ioctl = null),
  4016. (this._pendingSeekTime = null),
  4017. (this._pendingResolveSeekPoint = null),
  4018. (this._statisticsReporter = null);
  4019. }
  4020. return (
  4021. (e.prototype.destroy = function () {
  4022. (this._mediaInfo = null),
  4023. (this._mediaDataSource = null),
  4024. this._statisticsReporter &&
  4025. this._disableStatisticsReporter(),
  4026. this._ioctl &&
  4027. (this._ioctl.destroy(), (this._ioctl = null)),
  4028. this._demuxer &&
  4029. (this._demuxer.destroy(), (this._demuxer = null)),
  4030. this._remuxer &&
  4031. (this._remuxer.destroy(), (this._remuxer = null)),
  4032. this._emitter.removeAllListeners(),
  4033. (this._emitter = null);
  4034. }),
  4035. (e.prototype.on = function (e, t) {
  4036. this._emitter.addListener(e, t);
  4037. }),
  4038. (e.prototype.off = function (e, t) {
  4039. this._emitter.removeListener(e, t);
  4040. }),
  4041. (e.prototype.start = function () {
  4042. this._loadSegment(0), this._enableStatisticsReporter();
  4043. }),
  4044. (e.prototype._loadSegment = function (e, t) {
  4045. this._currentSegmentIndex = e;
  4046. var i = this._mediaDataSource.segments[e],
  4047. n = (this._ioctl = new A.Z(i, this._config, e));
  4048. (n.onError = this._onIOException.bind(this)),
  4049. (n.onSeeked = this._onIOSeeked.bind(this)),
  4050. (n.onComplete = this._onIOComplete.bind(this)),
  4051. (n.onRedirect = this._onIORedirect.bind(this)),
  4052. (n.onRecoveredEarlyEof =
  4053. this._onIORecoveredEarlyEof.bind(this)),
  4054. t
  4055. ? this._demuxer.bindDataSource(this._ioctl)
  4056. : (n.onDataArrival = this._onInitChunkArrival.bind(this)),
  4057. n.open(t);
  4058. }),
  4059. (e.prototype.stop = function () {
  4060. this._internalAbort(), this._disableStatisticsReporter();
  4061. }),
  4062. (e.prototype._internalAbort = function () {
  4063. this._ioctl && (this._ioctl.destroy(), (this._ioctl = null));
  4064. }),
  4065. (e.prototype.pause = function () {
  4066. this._ioctl &&
  4067. this._ioctl.isWorking() &&
  4068. (this._ioctl.pause(), this._disableStatisticsReporter());
  4069. }),
  4070. (e.prototype.resume = function () {
  4071. this._ioctl &&
  4072. this._ioctl.isPaused() &&
  4073. (this._ioctl.resume(), this._enableStatisticsReporter());
  4074. }),
  4075. (e.prototype.seek = function (e) {
  4076. if (null != this._mediaInfo && this._mediaInfo.isSeekable()) {
  4077. var t = this._searchSegmentIndexContains(e);
  4078. if (t === this._currentSegmentIndex) {
  4079. var i = this._mediaInfo.segments[t];
  4080. if (null == i) this._pendingSeekTime = e;
  4081. else {
  4082. var n = i.getNearestKeyframe(e);
  4083. this._remuxer.seek(n.milliseconds),
  4084. this._ioctl.seek(n.fileposition),
  4085. (this._pendingResolveSeekPoint = n.milliseconds);
  4086. }
  4087. } else {
  4088. var r = this._mediaInfo.segments[t];
  4089. if (null == r)
  4090. (this._pendingSeekTime = e),
  4091. this._internalAbort(),
  4092. this._remuxer.seek(),
  4093. this._remuxer.insertDiscontinuity(),
  4094. this._loadSegment(t);
  4095. else {
  4096. n = r.getNearestKeyframe(e);
  4097. this._internalAbort(),
  4098. this._remuxer.seek(e),
  4099. this._remuxer.insertDiscontinuity(),
  4100. this._demuxer.resetMediaInfo(),
  4101. (this._demuxer.timestampBase =
  4102. this._mediaDataSource.segments[t].timestampBase),
  4103. this._loadSegment(t, n.fileposition),
  4104. (this._pendingResolveSeekPoint = n.milliseconds),
  4105. this._reportSegmentMediaInfo(t);
  4106. }
  4107. }
  4108. this._enableStatisticsReporter();
  4109. }
  4110. }),
  4111. (e.prototype._searchSegmentIndexContains = function (e) {
  4112. for (
  4113. var t = this._mediaDataSource.segments,
  4114. i = t.length - 1,
  4115. n = 0;
  4116. n < t.length;
  4117. n++
  4118. )
  4119. if (e < t[n].timestampBase) {
  4120. i = n - 1;
  4121. break;
  4122. }
  4123. return i;
  4124. }),
  4125. (e.prototype._onInitChunkArrival = function (e, t) {
  4126. var i = this,
  4127. n = null,
  4128. r = 0;
  4129. if (t > 0)
  4130. this._demuxer.bindDataSource(this._ioctl),
  4131. (this._demuxer.timestampBase =
  4132. this._mediaDataSource.segments[
  4133. this._currentSegmentIndex
  4134. ].timestampBase),
  4135. (r = this._demuxer.parseChunks(e, t));
  4136. else if ((n = g.probe(e)).match) {
  4137. (this._demuxer = new g(n, this._config)),
  4138. this._remuxer || (this._remuxer = new S(this._config));
  4139. var o = this._mediaDataSource;
  4140. null == o.duration ||
  4141. isNaN(o.duration) ||
  4142. (this._demuxer.overridedDuration = o.duration),
  4143. 'boolean' == typeof o.hasAudio &&
  4144. (this._demuxer.overridedHasAudio = o.hasAudio),
  4145. 'boolean' == typeof o.hasVideo &&
  4146. (this._demuxer.overridedHasVideo = o.hasVideo),
  4147. (this._demuxer.timestampBase =
  4148. o.segments[this._currentSegmentIndex].timestampBase),
  4149. (this._demuxer.onError =
  4150. this._onDemuxException.bind(this)),
  4151. (this._demuxer.onMediaInfo =
  4152. this._onMediaInfo.bind(this)),
  4153. (this._demuxer.onMetaDataArrived =
  4154. this._onMetaDataArrived.bind(this)),
  4155. (this._demuxer.onScriptDataArrived =
  4156. this._onScriptDataArrived.bind(this)),
  4157. this._remuxer.bindDataSource(
  4158. this._demuxer.bindDataSource(this._ioctl)
  4159. ),
  4160. (this._remuxer.onInitSegment =
  4161. this._onRemuxerInitSegmentArrival.bind(this)),
  4162. (this._remuxer.onMediaSegment =
  4163. this._onRemuxerMediaSegmentArrival.bind(this)),
  4164. (r = this._demuxer.parseChunks(e, t));
  4165. } else
  4166. (n = null),
  4167. s.Z.e(this.TAG, 'Non-FLV, Unsupported media type!'),
  4168. Promise.resolve().then(function () {
  4169. i._internalAbort();
  4170. }),
  4171. this._emitter.emit(
  4172. L.Z.DEMUX_ERROR,
  4173. m.Z.FORMAT_UNSUPPORTED,
  4174. 'Non-FLV, Unsupported media type'
  4175. ),
  4176. (r = 0);
  4177. return r;
  4178. }),
  4179. (e.prototype._onMediaInfo = function (e) {
  4180. var t = this;
  4181. null == this._mediaInfo &&
  4182. ((this._mediaInfo = Object.assign({}, e)),
  4183. (this._mediaInfo.keyframesIndex = null),
  4184. (this._mediaInfo.segments = []),
  4185. (this._mediaInfo.segmentCount =
  4186. this._mediaDataSource.segments.length),
  4187. Object.setPrototypeOf(this._mediaInfo, a.Z.prototype));
  4188. var i = Object.assign({}, e);
  4189. Object.setPrototypeOf(i, a.Z.prototype),
  4190. (this._mediaInfo.segments[this._currentSegmentIndex] = i),
  4191. this._reportSegmentMediaInfo(this._currentSegmentIndex),
  4192. null != this._pendingSeekTime &&
  4193. Promise.resolve().then(function () {
  4194. var e = t._pendingSeekTime;
  4195. (t._pendingSeekTime = null), t.seek(e);
  4196. });
  4197. }),
  4198. (e.prototype._onMetaDataArrived = function (e) {
  4199. this._emitter.emit(L.Z.METADATA_ARRIVED, e);
  4200. }),
  4201. (e.prototype._onScriptDataArrived = function (e) {
  4202. this._emitter.emit(L.Z.SCRIPTDATA_ARRIVED, e);
  4203. }),
  4204. (e.prototype._onIOSeeked = function () {
  4205. this._remuxer.insertDiscontinuity();
  4206. }),
  4207. (e.prototype._onIOComplete = function (e) {
  4208. var t = e + 1;
  4209. t < this._mediaDataSource.segments.length
  4210. ? (this._internalAbort(),
  4211. this._remuxer.flushStashedSamples(),
  4212. this._loadSegment(t))
  4213. : (this._remuxer.flushStashedSamples(),
  4214. this._emitter.emit(L.Z.LOADING_COMPLETE),
  4215. this._disableStatisticsReporter());
  4216. }),
  4217. (e.prototype._onIORedirect = function (e) {
  4218. var t = this._ioctl.extraData;
  4219. this._mediaDataSource.segments[t].redirectedURL = e;
  4220. }),
  4221. (e.prototype._onIORecoveredEarlyEof = function () {
  4222. this._emitter.emit(L.Z.RECOVERED_EARLY_EOF);
  4223. }),
  4224. (e.prototype._onIOException = function (e, t) {
  4225. s.Z.e(
  4226. this.TAG,
  4227. 'IOException: type = ' +
  4228. e +
  4229. ', code = ' +
  4230. t.code +
  4231. ', msg = ' +
  4232. t.msg
  4233. ),
  4234. this._emitter.emit(L.Z.IO_ERROR, e, t),
  4235. this._disableStatisticsReporter();
  4236. }),
  4237. (e.prototype._onDemuxException = function (e, t) {
  4238. s.Z.e(
  4239. this.TAG,
  4240. 'DemuxException: type = ' + e + ', info = ' + t
  4241. ),
  4242. this._emitter.emit(L.Z.DEMUX_ERROR, e, t);
  4243. }),
  4244. (e.prototype._onRemuxerInitSegmentArrival = function (e, t) {
  4245. this._emitter.emit(L.Z.INIT_SEGMENT, e, t);
  4246. }),
  4247. (e.prototype._onRemuxerMediaSegmentArrival = function (e, t) {
  4248. if (
  4249. null == this._pendingSeekTime &&
  4250. (this._emitter.emit(L.Z.MEDIA_SEGMENT, e, t),
  4251. null != this._pendingResolveSeekPoint && 'video' === e)
  4252. ) {
  4253. var i = t.info.syncPoints,
  4254. n = this._pendingResolveSeekPoint;
  4255. (this._pendingResolveSeekPoint = null),
  4256. o.Z.safari &&
  4257. i.length > 0 &&
  4258. i[0].originalDts === n &&
  4259. (n = i[0].pts),
  4260. this._emitter.emit(L.Z.RECOMMEND_SEEKPOINT, n);
  4261. }
  4262. }),
  4263. (e.prototype._enableStatisticsReporter = function () {
  4264. null == this._statisticsReporter &&
  4265. (this._statisticsReporter = self.setInterval(
  4266. this._reportStatisticsInfo.bind(this),
  4267. this._config.statisticsInfoReportInterval
  4268. ));
  4269. }),
  4270. (e.prototype._disableStatisticsReporter = function () {
  4271. this._statisticsReporter &&
  4272. (self.clearInterval(this._statisticsReporter),
  4273. (this._statisticsReporter = null));
  4274. }),
  4275. (e.prototype._reportSegmentMediaInfo = function (e) {
  4276. var t = this._mediaInfo.segments[e],
  4277. i = Object.assign({}, t);
  4278. (i.duration = this._mediaInfo.duration),
  4279. (i.segmentCount = this._mediaInfo.segmentCount),
  4280. delete i.segments,
  4281. delete i.keyframesIndex,
  4282. this._emitter.emit(L.Z.MEDIA_INFO, i);
  4283. }),
  4284. (e.prototype._reportStatisticsInfo = function () {
  4285. var e = {};
  4286. (e.url = this._ioctl.currentURL),
  4287. (e.hasRedirect = this._ioctl.hasRedirect),
  4288. e.hasRedirect &&
  4289. (e.redirectedURL = this._ioctl.currentRedirectedURL),
  4290. (e.speed = this._ioctl.currentSpeed),
  4291. (e.loaderType = this._ioctl.loaderType),
  4292. (e.currentSegmentIndex = this._currentSegmentIndex),
  4293. (e.totalSegmentCount =
  4294. this._mediaDataSource.segments.length),
  4295. this._emitter.emit(L.Z.STATISTICS_INFO, e);
  4296. }),
  4297. e
  4298. );
  4299. })();
  4300. },
  4301. 257: function (e, t) {
  4302. 'use strict';
  4303. t.Z = {
  4304. IO_ERROR: 'io_error',
  4305. DEMUX_ERROR: 'demux_error',
  4306. INIT_SEGMENT: 'init_segment',
  4307. MEDIA_SEGMENT: 'media_segment',
  4308. LOADING_COMPLETE: 'loading_complete',
  4309. RECOVERED_EARLY_EOF: 'recovered_early_eof',
  4310. MEDIA_INFO: 'media_info',
  4311. METADATA_ARRIVED: 'metadata_arrived',
  4312. SCRIPTDATA_ARRIVED: 'scriptdata_arrived',
  4313. STATISTICS_INFO: 'statistics_info',
  4314. RECOMMEND_SEEKPOINT: 'recommend_seekpoint',
  4315. };
  4316. },
  4317. 82: function (e, t, i) {
  4318. 'use strict';
  4319. i(846), i(219), i(949), i(257);
  4320. },
  4321. 600: function (e, t) {
  4322. 'use strict';
  4323. t.Z = {
  4324. OK: 'OK',
  4325. FORMAT_ERROR: 'FormatError',
  4326. FORMAT_UNSUPPORTED: 'FormatUnsupported',
  4327. CODEC_UNSUPPORTED: 'CodecUnsupported',
  4328. };
  4329. },
  4330. 60: function (e, t, i) {
  4331. 'use strict';
  4332. i.d(t, {
  4333. default: function () {
  4334. return D;
  4335. },
  4336. });
  4337. var n = i(219),
  4338. r = i(191),
  4339. s = {
  4340. enableWorker: !1,
  4341. enableStashBuffer: !0,
  4342. stashInitialSize: void 0,
  4343. isLive: !1,
  4344. lazyLoad: !0,
  4345. lazyLoadMaxDuration: 180,
  4346. lazyLoadRecoverDuration: 30,
  4347. deferLoadAfterSourceOpen: !0,
  4348. autoCleanupMaxBackwardDuration: 180,
  4349. autoCleanupMinBackwardDuration: 120,
  4350. statisticsInfoReportInterval: 600,
  4351. fixAudioTimestampGap: !0,
  4352. accurateSeek: !1,
  4353. seekType: 'range',
  4354. seekParamStart: 'bstart',
  4355. seekParamEnd: 'bend',
  4356. rangeLoadZeroStart: !1,
  4357. customSeekHandler: void 0,
  4358. reuseRedirectedURL: !1,
  4359. headers: void 0,
  4360. customLoader: void 0,
  4361. };
  4362. function o() {
  4363. return Object.assign({}, s);
  4364. }
  4365. var a = (function () {
  4366. function e() {}
  4367. return (
  4368. (e.supportMSEH264Playback = function () {
  4369. return (
  4370. window.MediaSource &&
  4371. window.MediaSource.isTypeSupported(
  4372. 'video/mp4; codecs="avc1.42E01E,mp4a.40.2"'
  4373. )
  4374. );
  4375. }),
  4376. (e.supportNetworkStreamIO = function () {
  4377. var e = new r.Z({}, o()),
  4378. t = e.loaderType;
  4379. return (
  4380. e.destroy(),
  4381. 'fetch-stream-loader' == t || 'xhr-moz-chunked-loader' == t
  4382. );
  4383. }),
  4384. (e.getNetworkLoaderTypeName = function () {
  4385. var e = new r.Z({}, o()),
  4386. t = e.loaderType;
  4387. return e.destroy(), t;
  4388. }),
  4389. (e.supportNativeMediaPlayback = function (t) {
  4390. null == e.videoElement &&
  4391. (e.videoElement = window.document.createElement('video'));
  4392. var i = e.videoElement.canPlayType(t);
  4393. return 'probably' === i || 'maybe' == i;
  4394. }),
  4395. (e.getFeatureList = function () {
  4396. var t = {
  4397. mseFlvPlayback: !1,
  4398. mseLiveFlvPlayback: !1,
  4399. networkStreamIO: !1,
  4400. networkLoaderName: '',
  4401. nativeMP4H264Playback: !1,
  4402. nativeWebmVP8Playback: !1,
  4403. nativeWebmVP9Playback: !1,
  4404. };
  4405. return (
  4406. (t.mseFlvPlayback = e.supportMSEH264Playback()),
  4407. (t.networkStreamIO = e.supportNetworkStreamIO()),
  4408. (t.networkLoaderName = e.getNetworkLoaderTypeName()),
  4409. (t.mseLiveFlvPlayback =
  4410. t.mseFlvPlayback && t.networkStreamIO),
  4411. (t.nativeMP4H264Playback = e.supportNativeMediaPlayback(
  4412. 'video/mp4; codecs="avc1.42001E, mp4a.40.2"'
  4413. )),
  4414. (t.nativeWebmVP8Playback = e.supportNativeMediaPlayback(
  4415. 'video/webm; codecs="vp8.0, vorbis"'
  4416. )),
  4417. (t.nativeWebmVP9Playback = e.supportNativeMediaPlayback(
  4418. 'video/webm; codecs="vp9"'
  4419. )),
  4420. t
  4421. );
  4422. }),
  4423. e
  4424. );
  4425. })(),
  4426. h = i(939),
  4427. u = i(716),
  4428. l = i.n(u),
  4429. d = i(300),
  4430. c = i(538),
  4431. f = {
  4432. ERROR: 'error',
  4433. LOADING_COMPLETE: 'loading_complete',
  4434. RECOVERED_EARLY_EOF: 'recovered_early_eof',
  4435. MEDIA_INFO: 'media_info',
  4436. METADATA_ARRIVED: 'metadata_arrived',
  4437. SCRIPTDATA_ARRIVED: 'scriptdata_arrived',
  4438. STATISTICS_INFO: 'statistics_info',
  4439. },
  4440. _ = i(397),
  4441. p = i.n(_),
  4442. m = i(846),
  4443. g = i(949),
  4444. v = i(257),
  4445. y = i(118),
  4446. b = (function () {
  4447. function e(e, t) {
  4448. if (
  4449. ((this.TAG = 'Transmuxer'),
  4450. (this._emitter = new (l())()),
  4451. t.enableWorker && 'undefined' != typeof Worker)
  4452. )
  4453. try {
  4454. (this._worker = p()(82)),
  4455. (this._workerDestroying = !1),
  4456. this._worker.addEventListener(
  4457. 'message',
  4458. this._onWorkerMessage.bind(this)
  4459. ),
  4460. this._worker.postMessage({ cmd: 'init', param: [e, t] }),
  4461. (this.e = {
  4462. onLoggingConfigChanged:
  4463. this._onLoggingConfigChanged.bind(this),
  4464. }),
  4465. m.Z.registerListener(this.e.onLoggingConfigChanged),
  4466. this._worker.postMessage({
  4467. cmd: 'logging_config',
  4468. param: m.Z.getConfig(),
  4469. });
  4470. } catch (i) {
  4471. d.Z.e(
  4472. this.TAG,
  4473. 'Error while initialize transmuxing worker, fallback to inline transmuxing'
  4474. ),
  4475. (this._worker = null),
  4476. (this._controller = new g.Z(e, t));
  4477. }
  4478. else this._controller = new g.Z(e, t);
  4479. if (this._controller) {
  4480. var i = this._controller;
  4481. i.on(v.Z.IO_ERROR, this._onIOError.bind(this)),
  4482. i.on(v.Z.DEMUX_ERROR, this._onDemuxError.bind(this)),
  4483. i.on(v.Z.INIT_SEGMENT, this._onInitSegment.bind(this)),
  4484. i.on(v.Z.MEDIA_SEGMENT, this._onMediaSegment.bind(this)),
  4485. i.on(
  4486. v.Z.LOADING_COMPLETE,
  4487. this._onLoadingComplete.bind(this)
  4488. ),
  4489. i.on(
  4490. v.Z.RECOVERED_EARLY_EOF,
  4491. this._onRecoveredEarlyEof.bind(this)
  4492. ),
  4493. i.on(v.Z.MEDIA_INFO, this._onMediaInfo.bind(this)),
  4494. i.on(
  4495. v.Z.METADATA_ARRIVED,
  4496. this._onMetaDataArrived.bind(this)
  4497. ),
  4498. i.on(
  4499. v.Z.SCRIPTDATA_ARRIVED,
  4500. this._onScriptDataArrived.bind(this)
  4501. ),
  4502. i.on(
  4503. v.Z.STATISTICS_INFO,
  4504. this._onStatisticsInfo.bind(this)
  4505. ),
  4506. i.on(
  4507. v.Z.RECOMMEND_SEEKPOINT,
  4508. this._onRecommendSeekpoint.bind(this)
  4509. );
  4510. }
  4511. }
  4512. return (
  4513. (e.prototype.destroy = function () {
  4514. this._worker
  4515. ? this._workerDestroying ||
  4516. ((this._workerDestroying = !0),
  4517. this._worker.postMessage({ cmd: 'destroy' }),
  4518. m.Z.removeListener(this.e.onLoggingConfigChanged),
  4519. (this.e = null))
  4520. : (this._controller.destroy(), (this._controller = null)),
  4521. this._emitter.removeAllListeners(),
  4522. (this._emitter = null);
  4523. }),
  4524. (e.prototype.on = function (e, t) {
  4525. this._emitter.addListener(e, t);
  4526. }),
  4527. (e.prototype.off = function (e, t) {
  4528. this._emitter.removeListener(e, t);
  4529. }),
  4530. (e.prototype.hasWorker = function () {
  4531. return null != this._worker;
  4532. }),
  4533. (e.prototype.open = function () {
  4534. this._worker
  4535. ? this._worker.postMessage({ cmd: 'start' })
  4536. : this._controller.start();
  4537. }),
  4538. (e.prototype.close = function () {
  4539. this._worker
  4540. ? this._worker.postMessage({ cmd: 'stop' })
  4541. : this._controller.stop();
  4542. }),
  4543. (e.prototype.seek = function (e) {
  4544. this._worker
  4545. ? this._worker.postMessage({ cmd: 'seek', param: e })
  4546. : this._controller.seek(e);
  4547. }),
  4548. (e.prototype.pause = function () {
  4549. this._worker
  4550. ? this._worker.postMessage({ cmd: 'pause' })
  4551. : this._controller.pause();
  4552. }),
  4553. (e.prototype.resume = function () {
  4554. this._worker
  4555. ? this._worker.postMessage({ cmd: 'resume' })
  4556. : this._controller.resume();
  4557. }),
  4558. (e.prototype._onInitSegment = function (e, t) {
  4559. var i = this;
  4560. Promise.resolve().then(function () {
  4561. i._emitter.emit(v.Z.INIT_SEGMENT, e, t);
  4562. });
  4563. }),
  4564. (e.prototype._onMediaSegment = function (e, t) {
  4565. var i = this;
  4566. Promise.resolve().then(function () {
  4567. i._emitter.emit(v.Z.MEDIA_SEGMENT, e, t);
  4568. });
  4569. }),
  4570. (e.prototype._onLoadingComplete = function () {
  4571. var e = this;
  4572. Promise.resolve().then(function () {
  4573. e._emitter.emit(v.Z.LOADING_COMPLETE);
  4574. });
  4575. }),
  4576. (e.prototype._onRecoveredEarlyEof = function () {
  4577. var e = this;
  4578. Promise.resolve().then(function () {
  4579. e._emitter.emit(v.Z.RECOVERED_EARLY_EOF);
  4580. });
  4581. }),
  4582. (e.prototype._onMediaInfo = function (e) {
  4583. var t = this;
  4584. Promise.resolve().then(function () {
  4585. t._emitter.emit(v.Z.MEDIA_INFO, e);
  4586. });
  4587. }),
  4588. (e.prototype._onMetaDataArrived = function (e) {
  4589. var t = this;
  4590. Promise.resolve().then(function () {
  4591. t._emitter.emit(v.Z.METADATA_ARRIVED, e);
  4592. });
  4593. }),
  4594. (e.prototype._onScriptDataArrived = function (e) {
  4595. var t = this;
  4596. Promise.resolve().then(function () {
  4597. t._emitter.emit(v.Z.SCRIPTDATA_ARRIVED, e);
  4598. });
  4599. }),
  4600. (e.prototype._onStatisticsInfo = function (e) {
  4601. var t = this;
  4602. Promise.resolve().then(function () {
  4603. t._emitter.emit(v.Z.STATISTICS_INFO, e);
  4604. });
  4605. }),
  4606. (e.prototype._onIOError = function (e, t) {
  4607. var i = this;
  4608. Promise.resolve().then(function () {
  4609. i._emitter.emit(v.Z.IO_ERROR, e, t);
  4610. });
  4611. }),
  4612. (e.prototype._onDemuxError = function (e, t) {
  4613. var i = this;
  4614. Promise.resolve().then(function () {
  4615. i._emitter.emit(v.Z.DEMUX_ERROR, e, t);
  4616. });
  4617. }),
  4618. (e.prototype._onRecommendSeekpoint = function (e) {
  4619. var t = this;
  4620. Promise.resolve().then(function () {
  4621. t._emitter.emit(v.Z.RECOMMEND_SEEKPOINT, e);
  4622. });
  4623. }),
  4624. (e.prototype._onLoggingConfigChanged = function (e) {
  4625. this._worker &&
  4626. this._worker.postMessage({
  4627. cmd: 'logging_config',
  4628. param: e,
  4629. });
  4630. }),
  4631. (e.prototype._onWorkerMessage = function (e) {
  4632. var t = e.data,
  4633. i = t.data;
  4634. if ('destroyed' === t.msg || this._workerDestroying)
  4635. return (
  4636. (this._workerDestroying = !1),
  4637. this._worker.terminate(),
  4638. void (this._worker = null)
  4639. );
  4640. switch (t.msg) {
  4641. case v.Z.INIT_SEGMENT:
  4642. case v.Z.MEDIA_SEGMENT:
  4643. this._emitter.emit(t.msg, i.type, i.data);
  4644. break;
  4645. case v.Z.LOADING_COMPLETE:
  4646. case v.Z.RECOVERED_EARLY_EOF:
  4647. this._emitter.emit(t.msg);
  4648. break;
  4649. case v.Z.MEDIA_INFO:
  4650. Object.setPrototypeOf(i, y.Z.prototype),
  4651. this._emitter.emit(t.msg, i);
  4652. break;
  4653. case v.Z.METADATA_ARRIVED:
  4654. case v.Z.SCRIPTDATA_ARRIVED:
  4655. case v.Z.STATISTICS_INFO:
  4656. this._emitter.emit(t.msg, i);
  4657. break;
  4658. case v.Z.IO_ERROR:
  4659. case v.Z.DEMUX_ERROR:
  4660. this._emitter.emit(t.msg, i.type, i.info);
  4661. break;
  4662. case v.Z.RECOMMEND_SEEKPOINT:
  4663. this._emitter.emit(t.msg, i);
  4664. break;
  4665. case 'logcat_callback':
  4666. d.Z.emitter.emit('log', i.type, i.logcat);
  4667. }
  4668. }),
  4669. e
  4670. );
  4671. })(),
  4672. E = {
  4673. ERROR: 'error',
  4674. SOURCE_OPEN: 'source_open',
  4675. UPDATE_END: 'update_end',
  4676. BUFFER_FULL: 'buffer_full',
  4677. },
  4678. S = i(51),
  4679. A = i(29),
  4680. L = (function () {
  4681. function e(e) {
  4682. (this.TAG = 'MSEController'),
  4683. (this._config = e),
  4684. (this._emitter = new (l())()),
  4685. this._config.isLive &&
  4686. null == this._config.autoCleanupSourceBuffer &&
  4687. (this._config.autoCleanupSourceBuffer = !0),
  4688. (this.e = {
  4689. onSourceOpen: this._onSourceOpen.bind(this),
  4690. onSourceEnded: this._onSourceEnded.bind(this),
  4691. onSourceClose: this._onSourceClose.bind(this),
  4692. onSourceBufferError: this._onSourceBufferError.bind(this),
  4693. onSourceBufferUpdateEnd:
  4694. this._onSourceBufferUpdateEnd.bind(this),
  4695. }),
  4696. (this._mediaSource = null),
  4697. (this._mediaSourceObjectURL = null),
  4698. (this._mediaElement = null),
  4699. (this._isBufferFull = !1),
  4700. (this._hasPendingEos = !1),
  4701. (this._requireSetMediaDuration = !1),
  4702. (this._pendingMediaDuration = 0),
  4703. (this._pendingSourceBufferInit = []),
  4704. (this._mimeTypes = { video: null, audio: null }),
  4705. (this._sourceBuffers = { video: null, audio: null }),
  4706. (this._lastInitSegments = { video: null, audio: null }),
  4707. (this._pendingSegments = { video: [], audio: [] }),
  4708. (this._pendingRemoveRanges = { video: [], audio: [] }),
  4709. (this._idrList = new S.Vn());
  4710. }
  4711. return (
  4712. (e.prototype.destroy = function () {
  4713. (this._mediaElement || this._mediaSource) &&
  4714. this.detachMediaElement(),
  4715. (this.e = null),
  4716. this._emitter.removeAllListeners(),
  4717. (this._emitter = null);
  4718. }),
  4719. (e.prototype.on = function (e, t) {
  4720. this._emitter.addListener(e, t);
  4721. }),
  4722. (e.prototype.off = function (e, t) {
  4723. this._emitter.removeListener(e, t);
  4724. }),
  4725. (e.prototype.attachMediaElement = function (e) {
  4726. if (this._mediaSource)
  4727. throw new A.rT(
  4728. 'MediaSource has been attached to an HTMLMediaElement!'
  4729. );
  4730. var t = (this._mediaSource = new window.MediaSource());
  4731. t.addEventListener('sourceopen', this.e.onSourceOpen),
  4732. t.addEventListener('sourceended', this.e.onSourceEnded),
  4733. t.addEventListener('sourceclose', this.e.onSourceClose),
  4734. (this._mediaElement = e),
  4735. (this._mediaSourceObjectURL = window.URL.createObjectURL(
  4736. this._mediaSource
  4737. )),
  4738. (e.src = this._mediaSourceObjectURL);
  4739. }),
  4740. (e.prototype.detachMediaElement = function () {
  4741. if (this._mediaSource) {
  4742. var e = this._mediaSource;
  4743. for (var t in this._sourceBuffers) {
  4744. var i = this._pendingSegments[t];
  4745. i.splice(0, i.length),
  4746. (this._pendingSegments[t] = null),
  4747. (this._pendingRemoveRanges[t] = null),
  4748. (this._lastInitSegments[t] = null);
  4749. var n = this._sourceBuffers[t];
  4750. if (n) {
  4751. if ('closed' !== e.readyState) {
  4752. try {
  4753. e.removeSourceBuffer(n);
  4754. } catch (e) {
  4755. d.Z.e(this.TAG, e.message);
  4756. }
  4757. n.removeEventListener(
  4758. 'error',
  4759. this.e.onSourceBufferError
  4760. ),
  4761. n.removeEventListener(
  4762. 'updateend',
  4763. this.e.onSourceBufferUpdateEnd
  4764. );
  4765. }
  4766. (this._mimeTypes[t] = null),
  4767. (this._sourceBuffers[t] = null);
  4768. }
  4769. }
  4770. if ('open' === e.readyState)
  4771. try {
  4772. e.endOfStream();
  4773. } catch (e) {
  4774. d.Z.e(this.TAG, e.message);
  4775. }
  4776. e.removeEventListener('sourceopen', this.e.onSourceOpen),
  4777. e.removeEventListener(
  4778. 'sourceended',
  4779. this.e.onSourceEnded
  4780. ),
  4781. e.removeEventListener(
  4782. 'sourceclose',
  4783. this.e.onSourceClose
  4784. ),
  4785. (this._pendingSourceBufferInit = []),
  4786. (this._isBufferFull = !1),
  4787. this._idrList.clear(),
  4788. (this._mediaSource = null);
  4789. }
  4790. this._mediaElement &&
  4791. ((this._mediaElement.src = ''),
  4792. this._mediaElement.removeAttribute('src'),
  4793. (this._mediaElement = null)),
  4794. this._mediaSourceObjectURL &&
  4795. (window.URL.revokeObjectURL(this._mediaSourceObjectURL),
  4796. (this._mediaSourceObjectURL = null));
  4797. }),
  4798. (e.prototype.appendInitSegment = function (e, t) {
  4799. if (
  4800. !this._mediaSource ||
  4801. 'open' !== this._mediaSource.readyState
  4802. )
  4803. return (
  4804. this._pendingSourceBufferInit.push(e),
  4805. void this._pendingSegments[e.type].push(e)
  4806. );
  4807. var i = e,
  4808. n = '' + i.container;
  4809. i.codec && i.codec.length > 0 && (n += ';codecs=' + i.codec);
  4810. var r = !1;
  4811. if (
  4812. (d.Z.v(
  4813. this.TAG,
  4814. 'Received Initialization Segment, mimeType: ' + n
  4815. ),
  4816. (this._lastInitSegments[i.type] = i),
  4817. n !== this._mimeTypes[i.type])
  4818. ) {
  4819. if (this._mimeTypes[i.type])
  4820. d.Z.v(
  4821. this.TAG,
  4822. 'Notice: ' +
  4823. i.type +
  4824. ' mimeType changed, origin: ' +
  4825. this._mimeTypes[i.type] +
  4826. ', target: ' +
  4827. n
  4828. );
  4829. else {
  4830. r = !0;
  4831. try {
  4832. var s = (this._sourceBuffers[i.type] =
  4833. this._mediaSource.addSourceBuffer(n));
  4834. s.addEventListener('error', this.e.onSourceBufferError),
  4835. s.addEventListener(
  4836. 'updateend',
  4837. this.e.onSourceBufferUpdateEnd
  4838. );
  4839. } catch (e) {
  4840. return (
  4841. d.Z.e(this.TAG, e.message),
  4842. void this._emitter.emit(E.ERROR, {
  4843. code: e.code,
  4844. msg: e.message,
  4845. })
  4846. );
  4847. }
  4848. }
  4849. this._mimeTypes[i.type] = n;
  4850. }
  4851. t || this._pendingSegments[i.type].push(i),
  4852. r ||
  4853. (this._sourceBuffers[i.type] &&
  4854. !this._sourceBuffers[i.type].updating &&
  4855. this._doAppendSegments()),
  4856. c.Z.safari &&
  4857. 'audio/mpeg' === i.container &&
  4858. i.mediaDuration > 0 &&
  4859. ((this._requireSetMediaDuration = !0),
  4860. (this._pendingMediaDuration = i.mediaDuration / 1e3),
  4861. this._updateMediaSourceDuration());
  4862. }),
  4863. (e.prototype.appendMediaSegment = function (e) {
  4864. var t = e;
  4865. this._pendingSegments[t.type].push(t),
  4866. this._config.autoCleanupSourceBuffer &&
  4867. this._needCleanupSourceBuffer() &&
  4868. this._doCleanupSourceBuffer();
  4869. var i = this._sourceBuffers[t.type];
  4870. !i ||
  4871. i.updating ||
  4872. this._hasPendingRemoveRanges() ||
  4873. this._doAppendSegments();
  4874. }),
  4875. (e.prototype.seek = function (e) {
  4876. for (var t in this._sourceBuffers)
  4877. if (this._sourceBuffers[t]) {
  4878. var i = this._sourceBuffers[t];
  4879. if ('open' === this._mediaSource.readyState)
  4880. try {
  4881. i.abort();
  4882. } catch (e) {
  4883. d.Z.e(this.TAG, e.message);
  4884. }
  4885. this._idrList.clear();
  4886. var n = this._pendingSegments[t];
  4887. if (
  4888. (n.splice(0, n.length),
  4889. 'closed' !== this._mediaSource.readyState)
  4890. ) {
  4891. for (var r = 0; r < i.buffered.length; r++) {
  4892. var s = i.buffered.start(r),
  4893. o = i.buffered.end(r);
  4894. this._pendingRemoveRanges[t].push({
  4895. start: s,
  4896. end: o,
  4897. });
  4898. }
  4899. if (
  4900. (i.updating || this._doRemoveRanges(), c.Z.safari)
  4901. ) {
  4902. var a = this._lastInitSegments[t];
  4903. a &&
  4904. (this._pendingSegments[t].push(a),
  4905. i.updating || this._doAppendSegments());
  4906. }
  4907. }
  4908. }
  4909. }),
  4910. (e.prototype.endOfStream = function () {
  4911. var e = this._mediaSource,
  4912. t = this._sourceBuffers;
  4913. e && 'open' === e.readyState
  4914. ? (t.video && t.video.updating) ||
  4915. (t.audio && t.audio.updating)
  4916. ? (this._hasPendingEos = !0)
  4917. : ((this._hasPendingEos = !1), e.endOfStream())
  4918. : e &&
  4919. 'closed' === e.readyState &&
  4920. this._hasPendingSegments() &&
  4921. (this._hasPendingEos = !0);
  4922. }),
  4923. (e.prototype.getNearestKeyframe = function (e) {
  4924. return this._idrList.getLastSyncPointBeforeDts(e);
  4925. }),
  4926. (e.prototype._needCleanupSourceBuffer = function () {
  4927. if (!this._config.autoCleanupSourceBuffer) return !1;
  4928. var e = this._mediaElement.currentTime;
  4929. for (var t in this._sourceBuffers) {
  4930. var i = this._sourceBuffers[t];
  4931. if (i) {
  4932. var n = i.buffered;
  4933. if (
  4934. n.length >= 1 &&
  4935. e - n.start(0) >=
  4936. this._config.autoCleanupMaxBackwardDuration
  4937. )
  4938. return !0;
  4939. }
  4940. }
  4941. return !1;
  4942. }),
  4943. (e.prototype._doCleanupSourceBuffer = function () {
  4944. var e = this._mediaElement.currentTime;
  4945. for (var t in this._sourceBuffers) {
  4946. var i = this._sourceBuffers[t];
  4947. if (i) {
  4948. for (
  4949. var n = i.buffered, r = !1, s = 0;
  4950. s < n.length;
  4951. s++
  4952. ) {
  4953. var o = n.start(s),
  4954. a = n.end(s);
  4955. if (o <= e && e < a + 3) {
  4956. if (
  4957. e - o >=
  4958. this._config.autoCleanupMaxBackwardDuration
  4959. ) {
  4960. r = !0;
  4961. var h =
  4962. e - this._config.autoCleanupMinBackwardDuration;
  4963. this._pendingRemoveRanges[t].push({
  4964. start: o,
  4965. end: h,
  4966. });
  4967. }
  4968. } else
  4969. a < e &&
  4970. ((r = !0),
  4971. this._pendingRemoveRanges[t].push({
  4972. start: o,
  4973. end: a,
  4974. }));
  4975. }
  4976. r && !i.updating && this._doRemoveRanges();
  4977. }
  4978. }
  4979. }),
  4980. (e.prototype._updateMediaSourceDuration = function () {
  4981. var e = this._sourceBuffers;
  4982. if (
  4983. 0 !== this._mediaElement.readyState &&
  4984. 'open' === this._mediaSource.readyState &&
  4985. !(
  4986. (e.video && e.video.updating) ||
  4987. (e.audio && e.audio.updating)
  4988. )
  4989. ) {
  4990. var t = this._mediaSource.duration,
  4991. i = this._pendingMediaDuration;
  4992. i > 0 &&
  4993. (isNaN(t) || i > t) &&
  4994. (d.Z.v(
  4995. this.TAG,
  4996. 'Update MediaSource duration from ' + t + ' to ' + i
  4997. ),
  4998. (this._mediaSource.duration = i)),
  4999. (this._requireSetMediaDuration = !1),
  5000. (this._pendingMediaDuration = 0);
  5001. }
  5002. }),
  5003. (e.prototype._doRemoveRanges = function () {
  5004. for (var e in this._pendingRemoveRanges)
  5005. if (
  5006. this._sourceBuffers[e] &&
  5007. !this._sourceBuffers[e].updating
  5008. )
  5009. for (
  5010. var t = this._sourceBuffers[e],
  5011. i = this._pendingRemoveRanges[e];
  5012. i.length && !t.updating;
  5013. ) {
  5014. var n = i.shift();
  5015. t.remove(n.start, n.end);
  5016. }
  5017. }),
  5018. (e.prototype._doAppendSegments = function () {
  5019. var e = this._pendingSegments;
  5020. for (var t in e)
  5021. if (
  5022. this._sourceBuffers[t] &&
  5023. !this._sourceBuffers[t].updating &&
  5024. e[t].length > 0
  5025. ) {
  5026. var i = e[t].shift();
  5027. if (i.timestampOffset) {
  5028. var n = this._sourceBuffers[t].timestampOffset,
  5029. r = i.timestampOffset / 1e3;
  5030. Math.abs(n - r) > 0.1 &&
  5031. (d.Z.v(
  5032. this.TAG,
  5033. 'Update MPEG audio timestampOffset from ' +
  5034. n +
  5035. ' to ' +
  5036. r
  5037. ),
  5038. (this._sourceBuffers[t].timestampOffset = r)),
  5039. delete i.timestampOffset;
  5040. }
  5041. if (!i.data || 0 === i.data.byteLength) continue;
  5042. try {
  5043. this._sourceBuffers[t].appendBuffer(i.data),
  5044. (this._isBufferFull = !1),
  5045. 'video' === t &&
  5046. i.hasOwnProperty('info') &&
  5047. this._idrList.appendArray(i.info.syncPoints);
  5048. } catch (e) {
  5049. this._pendingSegments[t].unshift(i),
  5050. 22 === e.code
  5051. ? (this._isBufferFull ||
  5052. this._emitter.emit(E.BUFFER_FULL),
  5053. (this._isBufferFull = !0))
  5054. : (d.Z.e(this.TAG, e.message),
  5055. this._emitter.emit(E.ERROR, {
  5056. code: e.code,
  5057. msg: e.message,
  5058. }));
  5059. }
  5060. }
  5061. }),
  5062. (e.prototype._onSourceOpen = function () {
  5063. if (
  5064. (d.Z.v(this.TAG, 'MediaSource onSourceOpen'),
  5065. this._mediaSource.removeEventListener(
  5066. 'sourceopen',
  5067. this.e.onSourceOpen
  5068. ),
  5069. this._pendingSourceBufferInit.length > 0)
  5070. )
  5071. for (var e = this._pendingSourceBufferInit; e.length; ) {
  5072. var t = e.shift();
  5073. this.appendInitSegment(t, !0);
  5074. }
  5075. this._hasPendingSegments() && this._doAppendSegments(),
  5076. this._emitter.emit(E.SOURCE_OPEN);
  5077. }),
  5078. (e.prototype._onSourceEnded = function () {
  5079. d.Z.v(this.TAG, 'MediaSource onSourceEnded');
  5080. }),
  5081. (e.prototype._onSourceClose = function () {
  5082. d.Z.v(this.TAG, 'MediaSource onSourceClose'),
  5083. this._mediaSource &&
  5084. null != this.e &&
  5085. (this._mediaSource.removeEventListener(
  5086. 'sourceopen',
  5087. this.e.onSourceOpen
  5088. ),
  5089. this._mediaSource.removeEventListener(
  5090. 'sourceended',
  5091. this.e.onSourceEnded
  5092. ),
  5093. this._mediaSource.removeEventListener(
  5094. 'sourceclose',
  5095. this.e.onSourceClose
  5096. ));
  5097. }),
  5098. (e.prototype._hasPendingSegments = function () {
  5099. var e = this._pendingSegments;
  5100. return e.video.length > 0 || e.audio.length > 0;
  5101. }),
  5102. (e.prototype._hasPendingRemoveRanges = function () {
  5103. var e = this._pendingRemoveRanges;
  5104. return e.video.length > 0 || e.audio.length > 0;
  5105. }),
  5106. (e.prototype._onSourceBufferUpdateEnd = function () {
  5107. this._requireSetMediaDuration
  5108. ? this._updateMediaSourceDuration()
  5109. : this._hasPendingRemoveRanges()
  5110. ? this._doRemoveRanges()
  5111. : this._hasPendingSegments()
  5112. ? this._doAppendSegments()
  5113. : this._hasPendingEos && this.endOfStream(),
  5114. this._emitter.emit(E.UPDATE_END);
  5115. }),
  5116. (e.prototype._onSourceBufferError = function (e) {
  5117. d.Z.e(this.TAG, 'SourceBuffer Error: ' + e);
  5118. }),
  5119. e
  5120. );
  5121. })(),
  5122. R = i(600),
  5123. w = {
  5124. NETWORK_ERROR: 'NetworkError',
  5125. MEDIA_ERROR: 'MediaError',
  5126. OTHER_ERROR: 'OtherError',
  5127. },
  5128. O = {
  5129. NETWORK_EXCEPTION: h.nm.EXCEPTION,
  5130. NETWORK_STATUS_CODE_INVALID: h.nm.HTTP_STATUS_CODE_INVALID,
  5131. NETWORK_TIMEOUT: h.nm.CONNECTING_TIMEOUT,
  5132. NETWORK_UNRECOVERABLE_EARLY_EOF: h.nm.UNRECOVERABLE_EARLY_EOF,
  5133. MEDIA_MSE_ERROR: 'MediaMSEError',
  5134. MEDIA_FORMAT_ERROR: R.Z.FORMAT_ERROR,
  5135. MEDIA_FORMAT_UNSUPPORTED: R.Z.FORMAT_UNSUPPORTED,
  5136. MEDIA_CODEC_UNSUPPORTED: R.Z.CODEC_UNSUPPORTED,
  5137. },
  5138. T = (function () {
  5139. function e(e, t) {
  5140. if (
  5141. ((this.TAG = 'FlvPlayer'),
  5142. (this._type = 'FlvPlayer'),
  5143. (this._emitter = new (l())()),
  5144. (this._config = o()),
  5145. 'object' == typeof t && Object.assign(this._config, t),
  5146. 'flv' !== e.type.toLowerCase())
  5147. )
  5148. throw new A.OC(
  5149. 'FlvPlayer requires an flv MediaDataSource input!'
  5150. );
  5151. !0 === e.isLive && (this._config.isLive = !0),
  5152. (this.e = {
  5153. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  5154. onvSeeking: this._onvSeeking.bind(this),
  5155. onvCanPlay: this._onvCanPlay.bind(this),
  5156. onvStalled: this._onvStalled.bind(this),
  5157. onvProgress: this._onvProgress.bind(this),
  5158. }),
  5159. self.performance && self.performance.now
  5160. ? (this._now = self.performance.now.bind(self.performance))
  5161. : (this._now = Date.now),
  5162. (this._pendingSeekTime = null),
  5163. (this._requestSetTime = !1),
  5164. (this._seekpointRecord = null),
  5165. (this._progressChecker = null),
  5166. (this._mediaDataSource = e),
  5167. (this._mediaElement = null),
  5168. (this._msectl = null),
  5169. (this._transmuxer = null),
  5170. (this._mseSourceOpened = !1),
  5171. (this._hasPendingLoad = !1),
  5172. (this._receivedCanPlay = !1),
  5173. (this._mediaInfo = null),
  5174. (this._statisticsInfo = null);
  5175. var i =
  5176. c.Z.chrome &&
  5177. (c.Z.version.major < 50 ||
  5178. (50 === c.Z.version.major && c.Z.version.build < 2661));
  5179. (this._alwaysSeekKeyframe = !!(i || c.Z.msedge || c.Z.msie)),
  5180. this._alwaysSeekKeyframe && (this._config.accurateSeek = !1);
  5181. }
  5182. return (
  5183. (e.prototype.destroy = function () {
  5184. null != this._progressChecker &&
  5185. (window.clearInterval(this._progressChecker),
  5186. (this._progressChecker = null)),
  5187. this._transmuxer && this.unload(),
  5188. this._mediaElement && this.detachMediaElement(),
  5189. (this.e = null),
  5190. (this._mediaDataSource = null),
  5191. this._emitter.removeAllListeners(),
  5192. (this._emitter = null);
  5193. }),
  5194. (e.prototype.on = function (e, t) {
  5195. var i = this;
  5196. e === f.MEDIA_INFO
  5197. ? null != this._mediaInfo &&
  5198. Promise.resolve().then(function () {
  5199. i._emitter.emit(f.MEDIA_INFO, i.mediaInfo);
  5200. })
  5201. : e === f.STATISTICS_INFO &&
  5202. null != this._statisticsInfo &&
  5203. Promise.resolve().then(function () {
  5204. i._emitter.emit(f.STATISTICS_INFO, i.statisticsInfo);
  5205. }),
  5206. this._emitter.addListener(e, t);
  5207. }),
  5208. (e.prototype.off = function (e, t) {
  5209. this._emitter.removeListener(e, t);
  5210. }),
  5211. (e.prototype.attachMediaElement = function (e) {
  5212. var t = this;
  5213. if (
  5214. ((this._mediaElement = e),
  5215. e.addEventListener(
  5216. 'loadedmetadata',
  5217. this.e.onvLoadedMetadata
  5218. ),
  5219. e.addEventListener('seeking', this.e.onvSeeking),
  5220. e.addEventListener('canplay', this.e.onvCanPlay),
  5221. e.addEventListener('stalled', this.e.onvStalled),
  5222. e.addEventListener('progress', this.e.onvProgress),
  5223. (this._msectl = new L(this._config)),
  5224. this._msectl.on(
  5225. E.UPDATE_END,
  5226. this._onmseUpdateEnd.bind(this)
  5227. ),
  5228. this._msectl.on(
  5229. E.BUFFER_FULL,
  5230. this._onmseBufferFull.bind(this)
  5231. ),
  5232. this._msectl.on(E.SOURCE_OPEN, function () {
  5233. (t._mseSourceOpened = !0),
  5234. t._hasPendingLoad &&
  5235. ((t._hasPendingLoad = !1), t.load());
  5236. }),
  5237. this._msectl.on(E.ERROR, function (e) {
  5238. t._emitter.emit(
  5239. f.ERROR,
  5240. w.MEDIA_ERROR,
  5241. O.MEDIA_MSE_ERROR,
  5242. e
  5243. );
  5244. }),
  5245. this._msectl.attachMediaElement(e),
  5246. null != this._pendingSeekTime)
  5247. )
  5248. try {
  5249. (e.currentTime = this._pendingSeekTime),
  5250. (this._pendingSeekTime = null);
  5251. } catch (e) {}
  5252. }),
  5253. (e.prototype.detachMediaElement = function () {
  5254. this._mediaElement &&
  5255. (this._msectl.detachMediaElement(),
  5256. this._mediaElement.removeEventListener(
  5257. 'loadedmetadata',
  5258. this.e.onvLoadedMetadata
  5259. ),
  5260. this._mediaElement.removeEventListener(
  5261. 'seeking',
  5262. this.e.onvSeeking
  5263. ),
  5264. this._mediaElement.removeEventListener(
  5265. 'canplay',
  5266. this.e.onvCanPlay
  5267. ),
  5268. this._mediaElement.removeEventListener(
  5269. 'stalled',
  5270. this.e.onvStalled
  5271. ),
  5272. this._mediaElement.removeEventListener(
  5273. 'progress',
  5274. this.e.onvProgress
  5275. ),
  5276. (this._mediaElement = null)),
  5277. this._msectl &&
  5278. (this._msectl.destroy(), (this._msectl = null));
  5279. }),
  5280. (e.prototype.load = function () {
  5281. var e = this;
  5282. if (!this._mediaElement)
  5283. throw new A.rT(
  5284. 'HTMLMediaElement must be attached before load()!'
  5285. );
  5286. if (this._transmuxer)
  5287. throw new A.rT(
  5288. 'FlvPlayer.load() has been called, please call unload() first!'
  5289. );
  5290. this._hasPendingLoad ||
  5291. (this._config.deferLoadAfterSourceOpen &&
  5292. !1 === this._mseSourceOpened
  5293. ? (this._hasPendingLoad = !0)
  5294. : (this._mediaElement.readyState > 0 &&
  5295. ((this._requestSetTime = !0),
  5296. (this._mediaElement.currentTime = 0)),
  5297. (this._transmuxer = new b(
  5298. this._mediaDataSource,
  5299. this._config
  5300. )),
  5301. this._transmuxer.on(v.Z.INIT_SEGMENT, function (t, i) {
  5302. e._msectl.appendInitSegment(i);
  5303. }),
  5304. this._transmuxer.on(v.Z.MEDIA_SEGMENT, function (t, i) {
  5305. if (
  5306. (e._msectl.appendMediaSegment(i),
  5307. e._config.lazyLoad && !e._config.isLive)
  5308. ) {
  5309. var n = e._mediaElement.currentTime;
  5310. i.info.endDts >=
  5311. 1e3 * (n + e._config.lazyLoadMaxDuration) &&
  5312. null == e._progressChecker &&
  5313. (d.Z.v(
  5314. e.TAG,
  5315. 'Maximum buffering duration exceeded, suspend transmuxing task'
  5316. ),
  5317. e._suspendTransmuxer());
  5318. }
  5319. }),
  5320. this._transmuxer.on(v.Z.LOADING_COMPLETE, function () {
  5321. e._msectl.endOfStream(),
  5322. e._emitter.emit(f.LOADING_COMPLETE);
  5323. }),
  5324. this._transmuxer.on(
  5325. v.Z.RECOVERED_EARLY_EOF,
  5326. function () {
  5327. e._emitter.emit(f.RECOVERED_EARLY_EOF);
  5328. }
  5329. ),
  5330. this._transmuxer.on(v.Z.IO_ERROR, function (t, i) {
  5331. e._emitter.emit(f.ERROR, w.NETWORK_ERROR, t, i);
  5332. }),
  5333. this._transmuxer.on(v.Z.DEMUX_ERROR, function (t, i) {
  5334. e._emitter.emit(f.ERROR, w.MEDIA_ERROR, t, {
  5335. code: -1,
  5336. msg: i,
  5337. });
  5338. }),
  5339. this._transmuxer.on(v.Z.MEDIA_INFO, function (t) {
  5340. (e._mediaInfo = t),
  5341. e._emitter.emit(f.MEDIA_INFO, Object.assign({}, t));
  5342. }),
  5343. this._transmuxer.on(v.Z.METADATA_ARRIVED, function (t) {
  5344. e._emitter.emit(f.METADATA_ARRIVED, t);
  5345. }),
  5346. this._transmuxer.on(
  5347. v.Z.SCRIPTDATA_ARRIVED,
  5348. function (t) {
  5349. e._emitter.emit(f.SCRIPTDATA_ARRIVED, t);
  5350. }
  5351. ),
  5352. this._transmuxer.on(v.Z.STATISTICS_INFO, function (t) {
  5353. (e._statisticsInfo = e._fillStatisticsInfo(t)),
  5354. e._emitter.emit(
  5355. f.STATISTICS_INFO,
  5356. Object.assign({}, e._statisticsInfo)
  5357. );
  5358. }),
  5359. this._transmuxer.on(
  5360. v.Z.RECOMMEND_SEEKPOINT,
  5361. function (t) {
  5362. e._mediaElement &&
  5363. !e._config.accurateSeek &&
  5364. ((e._requestSetTime = !0),
  5365. (e._mediaElement.currentTime = t / 1e3));
  5366. }
  5367. ),
  5368. this._transmuxer.open()));
  5369. }),
  5370. (e.prototype.unload = function () {
  5371. this._mediaElement && this._mediaElement.pause(),
  5372. this._msectl && this._msectl.seek(0),
  5373. this._transmuxer &&
  5374. (this._transmuxer.close(),
  5375. this._transmuxer.destroy(),
  5376. (this._transmuxer = null));
  5377. }),
  5378. (e.prototype.play = function () {
  5379. return this._mediaElement.play();
  5380. }),
  5381. (e.prototype.pause = function () {
  5382. this._mediaElement.pause();
  5383. }),
  5384. Object.defineProperty(e.prototype, 'type', {
  5385. get: function () {
  5386. return this._type;
  5387. },
  5388. enumerable: !1,
  5389. configurable: !0,
  5390. }),
  5391. Object.defineProperty(e.prototype, 'buffered', {
  5392. get: function () {
  5393. return this._mediaElement.buffered;
  5394. },
  5395. enumerable: !1,
  5396. configurable: !0,
  5397. }),
  5398. Object.defineProperty(e.prototype, 'duration', {
  5399. get: function () {
  5400. return this._mediaElement.duration;
  5401. },
  5402. enumerable: !1,
  5403. configurable: !0,
  5404. }),
  5405. Object.defineProperty(e.prototype, 'volume', {
  5406. get: function () {
  5407. return this._mediaElement.volume;
  5408. },
  5409. set: function (e) {
  5410. this._mediaElement.volume = e;
  5411. },
  5412. enumerable: !1,
  5413. configurable: !0,
  5414. }),
  5415. Object.defineProperty(e.prototype, 'muted', {
  5416. get: function () {
  5417. return this._mediaElement.muted;
  5418. },
  5419. set: function (e) {
  5420. this._mediaElement.muted = e;
  5421. },
  5422. enumerable: !1,
  5423. configurable: !0,
  5424. }),
  5425. Object.defineProperty(e.prototype, 'currentTime', {
  5426. get: function () {
  5427. return this._mediaElement
  5428. ? this._mediaElement.currentTime
  5429. : 0;
  5430. },
  5431. set: function (e) {
  5432. this._mediaElement
  5433. ? this._internalSeek(e)
  5434. : (this._pendingSeekTime = e);
  5435. },
  5436. enumerable: !1,
  5437. configurable: !0,
  5438. }),
  5439. Object.defineProperty(e.prototype, 'mediaInfo', {
  5440. get: function () {
  5441. return Object.assign({}, this._mediaInfo);
  5442. },
  5443. enumerable: !1,
  5444. configurable: !0,
  5445. }),
  5446. Object.defineProperty(e.prototype, 'statisticsInfo', {
  5447. get: function () {
  5448. return (
  5449. null == this._statisticsInfo &&
  5450. (this._statisticsInfo = {}),
  5451. (this._statisticsInfo = this._fillStatisticsInfo(
  5452. this._statisticsInfo
  5453. )),
  5454. Object.assign({}, this._statisticsInfo)
  5455. );
  5456. },
  5457. enumerable: !1,
  5458. configurable: !0,
  5459. }),
  5460. (e.prototype._fillStatisticsInfo = function (e) {
  5461. if (
  5462. ((e.playerType = this._type),
  5463. !(this._mediaElement instanceof HTMLVideoElement))
  5464. )
  5465. return e;
  5466. var t = !0,
  5467. i = 0,
  5468. n = 0;
  5469. if (this._mediaElement.getVideoPlaybackQuality) {
  5470. var r = this._mediaElement.getVideoPlaybackQuality();
  5471. (i = r.totalVideoFrames), (n = r.droppedVideoFrames);
  5472. } else
  5473. null != this._mediaElement.webkitDecodedFrameCount
  5474. ? ((i = this._mediaElement.webkitDecodedFrameCount),
  5475. (n = this._mediaElement.webkitDroppedFrameCount))
  5476. : (t = !1);
  5477. return t && ((e.decodedFrames = i), (e.droppedFrames = n)), e;
  5478. }),
  5479. (e.prototype._onmseUpdateEnd = function () {
  5480. if (this._config.lazyLoad && !this._config.isLive) {
  5481. for (
  5482. var e = this._mediaElement.buffered,
  5483. t = this._mediaElement.currentTime,
  5484. i = 0,
  5485. n = 0;
  5486. n < e.length;
  5487. n++
  5488. ) {
  5489. var r = e.start(n),
  5490. s = e.end(n);
  5491. if (r <= t && t < s) {
  5492. r, (i = s);
  5493. break;
  5494. }
  5495. }
  5496. i >= t + this._config.lazyLoadMaxDuration &&
  5497. null == this._progressChecker &&
  5498. (d.Z.v(
  5499. this.TAG,
  5500. 'Maximum buffering duration exceeded, suspend transmuxing task'
  5501. ),
  5502. this._suspendTransmuxer());
  5503. }
  5504. }),
  5505. (e.prototype._onmseBufferFull = function () {
  5506. d.Z.v(
  5507. this.TAG,
  5508. 'MSE SourceBuffer is full, suspend transmuxing task'
  5509. ),
  5510. null == this._progressChecker && this._suspendTransmuxer();
  5511. }),
  5512. (e.prototype._suspendTransmuxer = function () {
  5513. this._transmuxer &&
  5514. (this._transmuxer.pause(),
  5515. null == this._progressChecker &&
  5516. (this._progressChecker = window.setInterval(
  5517. this._checkProgressAndResume.bind(this),
  5518. 1e3
  5519. )));
  5520. }),
  5521. (e.prototype._checkProgressAndResume = function () {
  5522. for (
  5523. var e = this._mediaElement.currentTime,
  5524. t = this._mediaElement.buffered,
  5525. i = !1,
  5526. n = 0;
  5527. n < t.length;
  5528. n++
  5529. ) {
  5530. var r = t.start(n),
  5531. s = t.end(n);
  5532. if (e >= r && e < s) {
  5533. e >= s - this._config.lazyLoadRecoverDuration && (i = !0);
  5534. break;
  5535. }
  5536. }
  5537. i &&
  5538. (window.clearInterval(this._progressChecker),
  5539. (this._progressChecker = null),
  5540. i &&
  5541. (d.Z.v(this.TAG, 'Continue loading from paused position'),
  5542. this._transmuxer.resume()));
  5543. }),
  5544. (e.prototype._isTimepointBuffered = function (e) {
  5545. for (
  5546. var t = this._mediaElement.buffered, i = 0;
  5547. i < t.length;
  5548. i++
  5549. ) {
  5550. var n = t.start(i),
  5551. r = t.end(i);
  5552. if (e >= n && e < r) return !0;
  5553. }
  5554. return !1;
  5555. }),
  5556. (e.prototype._internalSeek = function (e) {
  5557. var t = this._isTimepointBuffered(e),
  5558. i = !1,
  5559. n = 0;
  5560. if (e < 1 && this._mediaElement.buffered.length > 0) {
  5561. var r = this._mediaElement.buffered.start(0);
  5562. ((r < 1 && e < r) || c.Z.safari) &&
  5563. ((i = !0), (n = c.Z.safari ? 0.1 : r));
  5564. }
  5565. if (i)
  5566. (this._requestSetTime = !0),
  5567. (this._mediaElement.currentTime = n);
  5568. else if (t) {
  5569. if (this._alwaysSeekKeyframe) {
  5570. var s = this._msectl.getNearestKeyframe(
  5571. Math.floor(1e3 * e)
  5572. );
  5573. (this._requestSetTime = !0),
  5574. (this._mediaElement.currentTime =
  5575. null != s ? s.dts / 1e3 : e);
  5576. } else
  5577. (this._requestSetTime = !0),
  5578. (this._mediaElement.currentTime = e);
  5579. null != this._progressChecker &&
  5580. this._checkProgressAndResume();
  5581. } else
  5582. null != this._progressChecker &&
  5583. (window.clearInterval(this._progressChecker),
  5584. (this._progressChecker = null)),
  5585. this._msectl.seek(e),
  5586. this._transmuxer.seek(Math.floor(1e3 * e)),
  5587. this._config.accurateSeek &&
  5588. ((this._requestSetTime = !0),
  5589. (this._mediaElement.currentTime = e));
  5590. }),
  5591. (e.prototype._checkAndApplyUnbufferedSeekpoint = function () {
  5592. if (this._seekpointRecord)
  5593. if (this._seekpointRecord.recordTime <= this._now() - 100) {
  5594. var e = this._mediaElement.currentTime;
  5595. (this._seekpointRecord = null),
  5596. this._isTimepointBuffered(e) ||
  5597. (null != this._progressChecker &&
  5598. (window.clearTimeout(this._progressChecker),
  5599. (this._progressChecker = null)),
  5600. this._msectl.seek(e),
  5601. this._transmuxer.seek(Math.floor(1e3 * e)),
  5602. this._config.accurateSeek &&
  5603. ((this._requestSetTime = !0),
  5604. (this._mediaElement.currentTime = e)));
  5605. } else
  5606. window.setTimeout(
  5607. this._checkAndApplyUnbufferedSeekpoint.bind(this),
  5608. 50
  5609. );
  5610. }),
  5611. (e.prototype._checkAndResumeStuckPlayback = function (e) {
  5612. var t = this._mediaElement;
  5613. if (e || !this._receivedCanPlay || t.readyState < 2) {
  5614. var i = t.buffered;
  5615. i.length > 0 &&
  5616. t.currentTime < i.start(0) &&
  5617. (d.Z.w(
  5618. this.TAG,
  5619. 'Playback seems stuck at ' +
  5620. t.currentTime +
  5621. ', seek to ' +
  5622. i.start(0)
  5623. ),
  5624. (this._requestSetTime = !0),
  5625. (this._mediaElement.currentTime = i.start(0)),
  5626. this._mediaElement.removeEventListener(
  5627. 'progress',
  5628. this.e.onvProgress
  5629. ));
  5630. } else
  5631. this._mediaElement.removeEventListener(
  5632. 'progress',
  5633. this.e.onvProgress
  5634. );
  5635. }),
  5636. (e.prototype._onvLoadedMetadata = function (e) {
  5637. null != this._pendingSeekTime &&
  5638. ((this._mediaElement.currentTime = this._pendingSeekTime),
  5639. (this._pendingSeekTime = null));
  5640. }),
  5641. (e.prototype._onvSeeking = function (e) {
  5642. var t = this._mediaElement.currentTime,
  5643. i = this._mediaElement.buffered;
  5644. if (this._requestSetTime) this._requestSetTime = !1;
  5645. else {
  5646. if (t < 1 && i.length > 0) {
  5647. var n = i.start(0);
  5648. if ((n < 1 && t < n) || c.Z.safari)
  5649. return (
  5650. (this._requestSetTime = !0),
  5651. void (this._mediaElement.currentTime = c.Z.safari
  5652. ? 0.1
  5653. : n)
  5654. );
  5655. }
  5656. if (this._isTimepointBuffered(t)) {
  5657. if (this._alwaysSeekKeyframe) {
  5658. var r = this._msectl.getNearestKeyframe(
  5659. Math.floor(1e3 * t)
  5660. );
  5661. null != r &&
  5662. ((this._requestSetTime = !0),
  5663. (this._mediaElement.currentTime = r.dts / 1e3));
  5664. }
  5665. null != this._progressChecker &&
  5666. this._checkProgressAndResume();
  5667. } else
  5668. (this._seekpointRecord = {
  5669. seekPoint: t,
  5670. recordTime: this._now(),
  5671. }),
  5672. window.setTimeout(
  5673. this._checkAndApplyUnbufferedSeekpoint.bind(this),
  5674. 50
  5675. );
  5676. }
  5677. }),
  5678. (e.prototype._onvCanPlay = function (e) {
  5679. (this._receivedCanPlay = !0),
  5680. this._mediaElement.removeEventListener(
  5681. 'canplay',
  5682. this.e.onvCanPlay
  5683. );
  5684. }),
  5685. (e.prototype._onvStalled = function (e) {
  5686. this._checkAndResumeStuckPlayback(!0);
  5687. }),
  5688. (e.prototype._onvProgress = function (e) {
  5689. this._checkAndResumeStuckPlayback();
  5690. }),
  5691. e
  5692. );
  5693. })(),
  5694. C = (function () {
  5695. function e(e, t) {
  5696. if (
  5697. ((this.TAG = 'NativePlayer'),
  5698. (this._type = 'NativePlayer'),
  5699. (this._emitter = new (l())()),
  5700. (this._config = o()),
  5701. 'object' == typeof t && Object.assign(this._config, t),
  5702. 'flv' === e.type.toLowerCase())
  5703. )
  5704. throw new A.OC(
  5705. "NativePlayer does't support flv MediaDataSource input!"
  5706. );
  5707. if (e.hasOwnProperty('segments'))
  5708. throw new A.OC(
  5709. 'NativePlayer(' +
  5710. e.type +
  5711. ") doesn't support multipart playback!"
  5712. );
  5713. (this.e = {
  5714. onvLoadedMetadata: this._onvLoadedMetadata.bind(this),
  5715. }),
  5716. (this._pendingSeekTime = null),
  5717. (this._statisticsReporter = null),
  5718. (this._mediaDataSource = e),
  5719. (this._mediaElement = null);
  5720. }
  5721. return (
  5722. (e.prototype.destroy = function () {
  5723. this._mediaElement &&
  5724. (this.unload(), this.detachMediaElement()),
  5725. (this.e = null),
  5726. (this._mediaDataSource = null),
  5727. this._emitter.removeAllListeners(),
  5728. (this._emitter = null);
  5729. }),
  5730. (e.prototype.on = function (e, t) {
  5731. var i = this;
  5732. e === f.MEDIA_INFO
  5733. ? null != this._mediaElement &&
  5734. 0 !== this._mediaElement.readyState &&
  5735. Promise.resolve().then(function () {
  5736. i._emitter.emit(f.MEDIA_INFO, i.mediaInfo);
  5737. })
  5738. : e === f.STATISTICS_INFO &&
  5739. null != this._mediaElement &&
  5740. 0 !== this._mediaElement.readyState &&
  5741. Promise.resolve().then(function () {
  5742. i._emitter.emit(f.STATISTICS_INFO, i.statisticsInfo);
  5743. }),
  5744. this._emitter.addListener(e, t);
  5745. }),
  5746. (e.prototype.off = function (e, t) {
  5747. this._emitter.removeListener(e, t);
  5748. }),
  5749. (e.prototype.attachMediaElement = function (e) {
  5750. if (
  5751. ((this._mediaElement = e),
  5752. e.addEventListener(
  5753. 'loadedmetadata',
  5754. this.e.onvLoadedMetadata
  5755. ),
  5756. null != this._pendingSeekTime)
  5757. )
  5758. try {
  5759. (e.currentTime = this._pendingSeekTime),
  5760. (this._pendingSeekTime = null);
  5761. } catch (e) {}
  5762. }),
  5763. (e.prototype.detachMediaElement = function () {
  5764. this._mediaElement &&
  5765. ((this._mediaElement.src = ''),
  5766. this._mediaElement.removeAttribute('src'),
  5767. this._mediaElement.removeEventListener(
  5768. 'loadedmetadata',
  5769. this.e.onvLoadedMetadata
  5770. ),
  5771. (this._mediaElement = null)),
  5772. null != this._statisticsReporter &&
  5773. (window.clearInterval(this._statisticsReporter),
  5774. (this._statisticsReporter = null));
  5775. }),
  5776. (e.prototype.load = function () {
  5777. if (!this._mediaElement)
  5778. throw new A.rT(
  5779. 'HTMLMediaElement must be attached before load()!'
  5780. );
  5781. (this._mediaElement.src = this._mediaDataSource.url),
  5782. this._mediaElement.readyState > 0 &&
  5783. (this._mediaElement.currentTime = 0),
  5784. (this._mediaElement.preload = 'auto'),
  5785. this._mediaElement.load(),
  5786. (this._statisticsReporter = window.setInterval(
  5787. this._reportStatisticsInfo.bind(this),
  5788. this._config.statisticsInfoReportInterval
  5789. ));
  5790. }),
  5791. (e.prototype.unload = function () {
  5792. this._mediaElement &&
  5793. ((this._mediaElement.src = ''),
  5794. this._mediaElement.removeAttribute('src')),
  5795. null != this._statisticsReporter &&
  5796. (window.clearInterval(this._statisticsReporter),
  5797. (this._statisticsReporter = null));
  5798. }),
  5799. (e.prototype.play = function () {
  5800. return this._mediaElement.play();
  5801. }),
  5802. (e.prototype.pause = function () {
  5803. this._mediaElement.pause();
  5804. }),
  5805. Object.defineProperty(e.prototype, 'type', {
  5806. get: function () {
  5807. return this._type;
  5808. },
  5809. enumerable: !1,
  5810. configurable: !0,
  5811. }),
  5812. Object.defineProperty(e.prototype, 'buffered', {
  5813. get: function () {
  5814. return this._mediaElement.buffered;
  5815. },
  5816. enumerable: !1,
  5817. configurable: !0,
  5818. }),
  5819. Object.defineProperty(e.prototype, 'duration', {
  5820. get: function () {
  5821. return this._mediaElement.duration;
  5822. },
  5823. enumerable: !1,
  5824. configurable: !0,
  5825. }),
  5826. Object.defineProperty(e.prototype, 'volume', {
  5827. get: function () {
  5828. return this._mediaElement.volume;
  5829. },
  5830. set: function (e) {
  5831. this._mediaElement.volume = e;
  5832. },
  5833. enumerable: !1,
  5834. configurable: !0,
  5835. }),
  5836. Object.defineProperty(e.prototype, 'muted', {
  5837. get: function () {
  5838. return this._mediaElement.muted;
  5839. },
  5840. set: function (e) {
  5841. this._mediaElement.muted = e;
  5842. },
  5843. enumerable: !1,
  5844. configurable: !0,
  5845. }),
  5846. Object.defineProperty(e.prototype, 'currentTime', {
  5847. get: function () {
  5848. return this._mediaElement
  5849. ? this._mediaElement.currentTime
  5850. : 0;
  5851. },
  5852. set: function (e) {
  5853. this._mediaElement
  5854. ? (this._mediaElement.currentTime = e)
  5855. : (this._pendingSeekTime = e);
  5856. },
  5857. enumerable: !1,
  5858. configurable: !0,
  5859. }),
  5860. Object.defineProperty(e.prototype, 'mediaInfo', {
  5861. get: function () {
  5862. var e = {
  5863. mimeType:
  5864. (this._mediaElement instanceof HTMLAudioElement
  5865. ? 'audio/'
  5866. : 'video/') + this._mediaDataSource.type,
  5867. };
  5868. return (
  5869. this._mediaElement &&
  5870. ((e.duration = Math.floor(
  5871. 1e3 * this._mediaElement.duration
  5872. )),
  5873. this._mediaElement instanceof HTMLVideoElement &&
  5874. ((e.width = this._mediaElement.videoWidth),
  5875. (e.height = this._mediaElement.videoHeight))),
  5876. e
  5877. );
  5878. },
  5879. enumerable: !1,
  5880. configurable: !0,
  5881. }),
  5882. Object.defineProperty(e.prototype, 'statisticsInfo', {
  5883. get: function () {
  5884. var e = {
  5885. playerType: this._type,
  5886. url: this._mediaDataSource.url,
  5887. };
  5888. if (!(this._mediaElement instanceof HTMLVideoElement))
  5889. return e;
  5890. var t = !0,
  5891. i = 0,
  5892. n = 0;
  5893. if (this._mediaElement.getVideoPlaybackQuality) {
  5894. var r = this._mediaElement.getVideoPlaybackQuality();
  5895. (i = r.totalVideoFrames), (n = r.droppedVideoFrames);
  5896. } else
  5897. null != this._mediaElement.webkitDecodedFrameCount
  5898. ? ((i = this._mediaElement.webkitDecodedFrameCount),
  5899. (n = this._mediaElement.webkitDroppedFrameCount))
  5900. : (t = !1);
  5901. return (
  5902. t && ((e.decodedFrames = i), (e.droppedFrames = n)), e
  5903. );
  5904. },
  5905. enumerable: !1,
  5906. configurable: !0,
  5907. }),
  5908. (e.prototype._onvLoadedMetadata = function (e) {
  5909. null != this._pendingSeekTime &&
  5910. ((this._mediaElement.currentTime = this._pendingSeekTime),
  5911. (this._pendingSeekTime = null)),
  5912. this._emitter.emit(f.MEDIA_INFO, this.mediaInfo);
  5913. }),
  5914. (e.prototype._reportStatisticsInfo = function () {
  5915. this._emitter.emit(f.STATISTICS_INFO, this.statisticsInfo);
  5916. }),
  5917. e
  5918. );
  5919. })();
  5920. n.Z.install();
  5921. var k = {
  5922. createPlayer: function (e, t) {
  5923. var i = e;
  5924. if (null == i || 'object' != typeof i)
  5925. throw new A.OC('MediaDataSource must be an javascript object!');
  5926. if (!i.hasOwnProperty('type'))
  5927. throw new A.OC(
  5928. 'MediaDataSource must has type field to indicate video file type!'
  5929. );
  5930. switch (i.type) {
  5931. case 'flv':
  5932. return new T(i, t);
  5933. default:
  5934. return new C(i, t);
  5935. }
  5936. },
  5937. isSupported: function () {
  5938. return a.supportMSEH264Playback();
  5939. },
  5940. getFeatureList: function () {
  5941. return a.getFeatureList();
  5942. },
  5943. };
  5944. (k.BaseLoader = h.fp),
  5945. (k.LoaderStatus = h.GM),
  5946. (k.LoaderErrors = h.nm),
  5947. (k.Events = f),
  5948. (k.ErrorTypes = w),
  5949. (k.ErrorDetails = O),
  5950. (k.FlvPlayer = T),
  5951. (k.NativePlayer = C),
  5952. (k.LoggingControl = m.Z),
  5953. Object.defineProperty(k, 'version', {
  5954. enumerable: !0,
  5955. get: function () {
  5956. return '1.6.2';
  5957. },
  5958. });
  5959. var D = k;
  5960. },
  5961. 324: function (e, t, i) {
  5962. e.exports = i(60).default;
  5963. },
  5964. 191: function (e, t, i) {
  5965. 'use strict';
  5966. i.d(t, {
  5967. Z: function () {
  5968. return y;
  5969. },
  5970. });
  5971. var n,
  5972. r = i(300),
  5973. s = (function () {
  5974. function e() {
  5975. (this._firstCheckpoint = 0),
  5976. (this._lastCheckpoint = 0),
  5977. (this._intervalBytes = 0),
  5978. (this._totalBytes = 0),
  5979. (this._lastSecondBytes = 0),
  5980. self.performance && self.performance.now
  5981. ? (this._now = self.performance.now.bind(self.performance))
  5982. : (this._now = Date.now);
  5983. }
  5984. return (
  5985. (e.prototype.reset = function () {
  5986. (this._firstCheckpoint = this._lastCheckpoint = 0),
  5987. (this._totalBytes = this._intervalBytes = 0),
  5988. (this._lastSecondBytes = 0);
  5989. }),
  5990. (e.prototype.addBytes = function (e) {
  5991. 0 === this._firstCheckpoint
  5992. ? ((this._firstCheckpoint = this._now()),
  5993. (this._lastCheckpoint = this._firstCheckpoint),
  5994. (this._intervalBytes += e),
  5995. (this._totalBytes += e))
  5996. : this._now() - this._lastCheckpoint < 1e3
  5997. ? ((this._intervalBytes += e), (this._totalBytes += e))
  5998. : ((this._lastSecondBytes = this._intervalBytes),
  5999. (this._intervalBytes = e),
  6000. (this._totalBytes += e),
  6001. (this._lastCheckpoint = this._now()));
  6002. }),
  6003. Object.defineProperty(e.prototype, 'currentKBps', {
  6004. get: function () {
  6005. this.addBytes(0);
  6006. var e = (this._now() - this._lastCheckpoint) / 1e3;
  6007. return 0 == e && (e = 1), this._intervalBytes / e / 1024;
  6008. },
  6009. enumerable: !1,
  6010. configurable: !0,
  6011. }),
  6012. Object.defineProperty(e.prototype, 'lastSecondKBps', {
  6013. get: function () {
  6014. return (
  6015. this.addBytes(0),
  6016. 0 !== this._lastSecondBytes
  6017. ? this._lastSecondBytes / 1024
  6018. : this._now() - this._lastCheckpoint >= 500
  6019. ? this.currentKBps
  6020. : 0
  6021. );
  6022. },
  6023. enumerable: !1,
  6024. configurable: !0,
  6025. }),
  6026. Object.defineProperty(e.prototype, 'averageKBps', {
  6027. get: function () {
  6028. var e = (this._now() - this._firstCheckpoint) / 1e3;
  6029. return this._totalBytes / e / 1024;
  6030. },
  6031. enumerable: !1,
  6032. configurable: !0,
  6033. }),
  6034. e
  6035. );
  6036. })(),
  6037. o = i(939),
  6038. a = i(538),
  6039. h = i(29),
  6040. u =
  6041. ((n = function (e, t) {
  6042. return (n =
  6043. Object.setPrototypeOf ||
  6044. ({ __proto__: [] } instanceof Array &&
  6045. function (e, t) {
  6046. e.__proto__ = t;
  6047. }) ||
  6048. function (e, t) {
  6049. for (var i in t)
  6050. Object.prototype.hasOwnProperty.call(t, i) &&
  6051. (e[i] = t[i]);
  6052. })(e, t);
  6053. }),
  6054. function (e, t) {
  6055. if ('function' != typeof t && null !== t)
  6056. throw new TypeError(
  6057. 'Class extends value ' +
  6058. String(t) +
  6059. ' is not a constructor or null'
  6060. );
  6061. function i() {
  6062. this.constructor = e;
  6063. }
  6064. n(e, t),
  6065. (e.prototype =
  6066. null === t
  6067. ? Object.create(t)
  6068. : ((i.prototype = t.prototype), new i()));
  6069. }),
  6070. l = (function (e) {
  6071. function t(t, i) {
  6072. var n = e.call(this, 'fetch-stream-loader') || this;
  6073. return (
  6074. (n.TAG = 'FetchStreamLoader'),
  6075. (n._seekHandler = t),
  6076. (n._config = i),
  6077. (n._needStash = !0),
  6078. (n._requestAbort = !1),
  6079. (n._contentLength = null),
  6080. (n._receivedLength = 0),
  6081. n
  6082. );
  6083. }
  6084. return (
  6085. u(t, e),
  6086. (t.isSupported = function () {
  6087. try {
  6088. var e = a.Z.msedge && a.Z.version.minor >= 15048,
  6089. t = !a.Z.msedge || e;
  6090. return self.fetch && self.ReadableStream && t;
  6091. } catch (e) {
  6092. return !1;
  6093. }
  6094. }),
  6095. (t.prototype.destroy = function () {
  6096. this.isWorking() && this.abort(),
  6097. e.prototype.destroy.call(this);
  6098. }),
  6099. (t.prototype.open = function (e, t) {
  6100. var i = this;
  6101. (this._dataSource = e), (this._range = t);
  6102. var n = e.url;
  6103. this._config.reuseRedirectedURL &&
  6104. null != e.redirectedURL &&
  6105. (n = e.redirectedURL);
  6106. var r = this._seekHandler.getConfig(n, t),
  6107. s = new self.Headers();
  6108. if ('object' == typeof r.headers) {
  6109. var a = r.headers;
  6110. for (var u in a) a.hasOwnProperty(u) && s.append(u, a[u]);
  6111. }
  6112. var l = {
  6113. method: 'GET',
  6114. headers: s,
  6115. mode: 'cors',
  6116. cache: 'default',
  6117. referrerPolicy: 'no-referrer-when-downgrade',
  6118. };
  6119. if ('object' == typeof this._config.headers)
  6120. for (var u in this._config.headers)
  6121. s.append(u, this._config.headers[u]);
  6122. !1 === e.cors && (l.mode = 'same-origin'),
  6123. e.withCredentials && (l.credentials = 'include'),
  6124. e.referrerPolicy && (l.referrerPolicy = e.referrerPolicy),
  6125. self.AbortController &&
  6126. ((this._abortController = new self.AbortController()),
  6127. (l.signal = this._abortController.signal)),
  6128. (this._status = o.GM.kConnecting),
  6129. self
  6130. .fetch(r.url, l)
  6131. .then(function (e) {
  6132. if (i._requestAbort)
  6133. return (i._status = o.GM.kIdle), void e.body.cancel();
  6134. if (e.ok && e.status >= 200 && e.status <= 299) {
  6135. if (e.url !== r.url && i._onURLRedirect) {
  6136. var t = i._seekHandler.removeURLParameters(e.url);
  6137. i._onURLRedirect(t);
  6138. }
  6139. var n = e.headers.get('Content-Length');
  6140. return (
  6141. null != n &&
  6142. ((i._contentLength = parseInt(n)),
  6143. 0 !== i._contentLength &&
  6144. i._onContentLengthKnown &&
  6145. i._onContentLengthKnown(i._contentLength)),
  6146. i._pump.call(i, e.body.getReader())
  6147. );
  6148. }
  6149. if (((i._status = o.GM.kError), !i._onError))
  6150. throw new h.OZ(
  6151. 'FetchStreamLoader: Http code invalid, ' +
  6152. e.status +
  6153. ' ' +
  6154. e.statusText
  6155. );
  6156. i._onError(o.nm.HTTP_STATUS_CODE_INVALID, {
  6157. code: e.status,
  6158. msg: e.statusText,
  6159. });
  6160. })
  6161. .catch(function (e) {
  6162. if (
  6163. !i._abortController ||
  6164. !i._abortController.signal.aborted
  6165. ) {
  6166. if (((i._status = o.GM.kError), !i._onError)) throw e;
  6167. i._onError(o.nm.EXCEPTION, {
  6168. code: -1,
  6169. msg: e.message,
  6170. });
  6171. }
  6172. });
  6173. }),
  6174. (t.prototype.abort = function () {
  6175. if (
  6176. ((this._requestAbort = !0),
  6177. (this._status !== o.GM.kBuffering || !a.Z.chrome) &&
  6178. this._abortController)
  6179. )
  6180. try {
  6181. this._abortController.abort();
  6182. } catch (e) {}
  6183. }),
  6184. (t.prototype._pump = function (e) {
  6185. var t = this;
  6186. return e
  6187. .read()
  6188. .then(function (i) {
  6189. if (i.done)
  6190. if (
  6191. null !== t._contentLength &&
  6192. t._receivedLength < t._contentLength
  6193. ) {
  6194. t._status = o.GM.kError;
  6195. var n = o.nm.EARLY_EOF,
  6196. r = {
  6197. code: -1,
  6198. msg: 'Fetch stream meet Early-EOF',
  6199. };
  6200. if (!t._onError) throw new h.OZ(r.msg);
  6201. t._onError(n, r);
  6202. } else
  6203. (t._status = o.GM.kComplete),
  6204. t._onComplete &&
  6205. t._onComplete(
  6206. t._range.from,
  6207. t._range.from + t._receivedLength - 1
  6208. );
  6209. else {
  6210. if (
  6211. t._abortController &&
  6212. t._abortController.signal.aborted
  6213. )
  6214. return void (t._status = o.GM.kComplete);
  6215. if (!0 === t._requestAbort)
  6216. return (t._status = o.GM.kComplete), e.cancel();
  6217. t._status = o.GM.kBuffering;
  6218. var s = i.value.buffer,
  6219. a = t._range.from + t._receivedLength;
  6220. (t._receivedLength += s.byteLength),
  6221. t._onDataArrival &&
  6222. t._onDataArrival(s, a, t._receivedLength),
  6223. t._pump(e);
  6224. }
  6225. })
  6226. .catch(function (e) {
  6227. if (
  6228. t._abortController &&
  6229. t._abortController.signal.aborted
  6230. )
  6231. t._status = o.GM.kComplete;
  6232. else if (11 !== e.code || !a.Z.msedge) {
  6233. t._status = o.GM.kError;
  6234. var i = 0,
  6235. n = null;
  6236. if (
  6237. ((19 !== e.code && 'network error' !== e.message) ||
  6238. !(
  6239. null === t._contentLength ||
  6240. (null !== t._contentLength &&
  6241. t._receivedLength < t._contentLength)
  6242. )
  6243. ? ((i = o.nm.EXCEPTION),
  6244. (n = { code: e.code, msg: e.message }))
  6245. : ((i = o.nm.EARLY_EOF),
  6246. (n = {
  6247. code: e.code,
  6248. msg: 'Fetch stream meet Early-EOF',
  6249. })),
  6250. !t._onError)
  6251. )
  6252. throw new h.OZ(n.msg);
  6253. t._onError(i, n);
  6254. }
  6255. });
  6256. }),
  6257. t
  6258. );
  6259. })(o.fp),
  6260. d = (function () {
  6261. var e = function (t, i) {
  6262. return (e =
  6263. Object.setPrototypeOf ||
  6264. ({ __proto__: [] } instanceof Array &&
  6265. function (e, t) {
  6266. e.__proto__ = t;
  6267. }) ||
  6268. function (e, t) {
  6269. for (var i in t)
  6270. Object.prototype.hasOwnProperty.call(t, i) &&
  6271. (e[i] = t[i]);
  6272. })(t, i);
  6273. };
  6274. return function (t, i) {
  6275. if ('function' != typeof i && null !== i)
  6276. throw new TypeError(
  6277. 'Class extends value ' +
  6278. String(i) +
  6279. ' is not a constructor or null'
  6280. );
  6281. function n() {
  6282. this.constructor = t;
  6283. }
  6284. e(t, i),
  6285. (t.prototype =
  6286. null === i
  6287. ? Object.create(i)
  6288. : ((n.prototype = i.prototype), new n()));
  6289. };
  6290. })(),
  6291. c = (function (e) {
  6292. function t(t, i) {
  6293. var n = e.call(this, 'xhr-moz-chunked-loader') || this;
  6294. return (
  6295. (n.TAG = 'MozChunkedLoader'),
  6296. (n._seekHandler = t),
  6297. (n._config = i),
  6298. (n._needStash = !0),
  6299. (n._xhr = null),
  6300. (n._requestAbort = !1),
  6301. (n._contentLength = null),
  6302. (n._receivedLength = 0),
  6303. n
  6304. );
  6305. }
  6306. return (
  6307. d(t, e),
  6308. (t.isSupported = function () {
  6309. try {
  6310. var e = new XMLHttpRequest();
  6311. return (
  6312. e.open('GET', 'https://example.com', !0),
  6313. (e.responseType = 'moz-chunked-arraybuffer'),
  6314. 'moz-chunked-arraybuffer' === e.responseType
  6315. );
  6316. } catch (e) {
  6317. return r.Z.w('MozChunkedLoader', e.message), !1;
  6318. }
  6319. }),
  6320. (t.prototype.destroy = function () {
  6321. this.isWorking() && this.abort(),
  6322. this._xhr &&
  6323. ((this._xhr.onreadystatechange = null),
  6324. (this._xhr.onprogress = null),
  6325. (this._xhr.onloadend = null),
  6326. (this._xhr.onerror = null),
  6327. (this._xhr = null)),
  6328. e.prototype.destroy.call(this);
  6329. }),
  6330. (t.prototype.open = function (e, t) {
  6331. (this._dataSource = e), (this._range = t);
  6332. var i = e.url;
  6333. this._config.reuseRedirectedURL &&
  6334. null != e.redirectedURL &&
  6335. (i = e.redirectedURL);
  6336. var n = this._seekHandler.getConfig(i, t);
  6337. this._requestURL = n.url;
  6338. var r = (this._xhr = new XMLHttpRequest());
  6339. if (
  6340. (r.open('GET', n.url, !0),
  6341. (r.responseType = 'moz-chunked-arraybuffer'),
  6342. (r.onreadystatechange =
  6343. this._onReadyStateChange.bind(this)),
  6344. (r.onprogress = this._onProgress.bind(this)),
  6345. (r.onloadend = this._onLoadEnd.bind(this)),
  6346. (r.onerror = this._onXhrError.bind(this)),
  6347. e.withCredentials && (r.withCredentials = !0),
  6348. 'object' == typeof n.headers)
  6349. ) {
  6350. var s = n.headers;
  6351. for (var a in s)
  6352. s.hasOwnProperty(a) && r.setRequestHeader(a, s[a]);
  6353. }
  6354. if ('object' == typeof this._config.headers) {
  6355. s = this._config.headers;
  6356. for (var a in s)
  6357. s.hasOwnProperty(a) && r.setRequestHeader(a, s[a]);
  6358. }
  6359. (this._status = o.GM.kConnecting), r.send();
  6360. }),
  6361. (t.prototype.abort = function () {
  6362. (this._requestAbort = !0),
  6363. this._xhr && this._xhr.abort(),
  6364. (this._status = o.GM.kComplete);
  6365. }),
  6366. (t.prototype._onReadyStateChange = function (e) {
  6367. var t = e.target;
  6368. if (2 === t.readyState) {
  6369. if (
  6370. null != t.responseURL &&
  6371. t.responseURL !== this._requestURL &&
  6372. this._onURLRedirect
  6373. ) {
  6374. var i = this._seekHandler.removeURLParameters(
  6375. t.responseURL
  6376. );
  6377. this._onURLRedirect(i);
  6378. }
  6379. if (0 !== t.status && (t.status < 200 || t.status > 299)) {
  6380. if (((this._status = o.GM.kError), !this._onError))
  6381. throw new h.OZ(
  6382. 'MozChunkedLoader: Http code invalid, ' +
  6383. t.status +
  6384. ' ' +
  6385. t.statusText
  6386. );
  6387. this._onError(o.nm.HTTP_STATUS_CODE_INVALID, {
  6388. code: t.status,
  6389. msg: t.statusText,
  6390. });
  6391. } else this._status = o.GM.kBuffering;
  6392. }
  6393. }),
  6394. (t.prototype._onProgress = function (e) {
  6395. if (this._status !== o.GM.kError) {
  6396. null === this._contentLength &&
  6397. null !== e.total &&
  6398. 0 !== e.total &&
  6399. ((this._contentLength = e.total),
  6400. this._onContentLengthKnown &&
  6401. this._onContentLengthKnown(this._contentLength));
  6402. var t = e.target.response,
  6403. i = this._range.from + this._receivedLength;
  6404. (this._receivedLength += t.byteLength),
  6405. this._onDataArrival &&
  6406. this._onDataArrival(t, i, this._receivedLength);
  6407. }
  6408. }),
  6409. (t.prototype._onLoadEnd = function (e) {
  6410. !0 !== this._requestAbort
  6411. ? this._status !== o.GM.kError &&
  6412. ((this._status = o.GM.kComplete),
  6413. this._onComplete &&
  6414. this._onComplete(
  6415. this._range.from,
  6416. this._range.from + this._receivedLength - 1
  6417. ))
  6418. : (this._requestAbort = !1);
  6419. }),
  6420. (t.prototype._onXhrError = function (e) {
  6421. this._status = o.GM.kError;
  6422. var t = 0,
  6423. i = null;
  6424. if (
  6425. (this._contentLength && e.loaded < this._contentLength
  6426. ? ((t = o.nm.EARLY_EOF),
  6427. (i = {
  6428. code: -1,
  6429. msg: 'Moz-Chunked stream meet Early-Eof',
  6430. }))
  6431. : ((t = o.nm.EXCEPTION),
  6432. (i = {
  6433. code: -1,
  6434. msg: e.constructor.name + ' ' + e.type,
  6435. })),
  6436. !this._onError)
  6437. )
  6438. throw new h.OZ(i.msg);
  6439. this._onError(t, i);
  6440. }),
  6441. t
  6442. );
  6443. })(o.fp),
  6444. f = (function () {
  6445. var e = function (t, i) {
  6446. return (e =
  6447. Object.setPrototypeOf ||
  6448. ({ __proto__: [] } instanceof Array &&
  6449. function (e, t) {
  6450. e.__proto__ = t;
  6451. }) ||
  6452. function (e, t) {
  6453. for (var i in t)
  6454. Object.prototype.hasOwnProperty.call(t, i) &&
  6455. (e[i] = t[i]);
  6456. })(t, i);
  6457. };
  6458. return function (t, i) {
  6459. if ('function' != typeof i && null !== i)
  6460. throw new TypeError(
  6461. 'Class extends value ' +
  6462. String(i) +
  6463. ' is not a constructor or null'
  6464. );
  6465. function n() {
  6466. this.constructor = t;
  6467. }
  6468. e(t, i),
  6469. (t.prototype =
  6470. null === i
  6471. ? Object.create(i)
  6472. : ((n.prototype = i.prototype), new n()));
  6473. };
  6474. })(),
  6475. _ = (function (e) {
  6476. function t(t, i) {
  6477. var n = e.call(this, 'xhr-range-loader') || this;
  6478. return (
  6479. (n.TAG = 'RangeLoader'),
  6480. (n._seekHandler = t),
  6481. (n._config = i),
  6482. (n._needStash = !1),
  6483. (n._chunkSizeKBList = [
  6484. 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 5120,
  6485. 6144, 7168, 8192,
  6486. ]),
  6487. (n._currentChunkSizeKB = 384),
  6488. (n._currentSpeedNormalized = 0),
  6489. (n._zeroSpeedChunkCount = 0),
  6490. (n._xhr = null),
  6491. (n._speedSampler = new s()),
  6492. (n._requestAbort = !1),
  6493. (n._waitForTotalLength = !1),
  6494. (n._totalLengthReceived = !1),
  6495. (n._currentRequestURL = null),
  6496. (n._currentRedirectedURL = null),
  6497. (n._currentRequestRange = null),
  6498. (n._totalLength = null),
  6499. (n._contentLength = null),
  6500. (n._receivedLength = 0),
  6501. (n._lastTimeLoaded = 0),
  6502. n
  6503. );
  6504. }
  6505. return (
  6506. f(t, e),
  6507. (t.isSupported = function () {
  6508. try {
  6509. var e = new XMLHttpRequest();
  6510. return (
  6511. e.open('GET', 'https://example.com', !0),
  6512. (e.responseType = 'arraybuffer'),
  6513. 'arraybuffer' === e.responseType
  6514. );
  6515. } catch (e) {
  6516. return r.Z.w('RangeLoader', e.message), !1;
  6517. }
  6518. }),
  6519. (t.prototype.destroy = function () {
  6520. this.isWorking() && this.abort(),
  6521. this._xhr &&
  6522. ((this._xhr.onreadystatechange = null),
  6523. (this._xhr.onprogress = null),
  6524. (this._xhr.onload = null),
  6525. (this._xhr.onerror = null),
  6526. (this._xhr = null)),
  6527. e.prototype.destroy.call(this);
  6528. }),
  6529. Object.defineProperty(t.prototype, 'currentSpeed', {
  6530. get: function () {
  6531. return this._speedSampler.lastSecondKBps;
  6532. },
  6533. enumerable: !1,
  6534. configurable: !0,
  6535. }),
  6536. (t.prototype.open = function (e, t) {
  6537. (this._dataSource = e),
  6538. (this._range = t),
  6539. (this._status = o.GM.kConnecting);
  6540. var i = !1;
  6541. null != this._dataSource.filesize &&
  6542. 0 !== this._dataSource.filesize &&
  6543. ((i = !0), (this._totalLength = this._dataSource.filesize)),
  6544. this._totalLengthReceived || i
  6545. ? this._openSubRange()
  6546. : ((this._waitForTotalLength = !0),
  6547. this._internalOpen(this._dataSource, {
  6548. from: 0,
  6549. to: -1,
  6550. }));
  6551. }),
  6552. (t.prototype._openSubRange = function () {
  6553. var e = 1024 * this._currentChunkSizeKB,
  6554. t = this._range.from + this._receivedLength,
  6555. i = t + e;
  6556. null != this._contentLength &&
  6557. i - this._range.from >= this._contentLength &&
  6558. (i = this._range.from + this._contentLength - 1),
  6559. (this._currentRequestRange = { from: t, to: i }),
  6560. this._internalOpen(
  6561. this._dataSource,
  6562. this._currentRequestRange
  6563. );
  6564. }),
  6565. (t.prototype._internalOpen = function (e, t) {
  6566. this._lastTimeLoaded = 0;
  6567. var i = e.url;
  6568. this._config.reuseRedirectedURL &&
  6569. (null != this._currentRedirectedURL
  6570. ? (i = this._currentRedirectedURL)
  6571. : null != e.redirectedURL && (i = e.redirectedURL));
  6572. var n = this._seekHandler.getConfig(i, t);
  6573. this._currentRequestURL = n.url;
  6574. var r = (this._xhr = new XMLHttpRequest());
  6575. if (
  6576. (r.open('GET', n.url, !0),
  6577. (r.responseType = 'arraybuffer'),
  6578. (r.onreadystatechange =
  6579. this._onReadyStateChange.bind(this)),
  6580. (r.onprogress = this._onProgress.bind(this)),
  6581. (r.onload = this._onLoad.bind(this)),
  6582. (r.onerror = this._onXhrError.bind(this)),
  6583. e.withCredentials && (r.withCredentials = !0),
  6584. 'object' == typeof n.headers)
  6585. ) {
  6586. var s = n.headers;
  6587. for (var o in s)
  6588. s.hasOwnProperty(o) && r.setRequestHeader(o, s[o]);
  6589. }
  6590. if ('object' == typeof this._config.headers) {
  6591. s = this._config.headers;
  6592. for (var o in s)
  6593. s.hasOwnProperty(o) && r.setRequestHeader(o, s[o]);
  6594. }
  6595. r.send();
  6596. }),
  6597. (t.prototype.abort = function () {
  6598. (this._requestAbort = !0),
  6599. this._internalAbort(),
  6600. (this._status = o.GM.kComplete);
  6601. }),
  6602. (t.prototype._internalAbort = function () {
  6603. this._xhr &&
  6604. ((this._xhr.onreadystatechange = null),
  6605. (this._xhr.onprogress = null),
  6606. (this._xhr.onload = null),
  6607. (this._xhr.onerror = null),
  6608. this._xhr.abort(),
  6609. (this._xhr = null));
  6610. }),
  6611. (t.prototype._onReadyStateChange = function (e) {
  6612. var t = e.target;
  6613. if (2 === t.readyState) {
  6614. if (null != t.responseURL) {
  6615. var i = this._seekHandler.removeURLParameters(
  6616. t.responseURL
  6617. );
  6618. t.responseURL !== this._currentRequestURL &&
  6619. i !== this._currentRedirectedURL &&
  6620. ((this._currentRedirectedURL = i),
  6621. this._onURLRedirect && this._onURLRedirect(i));
  6622. }
  6623. if (t.status >= 200 && t.status <= 299) {
  6624. if (this._waitForTotalLength) return;
  6625. this._status = o.GM.kBuffering;
  6626. } else {
  6627. if (((this._status = o.GM.kError), !this._onError))
  6628. throw new h.OZ(
  6629. 'RangeLoader: Http code invalid, ' +
  6630. t.status +
  6631. ' ' +
  6632. t.statusText
  6633. );
  6634. this._onError(o.nm.HTTP_STATUS_CODE_INVALID, {
  6635. code: t.status,
  6636. msg: t.statusText,
  6637. });
  6638. }
  6639. }
  6640. }),
  6641. (t.prototype._onProgress = function (e) {
  6642. if (this._status !== o.GM.kError) {
  6643. if (null === this._contentLength) {
  6644. var t = !1;
  6645. if (this._waitForTotalLength) {
  6646. (this._waitForTotalLength = !1),
  6647. (this._totalLengthReceived = !0),
  6648. (t = !0);
  6649. var i = e.total;
  6650. this._internalAbort(),
  6651. (null != i) & (0 !== i) && (this._totalLength = i);
  6652. }
  6653. if (
  6654. (-1 === this._range.to
  6655. ? (this._contentLength =
  6656. this._totalLength - this._range.from)
  6657. : (this._contentLength =
  6658. this._range.to - this._range.from + 1),
  6659. t)
  6660. )
  6661. return void this._openSubRange();
  6662. this._onContentLengthKnown &&
  6663. this._onContentLengthKnown(this._contentLength);
  6664. }
  6665. var n = e.loaded - this._lastTimeLoaded;
  6666. (this._lastTimeLoaded = e.loaded),
  6667. this._speedSampler.addBytes(n);
  6668. }
  6669. }),
  6670. (t.prototype._normalizeSpeed = function (e) {
  6671. var t = this._chunkSizeKBList,
  6672. i = t.length - 1,
  6673. n = 0,
  6674. r = 0,
  6675. s = i;
  6676. if (e < t[0]) return t[0];
  6677. for (; r <= s; ) {
  6678. if (
  6679. (n = r + Math.floor((s - r) / 2)) === i ||
  6680. (e >= t[n] && e < t[n + 1])
  6681. )
  6682. return t[n];
  6683. t[n] < e ? (r = n + 1) : (s = n - 1);
  6684. }
  6685. }),
  6686. (t.prototype._onLoad = function (e) {
  6687. if (this._status !== o.GM.kError)
  6688. if (this._waitForTotalLength) this._waitForTotalLength = !1;
  6689. else {
  6690. this._lastTimeLoaded = 0;
  6691. var t = this._speedSampler.lastSecondKBps;
  6692. if (
  6693. (0 === t &&
  6694. (this._zeroSpeedChunkCount++,
  6695. this._zeroSpeedChunkCount >= 3 &&
  6696. (t = this._speedSampler.currentKBps)),
  6697. 0 !== t)
  6698. ) {
  6699. var i = this._normalizeSpeed(t);
  6700. this._currentSpeedNormalized !== i &&
  6701. ((this._currentSpeedNormalized = i),
  6702. (this._currentChunkSizeKB = i));
  6703. }
  6704. var n = e.target.response,
  6705. r = this._range.from + this._receivedLength;
  6706. this._receivedLength += n.byteLength;
  6707. var s = !1;
  6708. null != this._contentLength &&
  6709. this._receivedLength < this._contentLength
  6710. ? this._openSubRange()
  6711. : (s = !0),
  6712. this._onDataArrival &&
  6713. this._onDataArrival(n, r, this._receivedLength),
  6714. s &&
  6715. ((this._status = o.GM.kComplete),
  6716. this._onComplete &&
  6717. this._onComplete(
  6718. this._range.from,
  6719. this._range.from + this._receivedLength - 1
  6720. ));
  6721. }
  6722. }),
  6723. (t.prototype._onXhrError = function (e) {
  6724. this._status = o.GM.kError;
  6725. var t = 0,
  6726. i = null;
  6727. if (
  6728. (this._contentLength &&
  6729. this._receivedLength > 0 &&
  6730. this._receivedLength < this._contentLength
  6731. ? ((t = o.nm.EARLY_EOF),
  6732. (i = { code: -1, msg: 'RangeLoader meet Early-Eof' }))
  6733. : ((t = o.nm.EXCEPTION),
  6734. (i = {
  6735. code: -1,
  6736. msg: e.constructor.name + ' ' + e.type,
  6737. })),
  6738. !this._onError)
  6739. )
  6740. throw new h.OZ(i.msg);
  6741. this._onError(t, i);
  6742. }),
  6743. t
  6744. );
  6745. })(o.fp),
  6746. p = (function () {
  6747. var e = function (t, i) {
  6748. return (e =
  6749. Object.setPrototypeOf ||
  6750. ({ __proto__: [] } instanceof Array &&
  6751. function (e, t) {
  6752. e.__proto__ = t;
  6753. }) ||
  6754. function (e, t) {
  6755. for (var i in t)
  6756. Object.prototype.hasOwnProperty.call(t, i) &&
  6757. (e[i] = t[i]);
  6758. })(t, i);
  6759. };
  6760. return function (t, i) {
  6761. if ('function' != typeof i && null !== i)
  6762. throw new TypeError(
  6763. 'Class extends value ' +
  6764. String(i) +
  6765. ' is not a constructor or null'
  6766. );
  6767. function n() {
  6768. this.constructor = t;
  6769. }
  6770. e(t, i),
  6771. (t.prototype =
  6772. null === i
  6773. ? Object.create(i)
  6774. : ((n.prototype = i.prototype), new n()));
  6775. };
  6776. })(),
  6777. m = (function (e) {
  6778. function t() {
  6779. var t = e.call(this, 'websocket-loader') || this;
  6780. return (
  6781. (t.TAG = 'WebSocketLoader'),
  6782. (t._needStash = !0),
  6783. (t._ws = null),
  6784. (t._requestAbort = !1),
  6785. (t._receivedLength = 0),
  6786. t
  6787. );
  6788. }
  6789. return (
  6790. p(t, e),
  6791. (t.isSupported = function () {
  6792. try {
  6793. return void 0 !== self.WebSocket;
  6794. } catch (e) {
  6795. return !1;
  6796. }
  6797. }),
  6798. (t.prototype.destroy = function () {
  6799. this._ws && this.abort(), e.prototype.destroy.call(this);
  6800. }),
  6801. (t.prototype.open = function (e) {
  6802. try {
  6803. var t = (this._ws = new self.WebSocket(e.url));
  6804. (t.binaryType = 'arraybuffer'),
  6805. (t.onopen = this._onWebSocketOpen.bind(this)),
  6806. (t.onclose = this._onWebSocketClose.bind(this)),
  6807. (t.onmessage = this._onWebSocketMessage.bind(this)),
  6808. (t.onerror = this._onWebSocketError.bind(this)),
  6809. (this._status = o.GM.kConnecting);
  6810. } catch (e) {
  6811. this._status = o.GM.kError;
  6812. var i = { code: e.code, msg: e.message };
  6813. if (!this._onError) throw new h.OZ(i.msg);
  6814. this._onError(o.nm.EXCEPTION, i);
  6815. }
  6816. }),
  6817. (t.prototype.abort = function () {
  6818. var e = this._ws;
  6819. !e ||
  6820. (0 !== e.readyState && 1 !== e.readyState) ||
  6821. ((this._requestAbort = !0), e.close()),
  6822. (this._ws = null),
  6823. (this._status = o.GM.kComplete);
  6824. }),
  6825. (t.prototype._onWebSocketOpen = function (e) {
  6826. this._status = o.GM.kBuffering;
  6827. }),
  6828. (t.prototype._onWebSocketClose = function (e) {
  6829. !0 !== this._requestAbort
  6830. ? ((this._status = o.GM.kComplete),
  6831. this._onComplete &&
  6832. this._onComplete(0, this._receivedLength - 1))
  6833. : (this._requestAbort = !1);
  6834. }),
  6835. (t.prototype._onWebSocketMessage = function (e) {
  6836. var t = this;
  6837. if (e.data instanceof ArrayBuffer)
  6838. this._dispatchArrayBuffer(e.data);
  6839. else if (e.data instanceof Blob) {
  6840. var i = new FileReader();
  6841. (i.onload = function () {
  6842. t._dispatchArrayBuffer(i.result);
  6843. }),
  6844. i.readAsArrayBuffer(e.data);
  6845. } else {
  6846. this._status = o.GM.kError;
  6847. var n = {
  6848. code: -1,
  6849. msg:
  6850. 'Unsupported WebSocket message type: ' +
  6851. e.data.constructor.name,
  6852. };
  6853. if (!this._onError) throw new h.OZ(n.msg);
  6854. this._onError(o.nm.EXCEPTION, n);
  6855. }
  6856. }),
  6857. (t.prototype._dispatchArrayBuffer = function (e) {
  6858. var t = e,
  6859. i = this._receivedLength;
  6860. (this._receivedLength += t.byteLength),
  6861. this._onDataArrival &&
  6862. this._onDataArrival(t, i, this._receivedLength);
  6863. }),
  6864. (t.prototype._onWebSocketError = function (e) {
  6865. this._status = o.GM.kError;
  6866. var t = { code: e.code, msg: e.message };
  6867. if (!this._onError) throw new h.OZ(t.msg);
  6868. this._onError(o.nm.EXCEPTION, t);
  6869. }),
  6870. t
  6871. );
  6872. })(o.fp),
  6873. g = (function () {
  6874. function e(e) {
  6875. this._zeroStart = e || !1;
  6876. }
  6877. return (
  6878. (e.prototype.getConfig = function (e, t) {
  6879. var i = {};
  6880. if (0 !== t.from || -1 !== t.to) {
  6881. var n = void 0;
  6882. (n =
  6883. -1 !== t.to
  6884. ? 'bytes=' + t.from.toString() + '-' + t.to.toString()
  6885. : 'bytes=' + t.from.toString() + '-'),
  6886. (i.Range = n);
  6887. } else this._zeroStart && (i.Range = 'bytes=0-');
  6888. return { url: e, headers: i };
  6889. }),
  6890. (e.prototype.removeURLParameters = function (e) {
  6891. return e;
  6892. }),
  6893. e
  6894. );
  6895. })(),
  6896. v = (function () {
  6897. function e(e, t) {
  6898. (this._startName = e), (this._endName = t);
  6899. }
  6900. return (
  6901. (e.prototype.getConfig = function (e, t) {
  6902. var i = e;
  6903. if (0 !== t.from || -1 !== t.to) {
  6904. var n = !0;
  6905. -1 === i.indexOf('?') && ((i += '?'), (n = !1)),
  6906. n && (i += '&'),
  6907. (i += this._startName + '=' + t.from.toString()),
  6908. -1 !== t.to &&
  6909. (i += '&' + this._endName + '=' + t.to.toString());
  6910. }
  6911. return { url: i, headers: {} };
  6912. }),
  6913. (e.prototype.removeURLParameters = function (e) {
  6914. var t = e.split('?')[0],
  6915. i = void 0,
  6916. n = e.indexOf('?');
  6917. -1 !== n && (i = e.substring(n + 1));
  6918. var r = '';
  6919. if (null != i && i.length > 0)
  6920. for (var s = i.split('&'), o = 0; o < s.length; o++) {
  6921. var a = s[o].split('='),
  6922. h = o > 0;
  6923. a[0] !== this._startName &&
  6924. a[0] !== this._endName &&
  6925. (h && (r += '&'), (r += s[o]));
  6926. }
  6927. return 0 === r.length ? t : t + '?' + r;
  6928. }),
  6929. e
  6930. );
  6931. })(),
  6932. y = (function () {
  6933. function e(e, t, i) {
  6934. (this.TAG = 'IOController'),
  6935. (this._config = t),
  6936. (this._extraData = i),
  6937. (this._stashInitialSize = 393216),
  6938. null != t.stashInitialSize &&
  6939. t.stashInitialSize > 0 &&
  6940. (this._stashInitialSize = t.stashInitialSize),
  6941. (this._stashUsed = 0),
  6942. (this._stashSize = this._stashInitialSize),
  6943. (this._bufferSize = 3145728),
  6944. (this._stashBuffer = new ArrayBuffer(this._bufferSize)),
  6945. (this._stashByteStart = 0),
  6946. (this._enableStash = !0),
  6947. !1 === t.enableStashBuffer && (this._enableStash = !1),
  6948. (this._loader = null),
  6949. (this._loaderClass = null),
  6950. (this._seekHandler = null),
  6951. (this._dataSource = e),
  6952. (this._isWebSocketURL = /wss?:\/\/(.+?)/.test(e.url)),
  6953. (this._refTotalLength = e.filesize ? e.filesize : null),
  6954. (this._totalLength = this._refTotalLength),
  6955. (this._fullRequestFlag = !1),
  6956. (this._currentRange = null),
  6957. (this._redirectedURL = null),
  6958. (this._speedNormalized = 0),
  6959. (this._speedSampler = new s()),
  6960. (this._speedNormalizeList = [
  6961. 64, 128, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096,
  6962. ]),
  6963. (this._isEarlyEofReconnecting = !1),
  6964. (this._paused = !1),
  6965. (this._resumeFrom = 0),
  6966. (this._onDataArrival = null),
  6967. (this._onSeeked = null),
  6968. (this._onError = null),
  6969. (this._onComplete = null),
  6970. (this._onRedirect = null),
  6971. (this._onRecoveredEarlyEof = null),
  6972. this._selectSeekHandler(),
  6973. this._selectLoader(),
  6974. this._createLoader();
  6975. }
  6976. return (
  6977. (e.prototype.destroy = function () {
  6978. this._loader.isWorking() && this._loader.abort(),
  6979. this._loader.destroy(),
  6980. (this._loader = null),
  6981. (this._loaderClass = null),
  6982. (this._dataSource = null),
  6983. (this._stashBuffer = null),
  6984. (this._stashUsed =
  6985. this._stashSize =
  6986. this._bufferSize =
  6987. this._stashByteStart =
  6988. 0),
  6989. (this._currentRange = null),
  6990. (this._speedSampler = null),
  6991. (this._isEarlyEofReconnecting = !1),
  6992. (this._onDataArrival = null),
  6993. (this._onSeeked = null),
  6994. (this._onError = null),
  6995. (this._onComplete = null),
  6996. (this._onRedirect = null),
  6997. (this._onRecoveredEarlyEof = null),
  6998. (this._extraData = null);
  6999. }),
  7000. (e.prototype.isWorking = function () {
  7001. return (
  7002. this._loader && this._loader.isWorking() && !this._paused
  7003. );
  7004. }),
  7005. (e.prototype.isPaused = function () {
  7006. return this._paused;
  7007. }),
  7008. Object.defineProperty(e.prototype, 'status', {
  7009. get: function () {
  7010. return this._loader.status;
  7011. },
  7012. enumerable: !1,
  7013. configurable: !0,
  7014. }),
  7015. Object.defineProperty(e.prototype, 'extraData', {
  7016. get: function () {
  7017. return this._extraData;
  7018. },
  7019. set: function (e) {
  7020. this._extraData = e;
  7021. },
  7022. enumerable: !1,
  7023. configurable: !0,
  7024. }),
  7025. Object.defineProperty(e.prototype, 'onDataArrival', {
  7026. get: function () {
  7027. return this._onDataArrival;
  7028. },
  7029. set: function (e) {
  7030. this._onDataArrival = e;
  7031. },
  7032. enumerable: !1,
  7033. configurable: !0,
  7034. }),
  7035. Object.defineProperty(e.prototype, 'onSeeked', {
  7036. get: function () {
  7037. return this._onSeeked;
  7038. },
  7039. set: function (e) {
  7040. this._onSeeked = e;
  7041. },
  7042. enumerable: !1,
  7043. configurable: !0,
  7044. }),
  7045. Object.defineProperty(e.prototype, 'onError', {
  7046. get: function () {
  7047. return this._onError;
  7048. },
  7049. set: function (e) {
  7050. this._onError = e;
  7051. },
  7052. enumerable: !1,
  7053. configurable: !0,
  7054. }),
  7055. Object.defineProperty(e.prototype, 'onComplete', {
  7056. get: function () {
  7057. return this._onComplete;
  7058. },
  7059. set: function (e) {
  7060. this._onComplete = e;
  7061. },
  7062. enumerable: !1,
  7063. configurable: !0,
  7064. }),
  7065. Object.defineProperty(e.prototype, 'onRedirect', {
  7066. get: function () {
  7067. return this._onRedirect;
  7068. },
  7069. set: function (e) {
  7070. this._onRedirect = e;
  7071. },
  7072. enumerable: !1,
  7073. configurable: !0,
  7074. }),
  7075. Object.defineProperty(e.prototype, 'onRecoveredEarlyEof', {
  7076. get: function () {
  7077. return this._onRecoveredEarlyEof;
  7078. },
  7079. set: function (e) {
  7080. this._onRecoveredEarlyEof = e;
  7081. },
  7082. enumerable: !1,
  7083. configurable: !0,
  7084. }),
  7085. Object.defineProperty(e.prototype, 'currentURL', {
  7086. get: function () {
  7087. return this._dataSource.url;
  7088. },
  7089. enumerable: !1,
  7090. configurable: !0,
  7091. }),
  7092. Object.defineProperty(e.prototype, 'hasRedirect', {
  7093. get: function () {
  7094. return (
  7095. null != this._redirectedURL ||
  7096. null != this._dataSource.redirectedURL
  7097. );
  7098. },
  7099. enumerable: !1,
  7100. configurable: !0,
  7101. }),
  7102. Object.defineProperty(e.prototype, 'currentRedirectedURL', {
  7103. get: function () {
  7104. return (
  7105. this._redirectedURL || this._dataSource.redirectedURL
  7106. );
  7107. },
  7108. enumerable: !1,
  7109. configurable: !0,
  7110. }),
  7111. Object.defineProperty(e.prototype, 'currentSpeed', {
  7112. get: function () {
  7113. return this._loaderClass === _
  7114. ? this._loader.currentSpeed
  7115. : this._speedSampler.lastSecondKBps;
  7116. },
  7117. enumerable: !1,
  7118. configurable: !0,
  7119. }),
  7120. Object.defineProperty(e.prototype, 'loaderType', {
  7121. get: function () {
  7122. return this._loader.type;
  7123. },
  7124. enumerable: !1,
  7125. configurable: !0,
  7126. }),
  7127. (e.prototype._selectSeekHandler = function () {
  7128. var e = this._config;
  7129. if ('range' === e.seekType)
  7130. this._seekHandler = new g(this._config.rangeLoadZeroStart);
  7131. else if ('param' === e.seekType) {
  7132. var t = e.seekParamStart || 'bstart',
  7133. i = e.seekParamEnd || 'bend';
  7134. this._seekHandler = new v(t, i);
  7135. } else {
  7136. if ('custom' !== e.seekType)
  7137. throw new h.OC(
  7138. 'Invalid seekType in config: ' + e.seekType
  7139. );
  7140. if ('function' != typeof e.customSeekHandler)
  7141. throw new h.OC(
  7142. 'Custom seekType specified in config but invalid customSeekHandler!'
  7143. );
  7144. this._seekHandler = new e.customSeekHandler();
  7145. }
  7146. }),
  7147. (e.prototype._selectLoader = function () {
  7148. if (null != this._config.customLoader)
  7149. this._loaderClass = this._config.customLoader;
  7150. else if (this._isWebSocketURL) this._loaderClass = m;
  7151. else if (l.isSupported()) this._loaderClass = l;
  7152. else if (c.isSupported()) this._loaderClass = c;
  7153. else {
  7154. if (!_.isSupported())
  7155. throw new h.OZ(
  7156. "Your browser doesn't support xhr with arraybuffer responseType!"
  7157. );
  7158. this._loaderClass = _;
  7159. }
  7160. }),
  7161. (e.prototype._createLoader = function () {
  7162. (this._loader = new this._loaderClass(
  7163. this._seekHandler,
  7164. this._config
  7165. )),
  7166. !1 === this._loader.needStashBuffer &&
  7167. (this._enableStash = !1),
  7168. (this._loader.onContentLengthKnown =
  7169. this._onContentLengthKnown.bind(this)),
  7170. (this._loader.onURLRedirect =
  7171. this._onURLRedirect.bind(this)),
  7172. (this._loader.onDataArrival =
  7173. this._onLoaderChunkArrival.bind(this)),
  7174. (this._loader.onComplete =
  7175. this._onLoaderComplete.bind(this)),
  7176. (this._loader.onError = this._onLoaderError.bind(this));
  7177. }),
  7178. (e.prototype.open = function (e) {
  7179. (this._currentRange = { from: 0, to: -1 }),
  7180. e && (this._currentRange.from = e),
  7181. this._speedSampler.reset(),
  7182. e || (this._fullRequestFlag = !0),
  7183. this._loader.open(
  7184. this._dataSource,
  7185. Object.assign({}, this._currentRange)
  7186. );
  7187. }),
  7188. (e.prototype.abort = function () {
  7189. this._loader.abort(),
  7190. this._paused &&
  7191. ((this._paused = !1), (this._resumeFrom = 0));
  7192. }),
  7193. (e.prototype.pause = function () {
  7194. this.isWorking() &&
  7195. (this._loader.abort(),
  7196. 0 !== this._stashUsed
  7197. ? ((this._resumeFrom = this._stashByteStart),
  7198. (this._currentRange.to = this._stashByteStart - 1))
  7199. : (this._resumeFrom = this._currentRange.to + 1),
  7200. (this._stashUsed = 0),
  7201. (this._stashByteStart = 0),
  7202. (this._paused = !0));
  7203. }),
  7204. (e.prototype.resume = function () {
  7205. if (this._paused) {
  7206. this._paused = !1;
  7207. var e = this._resumeFrom;
  7208. (this._resumeFrom = 0), this._internalSeek(e, !0);
  7209. }
  7210. }),
  7211. (e.prototype.seek = function (e) {
  7212. (this._paused = !1),
  7213. (this._stashUsed = 0),
  7214. (this._stashByteStart = 0),
  7215. this._internalSeek(e, !0);
  7216. }),
  7217. (e.prototype._internalSeek = function (e, t) {
  7218. this._loader.isWorking() && this._loader.abort(),
  7219. this._flushStashBuffer(t),
  7220. this._loader.destroy(),
  7221. (this._loader = null);
  7222. var i = { from: e, to: -1 };
  7223. (this._currentRange = { from: i.from, to: -1 }),
  7224. this._speedSampler.reset(),
  7225. (this._stashSize = this._stashInitialSize),
  7226. this._createLoader(),
  7227. this._loader.open(this._dataSource, i),
  7228. this._onSeeked && this._onSeeked();
  7229. }),
  7230. (e.prototype.updateUrl = function (e) {
  7231. if (!e || 'string' != typeof e || 0 === e.length)
  7232. throw new h.OC('Url must be a non-empty string!');
  7233. this._dataSource.url = e;
  7234. }),
  7235. (e.prototype._expandBuffer = function (e) {
  7236. for (var t = this._stashSize; t + 1048576 < e; ) t *= 2;
  7237. if ((t += 1048576) !== this._bufferSize) {
  7238. var i = new ArrayBuffer(t);
  7239. if (this._stashUsed > 0) {
  7240. var n = new Uint8Array(
  7241. this._stashBuffer,
  7242. 0,
  7243. this._stashUsed
  7244. );
  7245. new Uint8Array(i, 0, t).set(n, 0);
  7246. }
  7247. (this._stashBuffer = i), (this._bufferSize = t);
  7248. }
  7249. }),
  7250. (e.prototype._normalizeSpeed = function (e) {
  7251. var t = this._speedNormalizeList,
  7252. i = t.length - 1,
  7253. n = 0,
  7254. r = 0,
  7255. s = i;
  7256. if (e < t[0]) return t[0];
  7257. for (; r <= s; ) {
  7258. if (
  7259. (n = r + Math.floor((s - r) / 2)) === i ||
  7260. (e >= t[n] && e < t[n + 1])
  7261. )
  7262. return t[n];
  7263. t[n] < e ? (r = n + 1) : (s = n - 1);
  7264. }
  7265. }),
  7266. (e.prototype._adjustStashSize = function (e) {
  7267. var t = 0;
  7268. (t =
  7269. this._config.isLive || e < 512
  7270. ? e
  7271. : e >= 512 && e <= 1024
  7272. ? Math.floor(1.5 * e)
  7273. : 2 * e) > 8192 && (t = 8192);
  7274. var i = 1024 * t + 1048576;
  7275. this._bufferSize < i && this._expandBuffer(i),
  7276. (this._stashSize = 1024 * t);
  7277. }),
  7278. (e.prototype._dispatchChunks = function (e, t) {
  7279. return (
  7280. (this._currentRange.to = t + e.byteLength - 1),
  7281. this._onDataArrival(e, t)
  7282. );
  7283. }),
  7284. (e.prototype._onURLRedirect = function (e) {
  7285. (this._redirectedURL = e),
  7286. this._onRedirect && this._onRedirect(e);
  7287. }),
  7288. (e.prototype._onContentLengthKnown = function (e) {
  7289. e &&
  7290. this._fullRequestFlag &&
  7291. ((this._totalLength = e), (this._fullRequestFlag = !1));
  7292. }),
  7293. (e.prototype._onLoaderChunkArrival = function (e, t, i) {
  7294. if (!this._onDataArrival)
  7295. throw new h.rT(
  7296. 'IOController: No existing consumer (onDataArrival) callback!'
  7297. );
  7298. if (!this._paused) {
  7299. this._isEarlyEofReconnecting &&
  7300. ((this._isEarlyEofReconnecting = !1),
  7301. this._onRecoveredEarlyEof && this._onRecoveredEarlyEof()),
  7302. this._speedSampler.addBytes(e.byteLength);
  7303. var n = this._speedSampler.lastSecondKBps;
  7304. if (0 !== n) {
  7305. var r = this._normalizeSpeed(n);
  7306. this._speedNormalized !== r &&
  7307. ((this._speedNormalized = r), this._adjustStashSize(r));
  7308. }
  7309. if (this._enableStash)
  7310. if (
  7311. (0 === this._stashUsed &&
  7312. 0 === this._stashByteStart &&
  7313. (this._stashByteStart = t),
  7314. this._stashUsed + e.byteLength <= this._stashSize)
  7315. ) {
  7316. (a = new Uint8Array(
  7317. this._stashBuffer,
  7318. 0,
  7319. this._stashSize
  7320. )).set(new Uint8Array(e), this._stashUsed),
  7321. (this._stashUsed += e.byteLength);
  7322. } else {
  7323. a = new Uint8Array(
  7324. this._stashBuffer,
  7325. 0,
  7326. this._bufferSize
  7327. );
  7328. if (this._stashUsed > 0) {
  7329. var s = this._stashBuffer.slice(0, this._stashUsed);
  7330. if (
  7331. (u = this._dispatchChunks(
  7332. s,
  7333. this._stashByteStart
  7334. )) < s.byteLength
  7335. ) {
  7336. if (u > 0) {
  7337. l = new Uint8Array(s, u);
  7338. a.set(l, 0),
  7339. (this._stashUsed = l.byteLength),
  7340. (this._stashByteStart += u);
  7341. }
  7342. } else
  7343. (this._stashUsed = 0), (this._stashByteStart += u);
  7344. this._stashUsed + e.byteLength > this._bufferSize &&
  7345. (this._expandBuffer(this._stashUsed + e.byteLength),
  7346. (a = new Uint8Array(
  7347. this._stashBuffer,
  7348. 0,
  7349. this._bufferSize
  7350. ))),
  7351. a.set(new Uint8Array(e), this._stashUsed),
  7352. (this._stashUsed += e.byteLength);
  7353. } else {
  7354. if ((u = this._dispatchChunks(e, t)) < e.byteLength)
  7355. (o = e.byteLength - u) > this._bufferSize &&
  7356. (this._expandBuffer(o),
  7357. (a = new Uint8Array(
  7358. this._stashBuffer,
  7359. 0,
  7360. this._bufferSize
  7361. ))),
  7362. a.set(new Uint8Array(e, u), 0),
  7363. (this._stashUsed += o),
  7364. (this._stashByteStart = t + u);
  7365. }
  7366. }
  7367. else if (0 === this._stashUsed) {
  7368. var o;
  7369. if ((u = this._dispatchChunks(e, t)) < e.byteLength)
  7370. (o = e.byteLength - u) > this._bufferSize &&
  7371. this._expandBuffer(o),
  7372. (a = new Uint8Array(
  7373. this._stashBuffer,
  7374. 0,
  7375. this._bufferSize
  7376. )).set(new Uint8Array(e, u), 0),
  7377. (this._stashUsed += o),
  7378. (this._stashByteStart = t + u);
  7379. } else {
  7380. var a, u;
  7381. if (
  7382. (this._stashUsed + e.byteLength > this._bufferSize &&
  7383. this._expandBuffer(this._stashUsed + e.byteLength),
  7384. (a = new Uint8Array(
  7385. this._stashBuffer,
  7386. 0,
  7387. this._bufferSize
  7388. )).set(new Uint8Array(e), this._stashUsed),
  7389. (this._stashUsed += e.byteLength),
  7390. (u = this._dispatchChunks(
  7391. this._stashBuffer.slice(0, this._stashUsed),
  7392. this._stashByteStart
  7393. )) < this._stashUsed && u > 0)
  7394. ) {
  7395. var l = new Uint8Array(this._stashBuffer, u);
  7396. a.set(l, 0);
  7397. }
  7398. (this._stashUsed -= u), (this._stashByteStart += u);
  7399. }
  7400. }
  7401. }),
  7402. (e.prototype._flushStashBuffer = function (e) {
  7403. if (this._stashUsed > 0) {
  7404. var t = this._stashBuffer.slice(0, this._stashUsed),
  7405. i = this._dispatchChunks(t, this._stashByteStart),
  7406. n = t.byteLength - i;
  7407. if (i < t.byteLength) {
  7408. if (!e) {
  7409. if (i > 0) {
  7410. var s = new Uint8Array(
  7411. this._stashBuffer,
  7412. 0,
  7413. this._bufferSize
  7414. ),
  7415. o = new Uint8Array(t, i);
  7416. s.set(o, 0),
  7417. (this._stashUsed = o.byteLength),
  7418. (this._stashByteStart += i);
  7419. }
  7420. return 0;
  7421. }
  7422. r.Z.w(
  7423. this.TAG,
  7424. n +
  7425. ' bytes unconsumed data remain when flush buffer, dropped'
  7426. );
  7427. }
  7428. return (this._stashUsed = 0), (this._stashByteStart = 0), n;
  7429. }
  7430. return 0;
  7431. }),
  7432. (e.prototype._onLoaderComplete = function (e, t) {
  7433. this._flushStashBuffer(!0),
  7434. this._onComplete && this._onComplete(this._extraData);
  7435. }),
  7436. (e.prototype._onLoaderError = function (e, t) {
  7437. switch (
  7438. (r.Z.e(
  7439. this.TAG,
  7440. 'Loader error, code = ' + t.code + ', msg = ' + t.msg
  7441. ),
  7442. this._flushStashBuffer(!1),
  7443. this._isEarlyEofReconnecting &&
  7444. ((this._isEarlyEofReconnecting = !1),
  7445. (e = o.nm.UNRECOVERABLE_EARLY_EOF)),
  7446. e)
  7447. ) {
  7448. case o.nm.EARLY_EOF:
  7449. if (!this._config.isLive && this._totalLength) {
  7450. var i = this._currentRange.to + 1;
  7451. return void (
  7452. i < this._totalLength &&
  7453. (r.Z.w(
  7454. this.TAG,
  7455. 'Connection lost, trying reconnect...'
  7456. ),
  7457. (this._isEarlyEofReconnecting = !0),
  7458. this._internalSeek(i, !1))
  7459. );
  7460. }
  7461. e = o.nm.UNRECOVERABLE_EARLY_EOF;
  7462. break;
  7463. case o.nm.UNRECOVERABLE_EARLY_EOF:
  7464. case o.nm.CONNECTING_TIMEOUT:
  7465. case o.nm.HTTP_STATUS_CODE_INVALID:
  7466. case o.nm.EXCEPTION:
  7467. }
  7468. if (!this._onError) throw new h.OZ('IOException: ' + t.msg);
  7469. this._onError(e, t);
  7470. }),
  7471. e
  7472. );
  7473. })();
  7474. },
  7475. 939: function (e, t, i) {
  7476. 'use strict';
  7477. i.d(t, {
  7478. GM: function () {
  7479. return r;
  7480. },
  7481. nm: function () {
  7482. return s;
  7483. },
  7484. fp: function () {
  7485. return o;
  7486. },
  7487. });
  7488. var n = i(29),
  7489. r = {
  7490. kIdle: 0,
  7491. kConnecting: 1,
  7492. kBuffering: 2,
  7493. kError: 3,
  7494. kComplete: 4,
  7495. },
  7496. s = {
  7497. OK: 'OK',
  7498. EXCEPTION: 'Exception',
  7499. HTTP_STATUS_CODE_INVALID: 'HttpStatusCodeInvalid',
  7500. CONNECTING_TIMEOUT: 'ConnectingTimeout',
  7501. EARLY_EOF: 'EarlyEof',
  7502. UNRECOVERABLE_EARLY_EOF: 'UnrecoverableEarlyEof',
  7503. },
  7504. o = (function () {
  7505. function e(e) {
  7506. (this._type = e || 'undefined'),
  7507. (this._status = r.kIdle),
  7508. (this._needStash = !1),
  7509. (this._onContentLengthKnown = null),
  7510. (this._onURLRedirect = null),
  7511. (this._onDataArrival = null),
  7512. (this._onError = null),
  7513. (this._onComplete = null);
  7514. }
  7515. return (
  7516. (e.prototype.destroy = function () {
  7517. (this._status = r.kIdle),
  7518. (this._onContentLengthKnown = null),
  7519. (this._onURLRedirect = null),
  7520. (this._onDataArrival = null),
  7521. (this._onError = null),
  7522. (this._onComplete = null);
  7523. }),
  7524. (e.prototype.isWorking = function () {
  7525. return (
  7526. this._status === r.kConnecting ||
  7527. this._status === r.kBuffering
  7528. );
  7529. }),
  7530. Object.defineProperty(e.prototype, 'type', {
  7531. get: function () {
  7532. return this._type;
  7533. },
  7534. enumerable: !1,
  7535. configurable: !0,
  7536. }),
  7537. Object.defineProperty(e.prototype, 'status', {
  7538. get: function () {
  7539. return this._status;
  7540. },
  7541. enumerable: !1,
  7542. configurable: !0,
  7543. }),
  7544. Object.defineProperty(e.prototype, 'needStashBuffer', {
  7545. get: function () {
  7546. return this._needStash;
  7547. },
  7548. enumerable: !1,
  7549. configurable: !0,
  7550. }),
  7551. Object.defineProperty(e.prototype, 'onContentLengthKnown', {
  7552. get: function () {
  7553. return this._onContentLengthKnown;
  7554. },
  7555. set: function (e) {
  7556. this._onContentLengthKnown = e;
  7557. },
  7558. enumerable: !1,
  7559. configurable: !0,
  7560. }),
  7561. Object.defineProperty(e.prototype, 'onURLRedirect', {
  7562. get: function () {
  7563. return this._onURLRedirect;
  7564. },
  7565. set: function (e) {
  7566. this._onURLRedirect = e;
  7567. },
  7568. enumerable: !1,
  7569. configurable: !0,
  7570. }),
  7571. Object.defineProperty(e.prototype, 'onDataArrival', {
  7572. get: function () {
  7573. return this._onDataArrival;
  7574. },
  7575. set: function (e) {
  7576. this._onDataArrival = e;
  7577. },
  7578. enumerable: !1,
  7579. configurable: !0,
  7580. }),
  7581. Object.defineProperty(e.prototype, 'onError', {
  7582. get: function () {
  7583. return this._onError;
  7584. },
  7585. set: function (e) {
  7586. this._onError = e;
  7587. },
  7588. enumerable: !1,
  7589. configurable: !0,
  7590. }),
  7591. Object.defineProperty(e.prototype, 'onComplete', {
  7592. get: function () {
  7593. return this._onComplete;
  7594. },
  7595. set: function (e) {
  7596. this._onComplete = e;
  7597. },
  7598. enumerable: !1,
  7599. configurable: !0,
  7600. }),
  7601. (e.prototype.open = function (e, t) {
  7602. throw new n.do('Unimplemented abstract function!');
  7603. }),
  7604. (e.prototype.abort = function () {
  7605. throw new n.do('Unimplemented abstract function!');
  7606. }),
  7607. e
  7608. );
  7609. })();
  7610. },
  7611. 538: function (e, t) {
  7612. 'use strict';
  7613. var i = {};
  7614. !(function () {
  7615. var e = self.navigator.userAgent.toLowerCase(),
  7616. t =
  7617. /(edge)\/([\w.]+)/.exec(e) ||
  7618. /(opr)[\/]([\w.]+)/.exec(e) ||
  7619. /(chrome)[ \/]([\w.]+)/.exec(e) ||
  7620. /(iemobile)[\/]([\w.]+)/.exec(e) ||
  7621. /(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(
  7622. e
  7623. ) ||
  7624. /(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(
  7625. e
  7626. ) ||
  7627. /(webkit)[ \/]([\w.]+)/.exec(e) ||
  7628. /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(e) ||
  7629. /(msie) ([\w.]+)/.exec(e) ||
  7630. (e.indexOf('trident') >= 0 && /(rv)(?::| )([\w.]+)/.exec(e)) ||
  7631. (e.indexOf('compatible') < 0 &&
  7632. /(firefox)[ \/]([\w.]+)/.exec(e)) ||
  7633. [],
  7634. n =
  7635. /(ipad)/.exec(e) ||
  7636. /(ipod)/.exec(e) ||
  7637. /(windows phone)/.exec(e) ||
  7638. /(iphone)/.exec(e) ||
  7639. /(kindle)/.exec(e) ||
  7640. /(android)/.exec(e) ||
  7641. /(windows)/.exec(e) ||
  7642. /(mac)/.exec(e) ||
  7643. /(linux)/.exec(e) ||
  7644. /(cros)/.exec(e) ||
  7645. [],
  7646. r = {
  7647. browser: t[5] || t[3] || t[1] || '',
  7648. version: t[2] || t[4] || '0',
  7649. majorVersion: t[4] || t[2] || '0',
  7650. platform: n[0] || '',
  7651. },
  7652. s = {};
  7653. if (r.browser) {
  7654. s[r.browser] = !0;
  7655. var o = r.majorVersion.split('.');
  7656. (s.version = {
  7657. major: parseInt(r.majorVersion, 10),
  7658. string: r.version,
  7659. }),
  7660. o.length > 1 && (s.version.minor = parseInt(o[1], 10)),
  7661. o.length > 2 && (s.version.build = parseInt(o[2], 10));
  7662. }
  7663. if (
  7664. (r.platform && (s[r.platform] = !0),
  7665. (s.chrome || s.opr || s.safari) && (s.webkit = !0),
  7666. s.rv || s.iemobile)
  7667. ) {
  7668. s.rv && delete s.rv;
  7669. var a = 'msie';
  7670. (r.browser = a), (s.msie = !0);
  7671. }
  7672. if (s.edge) {
  7673. delete s.edge;
  7674. var h = 'msedge';
  7675. (r.browser = h), (s.msedge = !0);
  7676. }
  7677. if (s.opr) {
  7678. var u = 'opera';
  7679. (r.browser = u), (s.opera = !0);
  7680. }
  7681. if (s.safari && s.android) {
  7682. var l = 'android';
  7683. (r.browser = l), (s.android = !0);
  7684. }
  7685. for (var d in ((s.name = r.browser), (s.platform = r.platform), i))
  7686. i.hasOwnProperty(d) && delete i[d];
  7687. Object.assign(i, s);
  7688. })(),
  7689. (t.Z = i);
  7690. },
  7691. 29: function (e, t, i) {
  7692. 'use strict';
  7693. i.d(t, {
  7694. OZ: function () {
  7695. return s;
  7696. },
  7697. rT: function () {
  7698. return o;
  7699. },
  7700. OC: function () {
  7701. return a;
  7702. },
  7703. do: function () {
  7704. return h;
  7705. },
  7706. });
  7707. var n,
  7708. r =
  7709. ((n = function (e, t) {
  7710. return (n =
  7711. Object.setPrototypeOf ||
  7712. ({ __proto__: [] } instanceof Array &&
  7713. function (e, t) {
  7714. e.__proto__ = t;
  7715. }) ||
  7716. function (e, t) {
  7717. for (var i in t)
  7718. Object.prototype.hasOwnProperty.call(t, i) &&
  7719. (e[i] = t[i]);
  7720. })(e, t);
  7721. }),
  7722. function (e, t) {
  7723. if ('function' != typeof t && null !== t)
  7724. throw new TypeError(
  7725. 'Class extends value ' +
  7726. String(t) +
  7727. ' is not a constructor or null'
  7728. );
  7729. function i() {
  7730. this.constructor = e;
  7731. }
  7732. n(e, t),
  7733. (e.prototype =
  7734. null === t
  7735. ? Object.create(t)
  7736. : ((i.prototype = t.prototype), new i()));
  7737. }),
  7738. s = (function () {
  7739. function e(e) {
  7740. this._message = e;
  7741. }
  7742. return (
  7743. Object.defineProperty(e.prototype, 'name', {
  7744. get: function () {
  7745. return 'RuntimeException';
  7746. },
  7747. enumerable: !1,
  7748. configurable: !0,
  7749. }),
  7750. Object.defineProperty(e.prototype, 'message', {
  7751. get: function () {
  7752. return this._message;
  7753. },
  7754. enumerable: !1,
  7755. configurable: !0,
  7756. }),
  7757. (e.prototype.toString = function () {
  7758. return this.name + ': ' + this.message;
  7759. }),
  7760. e
  7761. );
  7762. })(),
  7763. o = (function (e) {
  7764. function t(t) {
  7765. return e.call(this, t) || this;
  7766. }
  7767. return (
  7768. r(t, e),
  7769. Object.defineProperty(t.prototype, 'name', {
  7770. get: function () {
  7771. return 'IllegalStateException';
  7772. },
  7773. enumerable: !1,
  7774. configurable: !0,
  7775. }),
  7776. t
  7777. );
  7778. })(s),
  7779. a = (function (e) {
  7780. function t(t) {
  7781. return e.call(this, t) || this;
  7782. }
  7783. return (
  7784. r(t, e),
  7785. Object.defineProperty(t.prototype, 'name', {
  7786. get: function () {
  7787. return 'InvalidArgumentException';
  7788. },
  7789. enumerable: !1,
  7790. configurable: !0,
  7791. }),
  7792. t
  7793. );
  7794. })(s),
  7795. h = (function (e) {
  7796. function t(t) {
  7797. return e.call(this, t) || this;
  7798. }
  7799. return (
  7800. r(t, e),
  7801. Object.defineProperty(t.prototype, 'name', {
  7802. get: function () {
  7803. return 'NotImplementedException';
  7804. },
  7805. enumerable: !1,
  7806. configurable: !0,
  7807. }),
  7808. t
  7809. );
  7810. })(s);
  7811. },
  7812. 300: function (e, t, i) {
  7813. 'use strict';
  7814. var n = i(716),
  7815. r = i.n(n),
  7816. s = (function () {
  7817. function e() {}
  7818. return (
  7819. (e.e = function (t, i) {
  7820. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  7821. var n = '[' + t + '] > ' + i;
  7822. e.ENABLE_CALLBACK && e.emitter.emit('log', 'error', n),
  7823. e.ENABLE_ERROR &&
  7824. (console.error
  7825. ? console.error(n)
  7826. : console.warn
  7827. ? console.warn(n)
  7828. : console.log(n));
  7829. }),
  7830. (e.i = function (t, i) {
  7831. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  7832. var n = '[' + t + '] > ' + i;
  7833. e.ENABLE_CALLBACK && e.emitter.emit('log', 'info', n),
  7834. e.ENABLE_INFO &&
  7835. (console.info ? console.info(n) : console.log(n));
  7836. }),
  7837. (e.w = function (t, i) {
  7838. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  7839. var n = '[' + t + '] > ' + i;
  7840. e.ENABLE_CALLBACK && e.emitter.emit('log', 'warn', n),
  7841. e.ENABLE_WARN &&
  7842. (console.warn ? console.warn(n) : console.log(n));
  7843. }),
  7844. (e.d = function (t, i) {
  7845. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  7846. var n = '[' + t + '] > ' + i;
  7847. e.ENABLE_CALLBACK && e.emitter.emit('log', 'debug', n),
  7848. e.ENABLE_DEBUG &&
  7849. (console.debug ? console.debug(n) : console.log(n));
  7850. }),
  7851. (e.v = function (t, i) {
  7852. (t && !e.FORCE_GLOBAL_TAG) || (t = e.GLOBAL_TAG);
  7853. var n = '[' + t + '] > ' + i;
  7854. e.ENABLE_CALLBACK && e.emitter.emit('log', 'verbose', n),
  7855. e.ENABLE_VERBOSE && console.log(n);
  7856. }),
  7857. e
  7858. );
  7859. })();
  7860. (s.GLOBAL_TAG = 'flv.js'),
  7861. (s.FORCE_GLOBAL_TAG = !1),
  7862. (s.ENABLE_ERROR = !0),
  7863. (s.ENABLE_INFO = !0),
  7864. (s.ENABLE_WARN = !0),
  7865. (s.ENABLE_DEBUG = !0),
  7866. (s.ENABLE_VERBOSE = !0),
  7867. (s.ENABLE_CALLBACK = !1),
  7868. (s.emitter = new (r())()),
  7869. (t.Z = s);
  7870. },
  7871. 846: function (e, t, i) {
  7872. 'use strict';
  7873. var n = i(716),
  7874. r = i.n(n),
  7875. s = i(300),
  7876. o = (function () {
  7877. function e() {}
  7878. return (
  7879. Object.defineProperty(e, 'forceGlobalTag', {
  7880. get: function () {
  7881. return s.Z.FORCE_GLOBAL_TAG;
  7882. },
  7883. set: function (t) {
  7884. (s.Z.FORCE_GLOBAL_TAG = t), e._notifyChange();
  7885. },
  7886. enumerable: !1,
  7887. configurable: !0,
  7888. }),
  7889. Object.defineProperty(e, 'globalTag', {
  7890. get: function () {
  7891. return s.Z.GLOBAL_TAG;
  7892. },
  7893. set: function (t) {
  7894. (s.Z.GLOBAL_TAG = t), e._notifyChange();
  7895. },
  7896. enumerable: !1,
  7897. configurable: !0,
  7898. }),
  7899. Object.defineProperty(e, 'enableAll', {
  7900. get: function () {
  7901. return (
  7902. s.Z.ENABLE_VERBOSE &&
  7903. s.Z.ENABLE_DEBUG &&
  7904. s.Z.ENABLE_INFO &&
  7905. s.Z.ENABLE_WARN &&
  7906. s.Z.ENABLE_ERROR
  7907. );
  7908. },
  7909. set: function (t) {
  7910. (s.Z.ENABLE_VERBOSE = t),
  7911. (s.Z.ENABLE_DEBUG = t),
  7912. (s.Z.ENABLE_INFO = t),
  7913. (s.Z.ENABLE_WARN = t),
  7914. (s.Z.ENABLE_ERROR = t),
  7915. e._notifyChange();
  7916. },
  7917. enumerable: !1,
  7918. configurable: !0,
  7919. }),
  7920. Object.defineProperty(e, 'enableDebug', {
  7921. get: function () {
  7922. return s.Z.ENABLE_DEBUG;
  7923. },
  7924. set: function (t) {
  7925. (s.Z.ENABLE_DEBUG = t), e._notifyChange();
  7926. },
  7927. enumerable: !1,
  7928. configurable: !0,
  7929. }),
  7930. Object.defineProperty(e, 'enableVerbose', {
  7931. get: function () {
  7932. return s.Z.ENABLE_VERBOSE;
  7933. },
  7934. set: function (t) {
  7935. (s.Z.ENABLE_VERBOSE = t), e._notifyChange();
  7936. },
  7937. enumerable: !1,
  7938. configurable: !0,
  7939. }),
  7940. Object.defineProperty(e, 'enableInfo', {
  7941. get: function () {
  7942. return s.Z.ENABLE_INFO;
  7943. },
  7944. set: function (t) {
  7945. (s.Z.ENABLE_INFO = t), e._notifyChange();
  7946. },
  7947. enumerable: !1,
  7948. configurable: !0,
  7949. }),
  7950. Object.defineProperty(e, 'enableWarn', {
  7951. get: function () {
  7952. return s.Z.ENABLE_WARN;
  7953. },
  7954. set: function (t) {
  7955. (s.Z.ENABLE_WARN = t), e._notifyChange();
  7956. },
  7957. enumerable: !1,
  7958. configurable: !0,
  7959. }),
  7960. Object.defineProperty(e, 'enableError', {
  7961. get: function () {
  7962. return s.Z.ENABLE_ERROR;
  7963. },
  7964. set: function (t) {
  7965. (s.Z.ENABLE_ERROR = t), e._notifyChange();
  7966. },
  7967. enumerable: !1,
  7968. configurable: !0,
  7969. }),
  7970. (e.getConfig = function () {
  7971. return {
  7972. globalTag: s.Z.GLOBAL_TAG,
  7973. forceGlobalTag: s.Z.FORCE_GLOBAL_TAG,
  7974. enableVerbose: s.Z.ENABLE_VERBOSE,
  7975. enableDebug: s.Z.ENABLE_DEBUG,
  7976. enableInfo: s.Z.ENABLE_INFO,
  7977. enableWarn: s.Z.ENABLE_WARN,
  7978. enableError: s.Z.ENABLE_ERROR,
  7979. enableCallback: s.Z.ENABLE_CALLBACK,
  7980. };
  7981. }),
  7982. (e.applyConfig = function (e) {
  7983. (s.Z.GLOBAL_TAG = e.globalTag),
  7984. (s.Z.FORCE_GLOBAL_TAG = e.forceGlobalTag),
  7985. (s.Z.ENABLE_VERBOSE = e.enableVerbose),
  7986. (s.Z.ENABLE_DEBUG = e.enableDebug),
  7987. (s.Z.ENABLE_INFO = e.enableInfo),
  7988. (s.Z.ENABLE_WARN = e.enableWarn),
  7989. (s.Z.ENABLE_ERROR = e.enableError),
  7990. (s.Z.ENABLE_CALLBACK = e.enableCallback);
  7991. }),
  7992. (e._notifyChange = function () {
  7993. var t = e.emitter;
  7994. if (t.listenerCount('change') > 0) {
  7995. var i = e.getConfig();
  7996. t.emit('change', i);
  7997. }
  7998. }),
  7999. (e.registerListener = function (t) {
  8000. e.emitter.addListener('change', t);
  8001. }),
  8002. (e.removeListener = function (t) {
  8003. e.emitter.removeListener('change', t);
  8004. }),
  8005. (e.addLogListener = function (t) {
  8006. s.Z.emitter.addListener('log', t),
  8007. s.Z.emitter.listenerCount('log') > 0 &&
  8008. ((s.Z.ENABLE_CALLBACK = !0), e._notifyChange());
  8009. }),
  8010. (e.removeLogListener = function (t) {
  8011. s.Z.emitter.removeListener('log', t),
  8012. 0 === s.Z.emitter.listenerCount('log') &&
  8013. ((s.Z.ENABLE_CALLBACK = !1), e._notifyChange());
  8014. }),
  8015. e
  8016. );
  8017. })();
  8018. (o.emitter = new (r())()), (t.Z = o);
  8019. },
  8020. 219: function (e, t, i) {
  8021. 'use strict';
  8022. var n = (function () {
  8023. function e() {}
  8024. return (
  8025. (e.install = function () {
  8026. (Object.setPrototypeOf =
  8027. Object.setPrototypeOf ||
  8028. function (e, t) {
  8029. return (e.__proto__ = t), e;
  8030. }),
  8031. (Object.assign =
  8032. Object.assign ||
  8033. function (e) {
  8034. if (null == e)
  8035. throw new TypeError(
  8036. 'Cannot convert undefined or null to object'
  8037. );
  8038. for (
  8039. var t = Object(e), i = 1;
  8040. i < arguments.length;
  8041. i++
  8042. ) {
  8043. var n = arguments[i];
  8044. if (null != n)
  8045. for (var r in n) n.hasOwnProperty(r) && (t[r] = n[r]);
  8046. }
  8047. return t;
  8048. }),
  8049. 'function' != typeof self.Promise && i(264).polyfill();
  8050. }),
  8051. e
  8052. );
  8053. })();
  8054. n.install(), (t.Z = n);
  8055. },
  8056. },
  8057. t = {};
  8058. function i(n) {
  8059. var r = t[n];
  8060. if (void 0 !== r) return r.exports;
  8061. var s = (t[n] = { exports: {} });
  8062. return e[n].call(s.exports, s, s.exports, i), s.exports;
  8063. }
  8064. return (
  8065. (i.m = e),
  8066. (i.n = function (e) {
  8067. var t =
  8068. e && e.__esModule
  8069. ? function () {
  8070. return e.default;
  8071. }
  8072. : function () {
  8073. return e;
  8074. };
  8075. return i.d(t, { a: t }), t;
  8076. }),
  8077. (i.d = function (e, t) {
  8078. for (var n in t)
  8079. i.o(t, n) &&
  8080. !i.o(e, n) &&
  8081. Object.defineProperty(e, n, { enumerable: !0, get: t[n] });
  8082. }),
  8083. (i.g = (function () {
  8084. if ('object' == typeof globalThis) return globalThis;
  8085. try {
  8086. return this || new Function('return this')();
  8087. } catch (e) {
  8088. if ('object' == typeof window) return window;
  8089. }
  8090. })()),
  8091. (i.o = function (e, t) {
  8092. return Object.prototype.hasOwnProperty.call(e, t);
  8093. }),
  8094. i(324)
  8095. );
  8096. })();
  8097. });
  8098. //# sourceMappingURL=flv.min.js.map