video.min.js 1.2 MB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697176981769917700177011770217703177041770517706177071770817709177101771117712177131771417715177161771717718177191772017721177221772317724177251772617727177281772917730177311773217733177341773517736177371773817739177401774117742177431774417745177461774717748177491775017751177521775317754177551775617757177581775917760177611776217763177641776517766177671776817769177701777117772177731777417775177761777717778177791778017781177821778317784177851778617787177881778917790177911779217793177941779517796177971779817799178001780117802178031780417805178061780717808178091781017811178121781317814178151781617817178181781917820178211782217823178241782517826178271782817829178301783117832178331783417835178361783717838178391784017841178421784317844178451784617847178481784917850178511785217853178541785517856178571785817859178601786117862178631786417865178661786717868178691787017871178721787317874178751787617877178781787917880178811788217883178841788517886178871788817889178901789117892178931789417895178961789717898178991790017901179021790317904179051790617907179081790917910179111791217913179141791517916179171791817919179201792117922179231792417925179261792717928179291793017931179321793317934179351793617937179381793917940179411794217943179441794517946179471794817949179501795117952179531795417955179561795717958179591796017961179621796317964179651796617967179681796917970179711797217973179741797517976179771797817979179801798117982179831798417985179861798717988179891799017991179921799317994179951799617997179981799918000180011800218003180041800518006180071800818009180101801118012180131801418015180161801718018180191802018021180221802318024180251802618027180281802918030180311803218033180341803518036180371803818039180401804118042180431804418045180461804718048180491805018051180521805318054180551805618057180581805918060180611806218063180641806518066180671806818069180701807118072180731807418075180761807718078180791808018081180821808318084180851808618087180881808918090180911809218093180941809518096180971809818099181001810118102181031810418105181061810718108181091811018111181121811318114181151811618117181181811918120181211812218123181241812518126181271812818129181301813118132181331813418135181361813718138181391814018141181421814318144181451814618147181481814918150181511815218153181541815518156181571815818159181601816118162181631816418165181661816718168181691817018171181721817318174181751817618177181781817918180181811818218183181841818518186181871818818189181901819118192181931819418195181961819718198181991820018201182021820318204182051820618207182081820918210182111821218213182141821518216182171821818219182201822118222182231822418225182261822718228182291823018231182321823318234182351823618237182381823918240182411824218243182441824518246182471824818249182501825118252182531825418255182561825718258182591826018261182621826318264182651826618267182681826918270182711827218273182741827518276182771827818279182801828118282182831828418285182861828718288182891829018291182921829318294182951829618297182981829918300183011830218303183041830518306183071830818309183101831118312183131831418315183161831718318183191832018321183221832318324183251832618327183281832918330183311833218333183341833518336183371833818339183401834118342183431834418345183461834718348183491835018351183521835318354183551835618357183581835918360183611836218363183641836518366183671836818369183701837118372183731837418375183761837718378183791838018381183821838318384183851838618387183881838918390183911839218393183941839518396183971839818399184001840118402184031840418405184061840718408184091841018411184121841318414184151841618417184181841918420184211842218423184241842518426184271842818429184301843118432184331843418435184361843718438184391844018441184421844318444184451844618447184481844918450184511845218453184541845518456184571845818459184601846118462184631846418465184661846718468184691847018471184721847318474184751847618477184781847918480184811848218483184841848518486184871848818489184901849118492184931849418495184961849718498184991850018501185021850318504185051850618507185081850918510185111851218513185141851518516185171851818519185201852118522185231852418525185261852718528185291853018531185321853318534185351853618537185381853918540185411854218543185441854518546185471854818549185501855118552185531855418555185561855718558185591856018561185621856318564185651856618567185681856918570185711857218573185741857518576185771857818579185801858118582185831858418585185861858718588185891859018591185921859318594185951859618597185981859918600186011860218603186041860518606186071860818609186101861118612186131861418615186161861718618186191862018621186221862318624186251862618627186281862918630186311863218633186341863518636186371863818639186401864118642186431864418645186461864718648186491865018651186521865318654186551865618657186581865918660186611866218663186641866518666186671866818669186701867118672186731867418675186761867718678186791868018681186821868318684186851868618687186881868918690186911869218693186941869518696186971869818699187001870118702187031870418705187061870718708187091871018711187121871318714187151871618717187181871918720187211872218723187241872518726187271872818729187301873118732187331873418735187361873718738187391874018741187421874318744187451874618747187481874918750187511875218753187541875518756187571875818759187601876118762187631876418765187661876718768187691877018771187721877318774187751877618777187781877918780187811878218783187841878518786187871878818789187901879118792187931879418795187961879718798187991880018801188021880318804188051880618807188081880918810188111881218813188141881518816188171881818819188201882118822188231882418825188261882718828188291883018831188321883318834188351883618837188381883918840188411884218843188441884518846188471884818849188501885118852188531885418855188561885718858188591886018861188621886318864188651886618867188681886918870188711887218873188741887518876188771887818879188801888118882188831888418885188861888718888188891889018891188921889318894188951889618897188981889918900189011890218903189041890518906189071890818909189101891118912189131891418915189161891718918189191892018921189221892318924189251892618927189281892918930189311893218933189341893518936189371893818939189401894118942189431894418945189461894718948189491895018951189521895318954189551895618957189581895918960189611896218963189641896518966189671896818969189701897118972189731897418975189761897718978189791898018981189821898318984189851898618987189881898918990189911899218993189941899518996189971899818999190001900119002190031900419005190061900719008190091901019011190121901319014190151901619017190181901919020190211902219023190241902519026190271902819029190301903119032190331903419035190361903719038190391904019041190421904319044190451904619047190481904919050190511905219053190541905519056190571905819059190601906119062190631906419065190661906719068190691907019071190721907319074190751907619077190781907919080190811908219083190841908519086190871908819089190901909119092190931909419095190961909719098190991910019101191021910319104191051910619107191081910919110191111911219113191141911519116191171911819119191201912119122191231912419125191261912719128191291913019131191321913319134191351913619137191381913919140191411914219143191441914519146191471914819149191501915119152191531915419155191561915719158191591916019161191621916319164191651916619167191681916919170191711917219173191741917519176191771917819179191801918119182191831918419185191861918719188191891919019191191921919319194191951919619197191981919919200192011920219203192041920519206192071920819209192101921119212192131921419215192161921719218192191922019221192221922319224192251922619227192281922919230192311923219233192341923519236192371923819239192401924119242192431924419245192461924719248192491925019251192521925319254192551925619257192581925919260192611926219263192641926519266192671926819269192701927119272192731927419275192761927719278192791928019281192821928319284192851928619287192881928919290192911929219293192941929519296192971929819299193001930119302193031930419305193061930719308193091931019311193121931319314193151931619317193181931919320193211932219323193241932519326193271932819329193301933119332193331933419335193361933719338193391934019341193421934319344193451934619347193481934919350193511935219353193541935519356193571935819359193601936119362193631936419365193661936719368193691937019371193721937319374193751937619377193781937919380193811938219383193841938519386193871938819389193901939119392193931939419395193961939719398193991940019401194021940319404194051940619407194081940919410194111941219413194141941519416194171941819419194201942119422194231942419425194261942719428194291943019431194321943319434194351943619437194381943919440194411944219443194441944519446194471944819449194501945119452194531945419455194561945719458194591946019461194621946319464194651946619467194681946919470194711947219473194741947519476194771947819479194801948119482194831948419485194861948719488194891949019491194921949319494194951949619497194981949919500195011950219503195041950519506195071950819509195101951119512195131951419515195161951719518195191952019521195221952319524195251952619527195281952919530195311953219533195341953519536195371953819539195401954119542195431954419545195461954719548195491955019551195521955319554195551955619557195581955919560195611956219563195641956519566195671956819569195701957119572195731957419575195761957719578195791958019581195821958319584195851958619587195881958919590195911959219593195941959519596195971959819599196001960119602196031960419605196061960719608196091961019611196121961319614196151961619617196181961919620196211962219623196241962519626196271962819629196301963119632196331963419635196361963719638196391964019641196421964319644196451964619647196481964919650196511965219653196541965519656196571965819659196601966119662196631966419665196661966719668196691967019671196721967319674196751967619677196781967919680196811968219683196841968519686196871968819689196901969119692196931969419695196961969719698196991970019701197021970319704197051970619707197081970919710197111971219713197141971519716197171971819719197201972119722197231972419725197261972719728197291973019731197321973319734197351973619737197381973919740197411974219743197441974519746197471974819749197501975119752197531975419755197561975719758197591976019761197621976319764197651976619767197681976919770197711977219773197741977519776197771977819779197801978119782197831978419785197861978719788197891979019791197921979319794197951979619797197981979919800198011980219803198041980519806198071980819809198101981119812198131981419815198161981719818198191982019821198221982319824198251982619827198281982919830198311983219833198341983519836198371983819839198401984119842198431984419845198461984719848198491985019851198521985319854198551985619857198581985919860198611986219863198641986519866198671986819869198701987119872198731987419875198761987719878198791988019881198821988319884198851988619887198881988919890198911989219893198941989519896198971989819899199001990119902199031990419905199061990719908199091991019911199121991319914199151991619917199181991919920199211992219923199241992519926199271992819929199301993119932199331993419935199361993719938199391994019941199421994319944199451994619947199481994919950199511995219953199541995519956199571995819959199601996119962199631996419965199661996719968199691997019971199721997319974199751997619977199781997919980199811998219983199841998519986199871998819989199901999119992199931999419995199961999719998199992000020001200022000320004200052000620007200082000920010200112001220013200142001520016200172001820019200202002120022200232002420025200262002720028200292003020031200322003320034200352003620037200382003920040200412004220043200442004520046200472004820049200502005120052200532005420055200562005720058200592006020061200622006320064200652006620067200682006920070200712007220073200742007520076200772007820079200802008120082200832008420085200862008720088200892009020091200922009320094200952009620097200982009920100201012010220103201042010520106201072010820109201102011120112201132011420115201162011720118201192012020121201222012320124201252012620127201282012920130201312013220133201342013520136201372013820139201402014120142201432014420145201462014720148201492015020151201522015320154201552015620157201582015920160201612016220163201642016520166201672016820169201702017120172201732017420175201762017720178201792018020181201822018320184201852018620187201882018920190201912019220193201942019520196201972019820199202002020120202202032020420205202062020720208202092021020211202122021320214202152021620217202182021920220202212022220223202242022520226202272022820229202302023120232202332023420235202362023720238202392024020241202422024320244202452024620247202482024920250202512025220253202542025520256202572025820259202602026120262202632026420265202662026720268202692027020271202722027320274202752027620277202782027920280202812028220283202842028520286202872028820289202902029120292202932029420295202962029720298202992030020301203022030320304203052030620307203082030920310203112031220313203142031520316203172031820319203202032120322203232032420325203262032720328203292033020331203322033320334203352033620337203382033920340203412034220343203442034520346203472034820349203502035120352203532035420355203562035720358203592036020361203622036320364203652036620367203682036920370203712037220373203742037520376203772037820379203802038120382203832038420385203862038720388203892039020391203922039320394203952039620397203982039920400204012040220403204042040520406204072040820409204102041120412204132041420415204162041720418204192042020421204222042320424204252042620427204282042920430204312043220433204342043520436204372043820439204402044120442204432044420445204462044720448204492045020451204522045320454204552045620457204582045920460204612046220463204642046520466204672046820469204702047120472204732047420475204762047720478204792048020481204822048320484204852048620487204882048920490204912049220493204942049520496204972049820499205002050120502205032050420505205062050720508205092051020511205122051320514205152051620517205182051920520205212052220523205242052520526205272052820529205302053120532205332053420535205362053720538205392054020541205422054320544205452054620547205482054920550205512055220553205542055520556205572055820559205602056120562205632056420565205662056720568205692057020571205722057320574205752057620577205782057920580205812058220583205842058520586205872058820589205902059120592205932059420595205962059720598205992060020601206022060320604206052060620607206082060920610206112061220613206142061520616206172061820619206202062120622206232062420625206262062720628206292063020631206322063320634206352063620637206382063920640206412064220643206442064520646206472064820649206502065120652206532065420655206562065720658206592066020661206622066320664206652066620667206682066920670206712067220673206742067520676206772067820679206802068120682206832068420685206862068720688206892069020691206922069320694206952069620697206982069920700207012070220703207042070520706207072070820709207102071120712207132071420715207162071720718207192072020721207222072320724207252072620727207282072920730207312073220733207342073520736207372073820739207402074120742207432074420745207462074720748207492075020751207522075320754207552075620757207582075920760207612076220763207642076520766207672076820769207702077120772207732077420775207762077720778207792078020781207822078320784207852078620787207882078920790207912079220793207942079520796207972079820799208002080120802208032080420805208062080720808208092081020811208122081320814208152081620817208182081920820208212082220823208242082520826208272082820829208302083120832208332083420835208362083720838208392084020841208422084320844208452084620847208482084920850208512085220853208542085520856208572085820859208602086120862208632086420865208662086720868208692087020871208722087320874208752087620877208782087920880208812088220883208842088520886208872088820889208902089120892208932089420895208962089720898208992090020901209022090320904209052090620907209082090920910209112091220913209142091520916209172091820919209202092120922209232092420925209262092720928209292093020931209322093320934209352093620937209382093920940209412094220943209442094520946209472094820949209502095120952209532095420955209562095720958209592096020961209622096320964209652096620967209682096920970209712097220973209742097520976209772097820979209802098120982209832098420985209862098720988209892099020991209922099320994209952099620997209982099921000210012100221003210042100521006210072100821009210102101121012210132101421015210162101721018210192102021021210222102321024210252102621027210282102921030210312103221033210342103521036210372103821039210402104121042210432104421045210462104721048210492105021051210522105321054210552105621057210582105921060210612106221063210642106521066210672106821069210702107121072210732107421075210762107721078210792108021081210822108321084210852108621087210882108921090210912109221093210942109521096210972109821099211002110121102211032110421105211062110721108211092111021111211122111321114211152111621117211182111921120211212112221123211242112521126211272112821129211302113121132211332113421135211362113721138211392114021141211422114321144211452114621147211482114921150211512115221153211542115521156211572115821159211602116121162211632116421165211662116721168211692117021171211722117321174211752117621177211782117921180211812118221183211842118521186211872118821189211902119121192211932119421195211962119721198211992120021201212022120321204212052120621207212082120921210212112121221213212142121521216212172121821219212202122121222212232122421225212262122721228212292123021231212322123321234212352123621237212382123921240212412124221243212442124521246212472124821249212502125121252212532125421255212562125721258212592126021261212622126321264212652126621267212682126921270212712127221273212742127521276212772127821279212802128121282212832128421285212862128721288212892129021291212922129321294212952129621297212982129921300213012130221303213042130521306213072130821309213102131121312213132131421315213162131721318213192132021321213222132321324213252132621327213282132921330213312133221333213342133521336213372133821339213402134121342213432134421345213462134721348213492135021351213522135321354213552135621357213582135921360213612136221363213642136521366213672136821369213702137121372213732137421375213762137721378213792138021381213822138321384213852138621387213882138921390213912139221393213942139521396213972139821399214002140121402214032140421405214062140721408214092141021411214122141321414214152141621417214182141921420214212142221423214242142521426214272142821429214302143121432214332143421435214362143721438214392144021441214422144321444214452144621447214482144921450214512145221453214542145521456214572145821459214602146121462214632146421465214662146721468214692147021471214722147321474214752147621477214782147921480214812148221483214842148521486214872148821489214902149121492214932149421495214962149721498214992150021501215022150321504215052150621507215082150921510215112151221513215142151521516215172151821519215202152121522215232152421525215262152721528215292153021531215322153321534215352153621537215382153921540215412154221543215442154521546215472154821549215502155121552215532155421555215562155721558215592156021561215622156321564215652156621567215682156921570215712157221573215742157521576215772157821579215802158121582215832158421585215862158721588215892159021591215922159321594215952159621597215982159921600216012160221603216042160521606216072160821609216102161121612216132161421615216162161721618216192162021621216222162321624216252162621627216282162921630216312163221633216342163521636216372163821639216402164121642216432164421645216462164721648216492165021651216522165321654216552165621657216582165921660216612166221663216642166521666216672166821669216702167121672216732167421675216762167721678216792168021681216822168321684216852168621687216882168921690216912169221693216942169521696216972169821699217002170121702217032170421705217062170721708217092171021711217122171321714217152171621717217182171921720217212172221723217242172521726217272172821729217302173121732217332173421735217362173721738217392174021741217422174321744217452174621747217482174921750217512175221753217542175521756217572175821759217602176121762217632176421765217662176721768217692177021771217722177321774217752177621777217782177921780217812178221783217842178521786217872178821789217902179121792217932179421795217962179721798217992180021801218022180321804218052180621807218082180921810218112181221813218142181521816218172181821819218202182121822218232182421825218262182721828218292183021831218322183321834218352183621837218382183921840218412184221843218442184521846218472184821849218502185121852218532185421855218562185721858218592186021861218622186321864218652186621867218682186921870218712187221873218742187521876218772187821879218802188121882218832188421885218862188721888218892189021891218922189321894218952189621897218982189921900219012190221903219042190521906219072190821909219102191121912219132191421915219162191721918219192192021921219222192321924219252192621927219282192921930219312193221933219342193521936219372193821939219402194121942219432194421945219462194721948219492195021951219522195321954219552195621957219582195921960219612196221963219642196521966219672196821969219702197121972219732197421975219762197721978219792198021981219822198321984219852198621987219882198921990219912199221993219942199521996219972199821999220002200122002220032200422005220062200722008220092201022011220122201322014220152201622017220182201922020220212202222023220242202522026220272202822029220302203122032220332203422035220362203722038220392204022041220422204322044220452204622047220482204922050220512205222053220542205522056220572205822059220602206122062220632206422065220662206722068220692207022071220722207322074220752207622077220782207922080220812208222083220842208522086220872208822089220902209122092220932209422095220962209722098220992210022101221022210322104221052210622107221082210922110221112211222113221142211522116221172211822119221202212122122221232212422125221262212722128221292213022131221322213322134221352213622137221382213922140221412214222143221442214522146221472214822149221502215122152221532215422155221562215722158221592216022161221622216322164221652216622167221682216922170221712217222173221742217522176221772217822179221802218122182221832218422185221862218722188221892219022191221922219322194221952219622197221982219922200222012220222203222042220522206222072220822209222102221122212222132221422215222162221722218222192222022221222222222322224222252222622227222282222922230222312223222233222342223522236222372223822239222402224122242222432224422245222462224722248222492225022251222522225322254222552225622257222582225922260222612226222263222642226522266222672226822269222702227122272222732227422275222762227722278222792228022281222822228322284222852228622287222882228922290222912229222293222942229522296222972229822299223002230122302223032230422305223062230722308223092231022311223122231322314223152231622317223182231922320223212232222323223242232522326223272232822329223302233122332223332233422335223362233722338223392234022341223422234322344223452234622347223482234922350223512235222353223542235522356223572235822359223602236122362223632236422365223662236722368223692237022371223722237322374223752237622377223782237922380223812238222383223842238522386223872238822389223902239122392223932239422395223962239722398223992240022401224022240322404224052240622407224082240922410224112241222413224142241522416224172241822419224202242122422224232242422425224262242722428224292243022431224322243322434224352243622437224382243922440224412244222443224442244522446224472244822449224502245122452224532245422455224562245722458224592246022461224622246322464224652246622467224682246922470224712247222473224742247522476224772247822479224802248122482224832248422485224862248722488224892249022491224922249322494224952249622497224982249922500225012250222503225042250522506225072250822509225102251122512225132251422515225162251722518225192252022521225222252322524225252252622527225282252922530225312253222533225342253522536225372253822539225402254122542225432254422545225462254722548225492255022551225522255322554225552255622557225582255922560225612256222563225642256522566225672256822569225702257122572225732257422575225762257722578225792258022581225822258322584225852258622587225882258922590225912259222593225942259522596225972259822599226002260122602226032260422605226062260722608226092261022611226122261322614226152261622617226182261922620226212262222623226242262522626226272262822629226302263122632226332263422635226362263722638226392264022641226422264322644226452264622647226482264922650226512265222653226542265522656226572265822659226602266122662226632266422665226662266722668226692267022671226722267322674226752267622677226782267922680226812268222683226842268522686226872268822689226902269122692226932269422695226962269722698226992270022701227022270322704227052270622707227082270922710227112271222713227142271522716227172271822719227202272122722227232272422725227262272722728227292273022731227322273322734227352273622737227382273922740227412274222743227442274522746227472274822749227502275122752227532275422755227562275722758227592276022761227622276322764227652276622767227682276922770227712277222773227742277522776227772277822779227802278122782227832278422785227862278722788227892279022791227922279322794227952279622797227982279922800228012280222803228042280522806228072280822809228102281122812228132281422815228162281722818228192282022821228222282322824228252282622827228282282922830228312283222833228342283522836228372283822839228402284122842228432284422845228462284722848228492285022851228522285322854228552285622857228582285922860228612286222863228642286522866228672286822869228702287122872228732287422875228762287722878228792288022881228822288322884228852288622887228882288922890228912289222893228942289522896228972289822899229002290122902229032290422905229062290722908229092291022911229122291322914229152291622917229182291922920229212292222923229242292522926229272292822929229302293122932229332293422935229362293722938229392294022941229422294322944229452294622947229482294922950229512295222953229542295522956229572295822959229602296122962229632296422965229662296722968229692297022971229722297322974229752297622977229782297922980229812298222983229842298522986229872298822989229902299122992229932299422995229962299722998229992300023001230022300323004230052300623007230082300923010230112301223013230142301523016230172301823019230202302123022230232302423025230262302723028230292303023031230322303323034230352303623037230382303923040230412304223043230442304523046230472304823049230502305123052230532305423055230562305723058230592306023061230622306323064230652306623067230682306923070230712307223073230742307523076230772307823079
  1. /**
  2. * @license
  3. * Video.js 7.20.2 <http://videojs.com/>
  4. * Copyright Brightcove, Inc. <https://www.brightcove.com/>
  5. * Available under Apache License Version 2.0
  6. * <https://github.com/videojs/video.js/blob/main/LICENSE>
  7. *
  8. * Includes vtt.js <https://github.com/mozilla/vtt.js>
  9. * Available under Apache License Version 2.0
  10. * <https://github.com/mozilla/vtt.js/blob/main/LICENSE>
  11. */
  12. !(function (e, t) {
  13. 'object' == typeof exports && 'undefined' != typeof module
  14. ? (module.exports = t())
  15. : 'function' == typeof define && define.amd
  16. ? define(t)
  17. : ((e = 'undefined' != typeof globalThis ? globalThis : e || self).videojs = t())
  18. })(this, function () {
  19. 'use strict'
  20. for (
  21. var e,
  22. u = '7.20.2',
  23. i = {},
  24. a = function (e, t) {
  25. return (i[e] = i[e] || []), t && (i[e] = i[e].concat(t)), i[e]
  26. },
  27. n = function (e, t) {
  28. t = a(e).indexOf(t)
  29. return !(t <= -1) && ((i[e] = i[e].slice()), i[e].splice(t, 1), !0)
  30. },
  31. l = { prefixed: !0 },
  32. t = [
  33. ['requestFullscreen', 'exitFullscreen', 'fullscreenElement', 'fullscreenEnabled', 'fullscreenchange', 'fullscreenerror', 'fullscreen'],
  34. ['webkitRequestFullscreen', 'webkitExitFullscreen', 'webkitFullscreenElement', 'webkitFullscreenEnabled', 'webkitfullscreenchange', 'webkitfullscreenerror', '-webkit-full-screen'],
  35. ['mozRequestFullScreen', 'mozCancelFullScreen', 'mozFullScreenElement', 'mozFullScreenEnabled', 'mozfullscreenchange', 'mozfullscreenerror', '-moz-full-screen'],
  36. ['msRequestFullscreen', 'msExitFullscreen', 'msFullscreenElement', 'msFullscreenEnabled', 'MSFullscreenChange', 'MSFullscreenError', '-ms-fullscreen'],
  37. ],
  38. r = t[0],
  39. s = 0;
  40. s < t.length;
  41. s++
  42. )
  43. if (t[s][1] in document) {
  44. e = t[s]
  45. break
  46. }
  47. if (e) {
  48. for (var o = 0; o < e.length; o++) l[r[o]] = e[o]
  49. l.prefixed = e[0] !== r[0]
  50. }
  51. var c = [],
  52. d = function (a, s) {
  53. return function (e, t, i) {
  54. var n,
  55. r = s.levels[t],
  56. t = new RegExp('^(' + r + ')$')
  57. 'log' !== e && i.unshift(e.toUpperCase() + ':'),
  58. i.unshift(a + ':'),
  59. c && (c.push([].concat(i)), (n = c.length - 1e3), c.splice(0, 0 < n ? n : 0)),
  60. !window.console ||
  61. ((n = !(n = window.console[e]) && 'debug' === e ? window.console.info || window.console.log : n) && r && t.test(e) && n[Array.isArray(i) ? 'apply' : 'call'](window.console, i))
  62. }
  63. }
  64. var h = (function t(i) {
  65. function n() {
  66. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  67. a('log', r, t)
  68. }
  69. var r = 'info',
  70. a = d(i, n)
  71. return (
  72. (n.createLogger = function (e) {
  73. return t(i + ': ' + e)
  74. }),
  75. (n.levels = { all: 'debug|log|warn|error', off: '', debug: 'debug|log|warn|error', info: 'log|warn|error', warn: 'warn|error', error: 'error', DEFAULT: r }),
  76. (n.level = function (e) {
  77. if ('string' == typeof e) {
  78. if (!n.levels.hasOwnProperty(e)) throw new Error('"' + e + '" in not a valid log level')
  79. r = e
  80. }
  81. return r
  82. }),
  83. ((n.history = function () {
  84. return c ? [].concat(c) : []
  85. }).filter = function (t) {
  86. return (c || []).filter(function (e) {
  87. return new RegExp('.*' + t + '.*').test(e[0])
  88. })
  89. }),
  90. (n.history.clear = function () {
  91. c && (c.length = 0)
  92. }),
  93. (n.history.disable = function () {
  94. null !== c && ((c.length = 0), (c = null))
  95. }),
  96. (n.history.enable = function () {
  97. null === c && (c = [])
  98. }),
  99. (n.error = function () {
  100. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  101. return a('error', r, t)
  102. }),
  103. (n.warn = function () {
  104. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  105. return a('warn', r, t)
  106. }),
  107. (n.debug = function () {
  108. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  109. return a('debug', r, t)
  110. }),
  111. n
  112. )
  113. })('VIDEOJS'),
  114. p = h.createLogger,
  115. f = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : {}
  116. function m(e, t) {
  117. return e((t = { exports: {} }), t.exports), t.exports
  118. }
  119. var g = m(function (e) {
  120. function t() {
  121. return (
  122. (e.exports = t =
  123. Object.assign ||
  124. function (e) {
  125. for (var t = 1; t < arguments.length; t++) {
  126. var i,
  127. n = arguments[t]
  128. for (i in n) Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
  129. }
  130. return e
  131. }),
  132. t.apply(this, arguments)
  133. )
  134. }
  135. e.exports = t
  136. }),
  137. y = Object.prototype.toString,
  138. v = function (e) {
  139. return T(e) ? Object.keys(e) : []
  140. }
  141. function _(t, i) {
  142. v(t).forEach(function (e) {
  143. return i(t[e], e)
  144. })
  145. }
  146. function b(i) {
  147. for (var e = arguments.length, t = new Array(1 < e ? e - 1 : 0), n = 1; n < e; n++) t[n - 1] = arguments[n]
  148. return Object.assign
  149. ? g.apply(void 0, [i].concat(t))
  150. : (t.forEach(function (e) {
  151. e &&
  152. _(e, function (e, t) {
  153. i[t] = e
  154. })
  155. }),
  156. i)
  157. }
  158. function T(e) {
  159. return !!e && 'object' == typeof e
  160. }
  161. function S(e) {
  162. return T(e) && '[object Object]' === y.call(e) && e.constructor === Object
  163. }
  164. function w(e, t) {
  165. if (!e || !t) return ''
  166. if ('function' != typeof window.getComputedStyle) return ''
  167. var i
  168. try {
  169. i = window.getComputedStyle(e)
  170. } catch (e) {
  171. return ''
  172. }
  173. return i ? i.getPropertyValue(t) || i[t] : ''
  174. }
  175. var E = (window.navigator && window.navigator.userAgent) || '',
  176. k = /AppleWebKit\/([\d.]+)/i.exec(E),
  177. C = k ? parseFloat(k.pop()) : null,
  178. I = /iPod/i.test(E),
  179. x = (jt = E.match(/OS (\d+)_/i)) && jt[1] ? jt[1] : null,
  180. A = /Android/i.test(E),
  181. P = (function () {
  182. var e = E.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i)
  183. if (!e) return null
  184. var t = e[1] && parseFloat(e[1]),
  185. i = e[2] && parseFloat(e[2])
  186. return t && i ? parseFloat(e[1] + '.' + e[2]) : t || null
  187. })(),
  188. L = A && P < 5 && C < 537,
  189. D = /Firefox/i.test(E),
  190. O = /Edg/i.test(E),
  191. M = !O && (/Chrome/i.test(E) || /CriOS/i.test(E)),
  192. R = (zt = E.match(/(Chrome|CriOS)\/(\d+)/)) && zt[2] ? parseFloat(zt[2]) : null,
  193. N = (Xt = !(Xt = (Xt = /MSIE\s(\d+)\.\d/.exec(E)) && parseFloat(Xt[1])) && /Trident\/7.0/i.test(E) && /rv:11.0/.test(E) ? 11 : Xt),
  194. U = /Safari/i.test(E) && !M && !A && !O,
  195. B = /Windows/i.test(E),
  196. F = Boolean(X() && ('ontouchstart' in window || window.navigator.maxTouchPoints || (window.DocumentTouch && window.document instanceof window.DocumentTouch))),
  197. j = /iPad/i.test(E) || (U && F && !/iPhone/i.test(E)),
  198. H = /iPhone/i.test(E) && !j,
  199. q = H || j || I,
  200. V = (U || q) && !M,
  201. W = Object.freeze({
  202. __proto__: null,
  203. IS_IPOD: I,
  204. IOS_VERSION: x,
  205. IS_ANDROID: A,
  206. ANDROID_VERSION: P,
  207. IS_NATIVE_ANDROID: L,
  208. IS_FIREFOX: D,
  209. IS_EDGE: O,
  210. IS_CHROME: M,
  211. CHROME_VERSION: R,
  212. IE_VERSION: N,
  213. IS_SAFARI: U,
  214. IS_WINDOWS: B,
  215. TOUCH_ENABLED: F,
  216. IS_IPAD: j,
  217. IS_IPHONE: H,
  218. IS_IOS: q,
  219. IS_ANY_SAFARI: V,
  220. })
  221. function G(e) {
  222. return 'string' == typeof e && Boolean(e.trim())
  223. }
  224. function z(e) {
  225. if (0 <= e.indexOf(' ')) throw new Error('class has illegal whitespace characters')
  226. }
  227. function X() {
  228. return document === window.document
  229. }
  230. function K(e) {
  231. return T(e) && 1 === e.nodeType
  232. }
  233. function Y() {
  234. try {
  235. return window.parent !== window.self
  236. } catch (e) {
  237. return !0
  238. }
  239. }
  240. function Q(i) {
  241. return function (e, t) {
  242. if (!G(e)) return document[i](null)
  243. t = K((t = G(t) ? document.querySelector(t) : t)) ? t : document
  244. return t[i] && t[i](e)
  245. }
  246. }
  247. function $(e, i, t, n) {
  248. void 0 === e && (e = 'div'), void 0 === i && (i = {}), void 0 === t && (t = {})
  249. var r = document.createElement(e)
  250. return (
  251. Object.getOwnPropertyNames(i).forEach(function (e) {
  252. var t = i[e]
  253. ;-1 !== e.indexOf('aria-') || 'role' === e || 'type' === e
  254. ? (h.warn(
  255. 'Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set ' +
  256. e +
  257. ' to ' +
  258. t +
  259. '.'
  260. ),
  261. r.setAttribute(e, t))
  262. : 'textContent' === e
  263. ? J(r, t)
  264. : (r[e] === t && 'tabIndex' !== e) || (r[e] = t)
  265. }),
  266. Object.getOwnPropertyNames(t).forEach(function (e) {
  267. r.setAttribute(e, t[e])
  268. }),
  269. n && ye(r, n),
  270. r
  271. )
  272. }
  273. function J(e, t) {
  274. return 'undefined' == typeof e.textContent ? (e.innerText = t) : (e.textContent = t), e
  275. }
  276. function Z(e, t) {
  277. t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e)
  278. }
  279. function ee(e, t) {
  280. return z(t), e.classList ? e.classList.contains(t) : new RegExp('(^|\\s)' + t + '($|\\s)').test(e.className)
  281. }
  282. function te(e, t) {
  283. return e.classList ? e.classList.add(t) : ee(e, t) || (e.className = (e.className + ' ' + t).trim()), e
  284. }
  285. function ie(e, t) {
  286. return e
  287. ? (e.classList
  288. ? e.classList.remove(t)
  289. : (z(t),
  290. (e.className = e.className
  291. .split(/\s+/)
  292. .filter(function (e) {
  293. return e !== t
  294. })
  295. .join(' '))),
  296. e)
  297. : (h.warn("removeClass was called with an element that doesn't exist"), null)
  298. }
  299. function ne(e, t, i) {
  300. var n = ee(e, t)
  301. if ((i = 'boolean' != typeof (i = 'function' == typeof i ? i(e, t) : i) ? !n : i) !== n) return (i ? te : ie)(e, t), e
  302. }
  303. function re(i, n) {
  304. Object.getOwnPropertyNames(n).forEach(function (e) {
  305. var t = n[e]
  306. null === t || 'undefined' == typeof t || !1 === t ? i.removeAttribute(e) : i.setAttribute(e, !0 === t ? '' : t)
  307. })
  308. }
  309. function ae(e) {
  310. var t = {},
  311. i = ',autoplay,controls,playsinline,loop,muted,default,defaultMuted,'
  312. if (e && e.attributes && 0 < e.attributes.length)
  313. for (var n = e.attributes, r = n.length - 1; 0 <= r; r--) {
  314. var a = n[r].name,
  315. s = n[r].value
  316. ;('boolean' != typeof e[a] && -1 === i.indexOf(',' + a + ',')) || (s = null !== s), (t[a] = s)
  317. }
  318. return t
  319. }
  320. function se(e, t) {
  321. return e.getAttribute(t)
  322. }
  323. function oe(e, t, i) {
  324. e.setAttribute(t, i)
  325. }
  326. function ue(e, t) {
  327. e.removeAttribute(t)
  328. }
  329. function le() {
  330. document.body.focus(),
  331. (document.onselectstart = function () {
  332. return !1
  333. })
  334. }
  335. function ce() {
  336. document.onselectstart = function () {
  337. return !0
  338. }
  339. }
  340. function de(e) {
  341. if (e && e.getBoundingClientRect && e.parentNode) {
  342. var t = e.getBoundingClientRect(),
  343. i = {}
  344. return (
  345. ['bottom', 'height', 'left', 'right', 'top', 'width'].forEach(function (e) {
  346. void 0 !== t[e] && (i[e] = t[e])
  347. }),
  348. i.height || (i.height = parseFloat(w(e, 'height'))),
  349. i.width || (i.width = parseFloat(w(e, 'width'))),
  350. i
  351. )
  352. }
  353. }
  354. function he(e) {
  355. if (!e || (e && !e.offsetParent)) return { left: 0, top: 0, width: 0, height: 0 }
  356. for (var t = e.offsetWidth, i = e.offsetHeight, n = 0, r = 0; e.offsetParent && e !== document[l.fullscreenElement]; ) (n += e.offsetLeft), (r += e.offsetTop), (e = e.offsetParent)
  357. return { left: n, top: r, width: t, height: i }
  358. }
  359. function pe(e, t) {
  360. var i = { x: 0, y: 0 }
  361. if (q)
  362. for (var n = e; n && 'html' !== n.nodeName.toLowerCase(); ) {
  363. var r,
  364. a = w(n, 'transform')
  365. ;/^matrix/.test(a)
  366. ? ((r = a.slice(7, -1).split(/,\s/).map(Number)), (i.x += r[4]), (i.y += r[5]))
  367. : /^matrix3d/.test(a) && ((a = a.slice(9, -1).split(/,\s/).map(Number)), (i.x += a[12]), (i.y += a[13])),
  368. (n = n.parentNode)
  369. }
  370. var s = {},
  371. o = he(t.target),
  372. u = he(e),
  373. l = u.width,
  374. c = u.height,
  375. e = t.offsetY - (u.top - o.top),
  376. o = t.offsetX - (u.left - o.left)
  377. return (
  378. t.changedTouches && ((o = t.changedTouches[0].pageX - u.left), (e = t.changedTouches[0].pageY + u.top), q && ((o -= i.x), (e -= i.y))),
  379. (s.y = 1 - Math.max(0, Math.min(1, e / c))),
  380. (s.x = Math.max(0, Math.min(1, o / l))),
  381. s
  382. )
  383. }
  384. function fe(e) {
  385. return T(e) && 3 === e.nodeType
  386. }
  387. function me(e) {
  388. for (; e.firstChild; ) e.removeChild(e.firstChild)
  389. return e
  390. }
  391. function ge(e) {
  392. return (
  393. 'function' == typeof e && (e = e()),
  394. (Array.isArray(e) ? e : [e])
  395. .map(function (e) {
  396. return K((e = 'function' == typeof e ? e() : e)) || fe(e) ? e : 'string' == typeof e && /\S/.test(e) ? document.createTextNode(e) : void 0
  397. })
  398. .filter(function (e) {
  399. return e
  400. })
  401. )
  402. }
  403. function ye(t, e) {
  404. return (
  405. ge(e).forEach(function (e) {
  406. return t.appendChild(e)
  407. }),
  408. t
  409. )
  410. }
  411. function ve(e, t) {
  412. return ye(me(e), t)
  413. }
  414. function _e(e) {
  415. return (
  416. (void 0 === e.button && void 0 === e.buttons) ||
  417. (0 === e.button && void 0 === e.buttons) ||
  418. ('mouseup' === e.type && 0 === e.button && 0 === e.buttons) ||
  419. (0 === e.button && 1 === e.buttons)
  420. )
  421. }
  422. var be,
  423. Te = Q('querySelector'),
  424. Se = Q('querySelectorAll'),
  425. we = Object.freeze({
  426. __proto__: null,
  427. isReal: X,
  428. isEl: K,
  429. isInFrame: Y,
  430. createEl: $,
  431. textContent: J,
  432. prependTo: Z,
  433. hasClass: ee,
  434. addClass: te,
  435. removeClass: ie,
  436. toggleClass: ne,
  437. setAttributes: re,
  438. getAttributes: ae,
  439. getAttribute: se,
  440. setAttribute: oe,
  441. removeAttribute: ue,
  442. blockTextSelection: le,
  443. unblockTextSelection: ce,
  444. getBoundingClientRect: de,
  445. findPosition: he,
  446. getPointerPosition: pe,
  447. isTextNode: fe,
  448. emptyEl: me,
  449. normalizeContent: ge,
  450. appendContent: ye,
  451. insertContent: ve,
  452. isSingleLeftClick: _e,
  453. $: Te,
  454. $$: Se,
  455. }),
  456. Ee = !1,
  457. ke = function () {
  458. if (!1 !== be.options.autoSetup) {
  459. var e = Array.prototype.slice.call(document.getElementsByTagName('video')),
  460. t = Array.prototype.slice.call(document.getElementsByTagName('audio')),
  461. i = Array.prototype.slice.call(document.getElementsByTagName('video-js')),
  462. n = e.concat(t, i)
  463. if (n && 0 < n.length)
  464. for (var r = 0, a = n.length; r < a; r++) {
  465. var s = n[r]
  466. if (!s || !s.getAttribute) {
  467. Ce(1)
  468. break
  469. }
  470. void 0 === s.player && null !== s.getAttribute('data-setup') && be(s)
  471. }
  472. else Ee || Ce(1)
  473. }
  474. }
  475. function Ce(e, t) {
  476. X() && (t && (be = t), window.setTimeout(ke, e))
  477. }
  478. function Ie() {
  479. ;(Ee = !0), window.removeEventListener('load', Ie)
  480. }
  481. X() && ('complete' === document.readyState ? Ie() : window.addEventListener('load', Ie))
  482. function xe(e) {
  483. var t = document.createElement('style')
  484. return (t.className = e), t
  485. }
  486. function Ae(e, t) {
  487. e.styleSheet ? (e.styleSheet.cssText = t) : (e.textContent = t)
  488. }
  489. var Pe = 3
  490. window.WeakMap ||
  491. (ui = (function () {
  492. function e() {
  493. ;(this.vdata = 'vdata' + Math.floor((window.performance && window.performance.now()) || Date.now())), (this.data = {})
  494. }
  495. var t = e.prototype
  496. return (
  497. (t.set = function (e, t) {
  498. var i = e[this.vdata] || Pe++
  499. return e[this.vdata] || (e[this.vdata] = i), (this.data[i] = t), this
  500. }),
  501. (t.get = function (e) {
  502. var t = e[this.vdata]
  503. if (t) return this.data[t]
  504. h('We have no data for this element', e)
  505. }),
  506. (t.has = function (e) {
  507. return e[this.vdata] in this.data
  508. }),
  509. (t.delete = function (e) {
  510. var t = e[this.vdata]
  511. t && (delete this.data[t], delete e[this.vdata])
  512. }),
  513. e
  514. )
  515. })())
  516. var Le,
  517. De = new (window.WeakMap ? WeakMap : ui)()
  518. function Oe(e, t) {
  519. var i
  520. De.has(e) &&
  521. (0 === (i = De.get(e)).handlers[t].length &&
  522. (delete i.handlers[t], e.removeEventListener ? e.removeEventListener(t, i.dispatcher, !1) : e.detachEvent && e.detachEvent('on' + t, i.dispatcher)),
  523. Object.getOwnPropertyNames(i.handlers).length <= 0 && (delete i.handlers, delete i.dispatcher, delete i.disabled),
  524. 0 === Object.getOwnPropertyNames(i).length && De.delete(e))
  525. }
  526. function Me(t, i, e, n) {
  527. e.forEach(function (e) {
  528. t(i, e, n)
  529. })
  530. }
  531. function Re(e) {
  532. if (e.fixed_) return e
  533. function t() {
  534. return !0
  535. }
  536. function i() {
  537. return !1
  538. }
  539. if (!e || !e.isPropagationStopped || !e.isImmediatePropagationStopped) {
  540. var n,
  541. r,
  542. a,
  543. s = e || window.event
  544. for (n in ((e = {}), s))
  545. 'layerX' !== n &&
  546. 'layerY' !== n &&
  547. 'keyLocation' !== n &&
  548. 'webkitMovementX' !== n &&
  549. 'webkitMovementY' !== n &&
  550. 'path' !== n &&
  551. (('returnValue' === n && s.preventDefault) || (e[n] = s[n]))
  552. e.target || (e.target = e.srcElement || document),
  553. e.relatedTarget || (e.relatedTarget = e.fromElement === e.target ? e.toElement : e.fromElement),
  554. (e.preventDefault = function () {
  555. s.preventDefault && s.preventDefault(), (e.returnValue = !1), (s.returnValue = !1), (e.defaultPrevented = !0)
  556. }),
  557. (e.defaultPrevented = !1),
  558. (e.stopPropagation = function () {
  559. s.stopPropagation && s.stopPropagation(), (e.cancelBubble = !0), (s.cancelBubble = !0), (e.isPropagationStopped = t)
  560. }),
  561. (e.isPropagationStopped = i),
  562. (e.stopImmediatePropagation = function () {
  563. s.stopImmediatePropagation && s.stopImmediatePropagation(), (e.isImmediatePropagationStopped = t), e.stopPropagation()
  564. }),
  565. (e.isImmediatePropagationStopped = i),
  566. null !== e.clientX &&
  567. void 0 !== e.clientX &&
  568. ((r = document.documentElement),
  569. (a = document.body),
  570. (e.pageX = e.clientX + ((r && r.scrollLeft) || (a && a.scrollLeft) || 0) - ((r && r.clientLeft) || (a && a.clientLeft) || 0)),
  571. (e.pageY = e.clientY + ((r && r.scrollTop) || (a && a.scrollTop) || 0) - ((r && r.clientTop) || (a && a.clientTop) || 0))),
  572. (e.which = e.charCode || e.keyCode),
  573. null !== e.button && void 0 !== e.button && (e.button = 1 & e.button ? 0 : 4 & e.button ? 1 : 2 & e.button ? 2 : 0)
  574. }
  575. return (e.fixed_ = !0), e
  576. }
  577. var Ne = function () {
  578. if ('boolean' != typeof Le) {
  579. Le = !1
  580. try {
  581. var e = Object.defineProperty({}, 'passive', {
  582. get: function () {
  583. Le = !0
  584. },
  585. })
  586. window.addEventListener('test', null, e), window.removeEventListener('test', null, e)
  587. } catch (e) {}
  588. }
  589. return Le
  590. },
  591. Ue = ['touchstart', 'touchmove']
  592. function Be(s, e, t) {
  593. if (Array.isArray(e)) return Me(Be, s, e, t)
  594. De.has(s) || De.set(s, {})
  595. var o = De.get(s)
  596. o.handlers || (o.handlers = {}),
  597. o.handlers[e] || (o.handlers[e] = []),
  598. t.guid || (t.guid = Pe++),
  599. o.handlers[e].push(t),
  600. o.dispatcher ||
  601. ((o.disabled = !1),
  602. (o.dispatcher = function (e, t) {
  603. if (!o.disabled) {
  604. e = Re(e)
  605. var i = o.handlers[e.type]
  606. if (i)
  607. for (var n = i.slice(0), r = 0, a = n.length; r < a && !e.isImmediatePropagationStopped(); r++)
  608. try {
  609. n[r].call(s, e, t)
  610. } catch (e) {
  611. h.error(e)
  612. }
  613. }
  614. })),
  615. 1 === o.handlers[e].length &&
  616. (s.addEventListener ? ((t = !1), Ne() && -1 < Ue.indexOf(e) && (t = { passive: !0 }), s.addEventListener(e, o.dispatcher, t)) : s.attachEvent && s.attachEvent('on' + e, o.dispatcher))
  617. }
  618. function Fe(e, t, i) {
  619. if (De.has(e)) {
  620. var n = De.get(e)
  621. if (n.handlers) {
  622. if (Array.isArray(t)) return Me(Fe, e, t, i)
  623. var r = function (e, t) {
  624. ;(n.handlers[t] = []), Oe(e, t)
  625. }
  626. if (void 0 !== t) {
  627. var a = n.handlers[t]
  628. if (a)
  629. if (i) {
  630. if (i.guid) for (var s = 0; s < a.length; s++) a[s].guid === i.guid && a.splice(s--, 1)
  631. Oe(e, t)
  632. } else r(e, t)
  633. } else for (var o in n.handlers) Object.prototype.hasOwnProperty.call(n.handlers || {}, o) && r(e, o)
  634. }
  635. }
  636. }
  637. function je(e, t, i) {
  638. var n = De.has(e) ? De.get(e) : {},
  639. r = e.parentNode || e.ownerDocument
  640. return (
  641. 'string' == typeof t ? (t = { type: t, target: e }) : t.target || (t.target = e),
  642. (t = Re(t)),
  643. n.dispatcher && n.dispatcher.call(e, t, i),
  644. r && !t.isPropagationStopped() && !0 === t.bubbles
  645. ? je.call(null, r, t, i)
  646. : !r &&
  647. !t.defaultPrevented &&
  648. t.target &&
  649. t.target[t.type] &&
  650. (De.has(t.target) || De.set(t.target, {}),
  651. (r = De.get(t.target)),
  652. t.target[t.type] && ((r.disabled = !0), 'function' == typeof t.target[t.type] && t.target[t.type](), (r.disabled = !1))),
  653. !t.defaultPrevented
  654. )
  655. }
  656. function He(e, t, i) {
  657. if (Array.isArray(t)) return Me(He, e, t, i)
  658. function n() {
  659. Fe(e, t, n), i.apply(this, arguments)
  660. }
  661. ;(n.guid = i.guid = i.guid || Pe++), Be(e, t, n)
  662. }
  663. function qe(e, t, i) {
  664. function n() {
  665. Fe(e, t, n), i.apply(this, arguments)
  666. }
  667. ;(n.guid = i.guid = i.guid || Pe++), Be(e, t, n)
  668. }
  669. function Ve(e, t, i) {
  670. return t.guid || (t.guid = Pe++), ((e = t.bind(e)).guid = i ? i + '_' + t.guid : t.guid), e
  671. }
  672. function We(t, i) {
  673. var n = window.performance.now()
  674. return function () {
  675. var e = window.performance.now()
  676. i <= e - n && (t.apply(void 0, arguments), (n = e))
  677. }
  678. }
  679. function Ge(n, r, a, s) {
  680. var o
  681. function e() {
  682. var e = this,
  683. t = arguments,
  684. i = function () {
  685. ;(i = o = null), a || n.apply(e, t)
  686. }
  687. !o && a && n.apply(e, t), s.clearTimeout(o), (o = s.setTimeout(i, r))
  688. }
  689. return (
  690. void 0 === s && (s = window),
  691. (e.cancel = function () {
  692. s.clearTimeout(o), (o = null)
  693. }),
  694. e
  695. )
  696. }
  697. function ze() {}
  698. var Xe,
  699. Ke = Object.freeze({ __proto__: null, fixEvent: Re, on: Be, off: Fe, trigger: je, one: He, any: qe })
  700. ;(ze.prototype.allowedEvents_ = {}),
  701. (ze.prototype.addEventListener = ze.prototype.on =
  702. function (e, t) {
  703. var i = this.addEventListener
  704. ;(this.addEventListener = function () {}), Be(this, e, t), (this.addEventListener = i)
  705. }),
  706. (ze.prototype.removeEventListener = ze.prototype.off =
  707. function (e, t) {
  708. Fe(this, e, t)
  709. }),
  710. (ze.prototype.one = function (e, t) {
  711. var i = this.addEventListener
  712. ;(this.addEventListener = function () {}), He(this, e, t), (this.addEventListener = i)
  713. }),
  714. (ze.prototype.any = function (e, t) {
  715. var i = this.addEventListener
  716. ;(this.addEventListener = function () {}), qe(this, e, t), (this.addEventListener = i)
  717. }),
  718. (ze.prototype.dispatchEvent = ze.prototype.trigger =
  719. function (e) {
  720. var t = e.type || e
  721. ;(e = Re((e = 'string' == typeof e ? { type: t } : e))), this.allowedEvents_[t] && this['on' + t] && this['on' + t](e), je(this, e)
  722. }),
  723. (ze.prototype.queueTrigger = function (e) {
  724. var t = this
  725. Xe = Xe || new Map()
  726. var i = e.type || e,
  727. n = Xe.get(this)
  728. n || ((n = new Map()), Xe.set(this, n))
  729. var r = n.get(i)
  730. n.delete(i), window.clearTimeout(r)
  731. r = window.setTimeout(function () {
  732. 0 === n.size && ((n = null), Xe.delete(t)), t.trigger(e)
  733. }, 0)
  734. n.set(i, r)
  735. })
  736. function Ye(e) {
  737. return 'function' == typeof e.name ? e.name() : 'string' == typeof e.name ? e.name : e.name_ || (e.constructor && e.constructor.name ? e.constructor.name : typeof e)
  738. }
  739. function Qe(e) {
  740. return ('string' == typeof e && /\S/.test(e)) || (Array.isArray(e) && !!e.length)
  741. }
  742. function $e(e, t, i) {
  743. if (!e || (!e.nodeName && !it(e))) throw new Error('Invalid target for ' + Ye(t) + '#' + i + '; must be a DOM node or evented object.')
  744. }
  745. function Je(e, t, i) {
  746. if (!Qe(e)) throw new Error('Invalid event type for ' + Ye(t) + '#' + i + '; must be a non-empty string or array.')
  747. }
  748. function Ze(e, t, i) {
  749. if ('function' != typeof e) throw new Error('Invalid listener for ' + Ye(t) + '#' + i + '; must be a function.')
  750. }
  751. function et(e, t, i) {
  752. var n,
  753. r,
  754. a = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_,
  755. t = a ? ((n = e.eventBusEl_), 3 <= t.length && t.shift(), (r = t[0]), t[1]) : ((n = t[0]), (r = t[1]), t[2])
  756. return $e(n, e, i), Je(r, e, i), Ze(t, e, i), { isTargetingSelf: a, target: n, type: r, listener: (t = Ve(e, t)) }
  757. }
  758. function tt(e, t, i, n) {
  759. $e(e, e, t), e.nodeName ? Ke[t](e, i, n) : e[t](i, n)
  760. }
  761. var it = function (t) {
  762. return (
  763. t instanceof ze ||
  764. (!!t.eventBusEl_ &&
  765. ['on', 'one', 'off', 'trigger'].every(function (e) {
  766. return 'function' == typeof t[e]
  767. }))
  768. )
  769. },
  770. nt = {
  771. on: function () {
  772. for (var e = this, t = arguments.length, i = new Array(t), n = 0; n < t; n++) i[n] = arguments[n]
  773. var r,
  774. a = et(this, i, 'on'),
  775. s = a.isTargetingSelf,
  776. o = a.target,
  777. u = a.type,
  778. l = a.listener
  779. tt(o, 'on', u, l),
  780. s ||
  781. (((r = function () {
  782. return e.off(o, u, l)
  783. }).guid = l.guid),
  784. ((s = function () {
  785. return e.off('dispose', r)
  786. }).guid = l.guid),
  787. tt(this, 'on', 'dispose', r),
  788. tt(o, 'on', 'dispose', s))
  789. },
  790. one: function () {
  791. for (var r = this, e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  792. var n = et(this, t, 'one'),
  793. a = n.isTargetingSelf,
  794. s = n.target,
  795. o = n.type,
  796. u = n.listener
  797. a
  798. ? tt(s, 'one', o, u)
  799. : (((a = function e() {
  800. r.off(s, o, e)
  801. for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++) i[n] = arguments[n]
  802. u.apply(null, i)
  803. }).guid = u.guid),
  804. tt(s, 'one', o, a))
  805. },
  806. any: function () {
  807. for (var r = this, e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  808. var n = et(this, t, 'any'),
  809. a = n.isTargetingSelf,
  810. s = n.target,
  811. o = n.type,
  812. u = n.listener
  813. a
  814. ? tt(s, 'any', o, u)
  815. : (((a = function e() {
  816. r.off(s, o, e)
  817. for (var t = arguments.length, i = new Array(t), n = 0; n < t; n++) i[n] = arguments[n]
  818. u.apply(null, i)
  819. }).guid = u.guid),
  820. tt(s, 'any', o, a))
  821. },
  822. off: function (e, t, i) {
  823. !e || Qe(e)
  824. ? Fe(this.eventBusEl_, e, t)
  825. : ((t = t),
  826. $e((e = e), this, 'off'),
  827. Je(t, this, 'off'),
  828. Ze(i, this, 'off'),
  829. (i = Ve(this, i)),
  830. this.off('dispose', i),
  831. e.nodeName ? (Fe(e, t, i), Fe(e, 'dispose', i)) : it(e) && (e.off(t, i), e.off('dispose', i)))
  832. },
  833. trigger: function (e, t) {
  834. $e(this.eventBusEl_, this, 'trigger')
  835. var i = e && 'string' != typeof e ? e.type : e
  836. if (!Qe(i)) {
  837. i = 'Invalid event type for ' + Ye(this) + '#trigger; must be a non-empty string or object with a type key that has a non-empty value.'
  838. if (!e) throw new Error(i)
  839. ;(this.log || h).error(i)
  840. }
  841. return je(this.eventBusEl_, e, t)
  842. },
  843. }
  844. function rt(e, t) {
  845. t = (t = void 0 === t ? {} : t).eventBusKey
  846. if (t) {
  847. if (!e[t].nodeName) throw new Error('The eventBusKey "' + t + '" does not refer to an element.')
  848. e.eventBusEl_ = e[t]
  849. } else e.eventBusEl_ = $('span', { className: 'vjs-event-bus' })
  850. return (
  851. b(e, nt),
  852. e.eventedCallbacks &&
  853. e.eventedCallbacks.forEach(function (e) {
  854. e()
  855. }),
  856. e.on('dispose', function () {
  857. e.off(),
  858. [e, e.el_, e.eventBusEl_].forEach(function (e) {
  859. e && De.has(e) && De.delete(e)
  860. }),
  861. window.setTimeout(function () {
  862. e.eventBusEl_ = null
  863. }, 0)
  864. }),
  865. e
  866. )
  867. }
  868. var at = {
  869. state: {},
  870. setState: function (e) {
  871. var i,
  872. n = this
  873. return (
  874. _((e = 'function' == typeof e ? e() : e), function (e, t) {
  875. n.state[t] !== e && ((i = i || {})[t] = { from: n.state[t], to: e }), (n.state[t] = e)
  876. }),
  877. i && it(this) && this.trigger({ changes: i, type: 'statechanged' }),
  878. i
  879. )
  880. },
  881. }
  882. function st(e, t) {
  883. return b(e, at), (e.state = b({}, e.state, t)), 'function' == typeof e.handleStateChanged && it(e) && e.on('statechanged', e.handleStateChanged), e
  884. }
  885. function ot(e) {
  886. return 'string' != typeof e
  887. ? e
  888. : e.replace(/./, function (e) {
  889. return e.toLowerCase()
  890. })
  891. }
  892. function ut(e) {
  893. return 'string' != typeof e
  894. ? e
  895. : e.replace(/./, function (e) {
  896. return e.toUpperCase()
  897. })
  898. }
  899. function lt() {
  900. for (var i = {}, e = arguments.length, t = new Array(e), n = 0; n < e; n++) t[n] = arguments[n]
  901. return (
  902. t.forEach(function (e) {
  903. e &&
  904. _(e, function (e, t) {
  905. S(e) ? (S(i[t]) || (i[t] = {}), (i[t] = lt(i[t], e))) : (i[t] = e)
  906. })
  907. }),
  908. i
  909. )
  910. }
  911. var ct =
  912. window.Map ||
  913. (function () {
  914. function e() {
  915. this.map_ = {}
  916. }
  917. var t = e.prototype
  918. return (
  919. (t.has = function (e) {
  920. return e in this.map_
  921. }),
  922. (t.delete = function (e) {
  923. var t = this.has(e)
  924. return delete this.map_[e], t
  925. }),
  926. (t.set = function (e, t) {
  927. return (this.map_[e] = t), this
  928. }),
  929. (t.forEach = function (e, t) {
  930. for (var i in this.map_) e.call(t, this.map_[i], i, this)
  931. }),
  932. e
  933. )
  934. })(),
  935. dt =
  936. window.Set ||
  937. (function () {
  938. function e() {
  939. this.set_ = {}
  940. }
  941. var t = e.prototype
  942. return (
  943. (t.has = function (e) {
  944. return e in this.set_
  945. }),
  946. (t.delete = function (e) {
  947. var t = this.has(e)
  948. return delete this.set_[e], t
  949. }),
  950. (t.add = function (e) {
  951. return (this.set_[e] = 1), this
  952. }),
  953. (t.forEach = function (e, t) {
  954. for (var i in this.set_) e.call(t, i, i, this)
  955. }),
  956. e
  957. )
  958. })(),
  959. ht = m(function (e, t) {
  960. function i(e) {
  961. if ((!e || 'object' != typeof e || ((t = e.which || e.keyCode || e.charCode) && (e = t)), 'number' == typeof e)) return o[e]
  962. var t = String(e),
  963. e = n[t.toLowerCase()]
  964. return e || ((e = r[t.toLowerCase()]) ? e : 1 === t.length ? t.charCodeAt(0) : void 0)
  965. }
  966. i.isEventKey = function (e, t) {
  967. if (e && 'object' == typeof e) {
  968. var i = e.which || e.keyCode || e.charCode
  969. if (null == i) return !1
  970. if ('string' == typeof t) {
  971. e = n[t.toLowerCase()]
  972. if (e) return e === i
  973. if ((e = r[t.toLowerCase()])) return e === i
  974. } else if ('number' == typeof t) return t === i
  975. return !1
  976. }
  977. }
  978. for (
  979. var n =
  980. ((t = e.exports = i).code =
  981. t.codes =
  982. {
  983. backspace: 8,
  984. tab: 9,
  985. enter: 13,
  986. shift: 16,
  987. ctrl: 17,
  988. alt: 18,
  989. 'pause/break': 19,
  990. 'caps lock': 20,
  991. esc: 27,
  992. space: 32,
  993. 'page up': 33,
  994. 'page down': 34,
  995. end: 35,
  996. home: 36,
  997. left: 37,
  998. up: 38,
  999. right: 39,
  1000. down: 40,
  1001. insert: 45,
  1002. delete: 46,
  1003. command: 91,
  1004. 'left command': 91,
  1005. 'right command': 93,
  1006. 'numpad *': 106,
  1007. 'numpad +': 107,
  1008. 'numpad -': 109,
  1009. 'numpad .': 110,
  1010. 'numpad /': 111,
  1011. 'num lock': 144,
  1012. 'scroll lock': 145,
  1013. 'my computer': 182,
  1014. 'my calculator': 183,
  1015. ';': 186,
  1016. '=': 187,
  1017. ',': 188,
  1018. '-': 189,
  1019. '.': 190,
  1020. '/': 191,
  1021. '`': 192,
  1022. '[': 219,
  1023. '\\': 220,
  1024. ']': 221,
  1025. "'": 222,
  1026. }),
  1027. r = (t.aliases = {
  1028. windows: 91,
  1029. '⇧': 16,
  1030. '⌥': 18,
  1031. '⌃': 17,
  1032. '⌘': 91,
  1033. ctl: 17,
  1034. control: 17,
  1035. option: 18,
  1036. pause: 19,
  1037. break: 19,
  1038. caps: 20,
  1039. return: 13,
  1040. escape: 27,
  1041. spc: 32,
  1042. spacebar: 32,
  1043. pgup: 33,
  1044. pgdn: 34,
  1045. ins: 45,
  1046. del: 46,
  1047. cmd: 91,
  1048. }),
  1049. a = 97;
  1050. a < 123;
  1051. a++
  1052. )
  1053. n[String.fromCharCode(a)] = a - 32
  1054. for (var a = 48; a < 58; a++) n[a - 48] = a
  1055. for (a = 1; a < 13; a++) n['f' + a] = a + 111
  1056. for (a = 0; a < 10; a++) n['numpad ' + a] = a + 96
  1057. var s,
  1058. o = (t.names = t.title = {})
  1059. for (a in n) o[n[a]] = a
  1060. for (s in r) n[s] = r[s]
  1061. })
  1062. ht.code, ht.codes, ht.aliases, ht.names, ht.title
  1063. var pt = (function () {
  1064. function s(e, t, i) {
  1065. var n = this
  1066. !e && this.play ? (this.player_ = e = this) : (this.player_ = e),
  1067. (this.isDisposed_ = !1),
  1068. (this.parentComponent_ = null),
  1069. (this.options_ = lt({}, this.options_)),
  1070. (t = this.options_ = lt(this.options_, t)),
  1071. (this.id_ = t.id || (t.el && t.el.id)),
  1072. this.id_ || ((e = (e && e.id && e.id()) || 'no_player'), (this.id_ = e + '_component_' + Pe++)),
  1073. (this.name_ = t.name || null),
  1074. t.el ? (this.el_ = t.el) : !1 !== t.createEl && (this.el_ = this.createEl()),
  1075. t.className &&
  1076. this.el_ &&
  1077. t.className.split(' ').forEach(function (e) {
  1078. return n.addClass(e)
  1079. }),
  1080. !1 !== t.evented &&
  1081. (rt(this, { eventBusKey: this.el_ ? 'el_' : null }),
  1082. (this.handleLanguagechange = this.handleLanguagechange.bind(this)),
  1083. this.on(this.player_, 'languagechange', this.handleLanguagechange)),
  1084. st(this, this.constructor.defaultState),
  1085. (this.children_ = []),
  1086. (this.childIndex_ = {}),
  1087. (this.childNameIndex_ = {}),
  1088. (this.setTimeoutIds_ = new dt()),
  1089. (this.setIntervalIds_ = new dt()),
  1090. (this.rafIds_ = new dt()),
  1091. (this.namedRafs_ = new ct()),
  1092. (this.clearingTimersOnDispose_ = !1) !== t.initChildren && this.initChildren(),
  1093. this.ready(i),
  1094. !1 !== t.reportTouchActivity && this.enableTouchActivity()
  1095. }
  1096. var e = s.prototype
  1097. return (
  1098. (e.dispose = function (e) {
  1099. if ((void 0 === e && (e = {}), !this.isDisposed_)) {
  1100. if ((this.readyQueue_ && (this.readyQueue_.length = 0), this.trigger({ type: 'dispose', bubbles: !1 }), (this.isDisposed_ = !0), this.children_))
  1101. for (var t = this.children_.length - 1; 0 <= t; t--) this.children_[t].dispose && this.children_[t].dispose()
  1102. ;(this.children_ = null),
  1103. (this.childIndex_ = null),
  1104. (this.childNameIndex_ = null),
  1105. (this.parentComponent_ = null),
  1106. this.el_ && (this.el_.parentNode && (e.restoreEl ? this.el_.parentNode.replaceChild(e.restoreEl, this.el_) : this.el_.parentNode.removeChild(this.el_)), (this.el_ = null)),
  1107. (this.player_ = null)
  1108. }
  1109. }),
  1110. (e.isDisposed = function () {
  1111. return Boolean(this.isDisposed_)
  1112. }),
  1113. (e.player = function () {
  1114. return this.player_
  1115. }),
  1116. (e.options = function (e) {
  1117. return e && (this.options_ = lt(this.options_, e)), this.options_
  1118. }),
  1119. (e.el = function () {
  1120. return this.el_
  1121. }),
  1122. (e.createEl = function (e, t, i) {
  1123. return $(e, t, i)
  1124. }),
  1125. (e.localize = function (e, i, t) {
  1126. void 0 === t && (t = e)
  1127. var n = this.player_.language && this.player_.language(),
  1128. r = this.player_.languages && this.player_.languages(),
  1129. a = r && r[n],
  1130. n = n && n.split('-')[0],
  1131. n = r && r[n],
  1132. t = t
  1133. return (
  1134. a && a[e] ? (t = a[e]) : n && n[e] && (t = n[e]),
  1135. (t = i
  1136. ? t.replace(/\{(\d+)\}/g, function (e, t) {
  1137. t = i[t - 1]
  1138. return 'undefined' == typeof t ? e : t
  1139. })
  1140. : t)
  1141. )
  1142. }),
  1143. (e.handleLanguagechange = function () {}),
  1144. (e.contentEl = function () {
  1145. return this.contentEl_ || this.el_
  1146. }),
  1147. (e.id = function () {
  1148. return this.id_
  1149. }),
  1150. (e.name = function () {
  1151. return this.name_
  1152. }),
  1153. (e.children = function () {
  1154. return this.children_
  1155. }),
  1156. (e.getChildById = function (e) {
  1157. return this.childIndex_[e]
  1158. }),
  1159. (e.getChild = function (e) {
  1160. if (e) return this.childNameIndex_[e]
  1161. }),
  1162. (e.getDescendant = function () {
  1163. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  1164. for (
  1165. var t = t.reduce(function (e, t) {
  1166. return e.concat(t)
  1167. }, []),
  1168. n = this,
  1169. r = 0;
  1170. r < t.length;
  1171. r++
  1172. )
  1173. if (!(n = n.getChild(t[r])) || !n.getChild) return
  1174. return n
  1175. }),
  1176. (e.addChild = function (e, t, i) {
  1177. if ((void 0 === t && (t = {}), void 0 === i && (i = this.children_.length), 'string' == typeof e)) {
  1178. var n = ut(e),
  1179. r = t.componentClass || n
  1180. t.name = n
  1181. var a = s.getComponent(r)
  1182. if (!a) throw new Error('Component ' + r + ' does not exist')
  1183. if ('function' != typeof a) return null
  1184. a = new a(this.player_ || this, t)
  1185. } else a = e
  1186. return (
  1187. a.parentComponent_ && a.parentComponent_.removeChild(a),
  1188. this.children_.splice(i, 0, a),
  1189. (a.parentComponent_ = this),
  1190. 'function' == typeof a.id && (this.childIndex_[a.id()] = a),
  1191. (n = n || (a.name && ut(a.name()))) && ((this.childNameIndex_[n] = a), (this.childNameIndex_[ot(n)] = a)),
  1192. 'function' == typeof a.el &&
  1193. a.el() &&
  1194. ((n = null),
  1195. this.children_[i + 1] && (this.children_[i + 1].el_ ? (n = this.children_[i + 1].el_) : K(this.children_[i + 1]) && (n = this.children_[i + 1])),
  1196. this.contentEl().insertBefore(a.el(), n)),
  1197. a
  1198. )
  1199. }),
  1200. (e.removeChild = function (e) {
  1201. if ((e = 'string' == typeof e ? this.getChild(e) : e) && this.children_) {
  1202. for (var t, i = !1, n = this.children_.length - 1; 0 <= n; n--)
  1203. if (this.children_[n] === e) {
  1204. ;(i = !0), this.children_.splice(n, 1)
  1205. break
  1206. }
  1207. i &&
  1208. ((e.parentComponent_ = null),
  1209. (this.childIndex_[e.id()] = null),
  1210. (this.childNameIndex_[ut(e.name())] = null),
  1211. (this.childNameIndex_[ot(e.name())] = null),
  1212. (t = e.el()) && t.parentNode === this.contentEl() && this.contentEl().removeChild(e.el()))
  1213. }
  1214. }),
  1215. (e.initChildren = function () {
  1216. var i,
  1217. t,
  1218. e,
  1219. n = this,
  1220. r = this.options_.children
  1221. r &&
  1222. ((i = this.options_),
  1223. (t = s.getComponent('Tech')),
  1224. (e = Array.isArray(r) ? r : Object.keys(r))
  1225. .concat(
  1226. Object.keys(this.options_).filter(function (t) {
  1227. return !e.some(function (e) {
  1228. return 'string' == typeof e ? t === e : t === e.name
  1229. })
  1230. })
  1231. )
  1232. .map(function (e) {
  1233. var t,
  1234. e = 'string' == typeof e ? r[(t = e)] || n.options_[t] || {} : ((t = e.name), e)
  1235. return { name: t, opts: e }
  1236. })
  1237. .filter(function (e) {
  1238. e = s.getComponent(e.opts.componentClass || ut(e.name))
  1239. return e && !t.isTech(e)
  1240. })
  1241. .forEach(function (e) {
  1242. var t = e.name,
  1243. e = e.opts
  1244. !1 !== (e = void 0 !== i[t] ? i[t] : e) && (((e = !0 === e ? {} : e).playerOptions = n.options_.playerOptions), (e = n.addChild(t, e)) && (n[t] = e))
  1245. }))
  1246. }),
  1247. (e.buildCSSClass = function () {
  1248. return ''
  1249. }),
  1250. (e.ready = function (e, t) {
  1251. if ((void 0 === t && (t = !1), e)) return this.isReady_ ? void (t ? e.call(this) : this.setTimeout(e, 1)) : ((this.readyQueue_ = this.readyQueue_ || []), void this.readyQueue_.push(e))
  1252. }),
  1253. (e.triggerReady = function () {
  1254. ;(this.isReady_ = !0),
  1255. this.setTimeout(function () {
  1256. var e = this.readyQueue_
  1257. ;(this.readyQueue_ = []),
  1258. e &&
  1259. 0 < e.length &&
  1260. e.forEach(function (e) {
  1261. e.call(this)
  1262. }, this),
  1263. this.trigger('ready')
  1264. }, 1)
  1265. }),
  1266. (e.$ = function (e, t) {
  1267. return Te(e, t || this.contentEl())
  1268. }),
  1269. (e.$$ = function (e, t) {
  1270. return Se(e, t || this.contentEl())
  1271. }),
  1272. (e.hasClass = function (e) {
  1273. return ee(this.el_, e)
  1274. }),
  1275. (e.addClass = function (e) {
  1276. te(this.el_, e)
  1277. }),
  1278. (e.removeClass = function (e) {
  1279. ie(this.el_, e)
  1280. }),
  1281. (e.toggleClass = function (e, t) {
  1282. ne(this.el_, e, t)
  1283. }),
  1284. (e.show = function () {
  1285. this.removeClass('vjs-hidden')
  1286. }),
  1287. (e.hide = function () {
  1288. this.addClass('vjs-hidden')
  1289. }),
  1290. (e.lockShowing = function () {
  1291. this.addClass('vjs-lock-showing')
  1292. }),
  1293. (e.unlockShowing = function () {
  1294. this.removeClass('vjs-lock-showing')
  1295. }),
  1296. (e.getAttribute = function (e) {
  1297. return se(this.el_, e)
  1298. }),
  1299. (e.setAttribute = function (e, t) {
  1300. oe(this.el_, e, t)
  1301. }),
  1302. (e.removeAttribute = function (e) {
  1303. ue(this.el_, e)
  1304. }),
  1305. (e.width = function (e, t) {
  1306. return this.dimension('width', e, t)
  1307. }),
  1308. (e.height = function (e, t) {
  1309. return this.dimension('height', e, t)
  1310. }),
  1311. (e.dimensions = function (e, t) {
  1312. this.width(e, !0), this.height(t)
  1313. }),
  1314. (e.dimension = function (e, t, i) {
  1315. if (void 0 !== t)
  1316. return (
  1317. -1 !== ('' + (t = null === t || t != t ? 0 : t)).indexOf('%') || -1 !== ('' + t).indexOf('px') ? (this.el_.style[e] = t) : (this.el_.style[e] = 'auto' === t ? '' : t + 'px'),
  1318. void (i || this.trigger('componentresize'))
  1319. )
  1320. if (!this.el_) return 0
  1321. ;(t = this.el_.style[e]), (i = t.indexOf('px'))
  1322. return -1 !== i ? parseInt(t.slice(0, i), 10) : parseInt(this.el_['offset' + ut(e)], 10)
  1323. }),
  1324. (e.currentDimension = function (e) {
  1325. var t = 0
  1326. if ('width' !== e && 'height' !== e) throw new Error('currentDimension only accepts width or height value')
  1327. return (t = w(this.el_, e)), (0 !== (t = parseFloat(t)) && !isNaN(t)) || ((e = 'offset' + ut(e)), (t = this.el_[e])), t
  1328. }),
  1329. (e.currentDimensions = function () {
  1330. return { width: this.currentDimension('width'), height: this.currentDimension('height') }
  1331. }),
  1332. (e.currentWidth = function () {
  1333. return this.currentDimension('width')
  1334. }),
  1335. (e.currentHeight = function () {
  1336. return this.currentDimension('height')
  1337. }),
  1338. (e.focus = function () {
  1339. this.el_.focus()
  1340. }),
  1341. (e.blur = function () {
  1342. this.el_.blur()
  1343. }),
  1344. (e.handleKeyDown = function (e) {
  1345. this.player_ && (ht.isEventKey(e, 'Tab') || e.stopPropagation(), this.player_.handleKeyDown(e))
  1346. }),
  1347. (e.handleKeyPress = function (e) {
  1348. this.handleKeyDown(e)
  1349. }),
  1350. (e.emitTapEvents = function () {
  1351. var i,
  1352. t = 0,
  1353. n = null
  1354. this.on('touchstart', function (e) {
  1355. 1 === e.touches.length && ((n = { pageX: e.touches[0].pageX, pageY: e.touches[0].pageY }), (t = window.performance.now()), (i = !0))
  1356. }),
  1357. this.on('touchmove', function (e) {
  1358. var t
  1359. 1 < e.touches.length ? (i = !1) : n && ((t = e.touches[0].pageX - n.pageX), (e = e.touches[0].pageY - n.pageY), 10 < Math.sqrt(t * t + e * e) && (i = !1))
  1360. })
  1361. function e() {
  1362. i = !1
  1363. }
  1364. this.on('touchleave', e),
  1365. this.on('touchcancel', e),
  1366. this.on('touchend', function (e) {
  1367. !(n = null) === i && window.performance.now() - t < 200 && (e.preventDefault(), this.trigger('tap'))
  1368. })
  1369. }),
  1370. (e.enableTouchActivity = function () {
  1371. var t, i, e
  1372. this.player() &&
  1373. this.player().reportUserActivity &&
  1374. ((t = Ve(this.player(), this.player().reportUserActivity)),
  1375. this.on('touchstart', function () {
  1376. t(), this.clearInterval(i), (i = this.setInterval(t, 250))
  1377. }),
  1378. (e = function (e) {
  1379. t(), this.clearInterval(i)
  1380. }),
  1381. this.on('touchmove', t),
  1382. this.on('touchend', e),
  1383. this.on('touchcancel', e))
  1384. }),
  1385. (e.setTimeout = function (e, t) {
  1386. var i,
  1387. n = this
  1388. return (
  1389. (e = Ve(this, e)),
  1390. this.clearTimersOnDispose_(),
  1391. (i = window.setTimeout(function () {
  1392. n.setTimeoutIds_.has(i) && n.setTimeoutIds_.delete(i), e()
  1393. }, t)),
  1394. this.setTimeoutIds_.add(i),
  1395. i
  1396. )
  1397. }),
  1398. (e.clearTimeout = function (e) {
  1399. return this.setTimeoutIds_.has(e) && (this.setTimeoutIds_.delete(e), window.clearTimeout(e)), e
  1400. }),
  1401. (e.setInterval = function (e, t) {
  1402. ;(e = Ve(this, e)), this.clearTimersOnDispose_()
  1403. t = window.setInterval(e, t)
  1404. return this.setIntervalIds_.add(t), t
  1405. }),
  1406. (e.clearInterval = function (e) {
  1407. return this.setIntervalIds_.has(e) && (this.setIntervalIds_.delete(e), window.clearInterval(e)), e
  1408. }),
  1409. (e.requestAnimationFrame = function (e) {
  1410. var t,
  1411. i = this
  1412. return this.supportsRaf_
  1413. ? (this.clearTimersOnDispose_(),
  1414. (e = Ve(this, e)),
  1415. (t = window.requestAnimationFrame(function () {
  1416. i.rafIds_.has(t) && i.rafIds_.delete(t), e()
  1417. })),
  1418. this.rafIds_.add(t),
  1419. t)
  1420. : this.setTimeout(e, 1e3 / 60)
  1421. }),
  1422. (e.requestNamedAnimationFrame = function (e, t) {
  1423. var i = this
  1424. if (!this.namedRafs_.has(e)) {
  1425. this.clearTimersOnDispose_(), (t = Ve(this, t))
  1426. var n = this.requestAnimationFrame(function () {
  1427. t(), i.namedRafs_.has(e) && i.namedRafs_.delete(e)
  1428. })
  1429. return this.namedRafs_.set(e, n), e
  1430. }
  1431. }),
  1432. (e.cancelNamedAnimationFrame = function (e) {
  1433. this.namedRafs_.has(e) && (this.cancelAnimationFrame(this.namedRafs_.get(e)), this.namedRafs_.delete(e))
  1434. }),
  1435. (e.cancelAnimationFrame = function (e) {
  1436. return this.supportsRaf_ ? (this.rafIds_.has(e) && (this.rafIds_.delete(e), window.cancelAnimationFrame(e)), e) : this.clearTimeout(e)
  1437. }),
  1438. (e.clearTimersOnDispose_ = function () {
  1439. var n = this
  1440. this.clearingTimersOnDispose_ ||
  1441. ((this.clearingTimersOnDispose_ = !0),
  1442. this.one('dispose', function () {
  1443. ;[
  1444. ['namedRafs_', 'cancelNamedAnimationFrame'],
  1445. ['rafIds_', 'cancelAnimationFrame'],
  1446. ['setTimeoutIds_', 'clearTimeout'],
  1447. ['setIntervalIds_', 'clearInterval'],
  1448. ].forEach(function (e) {
  1449. var t = e[0],
  1450. i = e[1]
  1451. n[t].forEach(function (e, t) {
  1452. return n[i](t)
  1453. })
  1454. }),
  1455. (n.clearingTimersOnDispose_ = !1)
  1456. }))
  1457. }),
  1458. (s.registerComponent = function (e, t) {
  1459. if ('string' != typeof e || !e) throw new Error('Illegal component name, "' + e + '"; must be a non-empty string.')
  1460. var i = s.getComponent('Tech'),
  1461. n = i && i.isTech(t),
  1462. i = s === t || s.prototype.isPrototypeOf(t.prototype)
  1463. if (n || !i) {
  1464. var r = n ? 'techs must be registered using Tech.registerTech()' : 'must be a Component subclass'
  1465. throw new Error('Illegal component, "' + e + '"; ' + r + '.')
  1466. }
  1467. ;(e = ut(e)), s.components_ || (s.components_ = {})
  1468. r = s.getComponent('Player')
  1469. if ('Player' === e && r && r.players) {
  1470. var a = r.players,
  1471. r = Object.keys(a)
  1472. if (
  1473. a &&
  1474. 0 < r.length &&
  1475. r
  1476. .map(function (e) {
  1477. return a[e]
  1478. })
  1479. .every(Boolean)
  1480. )
  1481. throw new Error('Can not register Player component after player has been created.')
  1482. }
  1483. return (s.components_[e] = t), (s.components_[ot(e)] = t)
  1484. }),
  1485. (s.getComponent = function (e) {
  1486. if (e && s.components_) return s.components_[e]
  1487. }),
  1488. s
  1489. )
  1490. })()
  1491. ;(pt.prototype.supportsRaf_ = 'function' == typeof window.requestAnimationFrame && 'function' == typeof window.cancelAnimationFrame), pt.registerComponent('Component', pt)
  1492. var ft = function (e) {
  1493. if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called")
  1494. return e
  1495. }
  1496. var mt = function (e, t) {
  1497. ;(e.prototype = Object.create(t.prototype)), ((e.prototype.constructor = e).__proto__ = t)
  1498. }
  1499. function gt(e, t, i, n) {
  1500. return (
  1501. (function (e, t, i) {
  1502. if ('number' != typeof t || t < 0 || i < t)
  1503. throw new Error("Failed to execute '" + e + "' on 'TimeRanges': The index provided (" + t + ') is non-numeric or out of bounds (0-' + i + ').')
  1504. })(e, n, i.length - 1),
  1505. i[n][t]
  1506. )
  1507. }
  1508. function yt(e) {
  1509. var t =
  1510. void 0 === e || 0 === e.length
  1511. ? {
  1512. length: 0,
  1513. start: function () {
  1514. throw new Error('This TimeRanges object is empty')
  1515. },
  1516. end: function () {
  1517. throw new Error('This TimeRanges object is empty')
  1518. },
  1519. }
  1520. : { length: e.length, start: gt.bind(null, 'start', 0, e), end: gt.bind(null, 'end', 1, e) }
  1521. return (
  1522. window.Symbol &&
  1523. window.Symbol.iterator &&
  1524. (t[window.Symbol.iterator] = function () {
  1525. return (e || []).values()
  1526. }),
  1527. t
  1528. )
  1529. }
  1530. function vt(e, t) {
  1531. return Array.isArray(e) ? yt(e) : void 0 === e || void 0 === t ? yt() : yt([[e, t]])
  1532. }
  1533. function _t(e, t) {
  1534. var i,
  1535. n,
  1536. r = 0
  1537. if (!t) return 0
  1538. ;(e && e.length) || (e = vt(0, 0))
  1539. for (var a = 0; a < e.length; a++) (i = e.start(a)), (r += (n = t < (n = e.end(a)) ? t : n) - i)
  1540. return r / t
  1541. }
  1542. function bt(e) {
  1543. if (e instanceof bt) return e
  1544. 'number' == typeof e ? (this.code = e) : 'string' == typeof e ? (this.message = e) : T(e) && ('number' == typeof e.code && (this.code = e.code), b(this, e)),
  1545. this.message || (this.message = bt.defaultMessages[this.code] || '')
  1546. }
  1547. ;(bt.prototype.code = 0),
  1548. (bt.prototype.message = ''),
  1549. (bt.prototype.status = null),
  1550. (bt.errorTypes = ['MEDIA_ERR_CUSTOM', 'MEDIA_ERR_ABORTED', 'MEDIA_ERR_NETWORK', 'MEDIA_ERR_DECODE', 'MEDIA_ERR_SRC_NOT_SUPPORTED', 'MEDIA_ERR_ENCRYPTED']),
  1551. (bt.defaultMessages = {
  1552. 1: 'You aborted the media playback',
  1553. 2: 'A network error caused the media download to fail part-way.',
  1554. 3: 'The media playback was aborted due to a corruption problem or because the media used features your browser did not support.',
  1555. 4: 'The media could not be loaded, either because the server or network failed or because the format is not supported.',
  1556. 5: 'The media is encrypted and we do not have the keys to decrypt it.',
  1557. })
  1558. for (var Tt = 0; Tt < bt.errorTypes.length; Tt++) (bt[bt.errorTypes[Tt]] = Tt), (bt.prototype[bt.errorTypes[Tt]] = Tt)
  1559. var St = function (e, t) {
  1560. var i,
  1561. n = null
  1562. try {
  1563. i = JSON.parse(e, t)
  1564. } catch (e) {
  1565. n = e
  1566. }
  1567. return [n, i]
  1568. }
  1569. function wt(e) {
  1570. return null != e && 'function' == typeof e.then
  1571. }
  1572. function Et(e) {
  1573. wt(e) && e.then(null, function (e) {})
  1574. }
  1575. function kt(n) {
  1576. return ['kind', 'label', 'language', 'id', 'inBandMetadataTrackDispatchType', 'mode', 'src'].reduce(
  1577. function (e, t, i) {
  1578. return n[t] && (e[t] = n[t]), e
  1579. },
  1580. {
  1581. cues:
  1582. n.cues &&
  1583. Array.prototype.map.call(n.cues, function (e) {
  1584. return { startTime: e.startTime, endTime: e.endTime, text: e.text, id: e.id }
  1585. }),
  1586. }
  1587. )
  1588. }
  1589. var Ct = function (e) {
  1590. var t = e.$$('track'),
  1591. i = Array.prototype.map.call(t, function (e) {
  1592. return e.track
  1593. })
  1594. return Array.prototype.map
  1595. .call(t, function (e) {
  1596. var t = kt(e.track)
  1597. return e.src && (t.src = e.src), t
  1598. })
  1599. .concat(
  1600. Array.prototype.filter
  1601. .call(e.textTracks(), function (e) {
  1602. return -1 === i.indexOf(e)
  1603. })
  1604. .map(kt)
  1605. )
  1606. },
  1607. It = function (e, i) {
  1608. return (
  1609. e.forEach(function (e) {
  1610. var t = i.addRemoteTextTrack(e).track
  1611. !e.src &&
  1612. e.cues &&
  1613. e.cues.forEach(function (e) {
  1614. return t.addCue(e)
  1615. })
  1616. }),
  1617. i.textTracks()
  1618. )
  1619. },
  1620. xt = 'vjs-modal-dialog',
  1621. At = (function (n) {
  1622. function e(e, t) {
  1623. var i = n.call(this, e, t) || this
  1624. return (
  1625. (i.handleKeyDown_ = function (e) {
  1626. return i.handleKeyDown(e)
  1627. }),
  1628. (i.close_ = function (e) {
  1629. return i.close(e)
  1630. }),
  1631. (i.opened_ = i.hasBeenOpened_ = i.hasBeenFilled_ = !1),
  1632. i.closeable(!i.options_.uncloseable),
  1633. i.content(i.options_.content),
  1634. (i.contentEl_ = $('div', { className: xt + '-content' }, { role: 'document' })),
  1635. (i.descEl_ = $('p', { className: xt + '-description vjs-control-text', id: i.el().getAttribute('aria-describedby') })),
  1636. J(i.descEl_, i.description()),
  1637. i.el_.appendChild(i.descEl_),
  1638. i.el_.appendChild(i.contentEl_),
  1639. i
  1640. )
  1641. }
  1642. mt(e, n)
  1643. var t = e.prototype
  1644. return (
  1645. (t.createEl = function () {
  1646. return n.prototype.createEl.call(
  1647. this,
  1648. 'div',
  1649. { className: this.buildCSSClass(), tabIndex: -1 },
  1650. { 'aria-describedby': this.id() + '_description', 'aria-hidden': 'true', 'aria-label': this.label(), role: 'dialog' }
  1651. )
  1652. }),
  1653. (t.dispose = function () {
  1654. ;(this.contentEl_ = null), (this.descEl_ = null), (this.previouslyActiveEl_ = null), n.prototype.dispose.call(this)
  1655. }),
  1656. (t.buildCSSClass = function () {
  1657. return xt + ' vjs-hidden ' + n.prototype.buildCSSClass.call(this)
  1658. }),
  1659. (t.label = function () {
  1660. return this.localize(this.options_.label || 'Modal Window')
  1661. }),
  1662. (t.description = function () {
  1663. var e = this.options_.description || this.localize('This is a modal window.')
  1664. return this.closeable() && (e += ' ' + this.localize('This modal can be closed by pressing the Escape key or activating the close button.')), e
  1665. }),
  1666. (t.open = function () {
  1667. var e
  1668. this.opened_ ||
  1669. ((e = this.player()),
  1670. this.trigger('beforemodalopen'),
  1671. (this.opened_ = !0),
  1672. (!this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_)) || this.fill(),
  1673. (this.wasPlaying_ = !e.paused()),
  1674. this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(),
  1675. this.on('keydown', this.handleKeyDown_),
  1676. (this.hadControls_ = e.controls()),
  1677. e.controls(!1),
  1678. this.show(),
  1679. this.conditionalFocus_(),
  1680. this.el().setAttribute('aria-hidden', 'false'),
  1681. this.trigger('modalopen'),
  1682. (this.hasBeenOpened_ = !0))
  1683. }),
  1684. (t.opened = function (e) {
  1685. return 'boolean' == typeof e && this[e ? 'open' : 'close'](), this.opened_
  1686. }),
  1687. (t.close = function () {
  1688. var e
  1689. this.opened_ &&
  1690. ((e = this.player()),
  1691. this.trigger('beforemodalclose'),
  1692. (this.opened_ = !1),
  1693. this.wasPlaying_ && this.options_.pauseOnOpen && e.play(),
  1694. this.off('keydown', this.handleKeyDown_),
  1695. this.hadControls_ && e.controls(!0),
  1696. this.hide(),
  1697. this.el().setAttribute('aria-hidden', 'true'),
  1698. this.trigger('modalclose'),
  1699. this.conditionalBlur_(),
  1700. this.options_.temporary && this.dispose())
  1701. }),
  1702. (t.closeable = function (e) {
  1703. var t, i
  1704. return (
  1705. 'boolean' == typeof e &&
  1706. ((t = this.closeable_ = !!e),
  1707. (i = this.getChild('closeButton')),
  1708. t &&
  1709. !i &&
  1710. ((e = this.contentEl_),
  1711. (this.contentEl_ = this.el_),
  1712. (i = this.addChild('closeButton', { controlText: 'Close Modal Dialog' })),
  1713. (this.contentEl_ = e),
  1714. this.on(i, 'close', this.close_)),
  1715. !t && i && (this.off(i, 'close', this.close_), this.removeChild(i), i.dispose())),
  1716. this.closeable_
  1717. )
  1718. }),
  1719. (t.fill = function () {
  1720. this.fillWith(this.content())
  1721. }),
  1722. (t.fillWith = function (e) {
  1723. var t = this.contentEl(),
  1724. i = t.parentNode,
  1725. n = t.nextSibling
  1726. this.trigger('beforemodalfill'), (this.hasBeenFilled_ = !0), i.removeChild(t), this.empty(), ve(t, e), this.trigger('modalfill'), n ? i.insertBefore(t, n) : i.appendChild(t)
  1727. t = this.getChild('closeButton')
  1728. t && i.appendChild(t.el_)
  1729. }),
  1730. (t.empty = function () {
  1731. this.trigger('beforemodalempty'), me(this.contentEl()), this.trigger('modalempty')
  1732. }),
  1733. (t.content = function (e) {
  1734. return 'undefined' != typeof e && (this.content_ = e), this.content_
  1735. }),
  1736. (t.conditionalFocus_ = function () {
  1737. var e = document.activeElement,
  1738. t = this.player_.el_
  1739. ;(this.previouslyActiveEl_ = null), (!t.contains(e) && t !== e) || ((this.previouslyActiveEl_ = e), this.focus())
  1740. }),
  1741. (t.conditionalBlur_ = function () {
  1742. this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(), (this.previouslyActiveEl_ = null))
  1743. }),
  1744. (t.handleKeyDown = function (e) {
  1745. if ((e.stopPropagation(), ht.isEventKey(e, 'Escape') && this.closeable())) return e.preventDefault(), void this.close()
  1746. if (ht.isEventKey(e, 'Tab')) {
  1747. for (var t, i = this.focusableEls_(), n = this.el_.querySelector(':focus'), r = 0; r < i.length; r++)
  1748. if (n === i[r]) {
  1749. t = r
  1750. break
  1751. }
  1752. document.activeElement === this.el_ && (t = 0),
  1753. e.shiftKey && 0 === t ? (i[i.length - 1].focus(), e.preventDefault()) : e.shiftKey || t !== i.length - 1 || (i[0].focus(), e.preventDefault())
  1754. }
  1755. }),
  1756. (t.focusableEls_ = function () {
  1757. var e = this.el_.querySelectorAll('*')
  1758. return Array.prototype.filter.call(e, function (e) {
  1759. return (
  1760. ((e instanceof window.HTMLAnchorElement || e instanceof window.HTMLAreaElement) && e.hasAttribute('href')) ||
  1761. ((e instanceof window.HTMLInputElement || e instanceof window.HTMLSelectElement || e instanceof window.HTMLTextAreaElement || e instanceof window.HTMLButtonElement) &&
  1762. !e.hasAttribute('disabled')) ||
  1763. e instanceof window.HTMLIFrameElement ||
  1764. e instanceof window.HTMLObjectElement ||
  1765. e instanceof window.HTMLEmbedElement ||
  1766. (e.hasAttribute('tabindex') && -1 !== e.getAttribute('tabindex')) ||
  1767. e.hasAttribute('contenteditable')
  1768. )
  1769. })
  1770. }),
  1771. e
  1772. )
  1773. })(pt)
  1774. ;(At.prototype.options_ = { pauseOnOpen: !0, temporary: !0 }), pt.registerComponent('ModalDialog', At)
  1775. var Pt,
  1776. Lt = (function (n) {
  1777. function e(e) {
  1778. var t
  1779. void 0 === e && (e = []),
  1780. ((t = n.call(this) || this).tracks_ = []),
  1781. Object.defineProperty(ft(t), 'length', {
  1782. get: function () {
  1783. return this.tracks_.length
  1784. },
  1785. })
  1786. for (var i = 0; i < e.length; i++) t.addTrack(e[i])
  1787. return t
  1788. }
  1789. mt(e, n)
  1790. var t = e.prototype
  1791. return (
  1792. (t.addTrack = function (e) {
  1793. var t = this,
  1794. i = this.tracks_.length
  1795. '' + i in this ||
  1796. Object.defineProperty(this, i, {
  1797. get: function () {
  1798. return this.tracks_[i]
  1799. },
  1800. }),
  1801. -1 === this.tracks_.indexOf(e) && (this.tracks_.push(e), this.trigger({ track: e, type: 'addtrack', target: this })),
  1802. (e.labelchange_ = function () {
  1803. t.trigger({ track: e, type: 'labelchange', target: t })
  1804. }),
  1805. it(e) && e.addEventListener('labelchange', e.labelchange_)
  1806. }),
  1807. (t.removeTrack = function (e) {
  1808. for (var t, i = 0, n = this.length; i < n; i++)
  1809. if (this[i] === e) {
  1810. ;(t = this[i]).off && t.off(), this.tracks_.splice(i, 1)
  1811. break
  1812. }
  1813. t && this.trigger({ track: t, type: 'removetrack', target: this })
  1814. }),
  1815. (t.getTrackById = function (e) {
  1816. for (var t = null, i = 0, n = this.length; i < n; i++) {
  1817. var r = this[i]
  1818. if (r.id === e) {
  1819. t = r
  1820. break
  1821. }
  1822. }
  1823. return t
  1824. }),
  1825. e
  1826. )
  1827. })(ze)
  1828. for (Pt in ((Lt.prototype.allowedEvents_ = { change: 'change', addtrack: 'addtrack', removetrack: 'removetrack', labelchange: 'labelchange' }), Lt.prototype.allowedEvents_))
  1829. Lt.prototype['on' + Pt] = null
  1830. function Dt(e, t) {
  1831. for (var i = 0; i < e.length; i++) Object.keys(e[i]).length && t.id !== e[i].id && (e[i].enabled = !1)
  1832. }
  1833. function Ot(e, t) {
  1834. for (var i = 0; i < e.length; i++) Object.keys(e[i]).length && t.id !== e[i].id && (e[i].selected = !1)
  1835. }
  1836. function Mt(e) {
  1837. var t = ['protocol', 'hostname', 'port', 'pathname', 'search', 'hash', 'host'],
  1838. i = document.createElement('a')
  1839. i.href = e
  1840. for (var n = {}, r = 0; r < t.length; r++) n[t[r]] = i[t[r]]
  1841. return (
  1842. 'http:' === n.protocol && (n.host = n.host.replace(/:80$/, '')),
  1843. 'https:' === n.protocol && (n.host = n.host.replace(/:443$/, '')),
  1844. n.protocol || (n.protocol = window.location.protocol),
  1845. n.host || (n.host = window.location.host),
  1846. n
  1847. )
  1848. }
  1849. function Rt(e) {
  1850. var t
  1851. return e.match(/^https?:\/\//) || (((t = document.createElement('a')).href = e), (e = t.href)), e
  1852. }
  1853. function Nt(e) {
  1854. if ('string' == typeof e) {
  1855. e = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e)
  1856. if (e) return e.pop().toLowerCase()
  1857. }
  1858. return ''
  1859. }
  1860. function Ut(e, t) {
  1861. return void 0 === t && (t = window.location), (':' === (e = Mt(e)).protocol ? t : e).protocol + e.host !== t.protocol + t.host
  1862. }
  1863. var Bt = (function (n) {
  1864. function e(e) {
  1865. for (var t, i = (e = void 0 === e ? [] : e).length - 1; 0 <= i; i--)
  1866. if (e[i].enabled) {
  1867. Dt(e, e[i])
  1868. break
  1869. }
  1870. return ((t = n.call(this, e) || this).changing_ = !1), t
  1871. }
  1872. mt(e, n)
  1873. var t = e.prototype
  1874. return (
  1875. (t.addTrack = function (e) {
  1876. var t = this
  1877. e.enabled && Dt(this, e),
  1878. n.prototype.addTrack.call(this, e),
  1879. e.addEventListener &&
  1880. ((e.enabledChange_ = function () {
  1881. t.changing_ || ((t.changing_ = !0), Dt(t, e), (t.changing_ = !1), t.trigger('change'))
  1882. }),
  1883. e.addEventListener('enabledchange', e.enabledChange_))
  1884. }),
  1885. (t.removeTrack = function (e) {
  1886. n.prototype.removeTrack.call(this, e), e.removeEventListener && e.enabledChange_ && (e.removeEventListener('enabledchange', e.enabledChange_), (e.enabledChange_ = null))
  1887. }),
  1888. e
  1889. )
  1890. })(Lt),
  1891. Ft = (function (n) {
  1892. function e(e) {
  1893. for (var t, i = (e = void 0 === e ? [] : e).length - 1; 0 <= i; i--)
  1894. if (e[i].selected) {
  1895. Ot(e, e[i])
  1896. break
  1897. }
  1898. return (
  1899. ((t = n.call(this, e) || this).changing_ = !1),
  1900. Object.defineProperty(ft(t), 'selectedIndex', {
  1901. get: function () {
  1902. for (var e = 0; e < this.length; e++) if (this[e].selected) return e
  1903. return -1
  1904. },
  1905. set: function () {},
  1906. }),
  1907. t
  1908. )
  1909. }
  1910. mt(e, n)
  1911. var t = e.prototype
  1912. return (
  1913. (t.addTrack = function (e) {
  1914. var t = this
  1915. e.selected && Ot(this, e),
  1916. n.prototype.addTrack.call(this, e),
  1917. e.addEventListener &&
  1918. ((e.selectedChange_ = function () {
  1919. t.changing_ || ((t.changing_ = !0), Ot(t, e), (t.changing_ = !1), t.trigger('change'))
  1920. }),
  1921. e.addEventListener('selectedchange', e.selectedChange_))
  1922. }),
  1923. (t.removeTrack = function (e) {
  1924. n.prototype.removeTrack.call(this, e), e.removeEventListener && e.selectedChange_ && (e.removeEventListener('selectedchange', e.selectedChange_), (e.selectedChange_ = null))
  1925. }),
  1926. e
  1927. )
  1928. })(Lt),
  1929. k = (function (i) {
  1930. function e() {
  1931. return i.apply(this, arguments) || this
  1932. }
  1933. mt(e, i)
  1934. var t = e.prototype
  1935. return (
  1936. (t.addTrack = function (e) {
  1937. var t = this
  1938. i.prototype.addTrack.call(this, e),
  1939. this.queueChange_ ||
  1940. (this.queueChange_ = function () {
  1941. return t.queueTrigger('change')
  1942. }),
  1943. this.triggerSelectedlanguagechange ||
  1944. (this.triggerSelectedlanguagechange_ = function () {
  1945. return t.trigger('selectedlanguagechange')
  1946. }),
  1947. e.addEventListener('modechange', this.queueChange_)
  1948. ;-1 === ['metadata', 'chapters'].indexOf(e.kind) && e.addEventListener('modechange', this.triggerSelectedlanguagechange_)
  1949. }),
  1950. (t.removeTrack = function (e) {
  1951. i.prototype.removeTrack.call(this, e),
  1952. e.removeEventListener &&
  1953. (this.queueChange_ && e.removeEventListener('modechange', this.queueChange_),
  1954. this.selectedlanguagechange_ && e.removeEventListener('modechange', this.triggerSelectedlanguagechange_))
  1955. }),
  1956. e
  1957. )
  1958. })(Lt),
  1959. jt = (function () {
  1960. function e(e) {
  1961. void 0 === e && (e = []),
  1962. (this.trackElements_ = []),
  1963. Object.defineProperty(this, 'length', {
  1964. get: function () {
  1965. return this.trackElements_.length
  1966. },
  1967. })
  1968. for (var t = 0, i = e.length; t < i; t++) this.addTrackElement_(e[t])
  1969. }
  1970. var t = e.prototype
  1971. return (
  1972. (t.addTrackElement_ = function (e) {
  1973. var t = this.trackElements_.length
  1974. '' + t in this ||
  1975. Object.defineProperty(this, t, {
  1976. get: function () {
  1977. return this.trackElements_[t]
  1978. },
  1979. }),
  1980. -1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e)
  1981. }),
  1982. (t.getTrackElementByTrack_ = function (e) {
  1983. for (var t, i = 0, n = this.trackElements_.length; i < n; i++)
  1984. if (e === this.trackElements_[i].track) {
  1985. t = this.trackElements_[i]
  1986. break
  1987. }
  1988. return t
  1989. }),
  1990. (t.removeTrackElement_ = function (e) {
  1991. for (var t = 0, i = this.trackElements_.length; t < i; t++)
  1992. if (e === this.trackElements_[t]) {
  1993. this.trackElements_[t].track && 'function' == typeof this.trackElements_[t].track.off && this.trackElements_[t].track.off(),
  1994. 'function' == typeof this.trackElements_[t].off && this.trackElements_[t].off(),
  1995. this.trackElements_.splice(t, 1)
  1996. break
  1997. }
  1998. }),
  1999. e
  2000. )
  2001. })(),
  2002. Ht = (function () {
  2003. function t(e) {
  2004. t.prototype.setCues_.call(this, e),
  2005. Object.defineProperty(this, 'length', {
  2006. get: function () {
  2007. return this.length_
  2008. },
  2009. })
  2010. }
  2011. var e = t.prototype
  2012. return (
  2013. (e.setCues_ = function (e) {
  2014. var t = this.length || 0,
  2015. i = 0,
  2016. n = e.length
  2017. ;(this.cues_ = e), (this.length_ = e.length)
  2018. function r(e) {
  2019. '' + e in this ||
  2020. Object.defineProperty(this, '' + e, {
  2021. get: function () {
  2022. return this.cues_[e]
  2023. },
  2024. })
  2025. }
  2026. if (t < n) for (i = t; i < n; i++) r.call(this, i)
  2027. }),
  2028. (e.getCueById = function (e) {
  2029. for (var t = null, i = 0, n = this.length; i < n; i++) {
  2030. var r = this[i]
  2031. if (r.id === e) {
  2032. t = r
  2033. break
  2034. }
  2035. }
  2036. return t
  2037. }),
  2038. t
  2039. )
  2040. })(),
  2041. qt = { alternative: 'alternative', captions: 'captions', main: 'main', sign: 'sign', subtitles: 'subtitles', commentary: 'commentary' },
  2042. Vt = { alternative: 'alternative', descriptions: 'descriptions', main: 'main', 'main-desc': 'main-desc', translation: 'translation', commentary: 'commentary' },
  2043. Wt = { subtitles: 'subtitles', captions: 'captions', descriptions: 'descriptions', chapters: 'chapters', metadata: 'metadata' },
  2044. Gt = { disabled: 'disabled', hidden: 'hidden', showing: 'showing' },
  2045. C = (function (a) {
  2046. function e(e) {
  2047. void 0 === e && (e = {})
  2048. var t,
  2049. i = a.call(this) || this,
  2050. n = { id: e.id || 'vjs_track_' + Pe++, kind: e.kind || '', language: e.language || '' },
  2051. r = e.label || ''
  2052. for (t in n)
  2053. !(function (e) {
  2054. Object.defineProperty(ft(i), e, {
  2055. get: function () {
  2056. return n[e]
  2057. },
  2058. set: function () {},
  2059. })
  2060. })(t)
  2061. return (
  2062. Object.defineProperty(ft(i), 'label', {
  2063. get: function () {
  2064. return r
  2065. },
  2066. set: function (e) {
  2067. e !== r && ((r = e), this.trigger('labelchange'))
  2068. },
  2069. }),
  2070. i
  2071. )
  2072. }
  2073. return mt(e, a), e
  2074. })(ze),
  2075. zt = Object.freeze({ __proto__: null, parseUrl: Mt, getAbsoluteURL: Rt, getFileExtension: Nt, isCrossOrigin: Ut }),
  2076. Xt = 'undefined' != typeof window ? window : 'undefined' != typeof f ? f : 'undefined' != typeof self ? self : {},
  2077. Kt = Xt,
  2078. Yt = function (e) {
  2079. if (!e) return !1
  2080. var t = Qt.call(e)
  2081. return (
  2082. '[object Function]' === t ||
  2083. ('function' == typeof e && '[object RegExp]' !== t) ||
  2084. ('undefined' != typeof window && (e === window.setTimeout || e === window.alert || e === window.confirm || e === window.prompt))
  2085. )
  2086. },
  2087. Qt = Object.prototype.toString
  2088. ei.httpHandler = function (n, r) {
  2089. return (
  2090. void 0 === r && (r = !1),
  2091. function (e, t, i) {
  2092. if (e) n(e)
  2093. else if (400 <= t.statusCode && t.statusCode <= 599) {
  2094. e = i
  2095. if (r)
  2096. if (Kt.TextDecoder) {
  2097. t = (function (e) {
  2098. void 0 === e && (e = '')
  2099. return e
  2100. .toLowerCase()
  2101. .split(';')
  2102. .reduce(function (e, t) {
  2103. var i = t.split('='),
  2104. t = i[0],
  2105. i = i[1]
  2106. return 'charset' === t.trim() ? i.trim() : e
  2107. }, 'utf-8')
  2108. })(t.headers && t.headers['content-type'])
  2109. try {
  2110. e = new TextDecoder(t).decode(i)
  2111. } catch (e) {}
  2112. } else e = String.fromCharCode.apply(null, new Uint8Array(i))
  2113. n({ cause: e })
  2114. } else n(null, i)
  2115. }
  2116. )
  2117. }
  2118. /**
  2119. * @license
  2120. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  2121. * Copyright (c) 2014 David Björklund
  2122. * Available under the MIT license
  2123. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  2124. */
  2125. var $t = function (e) {
  2126. var n = {}
  2127. return (
  2128. e &&
  2129. e
  2130. .trim()
  2131. .split('\n')
  2132. .forEach(function (e) {
  2133. var t = e.indexOf(':'),
  2134. i = e.slice(0, t).trim().toLowerCase(),
  2135. t = e.slice(t + 1).trim()
  2136. 'undefined' == typeof n[i] ? (n[i] = t) : Array.isArray(n[i]) ? n[i].push(t) : (n[i] = [n[i], t])
  2137. }),
  2138. n
  2139. )
  2140. },
  2141. Jt = ei,
  2142. I = ei
  2143. function Zt(e, t, i) {
  2144. var n = e
  2145. return Yt(t) ? ((i = t), 'string' == typeof e && (n = { uri: e })) : (n = g({}, t, { uri: e })), (n.callback = i), n
  2146. }
  2147. function ei(e, t, i) {
  2148. return ti((t = Zt(e, t, i)))
  2149. }
  2150. function ti(n) {
  2151. if ('undefined' == typeof n.callback) throw new Error('callback argument missing')
  2152. var r = !1,
  2153. a = function (e, t, i) {
  2154. r || ((r = !0), n.callback(e, t, i))
  2155. }
  2156. function s() {
  2157. var e = void 0,
  2158. e =
  2159. l.response ||
  2160. l.responseText ||
  2161. (function (e) {
  2162. try {
  2163. if ('document' === e.responseType) return e.responseXML
  2164. var t = e.responseXML && 'parsererror' === e.responseXML.documentElement.nodeName
  2165. if ('' === e.responseType && !t) return e.responseXML
  2166. } catch (e) {}
  2167. return null
  2168. })(l)
  2169. if (m)
  2170. try {
  2171. e = JSON.parse(e)
  2172. } catch (e) {}
  2173. return e
  2174. }
  2175. function t(e) {
  2176. return clearTimeout(u), ((e = !(e instanceof Error) ? new Error('' + (e || 'Unknown XMLHttpRequest Error')) : e).statusCode = 0), a(e, g)
  2177. }
  2178. function e() {
  2179. if (!o) {
  2180. clearTimeout(u)
  2181. var e = n.useXDR && void 0 === l.status ? 200 : 1223 === l.status ? 204 : l.status,
  2182. t = g,
  2183. i = null
  2184. return (
  2185. 0 !== e
  2186. ? ((t = { body: s(), statusCode: e, method: d, headers: {}, url: c, rawRequest: l }), l.getAllResponseHeaders && (t.headers = $t(l.getAllResponseHeaders())))
  2187. : (i = new Error('Internal XMLHttpRequest Error')),
  2188. a(i, t, t.body)
  2189. )
  2190. }
  2191. }
  2192. var i,
  2193. o,
  2194. u,
  2195. l = n.xhr || null,
  2196. c = ((l = l || new (n.cors || n.useXDR ? ei.XDomainRequest : ei.XMLHttpRequest)()).url = n.uri || n.url),
  2197. d = (l.method = n.method || 'GET'),
  2198. h = n.body || n.data,
  2199. p = (l.headers = n.headers || {}),
  2200. f = !!n.sync,
  2201. m = !1,
  2202. g = { body: void 0, headers: {}, statusCode: 0, method: d, url: c, rawRequest: l }
  2203. if (
  2204. ('json' in n &&
  2205. !1 !== n.json &&
  2206. ((m = !0),
  2207. p.accept || p.Accept || (p.Accept = 'application/json'),
  2208. 'GET' !== d && 'HEAD' !== d && (p['content-type'] || p['Content-Type'] || (p['Content-Type'] = 'application/json'), (h = JSON.stringify(!0 === n.json ? h : n.json)))),
  2209. (l.onreadystatechange = function () {
  2210. 4 === l.readyState && setTimeout(e, 0)
  2211. }),
  2212. (l.onload = e),
  2213. (l.onerror = t),
  2214. (l.onprogress = function () {}),
  2215. (l.onabort = function () {
  2216. o = !0
  2217. }),
  2218. (l.ontimeout = t),
  2219. l.open(d, c, !f, n.username, n.password),
  2220. f || (l.withCredentials = !!n.withCredentials),
  2221. !f &&
  2222. 0 < n.timeout &&
  2223. (u = setTimeout(function () {
  2224. var e
  2225. o || ((o = !0), l.abort('timeout'), ((e = new Error('XMLHttpRequest timeout')).code = 'ETIMEDOUT'), t(e))
  2226. }, n.timeout)),
  2227. l.setRequestHeader)
  2228. )
  2229. for (i in p) p.hasOwnProperty(i) && l.setRequestHeader(i, p[i])
  2230. else if (
  2231. n.headers &&
  2232. !(function (e) {
  2233. for (var t in e) if (e.hasOwnProperty(t)) return
  2234. return 1
  2235. })(n.headers)
  2236. )
  2237. throw new Error('Headers cannot be set on an XDomainRequest object')
  2238. return 'responseType' in n && (l.responseType = n.responseType), 'beforeSend' in n && 'function' == typeof n.beforeSend && n.beforeSend(l), l.send(h || null), l
  2239. }
  2240. ;(ei.XMLHttpRequest = Kt.XMLHttpRequest || function () {}),
  2241. (ei.XDomainRequest = 'withCredentials' in new ei.XMLHttpRequest() ? ei.XMLHttpRequest : Kt.XDomainRequest),
  2242. (function (e, t) {
  2243. for (var i = 0; i < e.length; i++) t(e[i])
  2244. })(['get', 'put', 'post', 'patch', 'head', 'delete'], function (n) {
  2245. ei['delete' === n ? 'del' : n] = function (e, t, i) {
  2246. return ((t = Zt(e, t, i)).method = n.toUpperCase()), ti(t)
  2247. }
  2248. }),
  2249. (Jt.default = I)
  2250. function ii(e, t) {
  2251. var i = new window.WebVTT.Parser(window, window.vttjs, window.WebVTT.StringDecoder()),
  2252. n = []
  2253. ;(i.oncue = function (e) {
  2254. t.addCue(e)
  2255. }),
  2256. (i.onparsingerror = function (e) {
  2257. n.push(e)
  2258. }),
  2259. (i.onflush = function () {
  2260. t.trigger({ type: 'loadeddata', target: t })
  2261. }),
  2262. i.parse(e),
  2263. 0 < n.length &&
  2264. (window.console && window.console.groupCollapsed && window.console.groupCollapsed('Text Track parsing errors for ' + t.src),
  2265. n.forEach(function (e) {
  2266. return h.error(e)
  2267. }),
  2268. window.console && window.console.groupEnd && window.console.groupEnd()),
  2269. i.flush()
  2270. }
  2271. function ni(e, n) {
  2272. var t = { uri: e }
  2273. ;(e = Ut(e)) && (t.cors = e),
  2274. (e = 'use-credentials' === n.tech_.crossOrigin()) && (t.withCredentials = e),
  2275. Jt(
  2276. t,
  2277. Ve(this, function (e, t, i) {
  2278. return e
  2279. ? h.error(e, t)
  2280. : ((n.loaded_ = !0),
  2281. void ('function' != typeof window.WebVTT
  2282. ? n.tech_ &&
  2283. n.tech_.any(['vttjsloaded', 'vttjserror'], function (e) {
  2284. return 'vttjserror' !== e.type ? ii(i, n) : void h.error('vttjs failed to load, stopping trying to process ' + n.src)
  2285. })
  2286. : ii(i, n)))
  2287. })
  2288. )
  2289. }
  2290. var ri = (function (a) {
  2291. function e(e) {
  2292. var t
  2293. if (!(e = void 0 === e ? {} : e).tech) throw new Error('A tech was not provided.')
  2294. var e = lt(e, { kind: Wt[e.kind] || 'subtitles', language: e.language || e.srclang || '' }),
  2295. i = Gt[e.mode] || 'disabled',
  2296. n = e.default
  2297. ;('metadata' !== e.kind && 'chapters' !== e.kind) || (i = 'hidden'),
  2298. ((t = a.call(this, e) || this).tech_ = e.tech),
  2299. (t.cues_ = []),
  2300. (t.activeCues_ = []),
  2301. (t.preload_ = !1 !== t.tech_.preloadTextTracks)
  2302. var r = new Ht(t.cues_),
  2303. s = new Ht(t.activeCues_),
  2304. o = !1
  2305. t.timeupdateHandler = Ve(ft(t), function () {
  2306. this.tech_.isDisposed() ||
  2307. (this.tech_.isReady_ && ((this.activeCues = this.activeCues), o && (this.trigger('cuechange'), (o = !1))),
  2308. (this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler)))
  2309. })
  2310. return (
  2311. t.tech_.one('dispose', function () {
  2312. t.stopTracking()
  2313. }),
  2314. 'disabled' !== i && t.startTracking(),
  2315. Object.defineProperties(ft(t), {
  2316. default: {
  2317. get: function () {
  2318. return n
  2319. },
  2320. set: function () {},
  2321. },
  2322. mode: {
  2323. get: function () {
  2324. return i
  2325. },
  2326. set: function (e) {
  2327. Gt[e] &&
  2328. i !== e &&
  2329. ((i = e),
  2330. this.preload_ || 'disabled' === i || 0 !== this.cues.length || ni(this.src, this),
  2331. this.stopTracking(),
  2332. 'disabled' !== i && this.startTracking(),
  2333. this.trigger('modechange'))
  2334. },
  2335. },
  2336. cues: {
  2337. get: function () {
  2338. return this.loaded_ ? r : null
  2339. },
  2340. set: function () {},
  2341. },
  2342. activeCues: {
  2343. get: function () {
  2344. if (!this.loaded_) return null
  2345. if (0 === this.cues.length) return s
  2346. for (var e = this.tech_.currentTime(), t = [], i = 0, n = this.cues.length; i < n; i++) {
  2347. var r = this.cues[i]
  2348. ;((r.startTime <= e && r.endTime >= e) || (r.startTime === r.endTime && r.startTime <= e && r.startTime + 0.5 >= e)) && t.push(r)
  2349. }
  2350. if (((o = !1), t.length !== this.activeCues_.length)) o = !0
  2351. else for (var a = 0; a < t.length; a++) -1 === this.activeCues_.indexOf(t[a]) && (o = !0)
  2352. return (this.activeCues_ = t), s.setCues_(this.activeCues_), s
  2353. },
  2354. set: function () {},
  2355. },
  2356. }),
  2357. e.src ? ((t.src = e.src), t.preload_ || (t.loaded_ = !0), (t.preload_ || ('subtitles' !== e.kind && 'captions' !== e.kind)) && ni(t.src, ft(t))) : (t.loaded_ = !0),
  2358. t
  2359. )
  2360. }
  2361. mt(e, a)
  2362. var t = e.prototype
  2363. return (
  2364. (t.startTracking = function () {
  2365. this.rvf_ = this.tech_.requestVideoFrameCallback(this.timeupdateHandler)
  2366. }),
  2367. (t.stopTracking = function () {
  2368. this.rvf_ && (this.tech_.cancelVideoFrameCallback(this.rvf_), (this.rvf_ = void 0))
  2369. }),
  2370. (t.addCue = function (e) {
  2371. var t = e
  2372. if (window.vttjs && !(e instanceof window.vttjs.VTTCue)) {
  2373. for (var i in ((t = new window.vttjs.VTTCue(e.startTime, e.endTime, e.text)), e)) i in t || (t[i] = e[i])
  2374. ;(t.id = e.id), (t.originalCue_ = e)
  2375. }
  2376. for (var n = this.tech_.textTracks(), r = 0; r < n.length; r++) n[r] !== this && n[r].removeCue(t)
  2377. this.cues_.push(t), this.cues.setCues_(this.cues_)
  2378. }),
  2379. (t.removeCue = function (e) {
  2380. for (var t = this.cues_.length; t--; ) {
  2381. var i = this.cues_[t]
  2382. if (i === e || (i.originalCue_ && i.originalCue_ === e)) {
  2383. this.cues_.splice(t, 1), this.cues.setCues_(this.cues_)
  2384. break
  2385. }
  2386. }
  2387. }),
  2388. e
  2389. )
  2390. })(C)
  2391. ri.prototype.allowedEvents_ = { cuechange: 'cuechange' }
  2392. ;(x = (function (n) {
  2393. function e(e) {
  2394. var t = lt((e = void 0 === e ? {} : e), { kind: Vt[e.kind] || '' }),
  2395. e = n.call(this, t) || this,
  2396. i = !1
  2397. return (
  2398. Object.defineProperty(ft(e), 'enabled', {
  2399. get: function () {
  2400. return i
  2401. },
  2402. set: function (e) {
  2403. 'boolean' == typeof e && e !== i && ((i = e), this.trigger('enabledchange'))
  2404. },
  2405. }),
  2406. t.enabled && (e.enabled = t.enabled),
  2407. (e.loaded_ = !0),
  2408. e
  2409. )
  2410. }
  2411. return mt(e, n), e
  2412. })(C)),
  2413. (U = (function (n) {
  2414. function e(e) {
  2415. var t = lt((e = void 0 === e ? {} : e), { kind: qt[e.kind] || '' }),
  2416. e = n.call(this, t) || this,
  2417. i = !1
  2418. return (
  2419. Object.defineProperty(ft(e), 'selected', {
  2420. get: function () {
  2421. return i
  2422. },
  2423. set: function (e) {
  2424. 'boolean' == typeof e && e !== i && ((i = e), this.trigger('selectedchange'))
  2425. },
  2426. }),
  2427. t.selected && (e.selected = t.selected),
  2428. e
  2429. )
  2430. }
  2431. return mt(e, n), e
  2432. })(C)),
  2433. (j = (function (r) {
  2434. function e(e) {
  2435. var t
  2436. void 0 === e && (e = {})
  2437. var i = r.call(this) || this,
  2438. n = new ri(e)
  2439. return (
  2440. (i.kind = n.kind),
  2441. (i.src = n.src),
  2442. (i.srclang = n.language),
  2443. (i.label = n.label),
  2444. (i.default = n.default),
  2445. Object.defineProperties(ft(i), {
  2446. readyState: {
  2447. get: function () {
  2448. return t
  2449. },
  2450. },
  2451. track: {
  2452. get: function () {
  2453. return n
  2454. },
  2455. },
  2456. }),
  2457. (t = 0),
  2458. n.addEventListener('loadeddata', function () {
  2459. ;(t = 2), i.trigger({ type: 'load', target: ft(i) })
  2460. }),
  2461. i
  2462. )
  2463. }
  2464. return mt(e, r), e
  2465. })(ze))
  2466. ;(j.prototype.allowedEvents_ = { load: 'load' }), (j.NONE = 0), (j.LOADING = 1), (j.LOADED = 2), (j.ERROR = 3)
  2467. var ai = {
  2468. audio: { ListClass: Bt, TrackClass: x, capitalName: 'Audio' },
  2469. video: { ListClass: Ft, TrackClass: U, capitalName: 'Video' },
  2470. text: { ListClass: k, TrackClass: ri, capitalName: 'Text' },
  2471. }
  2472. Object.keys(ai).forEach(function (e) {
  2473. ;(ai[e].getterName = e + 'Tracks'), (ai[e].privateName = e + 'Tracks_')
  2474. })
  2475. var si = {
  2476. remoteText: { ListClass: k, TrackClass: ri, capitalName: 'RemoteText', getterName: 'remoteTextTracks', privateName: 'remoteTextTracks_' },
  2477. remoteTextEl: { ListClass: jt, TrackClass: j, capitalName: 'RemoteTextTrackEls', getterName: 'remoteTextTrackEls', privateName: 'remoteTextTrackEls_' },
  2478. },
  2479. oi = g({}, ai, si)
  2480. ;(si.names = Object.keys(si)), (ai.names = Object.keys(ai)), (oi.names = [].concat(si.names).concat(ai.names))
  2481. var ui = 'undefined' != typeof f ? f : 'undefined' != typeof window ? window : {},
  2482. li = 'undefined' != typeof document ? document : (li = ui['__GLOBAL_DOCUMENT_CACHE@4']) || (ui['__GLOBAL_DOCUMENT_CACHE@4'] = {}),
  2483. Xt = li,
  2484. ci =
  2485. Object.create ||
  2486. function (e) {
  2487. if (1 !== arguments.length) throw new Error('Object.create shim only accepts one parameter.')
  2488. return (di.prototype = e), new di()
  2489. }
  2490. function di() {}
  2491. function hi(e, t) {
  2492. ;(this.name = 'ParsingError'), (this.code = e.code), (this.message = t || e.message)
  2493. }
  2494. function pi(e) {
  2495. function t(e, t, i, n) {
  2496. return 3600 * (0 | e) + 60 * (0 | t) + (0 | i) + (0 | n) / 1e3
  2497. }
  2498. e = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/)
  2499. return e ? (e[3] ? t(e[1], e[2], e[3].replace(':', ''), e[4]) : 59 < e[1] ? t(e[1], e[2], 0, e[4]) : t(0, e[1], e[2], e[4])) : null
  2500. }
  2501. function fi() {
  2502. this.values = ci(null)
  2503. }
  2504. function mi(e, t, i, n) {
  2505. var r,
  2506. a,
  2507. s = n ? e.split(n) : [e]
  2508. for (r in s) 'string' == typeof s[r] && 2 === (a = s[r].split(i)).length && t(a[0], a[1])
  2509. }
  2510. function gi(t, e, s) {
  2511. var i = t
  2512. function n() {
  2513. var e = pi(t)
  2514. if (null === e) throw new hi(hi.Errors.BadTimeStamp, 'Malformed timestamp: ' + i)
  2515. return (t = t.replace(/^[^\sa-zA-Z-]+/, '')), e
  2516. }
  2517. function r() {
  2518. t = t.replace(/^\s+/, '')
  2519. }
  2520. if ((r(), (e.startTime = n()), r(), '--\x3e' !== t.substr(0, 3))) throw new hi(hi.Errors.BadTimeStamp, "Malformed time stamp (time stamps must be separated by '--\x3e'): " + i)
  2521. ;(t = t.substr(3)),
  2522. r(),
  2523. (e.endTime = n()),
  2524. r(),
  2525. (function (e, t) {
  2526. var a = new fi()
  2527. mi(
  2528. e,
  2529. function (e, t) {
  2530. switch (e) {
  2531. case 'region':
  2532. for (var i = s.length - 1; 0 <= i; i--)
  2533. if (s[i].id === t) {
  2534. a.set(e, s[i].region)
  2535. break
  2536. }
  2537. break
  2538. case 'vertical':
  2539. a.alt(e, t, ['rl', 'lr'])
  2540. break
  2541. case 'line':
  2542. var n = t.split(','),
  2543. r = n[0]
  2544. a.integer(e, r), a.percent(e, r) && a.set('snapToLines', !1), a.alt(e, r, ['auto']), 2 === n.length && a.alt('lineAlign', n[1], ['start', 'center', 'end'])
  2545. break
  2546. case 'position':
  2547. ;(n = t.split(',')), a.percent(e, n[0]), 2 === n.length && a.alt('positionAlign', n[1], ['start', 'center', 'end'])
  2548. break
  2549. case 'size':
  2550. a.percent(e, t)
  2551. break
  2552. case 'align':
  2553. a.alt(e, t, ['start', 'center', 'end', 'left', 'right'])
  2554. }
  2555. },
  2556. /:/,
  2557. /\s/
  2558. ),
  2559. (t.region = a.get('region', null)),
  2560. (t.vertical = a.get('vertical', ''))
  2561. try {
  2562. t.line = a.get('line', 'auto')
  2563. } catch (e) {}
  2564. ;(t.lineAlign = a.get('lineAlign', 'start')), (t.snapToLines = a.get('snapToLines', !0)), (t.size = a.get('size', 100))
  2565. try {
  2566. t.align = a.get('align', 'center')
  2567. } catch (e) {
  2568. t.align = a.get('align', 'middle')
  2569. }
  2570. try {
  2571. t.position = a.get('position', 'auto')
  2572. } catch (e) {
  2573. t.position = a.get('position', { start: 0, left: 0, center: 50, middle: 50, end: 100, right: 100 }, t.align)
  2574. }
  2575. t.positionAlign = a.get('positionAlign', { start: 'start', left: 'start', center: 'center', middle: 'center', end: 'end', right: 'end' }, t.align)
  2576. })(t, e)
  2577. }
  2578. ;(((hi.prototype = ci(Error.prototype)).constructor = hi).Errors = {
  2579. BadSignature: { code: 0, message: 'Malformed WebVTT signature.' },
  2580. BadTimeStamp: { code: 1, message: 'Malformed time stamp.' },
  2581. }),
  2582. (fi.prototype = {
  2583. set: function (e, t) {
  2584. this.get(e) || '' === t || (this.values[e] = t)
  2585. },
  2586. get: function (e, t, i) {
  2587. return i ? (this.has(e) ? this.values[e] : t[i]) : this.has(e) ? this.values[e] : t
  2588. },
  2589. has: function (e) {
  2590. return e in this.values
  2591. },
  2592. alt: function (e, t, i) {
  2593. for (var n = 0; n < i.length; ++n)
  2594. if (t === i[n]) {
  2595. this.set(e, t)
  2596. break
  2597. }
  2598. },
  2599. integer: function (e, t) {
  2600. ;/^-?\d+$/.test(t) && this.set(e, parseInt(t, 10))
  2601. },
  2602. percent: function (e, t) {
  2603. return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && (this.set(e, t), !0)
  2604. },
  2605. })
  2606. var yi = Xt.createElement && Xt.createElement('textarea'),
  2607. vi = { c: 'span', i: 'i', b: 'b', u: 'u', ruby: 'ruby', rt: 'rt', v: 'span', lang: 'span' },
  2608. _i = {
  2609. white: 'rgba(255,255,255,1)',
  2610. lime: 'rgba(0,255,0,1)',
  2611. cyan: 'rgba(0,255,255,1)',
  2612. red: 'rgba(255,0,0,1)',
  2613. yellow: 'rgba(255,255,0,1)',
  2614. magenta: 'rgba(255,0,255,1)',
  2615. blue: 'rgba(0,0,255,1)',
  2616. black: 'rgba(0,0,0,1)',
  2617. },
  2618. bi = { v: 'title', lang: 'lang' },
  2619. Ti = { rt: 'ruby' }
  2620. function Si(e, t) {
  2621. for (
  2622. var i, n, r, a, s, o, u, l, c, d, h = e.document.createElement('div'), p = h, f = [];
  2623. null !==
  2624. (i = (function () {
  2625. if (!t) return null
  2626. var e = t.match(/^([^<]*)(<[^>]*>?)?/)
  2627. return (e = e[1] || e[2]), (t = t.substr(e.length)), e
  2628. })());
  2629. )
  2630. '<' !== i[0]
  2631. ? p.appendChild(e.document.createTextNode(((s = i), (yi.innerHTML = s), (s = yi.textContent), (yi.textContent = ''), s)))
  2632. : '/' !== i[1]
  2633. ? (a = pi(i.substr(1, i.length - 2)))
  2634. ? ((n = e.document.createProcessingInstruction('timestamp', a)), p.appendChild(n))
  2635. : (r = i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/)) &&
  2636. ((l = r[1]),
  2637. (c = r[3]),
  2638. (d = void 0),
  2639. (d = vi[l]),
  2640. (n = d ? ((d = e.document.createElement(d)), (l = bi[l]) && c && (d[l] = c.trim()), d) : null) &&
  2641. ((o = p),
  2642. (Ti[(u = n).localName] && Ti[u.localName] !== o.localName) ||
  2643. (r[2] &&
  2644. ((a = r[2].split('.')).forEach(function (e) {
  2645. var t = /^bg_/.test(e),
  2646. e = t ? e.slice(3) : e
  2647. _i.hasOwnProperty(e) && ((e = _i[e]), (n.style[t ? 'background-color' : 'color'] = e))
  2648. }),
  2649. (n.className = a.join(' '))),
  2650. f.push(r[1]),
  2651. p.appendChild(n),
  2652. (p = n))))
  2653. : f.length && f[f.length - 1] === i.substr(2).replace('>', '') && (f.pop(), (p = p.parentNode))
  2654. return h
  2655. }
  2656. var wi = [
  2657. [1470, 1470],
  2658. [1472, 1472],
  2659. [1475, 1475],
  2660. [1478, 1478],
  2661. [1488, 1514],
  2662. [1520, 1524],
  2663. [1544, 1544],
  2664. [1547, 1547],
  2665. [1549, 1549],
  2666. [1563, 1563],
  2667. [1566, 1610],
  2668. [1645, 1647],
  2669. [1649, 1749],
  2670. [1765, 1766],
  2671. [1774, 1775],
  2672. [1786, 1805],
  2673. [1807, 1808],
  2674. [1810, 1839],
  2675. [1869, 1957],
  2676. [1969, 1969],
  2677. [1984, 2026],
  2678. [2036, 2037],
  2679. [2042, 2042],
  2680. [2048, 2069],
  2681. [2074, 2074],
  2682. [2084, 2084],
  2683. [2088, 2088],
  2684. [2096, 2110],
  2685. [2112, 2136],
  2686. [2142, 2142],
  2687. [2208, 2208],
  2688. [2210, 2220],
  2689. [8207, 8207],
  2690. [64285, 64285],
  2691. [64287, 64296],
  2692. [64298, 64310],
  2693. [64312, 64316],
  2694. [64318, 64318],
  2695. [64320, 64321],
  2696. [64323, 64324],
  2697. [64326, 64449],
  2698. [64467, 64829],
  2699. [64848, 64911],
  2700. [64914, 64967],
  2701. [65008, 65020],
  2702. [65136, 65140],
  2703. [65142, 65276],
  2704. [67584, 67589],
  2705. [67592, 67592],
  2706. [67594, 67637],
  2707. [67639, 67640],
  2708. [67644, 67644],
  2709. [67647, 67669],
  2710. [67671, 67679],
  2711. [67840, 67867],
  2712. [67872, 67897],
  2713. [67903, 67903],
  2714. [67968, 68023],
  2715. [68030, 68031],
  2716. [68096, 68096],
  2717. [68112, 68115],
  2718. [68117, 68119],
  2719. [68121, 68147],
  2720. [68160, 68167],
  2721. [68176, 68184],
  2722. [68192, 68223],
  2723. [68352, 68405],
  2724. [68416, 68437],
  2725. [68440, 68466],
  2726. [68472, 68479],
  2727. [68608, 68680],
  2728. [126464, 126467],
  2729. [126469, 126495],
  2730. [126497, 126498],
  2731. [126500, 126500],
  2732. [126503, 126503],
  2733. [126505, 126514],
  2734. [126516, 126519],
  2735. [126521, 126521],
  2736. [126523, 126523],
  2737. [126530, 126530],
  2738. [126535, 126535],
  2739. [126537, 126537],
  2740. [126539, 126539],
  2741. [126541, 126543],
  2742. [126545, 126546],
  2743. [126548, 126548],
  2744. [126551, 126551],
  2745. [126553, 126553],
  2746. [126555, 126555],
  2747. [126557, 126557],
  2748. [126559, 126559],
  2749. [126561, 126562],
  2750. [126564, 126564],
  2751. [126567, 126570],
  2752. [126572, 126578],
  2753. [126580, 126583],
  2754. [126585, 126588],
  2755. [126590, 126590],
  2756. [126592, 126601],
  2757. [126603, 126619],
  2758. [126625, 126627],
  2759. [126629, 126633],
  2760. [126635, 126651],
  2761. [1114109, 1114109],
  2762. ]
  2763. function Ei(e) {
  2764. var t = [],
  2765. i = ''
  2766. if (!e || !e.childNodes) return 'ltr'
  2767. function a(e, t) {
  2768. for (var i = t.childNodes.length - 1; 0 <= i; i--) e.push(t.childNodes[i])
  2769. }
  2770. for (
  2771. a(t, e);
  2772. (i = (function e(t) {
  2773. if (!t || !t.length) return null
  2774. var i = t.pop(),
  2775. n = i.textContent || i.innerText
  2776. if (n) {
  2777. var r = n.match(/^.*(\n|\r)/)
  2778. return r ? r[(t.length = 0)] : n
  2779. }
  2780. return 'ruby' === i.tagName ? e(t) : i.childNodes ? (a(t, i), e(t)) : void 0
  2781. })(t));
  2782. )
  2783. for (var n = 0; n < i.length; n++)
  2784. if (
  2785. (function (e) {
  2786. for (var t = 0; t < wi.length; t++) {
  2787. var i = wi[t]
  2788. if (e >= i[0] && e <= i[1]) return 1
  2789. }
  2790. })(i.charCodeAt(n))
  2791. )
  2792. return 'rtl'
  2793. return 'ltr'
  2794. }
  2795. function ki() {}
  2796. function Ci(e, t, i) {
  2797. ki.call(this), (this.cue = t), (this.cueDiv = Si(e, t.text))
  2798. var n = {
  2799. color: 'rgba(255, 255, 255, 1)',
  2800. backgroundColor: 'rgba(0, 0, 0, 0.8)',
  2801. position: 'relative',
  2802. left: 0,
  2803. right: 0,
  2804. top: 0,
  2805. bottom: 0,
  2806. display: 'inline',
  2807. writingMode: '' === t.vertical ? 'horizontal-tb' : 'lr' === t.vertical ? 'vertical-lr' : 'vertical-rl',
  2808. unicodeBidi: 'plaintext',
  2809. }
  2810. this.applyStyles(n, this.cueDiv),
  2811. (this.div = e.document.createElement('div')),
  2812. (n = {
  2813. direction: Ei(this.cueDiv),
  2814. writingMode: '' === t.vertical ? 'horizontal-tb' : 'lr' === t.vertical ? 'vertical-lr' : 'vertical-rl',
  2815. unicodeBidi: 'plaintext',
  2816. textAlign: 'middle' === t.align ? 'center' : t.align,
  2817. font: i.font,
  2818. whiteSpace: 'pre-line',
  2819. position: 'absolute',
  2820. }),
  2821. this.applyStyles(n),
  2822. this.div.appendChild(this.cueDiv)
  2823. var r = 0
  2824. switch (t.positionAlign) {
  2825. case 'start':
  2826. r = t.position
  2827. break
  2828. case 'center':
  2829. r = t.position - t.size / 2
  2830. break
  2831. case 'end':
  2832. r = t.position - t.size
  2833. }
  2834. '' === t.vertical
  2835. ? this.applyStyles({ left: this.formatStyle(r, '%'), width: this.formatStyle(t.size, '%') })
  2836. : this.applyStyles({ top: this.formatStyle(r, '%'), height: this.formatStyle(t.size, '%') }),
  2837. (this.move = function (e) {
  2838. this.applyStyles({
  2839. top: this.formatStyle(e.top, 'px'),
  2840. bottom: this.formatStyle(e.bottom, 'px'),
  2841. left: this.formatStyle(e.left, 'px'),
  2842. right: this.formatStyle(e.right, 'px'),
  2843. height: this.formatStyle(e.height, 'px'),
  2844. width: this.formatStyle(e.width, 'px'),
  2845. })
  2846. })
  2847. }
  2848. function Ii(e) {
  2849. var t, i, n, r
  2850. e.div &&
  2851. ((t = e.div.offsetHeight),
  2852. (i = e.div.offsetWidth),
  2853. (n = e.div.offsetTop),
  2854. (r = (r = e.div.childNodes) && (r = r[0]) && r.getClientRects && r.getClientRects()),
  2855. (e = e.div.getBoundingClientRect()),
  2856. (r = r ? Math.max((r[0] && r[0].height) || 0, e.height / r.length) : 0)),
  2857. (this.left = e.left),
  2858. (this.right = e.right),
  2859. (this.top = e.top || n),
  2860. (this.height = e.height || t),
  2861. (this.bottom = e.bottom || n + (e.height || t)),
  2862. (this.width = e.width || i),
  2863. (this.lineHeight = void 0 !== r ? r : e.lineHeight)
  2864. }
  2865. function xi(e, t, o, u) {
  2866. var i,
  2867. n = new Ii(t),
  2868. r = t.cue,
  2869. a = (function (e) {
  2870. if ('number' == typeof e.line && (e.snapToLines || (0 <= e.line && e.line <= 100))) return e.line
  2871. if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement) return -1
  2872. for (var t = e.track, i = t.textTrackList, n = 0, r = 0; r < i.length && i[r] !== t; r++) 'showing' === i[r].mode && n++
  2873. return -1 * ++n
  2874. })(r),
  2875. s = []
  2876. if (r.snapToLines) {
  2877. switch (r.vertical) {
  2878. case '':
  2879. ;(s = ['+y', '-y']), (i = 'height')
  2880. break
  2881. case 'rl':
  2882. ;(s = ['+x', '-x']), (i = 'width')
  2883. break
  2884. case 'lr':
  2885. ;(s = ['-x', '+x']), (i = 'width')
  2886. }
  2887. var l = n.lineHeight,
  2888. c = l * Math.round(a),
  2889. d = o[i] + l,
  2890. h = s[0]
  2891. Math.abs(c) > d && ((c = c < 0 ? -1 : 1), (c *= Math.ceil(d / l) * l)), a < 0 && ((c += '' === r.vertical ? o.height : o.width), (s = s.reverse())), n.move(h, c)
  2892. } else {
  2893. var p = (n.lineHeight / o.height) * 100
  2894. switch (r.lineAlign) {
  2895. case 'center':
  2896. a -= p / 2
  2897. break
  2898. case 'end':
  2899. a -= p
  2900. }
  2901. switch (r.vertical) {
  2902. case '':
  2903. t.applyStyles({ top: t.formatStyle(a, '%') })
  2904. break
  2905. case 'rl':
  2906. t.applyStyles({ left: t.formatStyle(a, '%') })
  2907. break
  2908. case 'lr':
  2909. t.applyStyles({ right: t.formatStyle(a, '%') })
  2910. }
  2911. ;(s = ['+y', '-x', '+x', '-y']), (n = new Ii(t))
  2912. }
  2913. n = (function (e, t) {
  2914. for (var i, n = new Ii(e), r = 1, a = 0; a < t.length; a++) {
  2915. for (; e.overlapsOppositeAxis(o, t[a]) || (e.within(o) && e.overlapsAny(u)); ) e.move(t[a])
  2916. if (e.within(o)) return e
  2917. var s = e.intersectPercentage(o)
  2918. s < r && ((i = new Ii(e)), (r = s)), (e = new Ii(n))
  2919. }
  2920. return i || n
  2921. })(n, s)
  2922. t.move(n.toCSSCompatValues(o))
  2923. }
  2924. function Ai() {}
  2925. ;(ki.prototype.applyStyles = function (e, t) {
  2926. for (var i in ((t = t || this.div), e)) e.hasOwnProperty(i) && (t.style[i] = e[i])
  2927. }),
  2928. (ki.prototype.formatStyle = function (e, t) {
  2929. return 0 === e ? 0 : e + t
  2930. }),
  2931. ((Ci.prototype = ci(ki.prototype)).constructor = Ci),
  2932. (Ii.prototype.move = function (e, t) {
  2933. switch (((t = void 0 !== t ? t : this.lineHeight), e)) {
  2934. case '+x':
  2935. ;(this.left += t), (this.right += t)
  2936. break
  2937. case '-x':
  2938. ;(this.left -= t), (this.right -= t)
  2939. break
  2940. case '+y':
  2941. ;(this.top += t), (this.bottom += t)
  2942. break
  2943. case '-y':
  2944. ;(this.top -= t), (this.bottom -= t)
  2945. }
  2946. }),
  2947. (Ii.prototype.overlaps = function (e) {
  2948. return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top
  2949. }),
  2950. (Ii.prototype.overlapsAny = function (e) {
  2951. for (var t = 0; t < e.length; t++) if (this.overlaps(e[t])) return !0
  2952. return !1
  2953. }),
  2954. (Ii.prototype.within = function (e) {
  2955. return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right
  2956. }),
  2957. (Ii.prototype.overlapsOppositeAxis = function (e, t) {
  2958. switch (t) {
  2959. case '+x':
  2960. return this.left < e.left
  2961. case '-x':
  2962. return this.right > e.right
  2963. case '+y':
  2964. return this.top < e.top
  2965. case '-y':
  2966. return this.bottom > e.bottom
  2967. }
  2968. }),
  2969. (Ii.prototype.intersectPercentage = function (e) {
  2970. return (Math.max(0, Math.min(this.right, e.right) - Math.max(this.left, e.left)) * Math.max(0, Math.min(this.bottom, e.bottom) - Math.max(this.top, e.top))) / (this.height * this.width)
  2971. }),
  2972. (Ii.prototype.toCSSCompatValues = function (e) {
  2973. return { top: this.top - e.top, bottom: e.bottom - this.bottom, left: this.left - e.left, right: e.right - this.right, height: this.height, width: this.width }
  2974. }),
  2975. (Ii.getSimpleBoxPosition = function (e) {
  2976. var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0,
  2977. i = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0,
  2978. n = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0
  2979. return {
  2980. left: (e = e.div ? e.div.getBoundingClientRect() : e.tagName ? e.getBoundingClientRect() : e).left,
  2981. right: e.right,
  2982. top: e.top || n,
  2983. height: e.height || t,
  2984. bottom: e.bottom || n + (e.height || t),
  2985. width: e.width || i,
  2986. }
  2987. }),
  2988. (Ai.StringDecoder = function () {
  2989. return {
  2990. decode: function (e) {
  2991. if (!e) return ''
  2992. if ('string' != typeof e) throw new Error('Error - expected string data.')
  2993. return decodeURIComponent(encodeURIComponent(e))
  2994. },
  2995. }
  2996. }),
  2997. (Ai.convertCueToDOMTree = function (e, t) {
  2998. return e && t ? Si(e, t) : null
  2999. })
  3000. ;(Ai.processCues = function (n, r, e) {
  3001. if (!n || !r || !e) return null
  3002. for (; e.firstChild; ) e.removeChild(e.firstChild)
  3003. var a = n.document.createElement('div')
  3004. if (
  3005. ((a.style.position = 'absolute'),
  3006. (a.style.left = '0'),
  3007. (a.style.right = '0'),
  3008. (a.style.top = '0'),
  3009. (a.style.bottom = '0'),
  3010. (a.style.margin = '1.5%'),
  3011. e.appendChild(a),
  3012. (function (e) {
  3013. for (var t = 0; t < e.length; t++) if (e[t].hasBeenReset || !e[t].displayState) return 1
  3014. })(r))
  3015. ) {
  3016. var s = [],
  3017. o = Ii.getSimpleBoxPosition(a),
  3018. u = { font: Math.round(0.05 * o.height * 100) / 100 + 'px sans-serif' }
  3019. !(function () {
  3020. for (var e, t, i = 0; i < r.length; i++) (t = r[i]), (e = new Ci(n, t, u)), a.appendChild(e.div), xi(0, e, o, s), (t.displayState = e.div), s.push(Ii.getSimpleBoxPosition(e))
  3021. })()
  3022. } else for (var t = 0; t < r.length; t++) a.appendChild(r[t].displayState)
  3023. }),
  3024. ((Ai.Parser = function (e, t, i) {
  3025. i || ((i = t), (t = {})),
  3026. (t = t || {}),
  3027. (this.window = e),
  3028. (this.vttjs = t),
  3029. (this.state = 'INITIAL'),
  3030. (this.buffer = ''),
  3031. (this.decoder = i || new TextDecoder('utf8')),
  3032. (this.regionList = [])
  3033. }).prototype = {
  3034. reportOrThrowError: function (e) {
  3035. if (!(e instanceof hi)) throw e
  3036. this.onparsingerror && this.onparsingerror(e)
  3037. },
  3038. parse: function (e) {
  3039. var n = this
  3040. function t() {
  3041. for (var e = n.buffer, t = 0; t < e.length && '\r' !== e[t] && '\n' !== e[t]; ) ++t
  3042. var i = e.substr(0, t)
  3043. return '\r' === e[t] && ++t, '\n' === e[t] && ++t, (n.buffer = e.substr(t)), i
  3044. }
  3045. function i(e) {
  3046. e.match(/X-TIMESTAMP-MAP/)
  3047. ? mi(
  3048. e,
  3049. function (e, t) {
  3050. var i
  3051. 'X-TIMESTAMP-MAP' === e &&
  3052. ((t = t),
  3053. (i = new fi()),
  3054. mi(
  3055. t,
  3056. function (e, t) {
  3057. switch (e) {
  3058. case 'MPEGT':
  3059. i.integer(e + 'S', t)
  3060. break
  3061. case 'LOCA':
  3062. i.set(e + 'L', pi(t))
  3063. }
  3064. },
  3065. /[^\d]:/,
  3066. /,/
  3067. ),
  3068. n.ontimestampmap && n.ontimestampmap({ MPEGTS: i.get('MPEGTS'), LOCAL: i.get('LOCAL') }))
  3069. },
  3070. /=/
  3071. )
  3072. : mi(
  3073. e,
  3074. function (e, t) {
  3075. var r
  3076. 'Region' === e &&
  3077. ((t = t),
  3078. (r = new fi()),
  3079. mi(
  3080. t,
  3081. function (e, t) {
  3082. switch (e) {
  3083. case 'id':
  3084. r.set(e, t)
  3085. break
  3086. case 'width':
  3087. r.percent(e, t)
  3088. break
  3089. case 'lines':
  3090. r.integer(e, t)
  3091. break
  3092. case 'regionanchor':
  3093. case 'viewportanchor':
  3094. var i = t.split(',')
  3095. if (2 !== i.length) break
  3096. var n = new fi()
  3097. if ((n.percent('x', i[0]), n.percent('y', i[1]), !n.has('x') || !n.has('y'))) break
  3098. r.set(e + 'X', n.get('x')), r.set(e + 'Y', n.get('y'))
  3099. break
  3100. case 'scroll':
  3101. r.alt(e, t, ['up'])
  3102. }
  3103. },
  3104. /=/,
  3105. /\s/
  3106. ),
  3107. r.has('id') &&
  3108. (((t = new (n.vttjs.VTTRegion || n.window.VTTRegion)()).width = r.get('width', 100)),
  3109. (t.lines = r.get('lines', 3)),
  3110. (t.regionAnchorX = r.get('regionanchorX', 0)),
  3111. (t.regionAnchorY = r.get('regionanchorY', 100)),
  3112. (t.viewportAnchorX = r.get('viewportanchorX', 0)),
  3113. (t.viewportAnchorY = r.get('viewportanchorY', 100)),
  3114. (t.scroll = r.get('scroll', '')),
  3115. n.onregion && n.onregion(t),
  3116. n.regionList.push({ id: r.get('id'), region: t })))
  3117. },
  3118. /:/
  3119. )
  3120. }
  3121. e && (n.buffer += n.decoder.decode(e, { stream: !0 }))
  3122. try {
  3123. if ('INITIAL' === n.state) {
  3124. if (!/\r\n|\n/.test(n.buffer)) return this
  3125. var r,
  3126. a = (r = t()).match(/^WEBVTT([ \t].*)?$/)
  3127. if (!a || !a[0]) throw new hi(hi.Errors.BadSignature)
  3128. n.state = 'HEADER'
  3129. }
  3130. for (var s = !1; n.buffer; ) {
  3131. if (!/\r\n|\n/.test(n.buffer)) return this
  3132. switch ((s ? (s = !1) : (r = t()), n.state)) {
  3133. case 'HEADER':
  3134. ;/:/.test(r) ? i(r) : r || (n.state = 'ID')
  3135. continue
  3136. case 'NOTE':
  3137. r || (n.state = 'ID')
  3138. continue
  3139. case 'ID':
  3140. if (/^NOTE($|[ \t])/.test(r)) {
  3141. n.state = 'NOTE'
  3142. break
  3143. }
  3144. if (!r) continue
  3145. n.cue = new (n.vttjs.VTTCue || n.window.VTTCue)(0, 0, '')
  3146. try {
  3147. n.cue.align = 'center'
  3148. } catch (e) {
  3149. n.cue.align = 'middle'
  3150. }
  3151. if (((n.state = 'CUE'), -1 === r.indexOf('--\x3e'))) {
  3152. n.cue.id = r
  3153. continue
  3154. }
  3155. case 'CUE':
  3156. try {
  3157. gi(r, n.cue, n.regionList)
  3158. } catch (e) {
  3159. n.reportOrThrowError(e), (n.cue = null), (n.state = 'BADCUE')
  3160. continue
  3161. }
  3162. n.state = 'CUETEXT'
  3163. continue
  3164. case 'CUETEXT':
  3165. var o = -1 !== r.indexOf('--\x3e')
  3166. if (!r || (o && (s = !0))) {
  3167. n.oncue && n.oncue(n.cue), (n.cue = null), (n.state = 'ID')
  3168. continue
  3169. }
  3170. n.cue.text && (n.cue.text += '\n'), (n.cue.text += r.replace(/\u2028/g, '\n').replace(/u2029/g, '\n'))
  3171. continue
  3172. case 'BADCUE':
  3173. r || (n.state = 'ID')
  3174. continue
  3175. }
  3176. }
  3177. } catch (e) {
  3178. n.reportOrThrowError(e), 'CUETEXT' === n.state && n.cue && n.oncue && n.oncue(n.cue), (n.cue = null), (n.state = 'INITIAL' === n.state ? 'BADWEBVTT' : 'BADCUE')
  3179. }
  3180. return this
  3181. },
  3182. flush: function () {
  3183. var t = this
  3184. try {
  3185. if (((t.buffer += t.decoder.decode()), (!t.cue && 'HEADER' !== t.state) || ((t.buffer += '\n\n'), t.parse()), 'INITIAL' === t.state)) throw new hi(hi.Errors.BadSignature)
  3186. } catch (e) {
  3187. t.reportOrThrowError(e)
  3188. }
  3189. return t.onflush && t.onflush(), this
  3190. },
  3191. })
  3192. var Pi = Ai,
  3193. Li = { '': 1, lr: 1, rl: 1 },
  3194. Di = { start: 1, center: 1, end: 1, left: 1, right: 1, auto: 1, 'line-left': 1, 'line-right': 1 }
  3195. function Oi(e) {
  3196. return 'string' == typeof e && !!Di[e.toLowerCase()] && e.toLowerCase()
  3197. }
  3198. function Mi(e, t, i) {
  3199. this.hasBeenReset = !1
  3200. var n = '',
  3201. r = !1,
  3202. a = e,
  3203. s = t,
  3204. o = i,
  3205. u = null,
  3206. l = '',
  3207. c = !0,
  3208. d = 'auto',
  3209. h = 'start',
  3210. p = 'auto',
  3211. f = 'auto',
  3212. m = 100,
  3213. g = 'center'
  3214. Object.defineProperties(this, {
  3215. id: {
  3216. enumerable: !0,
  3217. get: function () {
  3218. return n
  3219. },
  3220. set: function (e) {
  3221. n = '' + e
  3222. },
  3223. },
  3224. pauseOnExit: {
  3225. enumerable: !0,
  3226. get: function () {
  3227. return r
  3228. },
  3229. set: function (e) {
  3230. r = !!e
  3231. },
  3232. },
  3233. startTime: {
  3234. enumerable: !0,
  3235. get: function () {
  3236. return a
  3237. },
  3238. set: function (e) {
  3239. if ('number' != typeof e) throw new TypeError('Start time must be set to a number.')
  3240. ;(a = e), (this.hasBeenReset = !0)
  3241. },
  3242. },
  3243. endTime: {
  3244. enumerable: !0,
  3245. get: function () {
  3246. return s
  3247. },
  3248. set: function (e) {
  3249. if ('number' != typeof e) throw new TypeError('End time must be set to a number.')
  3250. ;(s = e), (this.hasBeenReset = !0)
  3251. },
  3252. },
  3253. text: {
  3254. enumerable: !0,
  3255. get: function () {
  3256. return o
  3257. },
  3258. set: function (e) {
  3259. ;(o = '' + e), (this.hasBeenReset = !0)
  3260. },
  3261. },
  3262. region: {
  3263. enumerable: !0,
  3264. get: function () {
  3265. return u
  3266. },
  3267. set: function (e) {
  3268. ;(u = e), (this.hasBeenReset = !0)
  3269. },
  3270. },
  3271. vertical: {
  3272. enumerable: !0,
  3273. get: function () {
  3274. return l
  3275. },
  3276. set: function (e) {
  3277. e = 'string' == typeof (e = e) && !!Li[e.toLowerCase()] && e.toLowerCase()
  3278. if (!1 === e) throw new SyntaxError('Vertical: an invalid or illegal direction string was specified.')
  3279. ;(l = e), (this.hasBeenReset = !0)
  3280. },
  3281. },
  3282. snapToLines: {
  3283. enumerable: !0,
  3284. get: function () {
  3285. return c
  3286. },
  3287. set: function (e) {
  3288. ;(c = !!e), (this.hasBeenReset = !0)
  3289. },
  3290. },
  3291. line: {
  3292. enumerable: !0,
  3293. get: function () {
  3294. return d
  3295. },
  3296. set: function (e) {
  3297. if ('number' != typeof e && 'auto' !== e) throw new SyntaxError('Line: an invalid number or illegal string was specified.')
  3298. ;(d = e), (this.hasBeenReset = !0)
  3299. },
  3300. },
  3301. lineAlign: {
  3302. enumerable: !0,
  3303. get: function () {
  3304. return h
  3305. },
  3306. set: function (e) {
  3307. e = Oi(e)
  3308. e && ((h = e), (this.hasBeenReset = !0))
  3309. },
  3310. },
  3311. position: {
  3312. enumerable: !0,
  3313. get: function () {
  3314. return p
  3315. },
  3316. set: function (e) {
  3317. if (e < 0 || 100 < e) throw new Error('Position must be between 0 and 100.')
  3318. ;(p = e), (this.hasBeenReset = !0)
  3319. },
  3320. },
  3321. positionAlign: {
  3322. enumerable: !0,
  3323. get: function () {
  3324. return f
  3325. },
  3326. set: function (e) {
  3327. e = Oi(e)
  3328. e && ((f = e), (this.hasBeenReset = !0))
  3329. },
  3330. },
  3331. size: {
  3332. enumerable: !0,
  3333. get: function () {
  3334. return m
  3335. },
  3336. set: function (e) {
  3337. if (e < 0 || 100 < e) throw new Error('Size must be between 0 and 100.')
  3338. ;(m = e), (this.hasBeenReset = !0)
  3339. },
  3340. },
  3341. align: {
  3342. enumerable: !0,
  3343. get: function () {
  3344. return g
  3345. },
  3346. set: function (e) {
  3347. e = Oi(e)
  3348. if (!e) throw new SyntaxError('align: an invalid or illegal alignment string was specified.')
  3349. ;(g = e), (this.hasBeenReset = !0)
  3350. },
  3351. },
  3352. }),
  3353. (this.displayState = void 0)
  3354. }
  3355. Mi.prototype.getCueAsHTML = function () {
  3356. return WebVTT.convertCueToDOMTree(window, this.text)
  3357. }
  3358. var Ri = Mi,
  3359. Ni = { '': !0, up: !0 }
  3360. function Ui(e) {
  3361. return 'number' == typeof e && 0 <= e && e <= 100
  3362. }
  3363. function Bi() {
  3364. var t = 100,
  3365. i = 3,
  3366. n = 0,
  3367. r = 100,
  3368. a = 0,
  3369. s = 100,
  3370. o = ''
  3371. Object.defineProperties(this, {
  3372. width: {
  3373. enumerable: !0,
  3374. get: function () {
  3375. return t
  3376. },
  3377. set: function (e) {
  3378. if (!Ui(e)) throw new Error('Width must be between 0 and 100.')
  3379. t = e
  3380. },
  3381. },
  3382. lines: {
  3383. enumerable: !0,
  3384. get: function () {
  3385. return i
  3386. },
  3387. set: function (e) {
  3388. if ('number' != typeof e) throw new TypeError('Lines must be set to a number.')
  3389. i = e
  3390. },
  3391. },
  3392. regionAnchorY: {
  3393. enumerable: !0,
  3394. get: function () {
  3395. return r
  3396. },
  3397. set: function (e) {
  3398. if (!Ui(e)) throw new Error('RegionAnchorX must be between 0 and 100.')
  3399. r = e
  3400. },
  3401. },
  3402. regionAnchorX: {
  3403. enumerable: !0,
  3404. get: function () {
  3405. return n
  3406. },
  3407. set: function (e) {
  3408. if (!Ui(e)) throw new Error('RegionAnchorY must be between 0 and 100.')
  3409. n = e
  3410. },
  3411. },
  3412. viewportAnchorY: {
  3413. enumerable: !0,
  3414. get: function () {
  3415. return s
  3416. },
  3417. set: function (e) {
  3418. if (!Ui(e)) throw new Error('ViewportAnchorY must be between 0 and 100.')
  3419. s = e
  3420. },
  3421. },
  3422. viewportAnchorX: {
  3423. enumerable: !0,
  3424. get: function () {
  3425. return a
  3426. },
  3427. set: function (e) {
  3428. if (!Ui(e)) throw new Error('ViewportAnchorX must be between 0 and 100.')
  3429. a = e
  3430. },
  3431. },
  3432. scroll: {
  3433. enumerable: !0,
  3434. get: function () {
  3435. return o
  3436. },
  3437. set: function (e) {
  3438. e = 'string' == typeof (e = e) && !!Ni[e.toLowerCase()] && e.toLowerCase()
  3439. !1 === e || (o = e)
  3440. },
  3441. },
  3442. })
  3443. }
  3444. var Fi = m(function (e) {
  3445. e = e.exports = { WebVTT: Pi, VTTCue: Ri, VTTRegion: Bi }
  3446. ;(Kt.vttjs = e), (Kt.WebVTT = e.WebVTT)
  3447. var t = e.VTTCue,
  3448. i = e.VTTRegion,
  3449. n = Kt.VTTCue,
  3450. r = Kt.VTTRegion
  3451. ;(e.shim = function () {
  3452. ;(Kt.VTTCue = t), (Kt.VTTRegion = i)
  3453. }),
  3454. (e.restore = function () {
  3455. ;(Kt.VTTCue = n), (Kt.VTTRegion = r)
  3456. }),
  3457. Kt.VTTCue || e.shim()
  3458. })
  3459. Fi.WebVTT, Fi.VTTCue, Fi.VTTRegion
  3460. var ji = (function (n) {
  3461. function i(t, e) {
  3462. var i
  3463. return (
  3464. void 0 === e && (e = function () {}),
  3465. ((t = void 0 === t ? {} : t).reportTouchActivity = !1),
  3466. ((i = n.call(this, null, t, e) || this).onDurationChange_ = function (e) {
  3467. return i.onDurationChange(e)
  3468. }),
  3469. (i.trackProgress_ = function (e) {
  3470. return i.trackProgress(e)
  3471. }),
  3472. (i.trackCurrentTime_ = function (e) {
  3473. return i.trackCurrentTime(e)
  3474. }),
  3475. (i.stopTrackingCurrentTime_ = function (e) {
  3476. return i.stopTrackingCurrentTime(e)
  3477. }),
  3478. (i.disposeSourceHandler_ = function (e) {
  3479. return i.disposeSourceHandler(e)
  3480. }),
  3481. (i.queuedHanders_ = new Set()),
  3482. (i.hasStarted_ = !1),
  3483. i.on('playing', function () {
  3484. this.hasStarted_ = !0
  3485. }),
  3486. i.on('loadstart', function () {
  3487. this.hasStarted_ = !1
  3488. }),
  3489. oi.names.forEach(function (e) {
  3490. e = oi[e]
  3491. t && t[e.getterName] && (i[e.privateName] = t[e.getterName])
  3492. }),
  3493. i.featuresProgressEvents || i.manualProgressOn(),
  3494. i.featuresTimeupdateEvents || i.manualTimeUpdatesOn(),
  3495. ['Text', 'Audio', 'Video'].forEach(function (e) {
  3496. !1 === t['native' + e + 'Tracks'] && (i['featuresNative' + e + 'Tracks'] = !1)
  3497. }),
  3498. !1 === t.nativeCaptions || !1 === t.nativeTextTracks ? (i.featuresNativeTextTracks = !1) : (!0 !== t.nativeCaptions && !0 !== t.nativeTextTracks) || (i.featuresNativeTextTracks = !0),
  3499. i.featuresNativeTextTracks || i.emulateTextTracks(),
  3500. (i.preloadTextTracks = !1 !== t.preloadTextTracks),
  3501. (i.autoRemoteTextTracks_ = new oi.text.ListClass()),
  3502. i.initTrackListeners(),
  3503. t.nativeControlsForTouch || i.emitTapEvents(),
  3504. i.constructor && (i.name_ = i.constructor.name || 'Unknown Tech'),
  3505. i
  3506. )
  3507. }
  3508. mt(i, n)
  3509. var e = i.prototype
  3510. return (
  3511. (e.triggerSourceset = function (e) {
  3512. var t = this
  3513. this.isReady_ ||
  3514. this.one('ready', function () {
  3515. return t.setTimeout(function () {
  3516. return t.triggerSourceset(e)
  3517. }, 1)
  3518. }),
  3519. this.trigger({ src: e, type: 'sourceset' })
  3520. }),
  3521. (e.manualProgressOn = function () {
  3522. this.on('durationchange', this.onDurationChange_), (this.manualProgress = !0), this.one('ready', this.trackProgress_)
  3523. }),
  3524. (e.manualProgressOff = function () {
  3525. ;(this.manualProgress = !1), this.stopTrackingProgress(), this.off('durationchange', this.onDurationChange_)
  3526. }),
  3527. (e.trackProgress = function (e) {
  3528. this.stopTrackingProgress(),
  3529. (this.progressInterval = this.setInterval(
  3530. Ve(this, function () {
  3531. var e = this.bufferedPercent()
  3532. this.bufferedPercent_ !== e && this.trigger('progress'), 1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress()
  3533. }),
  3534. 500
  3535. ))
  3536. }),
  3537. (e.onDurationChange = function (e) {
  3538. this.duration_ = this.duration()
  3539. }),
  3540. (e.buffered = function () {
  3541. return vt(0, 0)
  3542. }),
  3543. (e.bufferedPercent = function () {
  3544. return _t(this.buffered(), this.duration_)
  3545. }),
  3546. (e.stopTrackingProgress = function () {
  3547. this.clearInterval(this.progressInterval)
  3548. }),
  3549. (e.manualTimeUpdatesOn = function () {
  3550. ;(this.manualTimeUpdates = !0), this.on('play', this.trackCurrentTime_), this.on('pause', this.stopTrackingCurrentTime_)
  3551. }),
  3552. (e.manualTimeUpdatesOff = function () {
  3553. ;(this.manualTimeUpdates = !1), this.stopTrackingCurrentTime(), this.off('play', this.trackCurrentTime_), this.off('pause', this.stopTrackingCurrentTime_)
  3554. }),
  3555. (e.trackCurrentTime = function () {
  3556. this.currentTimeInterval && this.stopTrackingCurrentTime(),
  3557. (this.currentTimeInterval = this.setInterval(function () {
  3558. this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 })
  3559. }, 250))
  3560. }),
  3561. (e.stopTrackingCurrentTime = function () {
  3562. this.clearInterval(this.currentTimeInterval), this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 })
  3563. }),
  3564. (e.dispose = function () {
  3565. this.clearTracks(ai.names), this.manualProgress && this.manualProgressOff(), this.manualTimeUpdates && this.manualTimeUpdatesOff(), n.prototype.dispose.call(this)
  3566. }),
  3567. (e.clearTracks = function (e) {
  3568. var r = this
  3569. ;(e = [].concat(e)).forEach(function (e) {
  3570. for (var t = r[e + 'Tracks']() || [], i = t.length; i--; ) {
  3571. var n = t[i]
  3572. 'text' === e && r.removeRemoteTextTrack(n), t.removeTrack(n)
  3573. }
  3574. })
  3575. }),
  3576. (e.cleanupAutoTextTracks = function () {
  3577. for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--; ) {
  3578. var i = e[t]
  3579. this.removeRemoteTextTrack(i)
  3580. }
  3581. }),
  3582. (e.reset = function () {}),
  3583. (e.crossOrigin = function () {}),
  3584. (e.setCrossOrigin = function () {}),
  3585. (e.error = function (e) {
  3586. return void 0 !== e && ((this.error_ = new bt(e)), this.trigger('error')), this.error_
  3587. }),
  3588. (e.played = function () {
  3589. return this.hasStarted_ ? vt(0, 0) : vt()
  3590. }),
  3591. (e.play = function () {}),
  3592. (e.setScrubbing = function () {}),
  3593. (e.scrubbing = function () {}),
  3594. (e.setCurrentTime = function () {
  3595. this.manualTimeUpdates && this.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 })
  3596. }),
  3597. (e.initTrackListeners = function () {
  3598. var r = this
  3599. ai.names.forEach(function (e) {
  3600. function t() {
  3601. r.trigger(e + 'trackchange')
  3602. }
  3603. var i = ai[e],
  3604. n = r[i.getterName]()
  3605. n.addEventListener('removetrack', t),
  3606. n.addEventListener('addtrack', t),
  3607. r.on('dispose', function () {
  3608. n.removeEventListener('removetrack', t), n.removeEventListener('addtrack', t)
  3609. })
  3610. })
  3611. }),
  3612. (e.addWebVttScript_ = function () {
  3613. var e,
  3614. t = this
  3615. window.WebVTT ||
  3616. (document.body.contains(this.el())
  3617. ? !this.options_['vtt.js'] && S(Fi) && 0 < Object.keys(Fi).length
  3618. ? this.trigger('vttjsloaded')
  3619. : (((e = document.createElement('script')).src = this.options_['vtt.js'] || 'https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js'),
  3620. (e.onload = function () {
  3621. t.trigger('vttjsloaded')
  3622. }),
  3623. (e.onerror = function () {
  3624. t.trigger('vttjserror')
  3625. }),
  3626. this.on('dispose', function () {
  3627. ;(e.onload = null), (e.onerror = null)
  3628. }),
  3629. (window.WebVTT = !0),
  3630. this.el().parentNode.appendChild(e))
  3631. : this.ready(this.addWebVttScript_))
  3632. }),
  3633. (e.emulateTextTracks = function () {
  3634. function t(e) {
  3635. return n.addTrack(e.track)
  3636. }
  3637. function i(e) {
  3638. return n.removeTrack(e.track)
  3639. }
  3640. var e = this,
  3641. n = this.textTracks(),
  3642. r = this.remoteTextTracks()
  3643. r.on('addtrack', t), r.on('removetrack', i), this.addWebVttScript_()
  3644. function a() {
  3645. return e.trigger('texttrackchange')
  3646. }
  3647. function s() {
  3648. a()
  3649. for (var e = 0; e < n.length; e++) {
  3650. var t = n[e]
  3651. t.removeEventListener('cuechange', a), 'showing' === t.mode && t.addEventListener('cuechange', a)
  3652. }
  3653. }
  3654. s(),
  3655. n.addEventListener('change', s),
  3656. n.addEventListener('addtrack', s),
  3657. n.addEventListener('removetrack', s),
  3658. this.on('dispose', function () {
  3659. r.off('addtrack', t), r.off('removetrack', i), n.removeEventListener('change', s), n.removeEventListener('addtrack', s), n.removeEventListener('removetrack', s)
  3660. for (var e = 0; e < n.length; e++) n[e].removeEventListener('cuechange', a)
  3661. })
  3662. }),
  3663. (e.addTextTrack = function (e, t, i) {
  3664. if (!e) throw new Error('TextTrack kind is required but was not provided')
  3665. return (function (e, t, i, n, r) {
  3666. void 0 === r && (r = {})
  3667. var a = e.textTracks()
  3668. return (r.kind = t), i && (r.label = i), n && (r.language = n), (r.tech = e), (r = new oi.text.TrackClass(r)), a.addTrack(r), r
  3669. })(this, e, t, i)
  3670. }),
  3671. (e.createRemoteTextTrack = function (e) {
  3672. e = lt(e, { tech: this })
  3673. return new si.remoteTextEl.TrackClass(e)
  3674. }),
  3675. (e.addRemoteTextTrack = function (e, t) {
  3676. var i = this,
  3677. n = this.createRemoteTextTrack((e = void 0 === e ? {} : e))
  3678. return (
  3679. !0 !== t &&
  3680. !1 !== t &&
  3681. (h.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),
  3682. (t = !0)),
  3683. this.remoteTextTrackEls().addTrackElement_(n),
  3684. this.remoteTextTracks().addTrack(n.track),
  3685. !0 !== t &&
  3686. this.ready(function () {
  3687. return i.autoRemoteTextTracks_.addTrack(n.track)
  3688. }),
  3689. n
  3690. )
  3691. }),
  3692. (e.removeRemoteTextTrack = function (e) {
  3693. var t = this.remoteTextTrackEls().getTrackElementByTrack_(e)
  3694. this.remoteTextTrackEls().removeTrackElement_(t), this.remoteTextTracks().removeTrack(e), this.autoRemoteTextTracks_.removeTrack(e)
  3695. }),
  3696. (e.getVideoPlaybackQuality = function () {
  3697. return {}
  3698. }),
  3699. (e.requestPictureInPicture = function () {
  3700. var e = this.options_.Promise || window.Promise
  3701. if (e) return e.reject()
  3702. }),
  3703. (e.disablePictureInPicture = function () {
  3704. return !0
  3705. }),
  3706. (e.setDisablePictureInPicture = function () {}),
  3707. (e.requestVideoFrameCallback = function (e) {
  3708. var t = this,
  3709. i = Pe++
  3710. return (
  3711. this.paused()
  3712. ? (this.queuedHanders_.add(i),
  3713. this.one('playing', function () {
  3714. t.queuedHanders_.has(i) && (t.queuedHanders_.delete(i), e())
  3715. }))
  3716. : this.requestNamedAnimationFrame(i, e),
  3717. i
  3718. )
  3719. }),
  3720. (e.cancelVideoFrameCallback = function (e) {
  3721. this.queuedHanders_.has(e) ? this.queuedHanders_.delete(e) : this.cancelNamedAnimationFrame(e)
  3722. }),
  3723. (e.setPoster = function () {}),
  3724. (e.playsinline = function () {}),
  3725. (e.setPlaysinline = function () {}),
  3726. (e.overrideNativeAudioTracks = function () {}),
  3727. (e.overrideNativeVideoTracks = function () {}),
  3728. (e.canPlayType = function () {
  3729. return ''
  3730. }),
  3731. (i.canPlayType = function () {
  3732. return ''
  3733. }),
  3734. (i.canPlaySource = function (e, t) {
  3735. return i.canPlayType(e.type)
  3736. }),
  3737. (i.isTech = function (e) {
  3738. return e.prototype instanceof i || e instanceof i || e === i
  3739. }),
  3740. (i.registerTech = function (e, t) {
  3741. if ((i.techs_ || (i.techs_ = {}), !i.isTech(t))) throw new Error('Tech ' + e + ' must be a Tech')
  3742. if (!i.canPlayType) throw new Error('Techs must have a static canPlayType method on them')
  3743. if (!i.canPlaySource) throw new Error('Techs must have a static canPlaySource method on them')
  3744. return (e = ut(e)), (i.techs_[e] = t), (i.techs_[ot(e)] = t), 'Tech' !== e && i.defaultTechOrder_.push(e), t
  3745. }),
  3746. (i.getTech = function (e) {
  3747. if (e)
  3748. return i.techs_ && i.techs_[e]
  3749. ? i.techs_[e]
  3750. : ((e = ut(e)),
  3751. window && window.videojs && window.videojs[e]
  3752. ? (h.warn('The ' + e + ' tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)'), window.videojs[e])
  3753. : void 0)
  3754. }),
  3755. i
  3756. )
  3757. })(pt)
  3758. oi.names.forEach(function (e) {
  3759. var t = oi[e]
  3760. ji.prototype[t.getterName] = function () {
  3761. return (this[t.privateName] = this[t.privateName] || new t.ListClass()), this[t.privateName]
  3762. }
  3763. }),
  3764. (ji.prototype.featuresVolumeControl = !0),
  3765. (ji.prototype.featuresMuteControl = !0),
  3766. (ji.prototype.featuresFullscreenResize = !1),
  3767. (ji.prototype.featuresPlaybackRate = !1),
  3768. (ji.prototype.featuresProgressEvents = !1),
  3769. (ji.prototype.featuresSourceset = !1),
  3770. (ji.prototype.featuresTimeupdateEvents = !1),
  3771. (ji.prototype.featuresNativeTextTracks = !1),
  3772. (ji.prototype.featuresVideoFrameCallback = !1),
  3773. (ji.withSourceHandlers = function (r) {
  3774. ;(r.registerSourceHandler = function (e, t) {
  3775. var i = (i = r.sourceHandlers) || (r.sourceHandlers = [])
  3776. void 0 === t && (t = i.length), i.splice(t, 0, e)
  3777. }),
  3778. (r.canPlayType = function (e) {
  3779. for (var t, i = r.sourceHandlers || [], n = 0; n < i.length; n++) if ((t = i[n].canPlayType(e))) return t
  3780. return ''
  3781. }),
  3782. (r.selectSourceHandler = function (e, t) {
  3783. for (var i = r.sourceHandlers || [], n = 0; n < i.length; n++) if (i[n].canHandleSource(e, t)) return i[n]
  3784. return null
  3785. }),
  3786. (r.canPlaySource = function (e, t) {
  3787. var i = r.selectSourceHandler(e, t)
  3788. return i ? i.canHandleSource(e, t) : ''
  3789. })
  3790. ;['seekable', 'seeking', 'duration'].forEach(function (e) {
  3791. var t = this[e]
  3792. 'function' == typeof t &&
  3793. (this[e] = function () {
  3794. return this.sourceHandler_ && this.sourceHandler_[e] ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) : t.apply(this, arguments)
  3795. })
  3796. }, r.prototype),
  3797. (r.prototype.setSource = function (e) {
  3798. var t = r.selectSourceHandler(e, this.options_)
  3799. t || (r.nativeSourceHandler ? (t = r.nativeSourceHandler) : h.error('No source handler found for the current source.')),
  3800. this.disposeSourceHandler(),
  3801. this.off('dispose', this.disposeSourceHandler_),
  3802. t !== r.nativeSourceHandler && (this.currentSource_ = e),
  3803. (this.sourceHandler_ = t.handleSource(e, this, this.options_)),
  3804. this.one('dispose', this.disposeSourceHandler_)
  3805. }),
  3806. (r.prototype.disposeSourceHandler = function () {
  3807. this.currentSource_ && (this.clearTracks(['audio', 'video']), (this.currentSource_ = null)),
  3808. this.cleanupAutoTextTracks(),
  3809. this.sourceHandler_ && (this.sourceHandler_.dispose && this.sourceHandler_.dispose(), (this.sourceHandler_ = null))
  3810. })
  3811. }),
  3812. pt.registerComponent('Tech', ji),
  3813. ji.registerTech('Tech', ji),
  3814. (ji.defaultTechOrder_ = [])
  3815. var Hi = {},
  3816. qi = {},
  3817. Vi = {}
  3818. function Wi(e, t, i) {
  3819. e.setTimeout(function () {
  3820. return (function i(n, e, r, a, s, o) {
  3821. void 0 === n && (n = {})
  3822. void 0 === e && (e = [])
  3823. void 0 === s && (s = [])
  3824. void 0 === o && (o = !1)
  3825. var t = e,
  3826. e = t[0],
  3827. u = t.slice(1)
  3828. if ('string' == typeof e) i(n, Hi[e], r, a, s, o)
  3829. else if (e) {
  3830. var l = Qi(a, e)
  3831. if (!l.setSource) return s.push(l), i(n, u, r, a, s, o)
  3832. l.setSource(b({}, n), function (e, t) {
  3833. return e ? i(n, u, r, a, s, o) : (s.push(l), void i(t, n.type === t.type ? u : Hi[t.type], r, a, s, o))
  3834. })
  3835. } else u.length ? i(n, u, r, a, s, o) : o ? r(n, s) : i(n, Hi['*'], r, a, s, !0)
  3836. })(t, Hi[t.type], i, e)
  3837. }, 1)
  3838. }
  3839. function Gi(e, t, i, n) {
  3840. void 0 === n && (n = null)
  3841. var r = 'call' + ut(i),
  3842. r = e.reduce(Yi(r), n),
  3843. n = r === Vi,
  3844. r = n ? null : t[i](r)
  3845. return (
  3846. (function (e, t, i, n) {
  3847. for (var r = e.length - 1; 0 <= r; r--) {
  3848. var a = e[r]
  3849. a[t] && a[t](n, i)
  3850. }
  3851. })(e, i, r, n),
  3852. r
  3853. )
  3854. }
  3855. var zi = { buffered: 1, currentTime: 1, duration: 1, muted: 1, played: 1, paused: 1, seekable: 1, volume: 1, ended: 1 },
  3856. Xi = { setCurrentTime: 1, setMuted: 1, setVolume: 1 },
  3857. Ki = { play: 1, pause: 1 }
  3858. function Yi(i) {
  3859. return function (e, t) {
  3860. return e === Vi ? Vi : t[i] ? t[i](e) : e
  3861. }
  3862. }
  3863. function Qi(e, t) {
  3864. var i = qi[e.id()],
  3865. n = null
  3866. if (null == i) return (n = t(e)), (qi[e.id()] = [[t, n]]), n
  3867. for (var r = 0; r < i.length; r++) {
  3868. var a = i[r],
  3869. s = a[0],
  3870. a = a[1]
  3871. s === t && (n = a)
  3872. }
  3873. return null === n && ((n = t(e)), i.push([t, n])), n
  3874. }
  3875. function $i(e) {
  3876. return (e = Nt((e = void 0 === e ? '' : e))), Zi[e.toLowerCase()] || ''
  3877. }
  3878. function Ji(e) {
  3879. var t
  3880. return (e = Array.isArray(e)
  3881. ? ((t = []),
  3882. e.forEach(function (e) {
  3883. ;(e = Ji(e)), Array.isArray(e) ? (t = t.concat(e)) : T(e) && t.push(e)
  3884. }),
  3885. t)
  3886. : 'string' == typeof e && e.trim()
  3887. ? [en({ src: e })]
  3888. : T(e) && 'string' == typeof e.src && e.src && e.src.trim()
  3889. ? [en(e)]
  3890. : [])
  3891. }
  3892. var Zi = {
  3893. opus: 'video/ogg',
  3894. ogv: 'video/ogg',
  3895. mp4: 'video/mp4',
  3896. mov: 'video/mp4',
  3897. m4v: 'video/mp4',
  3898. mkv: 'video/x-matroska',
  3899. m4a: 'audio/mp4',
  3900. mp3: 'audio/mpeg',
  3901. aac: 'audio/aac',
  3902. caf: 'audio/x-caf',
  3903. flac: 'audio/flac',
  3904. oga: 'audio/ogg',
  3905. wav: 'audio/wav',
  3906. m3u8: 'application/x-mpegURL',
  3907. mpd: 'application/dash+xml',
  3908. jpg: 'image/jpeg',
  3909. jpeg: 'image/jpeg',
  3910. gif: 'image/gif',
  3911. png: 'image/png',
  3912. svg: 'image/svg+xml',
  3913. webp: 'image/webp',
  3914. }
  3915. function en(e) {
  3916. var t
  3917. return e.type || ((t = $i(e.src)) && (e.type = t)), e
  3918. }
  3919. I = (function (u) {
  3920. function e(e, t, i) {
  3921. var n = lt({ createEl: !1 }, t),
  3922. i = u.call(this, e, n, i) || this
  3923. if (t.playerOptions.sources && 0 !== t.playerOptions.sources.length) e.src(t.playerOptions.sources)
  3924. else
  3925. for (var r = 0, a = t.playerOptions.techOrder; r < a.length; r++) {
  3926. var s = ut(a[r]),
  3927. o = ji.getTech(s)
  3928. if ((o = !s ? pt.getComponent(s) : o) && o.isSupported()) {
  3929. e.loadTech_(s)
  3930. break
  3931. }
  3932. }
  3933. return i
  3934. }
  3935. return mt(e, u), e
  3936. })(pt)
  3937. pt.registerComponent('MediaLoader', I)
  3938. C = (function (n) {
  3939. function e(e, t) {
  3940. var i = n.call(this, e, t) || this
  3941. return (
  3942. i.options_.controlText && i.controlText(i.options_.controlText),
  3943. (i.handleMouseOver_ = function (e) {
  3944. return i.handleMouseOver(e)
  3945. }),
  3946. (i.handleMouseOut_ = function (e) {
  3947. return i.handleMouseOut(e)
  3948. }),
  3949. (i.handleClick_ = function (e) {
  3950. return i.handleClick(e)
  3951. }),
  3952. (i.handleKeyDown_ = function (e) {
  3953. return i.handleKeyDown(e)
  3954. }),
  3955. i.emitTapEvents(),
  3956. i.enable(),
  3957. i
  3958. )
  3959. }
  3960. mt(e, n)
  3961. var t = e.prototype
  3962. return (
  3963. (t.createEl = function (e, t, i) {
  3964. void 0 === e && (e = 'div'),
  3965. void 0 === t && (t = {}),
  3966. void 0 === i && (i = {}),
  3967. (t = b({ className: this.buildCSSClass(), tabIndex: 0 }, t)),
  3968. 'button' === e && h.error('Creating a ClickableComponent with an HTML element of ' + e + ' is not supported; use a Button instead.'),
  3969. (i = b({ role: 'button' }, i)),
  3970. (this.tabIndex_ = t.tabIndex)
  3971. i = $(e, t, i)
  3972. return i.appendChild($('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })), this.createControlTextEl(i), i
  3973. }),
  3974. (t.dispose = function () {
  3975. ;(this.controlTextEl_ = null), n.prototype.dispose.call(this)
  3976. }),
  3977. (t.createControlTextEl = function (e) {
  3978. return (
  3979. (this.controlTextEl_ = $('span', { className: 'vjs-control-text' }, { 'aria-live': 'polite' })),
  3980. e && e.appendChild(this.controlTextEl_),
  3981. this.controlText(this.controlText_, e),
  3982. this.controlTextEl_
  3983. )
  3984. }),
  3985. (t.controlText = function (e, t) {
  3986. if ((void 0 === t && (t = this.el()), void 0 === e)) return this.controlText_ || 'Need Text'
  3987. var i = this.localize(e)
  3988. ;(this.controlText_ = e), J(this.controlTextEl_, i), this.nonIconControl || this.player_.options_.noUITitleAttributes || t.setAttribute('title', i)
  3989. }),
  3990. (t.buildCSSClass = function () {
  3991. return 'vjs-control vjs-button ' + n.prototype.buildCSSClass.call(this)
  3992. }),
  3993. (t.enable = function () {
  3994. this.enabled_ ||
  3995. ((this.enabled_ = !0),
  3996. this.removeClass('vjs-disabled'),
  3997. this.el_.setAttribute('aria-disabled', 'false'),
  3998. 'undefined' != typeof this.tabIndex_ && this.el_.setAttribute('tabIndex', this.tabIndex_),
  3999. this.on(['tap', 'click'], this.handleClick_),
  4000. this.on('keydown', this.handleKeyDown_))
  4001. }),
  4002. (t.disable = function () {
  4003. ;(this.enabled_ = !1),
  4004. this.addClass('vjs-disabled'),
  4005. this.el_.setAttribute('aria-disabled', 'true'),
  4006. 'undefined' != typeof this.tabIndex_ && this.el_.removeAttribute('tabIndex'),
  4007. this.off('mouseover', this.handleMouseOver_),
  4008. this.off('mouseout', this.handleMouseOut_),
  4009. this.off(['tap', 'click'], this.handleClick_),
  4010. this.off('keydown', this.handleKeyDown_)
  4011. }),
  4012. (t.handleLanguagechange = function () {
  4013. this.controlText(this.controlText_)
  4014. }),
  4015. (t.handleClick = function (e) {
  4016. this.options_.clickHandler && this.options_.clickHandler.call(this, arguments)
  4017. }),
  4018. (t.handleKeyDown = function (e) {
  4019. ht.isEventKey(e, 'Space') || ht.isEventKey(e, 'Enter') ? (e.preventDefault(), e.stopPropagation(), this.trigger('click')) : n.prototype.handleKeyDown.call(this, e)
  4020. }),
  4021. e
  4022. )
  4023. })(pt)
  4024. pt.registerComponent('ClickableComponent', C),
  4025. pt.registerComponent(
  4026. 'PosterImage',
  4027. (function (n) {
  4028. function e(e, t) {
  4029. var i = n.call(this, e, t) || this
  4030. return (
  4031. i.update(),
  4032. (i.update_ = function (e) {
  4033. return i.update(e)
  4034. }),
  4035. e.on('posterchange', i.update_),
  4036. i
  4037. )
  4038. }
  4039. mt(e, n)
  4040. var t = e.prototype
  4041. return (
  4042. (t.dispose = function () {
  4043. this.player().off('posterchange', this.update_), n.prototype.dispose.call(this)
  4044. }),
  4045. (t.createEl = function () {
  4046. return $('div', { className: 'vjs-poster', tabIndex: -1 })
  4047. }),
  4048. (t.update = function (e) {
  4049. var t = this.player().poster()
  4050. this.setSrc(t), t ? this.show() : this.hide()
  4051. }),
  4052. (t.setSrc = function (e) {
  4053. this.el_.style.backgroundImage = e ? 'url("' + e + '")' : ''
  4054. }),
  4055. (t.handleClick = function (e) {
  4056. var t
  4057. this.player_.controls() &&
  4058. ((t = this.player_.usingPlugin('eme') && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length),
  4059. !this.player_.tech(!0) || ((N || O) && t) || this.player_.tech(!0).focus(),
  4060. this.player_.paused() ? Et(this.player_.play()) : this.player_.pause())
  4061. }),
  4062. e
  4063. )
  4064. })(C)
  4065. )
  4066. var tn = '#222',
  4067. nn = {
  4068. monospace: 'monospace',
  4069. sansSerif: 'sans-serif',
  4070. serif: 'serif',
  4071. monospaceSansSerif: '"Andale Mono", "Lucida Console", monospace',
  4072. monospaceSerif: '"Courier New", monospace',
  4073. proportionalSansSerif: 'sans-serif',
  4074. proportionalSerif: 'serif',
  4075. casual: '"Comic Sans MS", Impact, fantasy',
  4076. script: '"Monotype Corsiva", cursive',
  4077. smallcaps: '"Andale Mono", "Lucida Console", monospace, sans-serif',
  4078. }
  4079. function rn(e, t) {
  4080. var i
  4081. if (4 === e.length) i = e[1] + e[1] + e[2] + e[2] + e[3] + e[3]
  4082. else {
  4083. if (7 !== e.length) throw new Error('Invalid color code provided, ' + e + '; must be formatted as e.g. #f0e or #f604e2.')
  4084. i = e.slice(1)
  4085. }
  4086. return 'rgba(' + parseInt(i.slice(0, 2), 16) + ',' + parseInt(i.slice(2, 4), 16) + ',' + parseInt(i.slice(4, 6), 16) + ',' + t + ')'
  4087. }
  4088. function an(e, t, i) {
  4089. try {
  4090. e.style[t] = i
  4091. } catch (e) {
  4092. return
  4093. }
  4094. }
  4095. pt.registerComponent(
  4096. 'TextTrackDisplay',
  4097. (function (a) {
  4098. function e(i, e, t) {
  4099. function n(e) {
  4100. return r.updateDisplay(e)
  4101. }
  4102. var r = a.call(this, i, e, t) || this
  4103. return (
  4104. i.on('loadstart', function (e) {
  4105. return r.toggleDisplay(e)
  4106. }),
  4107. i.on('texttrackchange', n),
  4108. i.on('loadedmetadata', function (e) {
  4109. return r.preselectTrack(e)
  4110. }),
  4111. i.ready(
  4112. Ve(ft(r), function () {
  4113. if (i.tech_ && i.tech_.featuresNativeTextTracks) this.hide()
  4114. else {
  4115. i.on('fullscreenchange', n),
  4116. i.on('playerresize', n),
  4117. window.addEventListener('orientationchange', n),
  4118. i.on('dispose', function () {
  4119. return window.removeEventListener('orientationchange', n)
  4120. })
  4121. for (var e = this.options_.playerOptions.tracks || [], t = 0; t < e.length; t++) this.player_.addRemoteTextTrack(e[t], !0)
  4122. this.preselectTrack()
  4123. }
  4124. })
  4125. ),
  4126. r
  4127. )
  4128. }
  4129. mt(e, a)
  4130. var t = e.prototype
  4131. return (
  4132. (t.preselectTrack = function () {
  4133. for (var e, t, i, n = { captions: 1, subtitles: 1 }, r = this.player_.textTracks(), a = this.player_.cache_.selectedLanguage, s = 0; s < r.length; s++) {
  4134. var o = r[s]
  4135. a && a.enabled && a.language && a.language === o.language && o.kind in n
  4136. ? (i = (o.kind !== a.kind && i) || o)
  4137. : a && !a.enabled
  4138. ? (t = e = i = null)
  4139. : o.default && ('descriptions' !== o.kind || e ? o.kind in n && !t && (t = o) : (e = o))
  4140. }
  4141. i ? (i.mode = 'showing') : t ? (t.mode = 'showing') : e && (e.mode = 'showing')
  4142. }),
  4143. (t.toggleDisplay = function () {
  4144. this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show()
  4145. }),
  4146. (t.createEl = function () {
  4147. return a.prototype.createEl.call(this, 'div', { className: 'vjs-text-track-display' }, { translate: 'yes', 'aria-live': 'off', 'aria-atomic': 'true' })
  4148. }),
  4149. (t.clearDisplay = function () {
  4150. 'function' == typeof window.WebVTT && window.WebVTT.processCues(window, [], this.el_)
  4151. }),
  4152. (t.updateDisplay = function () {
  4153. var e = this.player_.textTracks(),
  4154. t = this.options_.allowMultipleShowingTracks
  4155. if ((this.clearDisplay(), t)) {
  4156. for (var i = [], n = 0; n < e.length; ++n) {
  4157. var r = e[n]
  4158. 'showing' === r.mode && i.push(r)
  4159. }
  4160. this.updateForTrack(i)
  4161. } else {
  4162. for (var a = null, s = null, o = e.length; o--; ) {
  4163. var u = e[o]
  4164. 'showing' === u.mode && ('descriptions' === u.kind ? (a = u) : (s = u))
  4165. }
  4166. s
  4167. ? ('off' !== this.getAttribute('aria-live') && this.setAttribute('aria-live', 'off'), this.updateForTrack(s))
  4168. : a && ('assertive' !== this.getAttribute('aria-live') && this.setAttribute('aria-live', 'assertive'), this.updateForTrack(a))
  4169. }
  4170. }),
  4171. (t.updateDisplayState = function (e) {
  4172. for (var t = this.player_.textTrackSettings.getValues(), i = e.activeCues, n = i.length; n--; ) {
  4173. var r,
  4174. a = i[n]
  4175. a &&
  4176. ((r = a.displayState),
  4177. t.color && (r.firstChild.style.color = t.color),
  4178. t.textOpacity && an(r.firstChild, 'color', rn(t.color || '#fff', t.textOpacity)),
  4179. t.backgroundColor && (r.firstChild.style.backgroundColor = t.backgroundColor),
  4180. t.backgroundOpacity && an(r.firstChild, 'backgroundColor', rn(t.backgroundColor || '#000', t.backgroundOpacity)),
  4181. t.windowColor && (t.windowOpacity ? an(r, 'backgroundColor', rn(t.windowColor, t.windowOpacity)) : (r.style.backgroundColor = t.windowColor)),
  4182. t.edgeStyle &&
  4183. ('dropshadow' === t.edgeStyle
  4184. ? (r.firstChild.style.textShadow = '2px 2px 3px #222, 2px 2px 4px #222, 2px 2px 5px ' + tn)
  4185. : 'raised' === t.edgeStyle
  4186. ? (r.firstChild.style.textShadow = '1px 1px #222, 2px 2px #222, 3px 3px ' + tn)
  4187. : 'depressed' === t.edgeStyle
  4188. ? (r.firstChild.style.textShadow = '1px 1px #ccc, 0 1px #ccc, -1px -1px #222, 0 -1px ' + tn)
  4189. : 'uniform' === t.edgeStyle && (r.firstChild.style.textShadow = '0 0 4px #222, 0 0 4px #222, 0 0 4px #222, 0 0 4px ' + tn)),
  4190. t.fontPercent &&
  4191. 1 !== t.fontPercent &&
  4192. ((a = window.parseFloat(r.style.fontSize)), (r.style.fontSize = a * t.fontPercent + 'px'), (r.style.height = 'auto'), (r.style.top = 'auto')),
  4193. t.fontFamily &&
  4194. 'default' !== t.fontFamily &&
  4195. ('small-caps' === t.fontFamily ? (r.firstChild.style.fontVariant = 'small-caps') : (r.firstChild.style.fontFamily = nn[t.fontFamily])))
  4196. }
  4197. }),
  4198. (t.updateForTrack = function (e) {
  4199. if (
  4200. (Array.isArray(e) || (e = [e]),
  4201. 'function' == typeof window.WebVTT &&
  4202. !e.every(function (e) {
  4203. return !e.activeCues
  4204. }))
  4205. ) {
  4206. for (var t = [], i = 0; i < e.length; ++i) for (var n = e[i], r = 0; r < n.activeCues.length; ++r) t.push(n.activeCues[r])
  4207. window.WebVTT.processCues(window, t, this.el_)
  4208. for (var a = 0; a < e.length; ++a) {
  4209. for (var s = e[a], o = 0; o < s.activeCues.length; ++o) {
  4210. var u = s.activeCues[o].displayState
  4211. te(u, 'vjs-text-track-cue'), te(u, 'vjs-text-track-cue-' + (s.language || a)), s.language && oe(u, 'lang', s.language)
  4212. }
  4213. this.player_.textTrackSettings && this.updateDisplayState(s)
  4214. }
  4215. }
  4216. }),
  4217. e
  4218. )
  4219. })(pt)
  4220. ),
  4221. pt.registerComponent(
  4222. 'LoadingSpinner',
  4223. (function (i) {
  4224. function e() {
  4225. return i.apply(this, arguments) || this
  4226. }
  4227. return (
  4228. mt(e, i),
  4229. (e.prototype.createEl = function () {
  4230. var e = this.player_.isAudio(),
  4231. t = this.localize(e ? 'Audio Player' : 'Video Player'),
  4232. e = $('span', { className: 'vjs-control-text', textContent: this.localize('{1} is loading.', [t]) }),
  4233. t = i.prototype.createEl.call(this, 'div', { className: 'vjs-loading-spinner', dir: 'ltr' })
  4234. return t.appendChild(e), t
  4235. }),
  4236. e
  4237. )
  4238. })(pt)
  4239. )
  4240. var sn = (function (t) {
  4241. function e() {
  4242. return t.apply(this, arguments) || this
  4243. }
  4244. mt(e, t)
  4245. var i = e.prototype
  4246. return (
  4247. (i.createEl = function (e, t, i) {
  4248. void 0 === t && (t = {}), void 0 === i && (i = {})
  4249. i = $('button', (t = b({ className: this.buildCSSClass() }, t)), (i = b({ type: 'button' }, i)))
  4250. return i.appendChild($('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })), this.createControlTextEl(i), i
  4251. }),
  4252. (i.addChild = function (e, t) {
  4253. void 0 === t && (t = {})
  4254. var i = this.constructor.name
  4255. return h.warn('Adding an actionable (user controllable) child to a Button (' + i + ') is not supported; use a ClickableComponent instead.'), pt.prototype.addChild.call(this, e, t)
  4256. }),
  4257. (i.enable = function () {
  4258. t.prototype.enable.call(this), this.el_.removeAttribute('disabled')
  4259. }),
  4260. (i.disable = function () {
  4261. t.prototype.disable.call(this), this.el_.setAttribute('disabled', 'disabled')
  4262. }),
  4263. (i.handleKeyDown = function (e) {
  4264. ht.isEventKey(e, 'Space') || ht.isEventKey(e, 'Enter') ? e.stopPropagation() : t.prototype.handleKeyDown.call(this, e)
  4265. }),
  4266. e
  4267. )
  4268. })(C)
  4269. pt.registerComponent('Button', sn)
  4270. Bt = (function (n) {
  4271. function e(e, t) {
  4272. var i = n.call(this, e, t) || this
  4273. return (
  4274. (i.mouseused_ = !1),
  4275. i.on('mousedown', function (e) {
  4276. return i.handleMouseDown(e)
  4277. }),
  4278. i
  4279. )
  4280. }
  4281. mt(e, n)
  4282. var t = e.prototype
  4283. return (
  4284. (t.buildCSSClass = function () {
  4285. return 'vjs-big-play-button'
  4286. }),
  4287. (t.handleClick = function (e) {
  4288. var t = this.player_.play()
  4289. if (this.mouseused_ && e.clientX && e.clientY) {
  4290. var i = this.player_.usingPlugin('eme') && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length
  4291. return Et(t), void (!this.player_.tech(!0) || ((N || O) && i) || this.player_.tech(!0).focus())
  4292. }
  4293. var i = this.player_.getChild('controlBar'),
  4294. n = i && i.getChild('playToggle')
  4295. n
  4296. ? ((i = function () {
  4297. return n.focus()
  4298. }),
  4299. wt(t) ? t.then(i, function () {}) : this.setTimeout(i, 1))
  4300. : this.player_.tech(!0).focus()
  4301. }),
  4302. (t.handleKeyDown = function (e) {
  4303. ;(this.mouseused_ = !1), n.prototype.handleKeyDown.call(this, e)
  4304. }),
  4305. (t.handleMouseDown = function (e) {
  4306. this.mouseused_ = !0
  4307. }),
  4308. e
  4309. )
  4310. })(sn)
  4311. ;(Bt.prototype.controlText_ = 'Play Video'),
  4312. pt.registerComponent('BigPlayButton', Bt),
  4313. pt.registerComponent(
  4314. 'CloseButton',
  4315. (function (i) {
  4316. function e(e, t) {
  4317. e = i.call(this, e, t) || this
  4318. return e.controlText((t && t.controlText) || e.localize('Close')), e
  4319. }
  4320. mt(e, i)
  4321. var t = e.prototype
  4322. return (
  4323. (t.buildCSSClass = function () {
  4324. return 'vjs-close-button ' + i.prototype.buildCSSClass.call(this)
  4325. }),
  4326. (t.handleClick = function (e) {
  4327. this.trigger({ type: 'close', bubbles: !1 })
  4328. }),
  4329. (t.handleKeyDown = function (e) {
  4330. ht.isEventKey(e, 'Esc') ? (e.preventDefault(), e.stopPropagation(), this.trigger('click')) : i.prototype.handleKeyDown.call(this, e)
  4331. }),
  4332. e
  4333. )
  4334. })(sn)
  4335. )
  4336. Ft = (function (n) {
  4337. function e(e, t) {
  4338. var i = n.call(this, e, (t = void 0 === t ? {} : t)) || this
  4339. return (
  4340. (t.replay = void 0 === t.replay || t.replay),
  4341. i.on(e, 'play', function (e) {
  4342. return i.handlePlay(e)
  4343. }),
  4344. i.on(e, 'pause', function (e) {
  4345. return i.handlePause(e)
  4346. }),
  4347. t.replay &&
  4348. i.on(e, 'ended', function (e) {
  4349. return i.handleEnded(e)
  4350. }),
  4351. i
  4352. )
  4353. }
  4354. mt(e, n)
  4355. var t = e.prototype
  4356. return (
  4357. (t.buildCSSClass = function () {
  4358. return 'vjs-play-control ' + n.prototype.buildCSSClass.call(this)
  4359. }),
  4360. (t.handleClick = function (e) {
  4361. this.player_.paused() ? Et(this.player_.play()) : this.player_.pause()
  4362. }),
  4363. (t.handleSeeked = function (e) {
  4364. this.removeClass('vjs-ended'), this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
  4365. }),
  4366. (t.handlePlay = function (e) {
  4367. this.removeClass('vjs-ended'), this.removeClass('vjs-paused'), this.addClass('vjs-playing'), this.controlText('Pause')
  4368. }),
  4369. (t.handlePause = function (e) {
  4370. this.removeClass('vjs-playing'), this.addClass('vjs-paused'), this.controlText('Play')
  4371. }),
  4372. (t.handleEnded = function (e) {
  4373. var t = this
  4374. this.removeClass('vjs-playing'),
  4375. this.addClass('vjs-ended'),
  4376. this.controlText('Replay'),
  4377. this.one(this.player_, 'seeked', function (e) {
  4378. return t.handleSeeked(e)
  4379. })
  4380. }),
  4381. e
  4382. )
  4383. })(sn)
  4384. ;(Ft.prototype.controlText_ = 'Play'), pt.registerComponent('PlayToggle', Ft)
  4385. function on(e, t) {
  4386. e = e < 0 ? 0 : e
  4387. var i = Math.floor(e % 60),
  4388. n = Math.floor((e / 60) % 60),
  4389. r = Math.floor(e / 3600),
  4390. a = Math.floor((t / 60) % 60),
  4391. t = Math.floor(t / 3600)
  4392. return (r = 0 < (r = isNaN(e) || e === 1 / 0 ? (n = i = '-') : r) || 0 < t ? r + ':' : '') + (n = ((r || 10 <= a) && n < 10 ? '0' + n : n) + ':') + (i = i < 10 ? '0' + i : i)
  4393. }
  4394. var un = on
  4395. function ln(e, t) {
  4396. return un(e, (t = void 0 === t ? e : t))
  4397. }
  4398. k = (function (n) {
  4399. function e(e, t) {
  4400. var i = n.call(this, e, t) || this
  4401. return (
  4402. i.on(e, ['timeupdate', 'ended'], function (e) {
  4403. return i.updateContent(e)
  4404. }),
  4405. i.updateTextNode_(),
  4406. i
  4407. )
  4408. }
  4409. mt(e, n)
  4410. var t = e.prototype
  4411. return (
  4412. (t.createEl = function () {
  4413. var e = this.buildCSSClass(),
  4414. t = n.prototype.createEl.call(this, 'div', { className: e + ' vjs-time-control vjs-control' }),
  4415. i = $('span', { className: 'vjs-control-text', textContent: this.localize(this.labelText_) + ' ' }, { role: 'presentation' })
  4416. return t.appendChild(i), (this.contentEl_ = $('span', { className: e + '-display' }, { 'aria-live': 'off', role: 'presentation' })), t.appendChild(this.contentEl_), t
  4417. }),
  4418. (t.dispose = function () {
  4419. ;(this.contentEl_ = null), (this.textNode_ = null), n.prototype.dispose.call(this)
  4420. }),
  4421. (t.updateTextNode_ = function (e) {
  4422. var t = this
  4423. ;(e = ln((e = void 0 === e ? 0 : e))),
  4424. this.formattedTime_ !== e &&
  4425. ((this.formattedTime_ = e),
  4426. this.requestNamedAnimationFrame('TimeDisplay#updateTextNode_', function () {
  4427. var e
  4428. t.contentEl_ &&
  4429. ((e = t.textNode_) &&
  4430. t.contentEl_.firstChild !== e &&
  4431. ((e = null),
  4432. h.warn('TimeDisplay#updateTextnode_: Prevented replacement of text node element since it was no longer a child of this node. Appending a new node instead.')),
  4433. (t.textNode_ = document.createTextNode(t.formattedTime_)),
  4434. t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_)))
  4435. }))
  4436. }),
  4437. (t.updateContent = function (e) {}),
  4438. e
  4439. )
  4440. })(pt)
  4441. ;(k.prototype.labelText_ = 'Time'), (k.prototype.controlText_ = 'Time'), pt.registerComponent('TimeDisplay', k)
  4442. jt = (function (e) {
  4443. function t() {
  4444. return e.apply(this, arguments) || this
  4445. }
  4446. mt(t, e)
  4447. var i = t.prototype
  4448. return (
  4449. (i.buildCSSClass = function () {
  4450. return 'vjs-current-time'
  4451. }),
  4452. (i.updateContent = function (e) {
  4453. var t = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()
  4454. this.updateTextNode_(t)
  4455. }),
  4456. t
  4457. )
  4458. })(k)
  4459. ;(jt.prototype.labelText_ = 'Current Time'), (jt.prototype.controlText_ = 'Current Time'), pt.registerComponent('CurrentTimeDisplay', jt)
  4460. j = (function (n) {
  4461. function e(e, t) {
  4462. var i = n.call(this, e, t) || this,
  4463. t = function (e) {
  4464. return i.updateContent(e)
  4465. }
  4466. return i.on(e, 'durationchange', t), i.on(e, 'loadstart', t), i.on(e, 'loadedmetadata', t), i
  4467. }
  4468. mt(e, n)
  4469. var t = e.prototype
  4470. return (
  4471. (t.buildCSSClass = function () {
  4472. return 'vjs-duration'
  4473. }),
  4474. (t.updateContent = function (e) {
  4475. var t = this.player_.duration()
  4476. this.updateTextNode_(t)
  4477. }),
  4478. e
  4479. )
  4480. })(k)
  4481. ;(j.prototype.labelText_ = 'Duration'),
  4482. (j.prototype.controlText_ = 'Duration'),
  4483. pt.registerComponent('DurationDisplay', j),
  4484. pt.registerComponent(
  4485. 'TimeDivider',
  4486. (function (n) {
  4487. function e() {
  4488. return n.apply(this, arguments) || this
  4489. }
  4490. return (
  4491. mt(e, n),
  4492. (e.prototype.createEl = function () {
  4493. var e = n.prototype.createEl.call(this, 'div', { className: 'vjs-time-control vjs-time-divider' }, { 'aria-hidden': !0 }),
  4494. t = n.prototype.createEl.call(this, 'div'),
  4495. i = n.prototype.createEl.call(this, 'span', { textContent: '/' })
  4496. return t.appendChild(i), e.appendChild(t), e
  4497. }),
  4498. e
  4499. )
  4500. })(pt)
  4501. )
  4502. f = (function (n) {
  4503. function e(e, t) {
  4504. var i = n.call(this, e, t) || this
  4505. return (
  4506. i.on(e, 'durationchange', function (e) {
  4507. return i.updateContent(e)
  4508. }),
  4509. i
  4510. )
  4511. }
  4512. mt(e, n)
  4513. var t = e.prototype
  4514. return (
  4515. (t.buildCSSClass = function () {
  4516. return 'vjs-remaining-time'
  4517. }),
  4518. (t.createEl = function () {
  4519. var e = n.prototype.createEl.call(this)
  4520. return !1 !== this.options_.displayNegative && e.insertBefore($('span', {}, { 'aria-hidden': !0 }, '-'), this.contentEl_), e
  4521. }),
  4522. (t.updateContent = function (e) {
  4523. var t
  4524. 'number' == typeof this.player_.duration() &&
  4525. ((t = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime()), this.updateTextNode_(t))
  4526. }),
  4527. e
  4528. )
  4529. })(k)
  4530. ;(f.prototype.labelText_ = 'Remaining Time'),
  4531. (f.prototype.controlText_ = 'Remaining Time'),
  4532. pt.registerComponent('RemainingTimeDisplay', f),
  4533. pt.registerComponent(
  4534. 'LiveDisplay',
  4535. (function (n) {
  4536. function e(e, t) {
  4537. var i = n.call(this, e, t) || this
  4538. return (
  4539. i.updateShowing(),
  4540. i.on(i.player(), 'durationchange', function (e) {
  4541. return i.updateShowing(e)
  4542. }),
  4543. i
  4544. )
  4545. }
  4546. mt(e, n)
  4547. var t = e.prototype
  4548. return (
  4549. (t.createEl = function () {
  4550. var e = n.prototype.createEl.call(this, 'div', { className: 'vjs-live-control vjs-control' })
  4551. return (
  4552. (this.contentEl_ = $('div', { className: 'vjs-live-display' }, { 'aria-live': 'off' })),
  4553. this.contentEl_.appendChild($('span', { className: 'vjs-control-text', textContent: this.localize('Stream Type') + ' ' })),
  4554. this.contentEl_.appendChild(document.createTextNode(this.localize('LIVE'))),
  4555. e.appendChild(this.contentEl_),
  4556. e
  4557. )
  4558. }),
  4559. (t.dispose = function () {
  4560. ;(this.contentEl_ = null), n.prototype.dispose.call(this)
  4561. }),
  4562. (t.updateShowing = function (e) {
  4563. this.player().duration() === 1 / 0 ? this.show() : this.hide()
  4564. }),
  4565. e
  4566. )
  4567. })(pt)
  4568. )
  4569. ui = (function (n) {
  4570. function e(e, t) {
  4571. var i = n.call(this, e, t) || this
  4572. return (
  4573. i.updateLiveEdgeStatus(),
  4574. i.player_.liveTracker &&
  4575. ((i.updateLiveEdgeStatusHandler_ = function (e) {
  4576. return i.updateLiveEdgeStatus(e)
  4577. }),
  4578. i.on(i.player_.liveTracker, 'liveedgechange', i.updateLiveEdgeStatusHandler_)),
  4579. i
  4580. )
  4581. }
  4582. mt(e, n)
  4583. var t = e.prototype
  4584. return (
  4585. (t.createEl = function () {
  4586. var e = n.prototype.createEl.call(this, 'button', { className: 'vjs-seek-to-live-control vjs-control' })
  4587. return (this.textEl_ = $('span', { className: 'vjs-seek-to-live-text', textContent: this.localize('LIVE') }, { 'aria-hidden': 'true' })), e.appendChild(this.textEl_), e
  4588. }),
  4589. (t.updateLiveEdgeStatus = function () {
  4590. !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge()
  4591. ? (this.setAttribute('aria-disabled', !0), this.addClass('vjs-at-live-edge'), this.controlText('Seek to live, currently playing live'))
  4592. : (this.setAttribute('aria-disabled', !1), this.removeClass('vjs-at-live-edge'), this.controlText('Seek to live, currently behind live'))
  4593. }),
  4594. (t.handleClick = function () {
  4595. this.player_.liveTracker.seekToLiveEdge()
  4596. }),
  4597. (t.dispose = function () {
  4598. this.player_.liveTracker && this.off(this.player_.liveTracker, 'liveedgechange', this.updateLiveEdgeStatusHandler_), (this.textEl_ = null), n.prototype.dispose.call(this)
  4599. }),
  4600. e
  4601. )
  4602. })(sn)
  4603. ;(ui.prototype.controlText_ = 'Seek to live, currently playing live'), pt.registerComponent('SeekToLive', ui)
  4604. function cn(e, t, i) {
  4605. return (e = Number(e)), Math.min(i, Math.max(t, isNaN(e) ? t : e))
  4606. }
  4607. li = (function (n) {
  4608. function e(e, t) {
  4609. var i = n.call(this, e, t) || this
  4610. return (
  4611. (i.handleMouseDown_ = function (e) {
  4612. return i.handleMouseDown(e)
  4613. }),
  4614. (i.handleMouseUp_ = function (e) {
  4615. return i.handleMouseUp(e)
  4616. }),
  4617. (i.handleKeyDown_ = function (e) {
  4618. return i.handleKeyDown(e)
  4619. }),
  4620. (i.handleClick_ = function (e) {
  4621. return i.handleClick(e)
  4622. }),
  4623. (i.handleMouseMove_ = function (e) {
  4624. return i.handleMouseMove(e)
  4625. }),
  4626. (i.update_ = function (e) {
  4627. return i.update(e)
  4628. }),
  4629. (i.bar = i.getChild(i.options_.barName)),
  4630. i.vertical(!!i.options_.vertical),
  4631. i.enable(),
  4632. i
  4633. )
  4634. }
  4635. mt(e, n)
  4636. var t = e.prototype
  4637. return (
  4638. (t.enabled = function () {
  4639. return this.enabled_
  4640. }),
  4641. (t.enable = function () {
  4642. this.enabled() ||
  4643. (this.on('mousedown', this.handleMouseDown_),
  4644. this.on('touchstart', this.handleMouseDown_),
  4645. this.on('keydown', this.handleKeyDown_),
  4646. this.on('click', this.handleClick_),
  4647. this.on(this.player_, 'controlsvisible', this.update),
  4648. this.playerEvent && this.on(this.player_, this.playerEvent, this.update),
  4649. this.removeClass('disabled'),
  4650. this.setAttribute('tabindex', 0),
  4651. (this.enabled_ = !0))
  4652. }),
  4653. (t.disable = function () {
  4654. var e
  4655. this.enabled() &&
  4656. ((e = this.bar.el_.ownerDocument),
  4657. this.off('mousedown', this.handleMouseDown_),
  4658. this.off('touchstart', this.handleMouseDown_),
  4659. this.off('keydown', this.handleKeyDown_),
  4660. this.off('click', this.handleClick_),
  4661. this.off(this.player_, 'controlsvisible', this.update_),
  4662. this.off(e, 'mousemove', this.handleMouseMove_),
  4663. this.off(e, 'mouseup', this.handleMouseUp_),
  4664. this.off(e, 'touchmove', this.handleMouseMove_),
  4665. this.off(e, 'touchend', this.handleMouseUp_),
  4666. this.removeAttribute('tabindex'),
  4667. this.addClass('disabled'),
  4668. this.playerEvent && this.off(this.player_, this.playerEvent, this.update),
  4669. (this.enabled_ = !1))
  4670. }),
  4671. (t.createEl = function (e, t, i) {
  4672. return (
  4673. void 0 === i && (i = {}),
  4674. ((t = void 0 === t ? {} : t).className = t.className + ' vjs-slider'),
  4675. (t = b({ tabIndex: 0 }, t)),
  4676. (i = b({ role: 'slider', 'aria-valuenow': 0, 'aria-valuemin': 0, 'aria-valuemax': 100, tabIndex: 0 }, i)),
  4677. n.prototype.createEl.call(this, e, t, i)
  4678. )
  4679. }),
  4680. (t.handleMouseDown = function (e) {
  4681. var t = this.bar.el_.ownerDocument
  4682. 'mousedown' === e.type && e.preventDefault(),
  4683. 'touchstart' !== e.type || M || e.preventDefault(),
  4684. le(),
  4685. this.addClass('vjs-sliding'),
  4686. this.trigger('slideractive'),
  4687. this.on(t, 'mousemove', this.handleMouseMove_),
  4688. this.on(t, 'mouseup', this.handleMouseUp_),
  4689. this.on(t, 'touchmove', this.handleMouseMove_),
  4690. this.on(t, 'touchend', this.handleMouseUp_),
  4691. this.handleMouseMove(e, !0)
  4692. }),
  4693. (t.handleMouseMove = function (e) {}),
  4694. (t.handleMouseUp = function () {
  4695. var e = this.bar.el_.ownerDocument
  4696. ce(),
  4697. this.removeClass('vjs-sliding'),
  4698. this.trigger('sliderinactive'),
  4699. this.off(e, 'mousemove', this.handleMouseMove_),
  4700. this.off(e, 'mouseup', this.handleMouseUp_),
  4701. this.off(e, 'touchmove', this.handleMouseMove_),
  4702. this.off(e, 'touchend', this.handleMouseUp_),
  4703. this.update()
  4704. }),
  4705. (t.update = function () {
  4706. var t = this
  4707. if (this.el_ && this.bar) {
  4708. var i = this.getProgress()
  4709. return i === this.progress_
  4710. ? i
  4711. : ((this.progress_ = i),
  4712. this.requestNamedAnimationFrame('Slider#update', function () {
  4713. var e = t.vertical() ? 'height' : 'width'
  4714. t.bar.el().style[e] = (100 * i).toFixed(2) + '%'
  4715. }),
  4716. i)
  4717. }
  4718. }),
  4719. (t.getProgress = function () {
  4720. return Number(cn(this.getPercent(), 0, 1).toFixed(4))
  4721. }),
  4722. (t.calculateDistance = function (e) {
  4723. e = pe(this.el_, e)
  4724. return this.vertical() ? e.y : e.x
  4725. }),
  4726. (t.handleKeyDown = function (e) {
  4727. ht.isEventKey(e, 'Left') || ht.isEventKey(e, 'Down')
  4728. ? (e.preventDefault(), e.stopPropagation(), this.stepBack())
  4729. : ht.isEventKey(e, 'Right') || ht.isEventKey(e, 'Up')
  4730. ? (e.preventDefault(), e.stopPropagation(), this.stepForward())
  4731. : n.prototype.handleKeyDown.call(this, e)
  4732. }),
  4733. (t.handleClick = function (e) {
  4734. e.stopPropagation(), e.preventDefault()
  4735. }),
  4736. (t.vertical = function (e) {
  4737. if (void 0 === e) return this.vertical_ || !1
  4738. ;(this.vertical_ = !!e), this.vertical_ ? this.addClass('vjs-slider-vertical') : this.addClass('vjs-slider-horizontal')
  4739. }),
  4740. e
  4741. )
  4742. })(pt)
  4743. pt.registerComponent('Slider', li)
  4744. function dn(e, t) {
  4745. return cn((e / t) * 100, 0, 100).toFixed(2) + '%'
  4746. }
  4747. pt.registerComponent(
  4748. 'LoadProgressBar',
  4749. (function (r) {
  4750. function e(e, t) {
  4751. var i = r.call(this, e, t) || this
  4752. return (
  4753. (i.partEls_ = []),
  4754. i.on(e, 'progress', function (e) {
  4755. return i.update(e)
  4756. }),
  4757. i
  4758. )
  4759. }
  4760. mt(e, r)
  4761. var t = e.prototype
  4762. return (
  4763. (t.createEl = function () {
  4764. var e = r.prototype.createEl.call(this, 'div', { className: 'vjs-load-progress' }),
  4765. t = $('span', { className: 'vjs-control-text' }),
  4766. i = $('span', { textContent: this.localize('Loaded') }),
  4767. n = document.createTextNode(': ')
  4768. return (
  4769. (this.percentageEl_ = $('span', { className: 'vjs-control-text-loaded-percentage', textContent: '0%' })),
  4770. e.appendChild(t),
  4771. t.appendChild(i),
  4772. t.appendChild(n),
  4773. t.appendChild(this.percentageEl_),
  4774. e
  4775. )
  4776. }),
  4777. (t.dispose = function () {
  4778. ;(this.partEls_ = null), (this.percentageEl_ = null), r.prototype.dispose.call(this)
  4779. }),
  4780. (t.update = function (e) {
  4781. var l = this
  4782. this.requestNamedAnimationFrame('LoadProgressBar#update', function () {
  4783. var e = l.player_.liveTracker,
  4784. t = l.player_.buffered(),
  4785. e = e && e.isLive() ? e.seekableEnd() : l.player_.duration(),
  4786. i = l.player_.bufferedEnd(),
  4787. n = l.partEls_,
  4788. e = dn(i, e)
  4789. l.percent_ !== e && ((l.el_.style.width = e), J(l.percentageEl_, e), (l.percent_ = e))
  4790. for (var r = 0; r < t.length; r++) {
  4791. var a = t.start(r),
  4792. s = t.end(r),
  4793. o = n[r]
  4794. o || ((o = l.el_.appendChild($())), (n[r] = o)),
  4795. (o.dataset.start === a && o.dataset.end === s) || ((o.dataset.start = a), (o.dataset.end = s), (o.style.left = dn(a, i)), (o.style.width = dn(s - a, i)))
  4796. }
  4797. for (var u = n.length; u > t.length; u--) l.el_.removeChild(n[u - 1])
  4798. n.length = t.length
  4799. })
  4800. }),
  4801. e
  4802. )
  4803. })(pt)
  4804. ),
  4805. pt.registerComponent(
  4806. 'TimeTooltip',
  4807. (function (i) {
  4808. function e(e, t) {
  4809. t = i.call(this, e, t) || this
  4810. return (t.update = We(Ve(ft(t), t.update), 30)), t
  4811. }
  4812. mt(e, i)
  4813. var t = e.prototype
  4814. return (
  4815. (t.createEl = function () {
  4816. return i.prototype.createEl.call(this, 'div', { className: 'vjs-time-tooltip' }, { 'aria-hidden': 'true' })
  4817. }),
  4818. (t.update = function (e, t, i) {
  4819. var n = he(this.el_),
  4820. r = de(this.player_.el()),
  4821. a = e.width * t
  4822. r &&
  4823. n &&
  4824. ((t = e.left - r.left + a),
  4825. (r = e.width - a + (r.right - e.right)),
  4826. t < (e = n.width / 2) ? (e += e - t) : r < e && (e = r),
  4827. e < 0 ? (e = 0) : e > n.width && (e = n.width),
  4828. (e = Math.round(e)),
  4829. (this.el_.style.right = '-' + e + 'px'),
  4830. this.write(i))
  4831. }),
  4832. (t.write = function (e) {
  4833. J(this.el_, e)
  4834. }),
  4835. (t.updateTime = function (n, r, a, s) {
  4836. var o = this
  4837. this.requestNamedAnimationFrame('TimeTooltip#updateTime', function () {
  4838. var e,
  4839. t,
  4840. i = o.player_.duration()
  4841. ;(i = o.player_.liveTracker && o.player_.liveTracker.isLive() ? ((t = (e = o.player_.liveTracker.liveWindow()) - r * e) < 1 ? '' : '-') + ln(t, e) : ln(a, i)),
  4842. o.update(n, r, i),
  4843. s && s()
  4844. })
  4845. }),
  4846. e
  4847. )
  4848. })(pt)
  4849. )
  4850. Xt = (function (i) {
  4851. function e(e, t) {
  4852. t = i.call(this, e, t) || this
  4853. return (t.update = We(Ve(ft(t), t.update), 30)), t
  4854. }
  4855. mt(e, i)
  4856. var t = e.prototype
  4857. return (
  4858. (t.createEl = function () {
  4859. return i.prototype.createEl.call(this, 'div', { className: 'vjs-play-progress vjs-slider-bar' }, { 'aria-hidden': 'true' })
  4860. }),
  4861. (t.update = function (e, t) {
  4862. var i,
  4863. n = this.getChild('timeTooltip')
  4864. n && ((i = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()), n.updateTime(e, t, i))
  4865. }),
  4866. e
  4867. )
  4868. })(pt)
  4869. ;(Xt.prototype.options_ = { children: [] }), q || A || Xt.prototype.options_.children.push('timeTooltip'), pt.registerComponent('PlayProgressBar', Xt)
  4870. I = (function (i) {
  4871. function e(e, t) {
  4872. t = i.call(this, e, t) || this
  4873. return (t.update = We(Ve(ft(t), t.update), 30)), t
  4874. }
  4875. mt(e, i)
  4876. var t = e.prototype
  4877. return (
  4878. (t.createEl = function () {
  4879. return i.prototype.createEl.call(this, 'div', { className: 'vjs-mouse-display' })
  4880. }),
  4881. (t.update = function (e, t) {
  4882. var i = this,
  4883. n = t * this.player_.duration()
  4884. this.getChild('timeTooltip').updateTime(e, t, n, function () {
  4885. i.el_.style.left = e.width * t + 'px'
  4886. })
  4887. }),
  4888. e
  4889. )
  4890. })(pt)
  4891. ;(I.prototype.options_ = { children: ['timeTooltip'] }), pt.registerComponent('MouseTimeDisplay', I)
  4892. Bt = (function (a) {
  4893. function e(e, t) {
  4894. t = a.call(this, e, t) || this
  4895. return t.setEventHandlers_(), t
  4896. }
  4897. mt(e, a)
  4898. var t = e.prototype
  4899. return (
  4900. (t.setEventHandlers_ = function () {
  4901. var t = this
  4902. ;(this.update_ = Ve(this, this.update)),
  4903. (this.update = We(this.update_, 30)),
  4904. this.on(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update),
  4905. this.player_.liveTracker && this.on(this.player_.liveTracker, 'liveedgechange', this.update),
  4906. (this.updateInterval = null),
  4907. (this.enableIntervalHandler_ = function (e) {
  4908. return t.enableInterval_(e)
  4909. }),
  4910. (this.disableIntervalHandler_ = function (e) {
  4911. return t.disableInterval_(e)
  4912. }),
  4913. this.on(this.player_, ['playing'], this.enableIntervalHandler_),
  4914. this.on(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_),
  4915. 'hidden' in document && 'visibilityState' in document && this.on(document, 'visibilitychange', this.toggleVisibility_)
  4916. }),
  4917. (t.toggleVisibility_ = function (e) {
  4918. 'hidden' === document.visibilityState
  4919. ? (this.cancelNamedAnimationFrame('SeekBar#update'), this.cancelNamedAnimationFrame('Slider#update'), this.disableInterval_(e))
  4920. : (this.player_.ended() || this.player_.paused() || this.enableInterval_(), this.update())
  4921. }),
  4922. (t.enableInterval_ = function () {
  4923. this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30))
  4924. }),
  4925. (t.disableInterval_ = function (e) {
  4926. ;(this.player_.liveTracker && this.player_.liveTracker.isLive() && e && 'ended' !== e.type) ||
  4927. (this.updateInterval && (this.clearInterval(this.updateInterval), (this.updateInterval = null)))
  4928. }),
  4929. (t.createEl = function () {
  4930. return a.prototype.createEl.call(this, 'div', { className: 'vjs-progress-holder' }, { 'aria-label': this.localize('Progress Bar') })
  4931. }),
  4932. (t.update = function (e) {
  4933. var n = this
  4934. if ('hidden' !== document.visibilityState) {
  4935. var r = a.prototype.update.call(this)
  4936. return (
  4937. this.requestNamedAnimationFrame('SeekBar#update', function () {
  4938. var e = n.player_.ended() ? n.player_.duration() : n.getCurrentTime_(),
  4939. t = n.player_.liveTracker,
  4940. i = n.player_.duration()
  4941. t && t.isLive() && (i = n.player_.liveTracker.liveCurrentTime()),
  4942. n.percent_ !== r && (n.el_.setAttribute('aria-valuenow', (100 * r).toFixed(2)), (n.percent_ = r)),
  4943. (n.currentTime_ === e && n.duration_ === i) ||
  4944. (n.el_.setAttribute('aria-valuetext', n.localize('progress bar timing: currentTime={1} duration={2}', [ln(e, i), ln(i, i)], '{1} of {2}')),
  4945. (n.currentTime_ = e),
  4946. (n.duration_ = i)),
  4947. n.bar && n.bar.update(de(n.el()), n.getProgress())
  4948. }),
  4949. r
  4950. )
  4951. }
  4952. }),
  4953. (t.userSeek_ = function (e) {
  4954. this.player_.liveTracker && this.player_.liveTracker.isLive() && this.player_.liveTracker.nextSeekedFromUser(), this.player_.currentTime(e)
  4955. }),
  4956. (t.getCurrentTime_ = function () {
  4957. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()
  4958. }),
  4959. (t.getPercent = function () {
  4960. var e,
  4961. t = this.getCurrentTime_(),
  4962. i = this.player_.liveTracker
  4963. return i && i.isLive() ? ((e = (t - i.seekableStart()) / i.liveWindow()), i.atLiveEdge() && (e = 1)) : (e = t / this.player_.duration()), e
  4964. }),
  4965. (t.handleMouseDown = function (e) {
  4966. _e(e) && (e.stopPropagation(), (this.videoWasPlaying = !this.player_.paused()), this.player_.pause(), a.prototype.handleMouseDown.call(this, e))
  4967. }),
  4968. (t.handleMouseMove = function (e, t) {
  4969. if ((void 0 === t && (t = !1), _e(e))) {
  4970. t || this.player_.scrubbing() || this.player_.scrubbing(!0)
  4971. var i = this.calculateDistance(e),
  4972. n = this.player_.liveTracker
  4973. if (n && n.isLive()) {
  4974. if (0.99 <= i) return void n.seekToLiveEdge()
  4975. var r,
  4976. t = n.seekableStart(),
  4977. e = n.liveCurrentTime()
  4978. if ((r = (r = e <= (r = t + i * n.liveWindow()) ? e : r) <= t ? t + 0.1 : r) === 1 / 0) return
  4979. } else (r = i * this.player_.duration()) === this.player_.duration() && (r -= 0.1)
  4980. this.userSeek_(r)
  4981. }
  4982. }),
  4983. (t.enable = function () {
  4984. a.prototype.enable.call(this)
  4985. var e = this.getChild('mouseTimeDisplay')
  4986. e && e.show()
  4987. }),
  4988. (t.disable = function () {
  4989. a.prototype.disable.call(this)
  4990. var e = this.getChild('mouseTimeDisplay')
  4991. e && e.hide()
  4992. }),
  4993. (t.handleMouseUp = function (e) {
  4994. a.prototype.handleMouseUp.call(this, e),
  4995. e && e.stopPropagation(),
  4996. this.player_.scrubbing(!1),
  4997. this.player_.trigger({ type: 'timeupdate', target: this, manuallyTriggered: !0 }),
  4998. this.videoWasPlaying ? Et(this.player_.play()) : this.update_()
  4999. }),
  5000. (t.stepForward = function () {
  5001. this.userSeek_(this.player_.currentTime() + 5)
  5002. }),
  5003. (t.stepBack = function () {
  5004. this.userSeek_(this.player_.currentTime() - 5)
  5005. }),
  5006. (t.handleAction = function (e) {
  5007. this.player_.paused() ? this.player_.play() : this.player_.pause()
  5008. }),
  5009. (t.handleKeyDown = function (e) {
  5010. var t,
  5011. i = this.player_.liveTracker
  5012. ht.isEventKey(e, 'Space') || ht.isEventKey(e, 'Enter')
  5013. ? (e.preventDefault(), e.stopPropagation(), this.handleAction(e))
  5014. : ht.isEventKey(e, 'Home')
  5015. ? (e.preventDefault(), e.stopPropagation(), this.userSeek_(0))
  5016. : ht.isEventKey(e, 'End')
  5017. ? (e.preventDefault(), e.stopPropagation(), i && i.isLive() ? this.userSeek_(i.liveCurrentTime()) : this.userSeek_(this.player_.duration()))
  5018. : /^[0-9]$/.test(ht(e))
  5019. ? (e.preventDefault(),
  5020. e.stopPropagation(),
  5021. (t = (10 * (ht.codes[ht(e)] - ht.codes[0])) / 100),
  5022. i && i.isLive() ? this.userSeek_(i.seekableStart() + i.liveWindow() * t) : this.userSeek_(this.player_.duration() * t))
  5023. : ht.isEventKey(e, 'PgDn')
  5024. ? (e.preventDefault(), e.stopPropagation(), this.userSeek_(this.player_.currentTime() - 60))
  5025. : ht.isEventKey(e, 'PgUp')
  5026. ? (e.preventDefault(), e.stopPropagation(), this.userSeek_(this.player_.currentTime() + 60))
  5027. : a.prototype.handleKeyDown.call(this, e)
  5028. }),
  5029. (t.dispose = function () {
  5030. this.disableInterval_(),
  5031. this.off(this.player_, ['ended', 'durationchange', 'timeupdate'], this.update),
  5032. this.player_.liveTracker && this.off(this.player_.liveTracker, 'liveedgechange', this.update),
  5033. this.off(this.player_, ['playing'], this.enableIntervalHandler_),
  5034. this.off(this.player_, ['ended', 'pause', 'waiting'], this.disableIntervalHandler_),
  5035. 'hidden' in document && 'visibilityState' in document && this.off(document, 'visibilitychange', this.toggleVisibility_),
  5036. a.prototype.dispose.call(this)
  5037. }),
  5038. e
  5039. )
  5040. })(li)
  5041. ;(Bt.prototype.options_ = { children: ['loadProgressBar', 'playProgressBar'], barName: 'playProgressBar' }),
  5042. q || A || Bt.prototype.options_.children.splice(1, 0, 'mouseTimeDisplay'),
  5043. pt.registerComponent('SeekBar', Bt)
  5044. Ft = (function (n) {
  5045. function e(e, t) {
  5046. var i = n.call(this, e, t) || this
  5047. return (
  5048. (i.handleMouseMove = We(Ve(ft(i), i.handleMouseMove), 30)),
  5049. (i.throttledHandleMouseSeek = We(Ve(ft(i), i.handleMouseSeek), 30)),
  5050. (i.handleMouseUpHandler_ = function (e) {
  5051. return i.handleMouseUp(e)
  5052. }),
  5053. (i.handleMouseDownHandler_ = function (e) {
  5054. return i.handleMouseDown(e)
  5055. }),
  5056. i.enable(),
  5057. i
  5058. )
  5059. }
  5060. mt(e, n)
  5061. var t = e.prototype
  5062. return (
  5063. (t.createEl = function () {
  5064. return n.prototype.createEl.call(this, 'div', { className: 'vjs-progress-control vjs-control' })
  5065. }),
  5066. (t.handleMouseMove = function (e) {
  5067. var t,
  5068. i,
  5069. n,
  5070. r,
  5071. a = this.getChild('seekBar')
  5072. a &&
  5073. ((t = a.getChild('playProgressBar')),
  5074. (i = a.getChild('mouseTimeDisplay')),
  5075. (t || i) && ((r = he((n = a.el()))), (e = pe(n, e).x), (e = cn(e, 0, 1)), i && i.update(r, e), t && t.update(r, a.getProgress())))
  5076. }),
  5077. (t.handleMouseSeek = function (e) {
  5078. var t = this.getChild('seekBar')
  5079. t && t.handleMouseMove(e)
  5080. }),
  5081. (t.enabled = function () {
  5082. return this.enabled_
  5083. }),
  5084. (t.disable = function () {
  5085. var e
  5086. this.children().forEach(function (e) {
  5087. return e.disable && e.disable()
  5088. }),
  5089. this.enabled() &&
  5090. (this.off(['mousedown', 'touchstart'], this.handleMouseDownHandler_),
  5091. this.off(this.el_, 'mousemove', this.handleMouseMove),
  5092. this.removeListenersAddedOnMousedownAndTouchstart(),
  5093. this.addClass('disabled'),
  5094. (this.enabled_ = !1),
  5095. this.player_.scrubbing() && ((e = this.getChild('seekBar')), this.player_.scrubbing(!1), e.videoWasPlaying && Et(this.player_.play())))
  5096. }),
  5097. (t.enable = function () {
  5098. this.children().forEach(function (e) {
  5099. return e.enable && e.enable()
  5100. }),
  5101. this.enabled() ||
  5102. (this.on(['mousedown', 'touchstart'], this.handleMouseDownHandler_), this.on(this.el_, 'mousemove', this.handleMouseMove), this.removeClass('disabled'), (this.enabled_ = !0))
  5103. }),
  5104. (t.removeListenersAddedOnMousedownAndTouchstart = function () {
  5105. var e = this.el_.ownerDocument
  5106. this.off(e, 'mousemove', this.throttledHandleMouseSeek),
  5107. this.off(e, 'touchmove', this.throttledHandleMouseSeek),
  5108. this.off(e, 'mouseup', this.handleMouseUpHandler_),
  5109. this.off(e, 'touchend', this.handleMouseUpHandler_)
  5110. }),
  5111. (t.handleMouseDown = function (e) {
  5112. var t = this.el_.ownerDocument,
  5113. i = this.getChild('seekBar')
  5114. i && i.handleMouseDown(e),
  5115. this.on(t, 'mousemove', this.throttledHandleMouseSeek),
  5116. this.on(t, 'touchmove', this.throttledHandleMouseSeek),
  5117. this.on(t, 'mouseup', this.handleMouseUpHandler_),
  5118. this.on(t, 'touchend', this.handleMouseUpHandler_)
  5119. }),
  5120. (t.handleMouseUp = function (e) {
  5121. var t = this.getChild('seekBar')
  5122. t && t.handleMouseUp(e), this.removeListenersAddedOnMousedownAndTouchstart()
  5123. }),
  5124. e
  5125. )
  5126. })(pt)
  5127. ;(Ft.prototype.options_ = { children: ['seekBar'] }), pt.registerComponent('ProgressControl', Ft)
  5128. jt = (function (n) {
  5129. function e(e, t) {
  5130. var i = n.call(this, e, t) || this
  5131. return (
  5132. i.on(e, ['enterpictureinpicture', 'leavepictureinpicture'], function (e) {
  5133. return i.handlePictureInPictureChange(e)
  5134. }),
  5135. i.on(e, ['disablepictureinpicturechanged', 'loadedmetadata'], function (e) {
  5136. return i.handlePictureInPictureEnabledChange(e)
  5137. }),
  5138. i.on(e, ['loadedmetadata', 'audioonlymodechange', 'audiopostermodechange'], function () {
  5139. 'audio' === e.currentType().substring(0, 5) || e.audioPosterMode() || e.audioOnlyMode() ? (e.isInPictureInPicture() && e.exitPictureInPicture(), i.hide()) : i.show()
  5140. }),
  5141. i.disable(),
  5142. i
  5143. )
  5144. }
  5145. mt(e, n)
  5146. var t = e.prototype
  5147. return (
  5148. (t.buildCSSClass = function () {
  5149. return 'vjs-picture-in-picture-control ' + n.prototype.buildCSSClass.call(this)
  5150. }),
  5151. (t.handlePictureInPictureEnabledChange = function () {
  5152. document.pictureInPictureEnabled && !1 === this.player_.disablePictureInPicture() ? this.enable() : this.disable()
  5153. }),
  5154. (t.handlePictureInPictureChange = function (e) {
  5155. this.player_.isInPictureInPicture() ? this.controlText('Exit Picture-in-Picture') : this.controlText('Picture-in-Picture'), this.handlePictureInPictureEnabledChange()
  5156. }),
  5157. (t.handleClick = function (e) {
  5158. this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture()
  5159. }),
  5160. e
  5161. )
  5162. })(sn)
  5163. ;(jt.prototype.controlText_ = 'Picture-in-Picture'), pt.registerComponent('PictureInPictureToggle', jt)
  5164. j = (function (n) {
  5165. function e(e, t) {
  5166. var i = n.call(this, e, t) || this
  5167. return (
  5168. i.on(e, 'fullscreenchange', function (e) {
  5169. return i.handleFullscreenChange(e)
  5170. }),
  5171. !1 === document[e.fsApi_.fullscreenEnabled] && i.disable(),
  5172. i
  5173. )
  5174. }
  5175. mt(e, n)
  5176. var t = e.prototype
  5177. return (
  5178. (t.buildCSSClass = function () {
  5179. return 'vjs-fullscreen-control ' + n.prototype.buildCSSClass.call(this)
  5180. }),
  5181. (t.handleFullscreenChange = function (e) {
  5182. this.player_.isFullscreen() ? this.controlText('Non-Fullscreen') : this.controlText('Fullscreen')
  5183. }),
  5184. (t.handleClick = function (e) {
  5185. this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen()
  5186. }),
  5187. e
  5188. )
  5189. })(sn)
  5190. ;(j.prototype.controlText_ = 'Fullscreen'), pt.registerComponent('FullscreenToggle', j)
  5191. pt.registerComponent(
  5192. 'VolumeLevel',
  5193. (function (t) {
  5194. function e() {
  5195. return t.apply(this, arguments) || this
  5196. }
  5197. return (
  5198. mt(e, t),
  5199. (e.prototype.createEl = function () {
  5200. var e = t.prototype.createEl.call(this, 'div', { className: 'vjs-volume-level' })
  5201. return e.appendChild(t.prototype.createEl.call(this, 'span', { className: 'vjs-control-text' })), e
  5202. }),
  5203. e
  5204. )
  5205. })(pt)
  5206. ),
  5207. pt.registerComponent(
  5208. 'VolumeLevelTooltip',
  5209. (function (i) {
  5210. function e(e, t) {
  5211. t = i.call(this, e, t) || this
  5212. return (t.update = We(Ve(ft(t), t.update), 30)), t
  5213. }
  5214. mt(e, i)
  5215. var t = e.prototype
  5216. return (
  5217. (t.createEl = function () {
  5218. return i.prototype.createEl.call(this, 'div', { className: 'vjs-volume-tooltip' }, { 'aria-hidden': 'true' })
  5219. }),
  5220. (t.update = function (e, t, i, n) {
  5221. if (!i) {
  5222. var r = de(this.el_),
  5223. a = de(this.player_.el()),
  5224. i = e.width * t
  5225. if (!a || !r) return
  5226. ;(t = e.left - a.left + i), (a = e.width - i + (a.right - e.right)), (e = r.width / 2)
  5227. t < e ? (e += e - t) : a < e && (e = a), e < 0 ? (e = 0) : e > r.width && (e = r.width), (this.el_.style.right = '-' + e + 'px')
  5228. }
  5229. this.write(n + '%')
  5230. }),
  5231. (t.write = function (e) {
  5232. J(this.el_, e)
  5233. }),
  5234. (t.updateVolume = function (e, t, i, n, r) {
  5235. var a = this
  5236. this.requestNamedAnimationFrame('VolumeLevelTooltip#updateVolume', function () {
  5237. a.update(e, t, i, n.toFixed(0)), r && r()
  5238. })
  5239. }),
  5240. e
  5241. )
  5242. })(pt)
  5243. )
  5244. k = (function (i) {
  5245. function e(e, t) {
  5246. t = i.call(this, e, t) || this
  5247. return (t.update = We(Ve(ft(t), t.update), 30)), t
  5248. }
  5249. mt(e, i)
  5250. var t = e.prototype
  5251. return (
  5252. (t.createEl = function () {
  5253. return i.prototype.createEl.call(this, 'div', { className: 'vjs-mouse-display' })
  5254. }),
  5255. (t.update = function (e, t, i) {
  5256. var n = this,
  5257. r = 100 * t
  5258. this.getChild('volumeLevelTooltip').updateVolume(e, t, i, r, function () {
  5259. i ? (n.el_.style.bottom = e.height * t + 'px') : (n.el_.style.left = e.width * t + 'px')
  5260. })
  5261. }),
  5262. e
  5263. )
  5264. })(pt)
  5265. ;(k.prototype.options_ = { children: ['volumeLevelTooltip'] }), pt.registerComponent('MouseVolumeLevelDisplay', k)
  5266. f = (function (n) {
  5267. function e(e, t) {
  5268. var i = n.call(this, e, t) || this
  5269. return (
  5270. i.on('slideractive', function (e) {
  5271. return i.updateLastVolume_(e)
  5272. }),
  5273. i.on(e, 'volumechange', function (e) {
  5274. return i.updateARIAAttributes(e)
  5275. }),
  5276. e.ready(function () {
  5277. return i.updateARIAAttributes()
  5278. }),
  5279. i
  5280. )
  5281. }
  5282. mt(e, n)
  5283. var t = e.prototype
  5284. return (
  5285. (t.createEl = function () {
  5286. return n.prototype.createEl.call(this, 'div', { className: 'vjs-volume-bar vjs-slider-bar' }, { 'aria-label': this.localize('Volume Level'), 'aria-live': 'polite' })
  5287. }),
  5288. (t.handleMouseDown = function (e) {
  5289. _e(e) && n.prototype.handleMouseDown.call(this, e)
  5290. }),
  5291. (t.handleMouseMove = function (e) {
  5292. var t,
  5293. i,
  5294. n,
  5295. r = this.getChild('mouseVolumeLevelDisplay')
  5296. r && ((t = de((n = this.el()))), (i = this.vertical()), (n = pe(n, e)), (n = i ? n.y : n.x), (n = cn(n, 0, 1)), r.update(t, n, i)),
  5297. _e(e) && (this.checkMuted(), this.player_.volume(this.calculateDistance(e)))
  5298. }),
  5299. (t.checkMuted = function () {
  5300. this.player_.muted() && this.player_.muted(!1)
  5301. }),
  5302. (t.getPercent = function () {
  5303. return this.player_.muted() ? 0 : this.player_.volume()
  5304. }),
  5305. (t.stepForward = function () {
  5306. this.checkMuted(), this.player_.volume(this.player_.volume() + 0.1)
  5307. }),
  5308. (t.stepBack = function () {
  5309. this.checkMuted(), this.player_.volume(this.player_.volume() - 0.1)
  5310. }),
  5311. (t.updateARIAAttributes = function (e) {
  5312. var t = this.player_.muted() ? 0 : this.volumeAsPercentage_()
  5313. this.el_.setAttribute('aria-valuenow', t), this.el_.setAttribute('aria-valuetext', t + '%')
  5314. }),
  5315. (t.volumeAsPercentage_ = function () {
  5316. return Math.round(100 * this.player_.volume())
  5317. }),
  5318. (t.updateLastVolume_ = function () {
  5319. var e = this,
  5320. t = this.player_.volume()
  5321. this.one('sliderinactive', function () {
  5322. 0 === e.player_.volume() && e.player_.lastVolume_(t)
  5323. })
  5324. }),
  5325. e
  5326. )
  5327. })(li)
  5328. ;(f.prototype.options_ = { children: ['volumeLevel'], barName: 'volumeLevel' }),
  5329. q || A || f.prototype.options_.children.splice(0, 0, 'mouseVolumeLevelDisplay'),
  5330. (f.prototype.playerEvent = 'volumechange'),
  5331. pt.registerComponent('VolumeBar', f)
  5332. ui = (function (a) {
  5333. function e(e, t) {
  5334. var i, n, r
  5335. return (
  5336. ((t = void 0 === t ? {} : t).vertical = t.vertical || !1),
  5337. ('undefined' != typeof t.volumeBar && !S(t.volumeBar)) || ((t.volumeBar = t.volumeBar || {}), (t.volumeBar.vertical = t.vertical)),
  5338. (i = a.call(this, e, t) || this),
  5339. (n = ft(i)),
  5340. (r = e).tech_ && !r.tech_.featuresVolumeControl && n.addClass('vjs-hidden'),
  5341. n.on(r, 'loadstart', function () {
  5342. r.tech_.featuresVolumeControl ? n.removeClass('vjs-hidden') : n.addClass('vjs-hidden')
  5343. }),
  5344. (i.throttledHandleMouseMove = We(Ve(ft(i), i.handleMouseMove), 30)),
  5345. (i.handleMouseUpHandler_ = function (e) {
  5346. return i.handleMouseUp(e)
  5347. }),
  5348. i.on('mousedown', function (e) {
  5349. return i.handleMouseDown(e)
  5350. }),
  5351. i.on('touchstart', function (e) {
  5352. return i.handleMouseDown(e)
  5353. }),
  5354. i.on('mousemove', function (e) {
  5355. return i.handleMouseMove(e)
  5356. }),
  5357. i.on(i.volumeBar, ['focus', 'slideractive'], function () {
  5358. i.volumeBar.addClass('vjs-slider-active'), i.addClass('vjs-slider-active'), i.trigger('slideractive')
  5359. }),
  5360. i.on(i.volumeBar, ['blur', 'sliderinactive'], function () {
  5361. i.volumeBar.removeClass('vjs-slider-active'), i.removeClass('vjs-slider-active'), i.trigger('sliderinactive')
  5362. }),
  5363. i
  5364. )
  5365. }
  5366. mt(e, a)
  5367. var t = e.prototype
  5368. return (
  5369. (t.createEl = function () {
  5370. var e = 'vjs-volume-horizontal'
  5371. return this.options_.vertical && (e = 'vjs-volume-vertical'), a.prototype.createEl.call(this, 'div', { className: 'vjs-volume-control vjs-control ' + e })
  5372. }),
  5373. (t.handleMouseDown = function (e) {
  5374. var t = this.el_.ownerDocument
  5375. this.on(t, 'mousemove', this.throttledHandleMouseMove),
  5376. this.on(t, 'touchmove', this.throttledHandleMouseMove),
  5377. this.on(t, 'mouseup', this.handleMouseUpHandler_),
  5378. this.on(t, 'touchend', this.handleMouseUpHandler_)
  5379. }),
  5380. (t.handleMouseUp = function (e) {
  5381. var t = this.el_.ownerDocument
  5382. this.off(t, 'mousemove', this.throttledHandleMouseMove),
  5383. this.off(t, 'touchmove', this.throttledHandleMouseMove),
  5384. this.off(t, 'mouseup', this.handleMouseUpHandler_),
  5385. this.off(t, 'touchend', this.handleMouseUpHandler_)
  5386. }),
  5387. (t.handleMouseMove = function (e) {
  5388. this.volumeBar.handleMouseMove(e)
  5389. }),
  5390. e
  5391. )
  5392. })(pt)
  5393. ;(ui.prototype.options_ = { children: ['volumeBar'] }), pt.registerComponent('VolumeControl', ui)
  5394. Xt = (function (a) {
  5395. function e(e, t) {
  5396. var i,
  5397. n,
  5398. r = a.call(this, e, t) || this
  5399. return (
  5400. (i = ft(r)),
  5401. (n = e).tech_ && !n.tech_.featuresMuteControl && i.addClass('vjs-hidden'),
  5402. i.on(n, 'loadstart', function () {
  5403. n.tech_.featuresMuteControl ? i.removeClass('vjs-hidden') : i.addClass('vjs-hidden')
  5404. }),
  5405. r.on(e, ['loadstart', 'volumechange'], function (e) {
  5406. return r.update(e)
  5407. }),
  5408. r
  5409. )
  5410. }
  5411. mt(e, a)
  5412. var t = e.prototype
  5413. return (
  5414. (t.buildCSSClass = function () {
  5415. return 'vjs-mute-control ' + a.prototype.buildCSSClass.call(this)
  5416. }),
  5417. (t.handleClick = function (e) {
  5418. var t = this.player_.volume(),
  5419. i = this.player_.lastVolume_()
  5420. 0 === t ? (this.player_.volume(i < 0.1 ? 0.1 : i), this.player_.muted(!1)) : this.player_.muted(!this.player_.muted())
  5421. }),
  5422. (t.update = function (e) {
  5423. this.updateIcon_(), this.updateControlText_()
  5424. }),
  5425. (t.updateIcon_ = function () {
  5426. var e = this.player_.volume(),
  5427. t = 3
  5428. q && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted),
  5429. 0 === e || this.player_.muted() ? (t = 0) : e < 0.33 ? (t = 1) : e < 0.67 && (t = 2)
  5430. for (var i = 0; i < 4; i++) ie(this.el_, 'vjs-vol-' + i)
  5431. te(this.el_, 'vjs-vol-' + t)
  5432. }),
  5433. (t.updateControlText_ = function () {
  5434. var e = this.player_.muted() || 0 === this.player_.volume() ? 'Unmute' : 'Mute'
  5435. this.controlText() !== e && this.controlText(e)
  5436. }),
  5437. e
  5438. )
  5439. })(sn)
  5440. ;(Xt.prototype.controlText_ = 'Mute'), pt.registerComponent('MuteToggle', Xt)
  5441. I = (function (n) {
  5442. function e(e, t) {
  5443. var i
  5444. return (
  5445. 'undefined' != typeof (t = void 0 === t ? {} : t).inline ? (t.inline = t.inline) : (t.inline = !0),
  5446. ('undefined' != typeof t.volumeControl && !S(t.volumeControl)) || ((t.volumeControl = t.volumeControl || {}), (t.volumeControl.vertical = !t.inline)),
  5447. ((i = n.call(this, e, t) || this).handleKeyPressHandler_ = function (e) {
  5448. return i.handleKeyPress(e)
  5449. }),
  5450. i.on(e, ['loadstart'], function (e) {
  5451. return i.volumePanelState_(e)
  5452. }),
  5453. i.on(i.muteToggle, 'keyup', function (e) {
  5454. return i.handleKeyPress(e)
  5455. }),
  5456. i.on(i.volumeControl, 'keyup', function (e) {
  5457. return i.handleVolumeControlKeyUp(e)
  5458. }),
  5459. i.on('keydown', function (e) {
  5460. return i.handleKeyPress(e)
  5461. }),
  5462. i.on('mouseover', function (e) {
  5463. return i.handleMouseOver(e)
  5464. }),
  5465. i.on('mouseout', function (e) {
  5466. return i.handleMouseOut(e)
  5467. }),
  5468. i.on(i.volumeControl, ['slideractive'], i.sliderActive_),
  5469. i.on(i.volumeControl, ['sliderinactive'], i.sliderInactive_),
  5470. i
  5471. )
  5472. }
  5473. mt(e, n)
  5474. var t = e.prototype
  5475. return (
  5476. (t.sliderActive_ = function () {
  5477. this.addClass('vjs-slider-active')
  5478. }),
  5479. (t.sliderInactive_ = function () {
  5480. this.removeClass('vjs-slider-active')
  5481. }),
  5482. (t.volumePanelState_ = function () {
  5483. this.volumeControl.hasClass('vjs-hidden') && this.muteToggle.hasClass('vjs-hidden') && this.addClass('vjs-hidden'),
  5484. this.volumeControl.hasClass('vjs-hidden') && !this.muteToggle.hasClass('vjs-hidden') && this.addClass('vjs-mute-toggle-only')
  5485. }),
  5486. (t.createEl = function () {
  5487. var e = 'vjs-volume-panel-horizontal'
  5488. return this.options_.inline || (e = 'vjs-volume-panel-vertical'), n.prototype.createEl.call(this, 'div', { className: 'vjs-volume-panel vjs-control ' + e })
  5489. }),
  5490. (t.dispose = function () {
  5491. this.handleMouseOut(), n.prototype.dispose.call(this)
  5492. }),
  5493. (t.handleVolumeControlKeyUp = function (e) {
  5494. ht.isEventKey(e, 'Esc') && this.muteToggle.focus()
  5495. }),
  5496. (t.handleMouseOver = function (e) {
  5497. this.addClass('vjs-hover'), Be(document, 'keyup', this.handleKeyPressHandler_)
  5498. }),
  5499. (t.handleMouseOut = function (e) {
  5500. this.removeClass('vjs-hover'), Fe(document, 'keyup', this.handleKeyPressHandler_)
  5501. }),
  5502. (t.handleKeyPress = function (e) {
  5503. ht.isEventKey(e, 'Esc') && this.handleMouseOut()
  5504. }),
  5505. e
  5506. )
  5507. })(pt)
  5508. ;(I.prototype.options_ = { children: ['muteToggle', 'volumeControl'] }), pt.registerComponent('VolumePanel', I)
  5509. var hn = (function (n) {
  5510. function e(e, t) {
  5511. var i = n.call(this, e, t) || this
  5512. return (
  5513. t && (i.menuButton_ = t.menuButton),
  5514. (i.focusedChild_ = -1),
  5515. i.on('keydown', function (e) {
  5516. return i.handleKeyDown(e)
  5517. }),
  5518. (i.boundHandleBlur_ = function (e) {
  5519. return i.handleBlur(e)
  5520. }),
  5521. (i.boundHandleTapClick_ = function (e) {
  5522. return i.handleTapClick(e)
  5523. }),
  5524. i
  5525. )
  5526. }
  5527. mt(e, n)
  5528. var t = e.prototype
  5529. return (
  5530. (t.addEventListenerForItem = function (e) {
  5531. e instanceof pt && (this.on(e, 'blur', this.boundHandleBlur_), this.on(e, ['tap', 'click'], this.boundHandleTapClick_))
  5532. }),
  5533. (t.removeEventListenerForItem = function (e) {
  5534. e instanceof pt && (this.off(e, 'blur', this.boundHandleBlur_), this.off(e, ['tap', 'click'], this.boundHandleTapClick_))
  5535. }),
  5536. (t.removeChild = function (e) {
  5537. 'string' == typeof e && (e = this.getChild(e)), this.removeEventListenerForItem(e), n.prototype.removeChild.call(this, e)
  5538. }),
  5539. (t.addItem = function (e) {
  5540. e = this.addChild(e)
  5541. e && this.addEventListenerForItem(e)
  5542. }),
  5543. (t.createEl = function () {
  5544. var e = this.options_.contentElType || 'ul'
  5545. ;(this.contentEl_ = $(e, { className: 'vjs-menu-content' })), this.contentEl_.setAttribute('role', 'menu')
  5546. e = n.prototype.createEl.call(this, 'div', { append: this.contentEl_, className: 'vjs-menu' })
  5547. return (
  5548. e.appendChild(this.contentEl_),
  5549. Be(e, 'click', function (e) {
  5550. e.preventDefault(), e.stopImmediatePropagation()
  5551. }),
  5552. e
  5553. )
  5554. }),
  5555. (t.dispose = function () {
  5556. ;(this.contentEl_ = null), (this.boundHandleBlur_ = null), (this.boundHandleTapClick_ = null), n.prototype.dispose.call(this)
  5557. }),
  5558. (t.handleBlur = function (e) {
  5559. var t = e.relatedTarget || document.activeElement
  5560. this.children().some(function (e) {
  5561. return e.el() === t
  5562. }) ||
  5563. ((e = this.menuButton_) && e.buttonPressed_ && t !== e.el().firstChild && e.unpressButton())
  5564. }),
  5565. (t.handleTapClick = function (t) {
  5566. var e
  5567. this.menuButton_ &&
  5568. (this.menuButton_.unpressButton(),
  5569. (e = this.children()),
  5570. !Array.isArray(e) ||
  5571. ((e = e.filter(function (e) {
  5572. return e.el() === t.target
  5573. })[0]) &&
  5574. 'CaptionSettingsMenuItem' !== e.name() &&
  5575. this.menuButton_.focus()))
  5576. }),
  5577. (t.handleKeyDown = function (e) {
  5578. ht.isEventKey(e, 'Left') || ht.isEventKey(e, 'Down')
  5579. ? (e.preventDefault(), e.stopPropagation(), this.stepForward())
  5580. : (ht.isEventKey(e, 'Right') || ht.isEventKey(e, 'Up')) && (e.preventDefault(), e.stopPropagation(), this.stepBack())
  5581. }),
  5582. (t.stepForward = function () {
  5583. var e = 0
  5584. void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1), this.focus(e)
  5585. }),
  5586. (t.stepBack = function () {
  5587. var e = 0
  5588. void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1), this.focus(e)
  5589. }),
  5590. (t.focus = function (e) {
  5591. void 0 === e && (e = 0)
  5592. var t = this.children().slice()
  5593. t.length && t[0].hasClass('vjs-menu-title') && t.shift(), 0 < t.length && (e < 0 ? (e = 0) : e >= t.length && (e = t.length - 1), t[(this.focusedChild_ = e)].el_.focus())
  5594. }),
  5595. e
  5596. )
  5597. })(pt)
  5598. pt.registerComponent('Menu', hn)
  5599. Bt = (function (n) {
  5600. function e(e, t) {
  5601. var i
  5602. ;((i = n.call(this, e, (t = void 0 === t ? {} : t)) || this).menuButton_ = new sn(e, t)), i.menuButton_.controlText(i.controlText_), i.menuButton_.el_.setAttribute('aria-haspopup', 'true')
  5603. t = sn.prototype.buildCSSClass()
  5604. ;(i.menuButton_.el_.className = i.buildCSSClass() + ' ' + t), i.menuButton_.removeClass('vjs-control'), i.addChild(i.menuButton_), i.update(), (i.enabled_ = !0)
  5605. t = function (e) {
  5606. return i.handleClick(e)
  5607. }
  5608. return (
  5609. (i.handleMenuKeyUp_ = function (e) {
  5610. return i.handleMenuKeyUp(e)
  5611. }),
  5612. i.on(i.menuButton_, 'tap', t),
  5613. i.on(i.menuButton_, 'click', t),
  5614. i.on(i.menuButton_, 'keydown', function (e) {
  5615. return i.handleKeyDown(e)
  5616. }),
  5617. i.on(i.menuButton_, 'mouseenter', function () {
  5618. i.addClass('vjs-hover'), i.menu.show(), Be(document, 'keyup', i.handleMenuKeyUp_)
  5619. }),
  5620. i.on('mouseleave', function (e) {
  5621. return i.handleMouseLeave(e)
  5622. }),
  5623. i.on('keydown', function (e) {
  5624. return i.handleSubmenuKeyDown(e)
  5625. }),
  5626. i
  5627. )
  5628. }
  5629. mt(e, n)
  5630. var t = e.prototype
  5631. return (
  5632. (t.update = function () {
  5633. var e = this.createMenu()
  5634. this.menu && (this.menu.dispose(), this.removeChild(this.menu)),
  5635. (this.menu = e),
  5636. this.addChild(e),
  5637. (this.buttonPressed_ = !1),
  5638. this.menuButton_.el_.setAttribute('aria-expanded', 'false'),
  5639. this.items && this.items.length <= this.hideThreshold_
  5640. ? (this.hide(), this.menu.contentEl_.removeAttribute('role'))
  5641. : (this.show(), this.menu.contentEl_.setAttribute('role', 'menu'))
  5642. }),
  5643. (t.createMenu = function () {
  5644. var e,
  5645. t = new hn(this.player_, { menuButton: this })
  5646. if (
  5647. ((this.hideThreshold_ = 0),
  5648. this.options_.title && ((e = $('li', { className: 'vjs-menu-title', textContent: ut(this.options_.title), tabIndex: -1 })), (e = new pt(this.player_, { el: e })), t.addItem(e)),
  5649. (this.items = this.createItems()),
  5650. this.items)
  5651. )
  5652. for (var i = 0; i < this.items.length; i++) t.addItem(this.items[i])
  5653. return t
  5654. }),
  5655. (t.createItems = function () {}),
  5656. (t.createEl = function () {
  5657. return n.prototype.createEl.call(this, 'div', { className: this.buildWrapperCSSClass() }, {})
  5658. }),
  5659. (t.buildWrapperCSSClass = function () {
  5660. var e = 'vjs-menu-button'
  5661. return !0 === this.options_.inline ? (e += '-inline') : (e += '-popup'), 'vjs-menu-button ' + e + ' ' + sn.prototype.buildCSSClass() + ' ' + n.prototype.buildCSSClass.call(this)
  5662. }),
  5663. (t.buildCSSClass = function () {
  5664. var e = 'vjs-menu-button'
  5665. return !0 === this.options_.inline ? (e += '-inline') : (e += '-popup'), 'vjs-menu-button ' + e + ' ' + n.prototype.buildCSSClass.call(this)
  5666. }),
  5667. (t.controlText = function (e, t) {
  5668. return void 0 === t && (t = this.menuButton_.el()), this.menuButton_.controlText(e, t)
  5669. }),
  5670. (t.dispose = function () {
  5671. this.handleMouseLeave(), n.prototype.dispose.call(this)
  5672. }),
  5673. (t.handleClick = function (e) {
  5674. this.buttonPressed_ ? this.unpressButton() : this.pressButton()
  5675. }),
  5676. (t.handleMouseLeave = function (e) {
  5677. this.removeClass('vjs-hover'), Fe(document, 'keyup', this.handleMenuKeyUp_)
  5678. }),
  5679. (t.focus = function () {
  5680. this.menuButton_.focus()
  5681. }),
  5682. (t.blur = function () {
  5683. this.menuButton_.blur()
  5684. }),
  5685. (t.handleKeyDown = function (e) {
  5686. ht.isEventKey(e, 'Esc') || ht.isEventKey(e, 'Tab')
  5687. ? (this.buttonPressed_ && this.unpressButton(), ht.isEventKey(e, 'Tab') || (e.preventDefault(), this.menuButton_.focus()))
  5688. : (ht.isEventKey(e, 'Up') || ht.isEventKey(e, 'Down')) && (this.buttonPressed_ || (e.preventDefault(), this.pressButton()))
  5689. }),
  5690. (t.handleMenuKeyUp = function (e) {
  5691. ;(ht.isEventKey(e, 'Esc') || ht.isEventKey(e, 'Tab')) && this.removeClass('vjs-hover')
  5692. }),
  5693. (t.handleSubmenuKeyPress = function (e) {
  5694. this.handleSubmenuKeyDown(e)
  5695. }),
  5696. (t.handleSubmenuKeyDown = function (e) {
  5697. ;(ht.isEventKey(e, 'Esc') || ht.isEventKey(e, 'Tab')) && (this.buttonPressed_ && this.unpressButton(), ht.isEventKey(e, 'Tab') || (e.preventDefault(), this.menuButton_.focus()))
  5698. }),
  5699. (t.pressButton = function () {
  5700. this.enabled_ && ((this.buttonPressed_ = !0), this.menu.show(), this.menu.lockShowing(), this.menuButton_.el_.setAttribute('aria-expanded', 'true'), (q && Y()) || this.menu.focus())
  5701. }),
  5702. (t.unpressButton = function () {
  5703. this.enabled_ && ((this.buttonPressed_ = !1), this.menu.unlockShowing(), this.menu.hide(), this.menuButton_.el_.setAttribute('aria-expanded', 'false'))
  5704. }),
  5705. (t.disable = function () {
  5706. this.unpressButton(), (this.enabled_ = !1), this.addClass('vjs-disabled'), this.menuButton_.disable()
  5707. }),
  5708. (t.enable = function () {
  5709. ;(this.enabled_ = !0), this.removeClass('vjs-disabled'), this.menuButton_.enable()
  5710. }),
  5711. e
  5712. )
  5713. })(pt)
  5714. pt.registerComponent('MenuButton', Bt)
  5715. Ft = (function (r) {
  5716. function e(e, t) {
  5717. var i = t.tracks,
  5718. t = r.call(this, e, t) || this
  5719. if ((t.items.length <= 1 && t.hide(), !i)) return ft(t)
  5720. var n = Ve(ft(t), t.update)
  5721. return (
  5722. i.addEventListener('removetrack', n),
  5723. i.addEventListener('addtrack', n),
  5724. i.addEventListener('labelchange', n),
  5725. t.player_.on('ready', n),
  5726. t.player_.on('dispose', function () {
  5727. i.removeEventListener('removetrack', n), i.removeEventListener('addtrack', n), i.removeEventListener('labelchange', n)
  5728. }),
  5729. t
  5730. )
  5731. }
  5732. return mt(e, r), e
  5733. })(Bt)
  5734. pt.registerComponent('TrackButton', Ft)
  5735. var pn = ['Tab', 'Esc', 'Up', 'Down', 'Right', 'Left'],
  5736. jt = (function (n) {
  5737. function e(e, t) {
  5738. e = n.call(this, e, t) || this
  5739. return (
  5740. (e.selectable = t.selectable),
  5741. (e.isSelected_ = t.selected || !1),
  5742. (e.multiSelectable = t.multiSelectable),
  5743. e.selected(e.isSelected_),
  5744. e.selectable ? (e.multiSelectable ? e.el_.setAttribute('role', 'menuitemcheckbox') : e.el_.setAttribute('role', 'menuitemradio')) : e.el_.setAttribute('role', 'menuitem'),
  5745. e
  5746. )
  5747. }
  5748. mt(e, n)
  5749. var t = e.prototype
  5750. return (
  5751. (t.createEl = function (e, t, i) {
  5752. this.nonIconControl = !0
  5753. i = n.prototype.createEl.call(this, 'li', b({ className: 'vjs-menu-item', tabIndex: -1 }, t), i)
  5754. return i.replaceChild($('span', { className: 'vjs-menu-item-text', textContent: this.localize(this.options_.label) }), i.querySelector('.vjs-icon-placeholder')), i
  5755. }),
  5756. (t.handleKeyDown = function (t) {
  5757. pn.some(function (e) {
  5758. return ht.isEventKey(t, e)
  5759. }) || n.prototype.handleKeyDown.call(this, t)
  5760. }),
  5761. (t.handleClick = function (e) {
  5762. this.selected(!0)
  5763. }),
  5764. (t.selected = function (e) {
  5765. this.selectable &&
  5766. (e
  5767. ? (this.addClass('vjs-selected'), this.el_.setAttribute('aria-checked', 'true'), this.controlText(', selected'), (this.isSelected_ = !0))
  5768. : (this.removeClass('vjs-selected'), this.el_.setAttribute('aria-checked', 'false'), this.controlText(''), (this.isSelected_ = !1)))
  5769. }),
  5770. e
  5771. )
  5772. })(C)
  5773. pt.registerComponent('MenuItem', jt)
  5774. var fn = (function (u) {
  5775. function e(e, t) {
  5776. var n,
  5777. i = t.track,
  5778. r = e.textTracks()
  5779. ;(t.label = i.label || i.language || 'Unknown'),
  5780. (t.selected = 'showing' === i.mode),
  5781. ((n = u.call(this, e, t) || this).track = i),
  5782. (n.kinds = (t.kinds || [t.kind || n.track.kind]).filter(Boolean))
  5783. function a() {
  5784. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  5785. n.handleTracksChange.apply(ft(n), t)
  5786. }
  5787. function s() {
  5788. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  5789. n.handleSelectedLanguageChange.apply(ft(n), t)
  5790. }
  5791. var o
  5792. return (
  5793. e.on(['loadstart', 'texttrackchange'], a),
  5794. r.addEventListener('change', a),
  5795. r.addEventListener('selectedlanguagechange', s),
  5796. n.on('dispose', function () {
  5797. e.off(['loadstart', 'texttrackchange'], a), r.removeEventListener('change', a), r.removeEventListener('selectedlanguagechange', s)
  5798. }),
  5799. void 0 === r.onchange &&
  5800. n.on(['tap', 'click'], function () {
  5801. if ('object' != typeof window.Event)
  5802. try {
  5803. o = new window.Event('change')
  5804. } catch (e) {}
  5805. o || (o = document.createEvent('Event')).initEvent('change', !0, !0), r.dispatchEvent(o)
  5806. }),
  5807. n.handleTracksChange(),
  5808. n
  5809. )
  5810. }
  5811. mt(e, u)
  5812. var t = e.prototype
  5813. return (
  5814. (t.handleClick = function (e) {
  5815. var t = this.track,
  5816. i = this.player_.textTracks()
  5817. if ((u.prototype.handleClick.call(this, e), i))
  5818. for (var n = 0; n < i.length; n++) {
  5819. var r = i[n]
  5820. ;-1 !== this.kinds.indexOf(r.kind) && (r === t ? 'showing' !== r.mode && (r.mode = 'showing') : 'disabled' !== r.mode && (r.mode = 'disabled'))
  5821. }
  5822. }),
  5823. (t.handleTracksChange = function (e) {
  5824. var t = 'showing' === this.track.mode
  5825. t !== this.isSelected_ && this.selected(t)
  5826. }),
  5827. (t.handleSelectedLanguageChange = function (e) {
  5828. var t
  5829. 'showing' === this.track.mode &&
  5830. (((t = this.player_.cache_.selectedLanguage) && t.enabled && t.language === this.track.language && t.kind !== this.track.kind) ||
  5831. (this.player_.cache_.selectedLanguage = { enabled: !0, language: this.track.language, kind: this.track.kind }))
  5832. }),
  5833. (t.dispose = function () {
  5834. ;(this.track = null), u.prototype.dispose.call(this)
  5835. }),
  5836. e
  5837. )
  5838. })(jt)
  5839. pt.registerComponent('TextTrackMenuItem', fn)
  5840. var mn = (function (i) {
  5841. function e(e, t) {
  5842. return (
  5843. (t.track = { player: e, kind: t.kind, kinds: t.kinds, default: !1, mode: 'disabled' }),
  5844. t.kinds || (t.kinds = [t.kind]),
  5845. t.label ? (t.track.label = t.label) : (t.track.label = t.kinds.join(' and ') + ' off'),
  5846. (t.selectable = !0),
  5847. (t.multiSelectable = !1),
  5848. i.call(this, e, t) || this
  5849. )
  5850. }
  5851. mt(e, i)
  5852. var t = e.prototype
  5853. return (
  5854. (t.handleTracksChange = function (e) {
  5855. for (var t = this.player().textTracks(), i = !0, n = 0, r = t.length; n < r; n++) {
  5856. var a = t[n]
  5857. if (-1 < this.options_.kinds.indexOf(a.kind) && 'showing' === a.mode) {
  5858. i = !1
  5859. break
  5860. }
  5861. }
  5862. i !== this.isSelected_ && this.selected(i)
  5863. }),
  5864. (t.handleSelectedLanguageChange = function (e) {
  5865. for (var t = this.player().textTracks(), i = !0, n = 0, r = t.length; n < r; n++) {
  5866. var a = t[n]
  5867. if (-1 < ['captions', 'descriptions', 'subtitles'].indexOf(a.kind) && 'showing' === a.mode) {
  5868. i = !1
  5869. break
  5870. }
  5871. }
  5872. i && (this.player_.cache_.selectedLanguage = { enabled: !1 })
  5873. }),
  5874. e
  5875. )
  5876. })(fn)
  5877. pt.registerComponent('OffTextTrackMenuItem', mn)
  5878. j = (function (i) {
  5879. function e(e, t) {
  5880. return ((t = void 0 === t ? {} : t).tracks = e.textTracks()), i.call(this, e, t) || this
  5881. }
  5882. return (
  5883. mt(e, i),
  5884. (e.prototype.createItems = function (e, t) {
  5885. var i
  5886. void 0 === t && (t = fn),
  5887. this.label_ && (i = this.label_ + ' off'),
  5888. (e = void 0 === e ? [] : e).push(new mn(this.player_, { kinds: this.kinds_, kind: this.kind_, label: i })),
  5889. (this.hideThreshold_ += 1)
  5890. var n = this.player_.textTracks()
  5891. Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_])
  5892. for (var r = 0; r < n.length; r++) {
  5893. var a,
  5894. s = n[r]
  5895. ;-1 < this.kinds_.indexOf(s.kind) &&
  5896. ((a = new t(this.player_, { track: s, kinds: this.kinds_, kind: this.kind_, selectable: !0, multiSelectable: !1 })).addClass('vjs-' + s.kind + '-menu-item'), e.push(a))
  5897. }
  5898. return e
  5899. }),
  5900. e
  5901. )
  5902. })(Ft)
  5903. pt.registerComponent('TextTrackButton', j)
  5904. var gn = (function (a) {
  5905. function e(e, t) {
  5906. var i = t.track,
  5907. n = t.cue,
  5908. r = e.currentTime()
  5909. return (t.selectable = !0), (t.multiSelectable = !1), (t.label = n.text), (t.selected = n.startTime <= r && r < n.endTime), ((t = a.call(this, e, t) || this).track = i), (t.cue = n), t
  5910. }
  5911. return (
  5912. mt(e, a),
  5913. (e.prototype.handleClick = function (e) {
  5914. a.prototype.handleClick.call(this), this.player_.currentTime(this.cue.startTime)
  5915. }),
  5916. e
  5917. )
  5918. })(jt)
  5919. pt.registerComponent('ChaptersTrackMenuItem', gn)
  5920. k = (function (r) {
  5921. function e(e, t, i) {
  5922. var n = r.call(this, e, t, i) || this
  5923. return (
  5924. (n.selectCurrentItem_ = function () {
  5925. n.items.forEach(function (e) {
  5926. e.selected(n.track_.activeCues[0] === e.cue)
  5927. })
  5928. }),
  5929. n
  5930. )
  5931. }
  5932. mt(e, r)
  5933. var t = e.prototype
  5934. return (
  5935. (t.buildCSSClass = function () {
  5936. return 'vjs-chapters-button ' + r.prototype.buildCSSClass.call(this)
  5937. }),
  5938. (t.buildWrapperCSSClass = function () {
  5939. return 'vjs-chapters-button ' + r.prototype.buildWrapperCSSClass.call(this)
  5940. }),
  5941. (t.update = function (e) {
  5942. ;(e && e.track && 'chapters' !== e.track.kind) ||
  5943. ((e = this.findChaptersTrack()) !== this.track_
  5944. ? (this.setTrack(e), r.prototype.update.call(this))
  5945. : (!this.items || (e && e.cues && e.cues.length !== this.items.length)) && r.prototype.update.call(this))
  5946. }),
  5947. (t.setTrack = function (e) {
  5948. var t
  5949. this.track_ !== e &&
  5950. (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)),
  5951. this.track_ &&
  5952. ((t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_)) && t.removeEventListener('load', this.updateHandler_),
  5953. this.track_.removeEventListener('cuechange', this.selectCurrentItem_),
  5954. (this.track_ = null)),
  5955. (this.track_ = e),
  5956. this.track_ &&
  5957. ((this.track_.mode = 'hidden'),
  5958. (e = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_)) && e.addEventListener('load', this.updateHandler_),
  5959. this.track_.addEventListener('cuechange', this.selectCurrentItem_)))
  5960. }),
  5961. (t.findChaptersTrack = function () {
  5962. for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) {
  5963. var i = e[t]
  5964. if (i.kind === this.kind_) return i
  5965. }
  5966. }),
  5967. (t.getMenuCaption = function () {
  5968. return this.track_ && this.track_.label ? this.track_.label : this.localize(ut(this.kind_))
  5969. }),
  5970. (t.createMenu = function () {
  5971. return (this.options_.title = this.getMenuCaption()), r.prototype.createMenu.call(this)
  5972. }),
  5973. (t.createItems = function () {
  5974. var e = []
  5975. if (!this.track_) return e
  5976. var t = this.track_.cues
  5977. if (!t) return e
  5978. for (var i = 0, n = t.length; i < n; i++) {
  5979. var r = t[i],
  5980. r = new gn(this.player_, { track: this.track_, cue: r })
  5981. e.push(r)
  5982. }
  5983. return e
  5984. }),
  5985. e
  5986. )
  5987. })(j)
  5988. ;(k.prototype.kind_ = 'chapters'), (k.prototype.controlText_ = 'Chapters'), pt.registerComponent('ChaptersButton', k)
  5989. li = (function (a) {
  5990. function e(e, t, i) {
  5991. var i = a.call(this, e, t, i) || this,
  5992. n = e.textTracks(),
  5993. r = Ve(ft(i), i.handleTracksChange)
  5994. return (
  5995. n.addEventListener('change', r),
  5996. i.on('dispose', function () {
  5997. n.removeEventListener('change', r)
  5998. }),
  5999. i
  6000. )
  6001. }
  6002. mt(e, a)
  6003. var t = e.prototype
  6004. return (
  6005. (t.handleTracksChange = function (e) {
  6006. for (var t = this.player().textTracks(), i = !1, n = 0, r = t.length; n < r; n++) {
  6007. var a = t[n]
  6008. if (a.kind !== this.kind_ && 'showing' === a.mode) {
  6009. i = !0
  6010. break
  6011. }
  6012. }
  6013. i ? this.disable() : this.enable()
  6014. }),
  6015. (t.buildCSSClass = function () {
  6016. return 'vjs-descriptions-button ' + a.prototype.buildCSSClass.call(this)
  6017. }),
  6018. (t.buildWrapperCSSClass = function () {
  6019. return 'vjs-descriptions-button ' + a.prototype.buildWrapperCSSClass.call(this)
  6020. }),
  6021. e
  6022. )
  6023. })(j)
  6024. ;(li.prototype.kind_ = 'descriptions'), (li.prototype.controlText_ = 'Descriptions'), pt.registerComponent('DescriptionsButton', li)
  6025. f = (function (n) {
  6026. function e(e, t, i) {
  6027. return n.call(this, e, t, i) || this
  6028. }
  6029. mt(e, n)
  6030. var t = e.prototype
  6031. return (
  6032. (t.buildCSSClass = function () {
  6033. return 'vjs-subtitles-button ' + n.prototype.buildCSSClass.call(this)
  6034. }),
  6035. (t.buildWrapperCSSClass = function () {
  6036. return 'vjs-subtitles-button ' + n.prototype.buildWrapperCSSClass.call(this)
  6037. }),
  6038. e
  6039. )
  6040. })(j)
  6041. ;(f.prototype.kind_ = 'subtitles'), (f.prototype.controlText_ = 'Subtitles'), pt.registerComponent('SubtitlesButton', f)
  6042. var yn = (function (i) {
  6043. function e(e, t) {
  6044. return (
  6045. (t.track = { player: e, kind: t.kind, label: t.kind + ' settings', selectable: !1, default: !1, mode: 'disabled' }),
  6046. (t.selectable = !1),
  6047. (t.name = 'CaptionSettingsMenuItem'),
  6048. (e = i.call(this, e, t) || this).addClass('vjs-texttrack-settings'),
  6049. e.controlText(', opens ' + t.kind + ' settings dialog'),
  6050. e
  6051. )
  6052. }
  6053. return (
  6054. mt(e, i),
  6055. (e.prototype.handleClick = function (e) {
  6056. this.player().getChild('textTrackSettings').open()
  6057. }),
  6058. e
  6059. )
  6060. })(fn)
  6061. pt.registerComponent('CaptionSettingsMenuItem', yn)
  6062. ui = (function (n) {
  6063. function e(e, t, i) {
  6064. return n.call(this, e, t, i) || this
  6065. }
  6066. mt(e, n)
  6067. var t = e.prototype
  6068. return (
  6069. (t.buildCSSClass = function () {
  6070. return 'vjs-captions-button ' + n.prototype.buildCSSClass.call(this)
  6071. }),
  6072. (t.buildWrapperCSSClass = function () {
  6073. return 'vjs-captions-button ' + n.prototype.buildWrapperCSSClass.call(this)
  6074. }),
  6075. (t.createItems = function () {
  6076. var e = []
  6077. return (
  6078. (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) ||
  6079. !this.player().getChild('textTrackSettings') ||
  6080. (e.push(new yn(this.player_, { kind: this.kind_ })), (this.hideThreshold_ += 1)),
  6081. n.prototype.createItems.call(this, e)
  6082. )
  6083. }),
  6084. e
  6085. )
  6086. })(j)
  6087. ;(ui.prototype.kind_ = 'captions'), (ui.prototype.controlText_ = 'Captions'), pt.registerComponent('CaptionsButton', ui)
  6088. var vn = (function (n) {
  6089. function e() {
  6090. return n.apply(this, arguments) || this
  6091. }
  6092. return (
  6093. mt(e, n),
  6094. (e.prototype.createEl = function (e, t, i) {
  6095. ;(t = n.prototype.createEl.call(this, e, t, i)), (i = t.querySelector('.vjs-menu-item-text'))
  6096. return (
  6097. 'captions' === this.options_.track.kind &&
  6098. (i.appendChild($('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })),
  6099. i.appendChild($('span', { className: 'vjs-control-text', textContent: ' ' + this.localize('Captions') }))),
  6100. t
  6101. )
  6102. }),
  6103. e
  6104. )
  6105. })(fn)
  6106. pt.registerComponent('SubsCapsMenuItem', vn)
  6107. Xt = (function (i) {
  6108. function e(e, t) {
  6109. return (
  6110. ((t = i.call(this, e, (t = void 0 === t ? {} : t)) || this).label_ = 'subtitles'),
  6111. -1 < ['en', 'en-us', 'en-ca', 'fr-ca'].indexOf(t.player_.language_) && (t.label_ = 'captions'),
  6112. t.menuButton_.controlText(ut(t.label_)),
  6113. t
  6114. )
  6115. }
  6116. mt(e, i)
  6117. var t = e.prototype
  6118. return (
  6119. (t.buildCSSClass = function () {
  6120. return 'vjs-subs-caps-button ' + i.prototype.buildCSSClass.call(this)
  6121. }),
  6122. (t.buildWrapperCSSClass = function () {
  6123. return 'vjs-subs-caps-button ' + i.prototype.buildWrapperCSSClass.call(this)
  6124. }),
  6125. (t.createItems = function () {
  6126. var e = []
  6127. return (
  6128. (this.player().tech_ && this.player().tech_.featuresNativeTextTracks) ||
  6129. !this.player().getChild('textTrackSettings') ||
  6130. (e.push(new yn(this.player_, { kind: this.label_ })), (this.hideThreshold_ += 1)),
  6131. (e = i.prototype.createItems.call(this, e, vn))
  6132. )
  6133. }),
  6134. e
  6135. )
  6136. })(j)
  6137. ;(Xt.prototype.kinds_ = ['captions', 'subtitles']), (Xt.prototype.controlText_ = 'Subtitles'), pt.registerComponent('SubsCapsButton', Xt)
  6138. var _n = (function (s) {
  6139. function e(e, t) {
  6140. var n,
  6141. i = t.track,
  6142. r = e.audioTracks()
  6143. ;(t.label = i.label || i.language || 'Unknown'), (t.selected = i.enabled), ((n = s.call(this, e, t) || this).track = i), n.addClass('vjs-' + i.kind + '-menu-item')
  6144. function a() {
  6145. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  6146. n.handleTracksChange.apply(ft(n), t)
  6147. }
  6148. return (
  6149. r.addEventListener('change', a),
  6150. n.on('dispose', function () {
  6151. r.removeEventListener('change', a)
  6152. }),
  6153. n
  6154. )
  6155. }
  6156. mt(e, s)
  6157. var t = e.prototype
  6158. return (
  6159. (t.createEl = function (e, t, i) {
  6160. ;(t = s.prototype.createEl.call(this, e, t, i)), (i = t.querySelector('.vjs-menu-item-text'))
  6161. return (
  6162. 'main-desc' === this.options_.track.kind &&
  6163. (i.appendChild($('span', { className: 'vjs-icon-placeholder' }, { 'aria-hidden': !0 })),
  6164. i.appendChild($('span', { className: 'vjs-control-text', textContent: ' ' + this.localize('Descriptions') }))),
  6165. t
  6166. )
  6167. }),
  6168. (t.handleClick = function (e) {
  6169. if ((s.prototype.handleClick.call(this, e), (this.track.enabled = !0), this.player_.tech_.featuresNativeAudioTracks))
  6170. for (var t = this.player_.audioTracks(), i = 0; i < t.length; i++) {
  6171. var n = t[i]
  6172. n !== this.track && (n.enabled = n === this.track)
  6173. }
  6174. }),
  6175. (t.handleTracksChange = function (e) {
  6176. this.selected(this.track.enabled)
  6177. }),
  6178. e
  6179. )
  6180. })(jt)
  6181. pt.registerComponent('AudioTrackMenuItem', _n)
  6182. I = (function (i) {
  6183. function e(e, t) {
  6184. return ((t = void 0 === t ? {} : t).tracks = e.audioTracks()), i.call(this, e, t) || this
  6185. }
  6186. mt(e, i)
  6187. var t = e.prototype
  6188. return (
  6189. (t.buildCSSClass = function () {
  6190. return 'vjs-audio-button ' + i.prototype.buildCSSClass.call(this)
  6191. }),
  6192. (t.buildWrapperCSSClass = function () {
  6193. return 'vjs-audio-button ' + i.prototype.buildWrapperCSSClass.call(this)
  6194. }),
  6195. (t.createItems = function (e) {
  6196. void 0 === e && (e = []), (this.hideThreshold_ = 1)
  6197. for (var t = this.player_.audioTracks(), i = 0; i < t.length; i++) {
  6198. var n = t[i]
  6199. e.push(new _n(this.player_, { track: n, selectable: !0, multiSelectable: !1 }))
  6200. }
  6201. return e
  6202. }),
  6203. e
  6204. )
  6205. })(Ft)
  6206. ;(I.prototype.controlText_ = 'Audio Track'), pt.registerComponent('AudioTrackButton', I)
  6207. var bn = (function (a) {
  6208. function e(e, t) {
  6209. var i,
  6210. n = t.rate,
  6211. r = parseFloat(n, 10)
  6212. return (
  6213. (t.label = n),
  6214. (t.selected = r === e.playbackRate()),
  6215. (t.selectable = !0),
  6216. (t.multiSelectable = !1),
  6217. ((i = a.call(this, e, t) || this).label = n),
  6218. (i.rate = r),
  6219. i.on(e, 'ratechange', function (e) {
  6220. return i.update(e)
  6221. }),
  6222. i
  6223. )
  6224. }
  6225. mt(e, a)
  6226. var t = e.prototype
  6227. return (
  6228. (t.handleClick = function (e) {
  6229. a.prototype.handleClick.call(this), this.player().playbackRate(this.rate)
  6230. }),
  6231. (t.update = function (e) {
  6232. this.selected(this.player().playbackRate() === this.rate)
  6233. }),
  6234. e
  6235. )
  6236. })(jt)
  6237. ;(bn.prototype.contentElType = 'button'), pt.registerComponent('PlaybackRateMenuItem', bn)
  6238. C = (function (n) {
  6239. function e(e, t) {
  6240. var i = n.call(this, e, t) || this
  6241. return (
  6242. i.menuButton_.el_.setAttribute('aria-describedby', i.labelElId_),
  6243. i.updateVisibility(),
  6244. i.updateLabel(),
  6245. i.on(e, 'loadstart', function (e) {
  6246. return i.updateVisibility(e)
  6247. }),
  6248. i.on(e, 'ratechange', function (e) {
  6249. return i.updateLabel(e)
  6250. }),
  6251. i.on(e, 'playbackrateschange', function (e) {
  6252. return i.handlePlaybackRateschange(e)
  6253. }),
  6254. i
  6255. )
  6256. }
  6257. mt(e, n)
  6258. var t = e.prototype
  6259. return (
  6260. (t.createEl = function () {
  6261. var e = n.prototype.createEl.call(this)
  6262. return (
  6263. (this.labelElId_ = 'vjs-playback-rate-value-label-' + this.id_),
  6264. (this.labelEl_ = $('div', { className: 'vjs-playback-rate-value', id: this.labelElId_, textContent: '1x' })),
  6265. e.appendChild(this.labelEl_),
  6266. e
  6267. )
  6268. }),
  6269. (t.dispose = function () {
  6270. ;(this.labelEl_ = null), n.prototype.dispose.call(this)
  6271. }),
  6272. (t.buildCSSClass = function () {
  6273. return 'vjs-playback-rate ' + n.prototype.buildCSSClass.call(this)
  6274. }),
  6275. (t.buildWrapperCSSClass = function () {
  6276. return 'vjs-playback-rate ' + n.prototype.buildWrapperCSSClass.call(this)
  6277. }),
  6278. (t.createItems = function () {
  6279. for (var e = this.playbackRates(), t = [], i = e.length - 1; 0 <= i; i--) t.push(new bn(this.player(), { rate: e[i] + 'x' }))
  6280. return t
  6281. }),
  6282. (t.updateARIAAttributes = function () {
  6283. this.el().setAttribute('aria-valuenow', this.player().playbackRate())
  6284. }),
  6285. (t.handleClick = function (e) {
  6286. var t = this.player().playbackRate(),
  6287. i = this.playbackRates(),
  6288. t = (i.indexOf(t) + 1) % i.length
  6289. this.player().playbackRate(i[t])
  6290. }),
  6291. (t.handlePlaybackRateschange = function (e) {
  6292. this.update()
  6293. }),
  6294. (t.playbackRates = function () {
  6295. var e = this.player()
  6296. return (e.playbackRates && e.playbackRates()) || []
  6297. }),
  6298. (t.playbackRateSupported = function () {
  6299. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length
  6300. }),
  6301. (t.updateVisibility = function (e) {
  6302. this.playbackRateSupported() ? this.removeClass('vjs-hidden') : this.addClass('vjs-hidden')
  6303. }),
  6304. (t.updateLabel = function (e) {
  6305. this.playbackRateSupported() && (this.labelEl_.textContent = this.player().playbackRate() + 'x')
  6306. }),
  6307. e
  6308. )
  6309. })(Bt)
  6310. ;(C.prototype.controlText_ = 'Playback Rate'), pt.registerComponent('PlaybackRateMenuButton', C)
  6311. k = (function (n) {
  6312. function e() {
  6313. return n.apply(this, arguments) || this
  6314. }
  6315. mt(e, n)
  6316. var t = e.prototype
  6317. return (
  6318. (t.buildCSSClass = function () {
  6319. return 'vjs-spacer ' + n.prototype.buildCSSClass.call(this)
  6320. }),
  6321. (t.createEl = function (e, t, i) {
  6322. return void 0 === e && (e = 'div'), void 0 === i && (i = {}), (t = void 0 === t ? {} : t).className || (t.className = this.buildCSSClass()), n.prototype.createEl.call(this, e, t, i)
  6323. }),
  6324. e
  6325. )
  6326. })(pt)
  6327. pt.registerComponent('Spacer', k),
  6328. pt.registerComponent(
  6329. 'CustomControlSpacer',
  6330. (function (e) {
  6331. function t() {
  6332. return e.apply(this, arguments) || this
  6333. }
  6334. mt(t, e)
  6335. var i = t.prototype
  6336. return (
  6337. (i.buildCSSClass = function () {
  6338. return 'vjs-custom-control-spacer ' + e.prototype.buildCSSClass.call(this)
  6339. }),
  6340. (i.createEl = function () {
  6341. return e.prototype.createEl.call(this, 'div', { className: this.buildCSSClass(), textContent: ' ' })
  6342. }),
  6343. t
  6344. )
  6345. })(k)
  6346. )
  6347. li = (function (e) {
  6348. function t() {
  6349. return e.apply(this, arguments) || this
  6350. }
  6351. return (
  6352. mt(t, e),
  6353. (t.prototype.createEl = function () {
  6354. return e.prototype.createEl.call(this, 'div', { className: 'vjs-control-bar', dir: 'ltr' })
  6355. }),
  6356. t
  6357. )
  6358. })(pt)
  6359. ;(li.prototype.options_ = {
  6360. children: [
  6361. 'playToggle',
  6362. 'volumePanel',
  6363. 'currentTimeDisplay',
  6364. 'timeDivider',
  6365. 'durationDisplay',
  6366. 'progressControl',
  6367. 'liveDisplay',
  6368. 'seekToLive',
  6369. 'remainingTimeDisplay',
  6370. 'customControlSpacer',
  6371. 'playbackRateMenuButton',
  6372. 'chaptersButton',
  6373. 'descriptionsButton',
  6374. 'subsCapsButton',
  6375. 'audioTrackButton',
  6376. 'fullscreenToggle',
  6377. ],
  6378. }),
  6379. 'exitPictureInPicture' in document && li.prototype.options_.children.splice(li.prototype.options_.children.length - 1, 0, 'pictureInPictureToggle'),
  6380. pt.registerComponent('ControlBar', li)
  6381. f = (function (n) {
  6382. function e(e, t) {
  6383. var i = n.call(this, e, t) || this
  6384. return (
  6385. i.on(e, 'error', function (e) {
  6386. return i.open(e)
  6387. }),
  6388. i
  6389. )
  6390. }
  6391. mt(e, n)
  6392. var t = e.prototype
  6393. return (
  6394. (t.buildCSSClass = function () {
  6395. return 'vjs-error-display ' + n.prototype.buildCSSClass.call(this)
  6396. }),
  6397. (t.content = function () {
  6398. var e = this.player().error()
  6399. return e ? this.localize(e.message) : ''
  6400. }),
  6401. e
  6402. )
  6403. })(At)
  6404. ;(f.prototype.options_ = g({}, At.prototype.options_, { pauseOnOpen: !1, fillAlways: !0, temporary: !1, uncloseable: !0 })), pt.registerComponent('ErrorDisplay', f)
  6405. var Tn = 'vjs-text-track-settings',
  6406. ui = ['#000', 'Black'],
  6407. j = ['#00F', 'Blue'],
  6408. Xt = ['#0FF', 'Cyan'],
  6409. Ft = ['#0F0', 'Green'],
  6410. I = ['#F0F', 'Magenta'],
  6411. jt = ['#F00', 'Red'],
  6412. Bt = ['#FFF', 'White'],
  6413. C = ['#FF0', 'Yellow'],
  6414. k = ['1', 'Opaque'],
  6415. li = ['0.5', 'Semi-Transparent'],
  6416. f = ['0', 'Transparent'],
  6417. Sn = {
  6418. backgroundColor: { selector: '.vjs-bg-color > select', id: 'captions-background-color-%s', label: 'Color', options: [ui, Bt, jt, Ft, j, C, I, Xt] },
  6419. backgroundOpacity: { selector: '.vjs-bg-opacity > select', id: 'captions-background-opacity-%s', label: 'Transparency', options: [k, li, f] },
  6420. color: { selector: '.vjs-fg-color > select', id: 'captions-foreground-color-%s', label: 'Color', options: [Bt, ui, jt, Ft, j, C, I, Xt] },
  6421. edgeStyle: {
  6422. selector: '.vjs-edge-style > select',
  6423. id: '%s',
  6424. label: 'Text Edge Style',
  6425. options: [
  6426. ['none', 'None'],
  6427. ['raised', 'Raised'],
  6428. ['depressed', 'Depressed'],
  6429. ['uniform', 'Uniform'],
  6430. ['dropshadow', 'Dropshadow'],
  6431. ],
  6432. },
  6433. fontFamily: {
  6434. selector: '.vjs-font-family > select',
  6435. id: 'captions-font-family-%s',
  6436. label: 'Font Family',
  6437. options: [
  6438. ['proportionalSansSerif', 'Proportional Sans-Serif'],
  6439. ['monospaceSansSerif', 'Monospace Sans-Serif'],
  6440. ['proportionalSerif', 'Proportional Serif'],
  6441. ['monospaceSerif', 'Monospace Serif'],
  6442. ['casual', 'Casual'],
  6443. ['script', 'Script'],
  6444. ['small-caps', 'Small Caps'],
  6445. ],
  6446. },
  6447. fontPercent: {
  6448. selector: '.vjs-font-percent > select',
  6449. id: 'captions-font-size-%s',
  6450. label: 'Font Size',
  6451. options: [
  6452. ['0.50', '50%'],
  6453. ['0.75', '75%'],
  6454. ['1.00', '100%'],
  6455. ['1.25', '125%'],
  6456. ['1.50', '150%'],
  6457. ['1.75', '175%'],
  6458. ['2.00', '200%'],
  6459. ['3.00', '300%'],
  6460. ['4.00', '400%'],
  6461. ],
  6462. default: 2,
  6463. parser: function (e) {
  6464. return '1.00' === e ? null : Number(e)
  6465. },
  6466. },
  6467. textOpacity: { selector: '.vjs-text-opacity > select', id: 'captions-foreground-opacity-%s', label: 'Transparency', options: [k, li] },
  6468. windowColor: { selector: '.vjs-window-color > select', id: 'captions-window-color-%s', label: 'Color' },
  6469. windowOpacity: { selector: '.vjs-window-opacity > select', id: 'captions-window-opacity-%s', label: 'Transparency', options: [f, li, k] },
  6470. }
  6471. function wn(e, t) {
  6472. if ((e = t ? t(e) : e) && 'none' !== e) return e
  6473. }
  6474. ;(Sn.windowColor.options = Sn.backgroundColor.options),
  6475. pt.registerComponent(
  6476. 'TextTrackSettings',
  6477. (function (n) {
  6478. function e(e, t) {
  6479. var i
  6480. return (
  6481. (t.temporary = !1),
  6482. ((i = n.call(this, e, t) || this).updateDisplay = i.updateDisplay.bind(ft(i))),
  6483. i.fill(),
  6484. (i.hasBeenOpened_ = i.hasBeenFilled_ = !0),
  6485. (i.endDialog = $('p', { className: 'vjs-control-text', textContent: i.localize('End of dialog window.') })),
  6486. i.el().appendChild(i.endDialog),
  6487. i.setDefaults(),
  6488. void 0 === t.persistTextTrackSettings && (i.options_.persistTextTrackSettings = i.options_.playerOptions.persistTextTrackSettings),
  6489. i.on(i.$('.vjs-done-button'), 'click', function () {
  6490. i.saveSettings(), i.close()
  6491. }),
  6492. i.on(i.$('.vjs-default-button'), 'click', function () {
  6493. i.setDefaults(), i.updateDisplay()
  6494. }),
  6495. _(Sn, function (e) {
  6496. i.on(i.$(e.selector), 'change', i.updateDisplay)
  6497. }),
  6498. i.options_.persistTextTrackSettings && i.restoreSettings(),
  6499. i
  6500. )
  6501. }
  6502. mt(e, n)
  6503. var t = e.prototype
  6504. return (
  6505. (t.dispose = function () {
  6506. ;(this.endDialog = null), n.prototype.dispose.call(this)
  6507. }),
  6508. (t.createElSelect_ = function (e, t, i) {
  6509. var n = this
  6510. void 0 === t && (t = ''), void 0 === i && (i = 'label')
  6511. var e = Sn[e],
  6512. r = e.id.replace('%s', this.id_),
  6513. a = [t, r].join(' ').trim()
  6514. return ['<' + i + ' id="' + r + '" class="' + ('label' === i ? 'vjs-label' : '') + '">', this.localize(e.label), '</' + i + '>', '<select aria-labelledby="' + a + '">']
  6515. .concat(
  6516. e.options.map(function (e) {
  6517. var t = r + '-' + e[1].replace(/\W+/g, '')
  6518. return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + ' ' + t + '">', n.localize(e[1]), '</option>'].join('')
  6519. })
  6520. )
  6521. .concat('</select>')
  6522. .join('')
  6523. }),
  6524. (t.createElFgColor_ = function () {
  6525. var e = 'captions-text-legend-' + this.id_
  6526. return [
  6527. '<fieldset class="vjs-fg-color vjs-track-setting">',
  6528. '<legend id="' + e + '">',
  6529. this.localize('Text'),
  6530. '</legend>',
  6531. this.createElSelect_('color', e),
  6532. '<span class="vjs-text-opacity vjs-opacity">',
  6533. this.createElSelect_('textOpacity', e),
  6534. '</span>',
  6535. '</fieldset>',
  6536. ].join('')
  6537. }),
  6538. (t.createElBgColor_ = function () {
  6539. var e = 'captions-background-' + this.id_
  6540. return [
  6541. '<fieldset class="vjs-bg-color vjs-track-setting">',
  6542. '<legend id="' + e + '">',
  6543. this.localize('Background'),
  6544. '</legend>',
  6545. this.createElSelect_('backgroundColor', e),
  6546. '<span class="vjs-bg-opacity vjs-opacity">',
  6547. this.createElSelect_('backgroundOpacity', e),
  6548. '</span>',
  6549. '</fieldset>',
  6550. ].join('')
  6551. }),
  6552. (t.createElWinColor_ = function () {
  6553. var e = 'captions-window-' + this.id_
  6554. return [
  6555. '<fieldset class="vjs-window-color vjs-track-setting">',
  6556. '<legend id="' + e + '">',
  6557. this.localize('Window'),
  6558. '</legend>',
  6559. this.createElSelect_('windowColor', e),
  6560. '<span class="vjs-window-opacity vjs-opacity">',
  6561. this.createElSelect_('windowOpacity', e),
  6562. '</span>',
  6563. '</fieldset>',
  6564. ].join('')
  6565. }),
  6566. (t.createElColors_ = function () {
  6567. return $('div', { className: 'vjs-track-settings-colors', innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join('') })
  6568. }),
  6569. (t.createElFont_ = function () {
  6570. return $('div', {
  6571. className: 'vjs-track-settings-font',
  6572. innerHTML: [
  6573. '<fieldset class="vjs-font-percent vjs-track-setting">',
  6574. this.createElSelect_('fontPercent', '', 'legend'),
  6575. '</fieldset>',
  6576. '<fieldset class="vjs-edge-style vjs-track-setting">',
  6577. this.createElSelect_('edgeStyle', '', 'legend'),
  6578. '</fieldset>',
  6579. '<fieldset class="vjs-font-family vjs-track-setting">',
  6580. this.createElSelect_('fontFamily', '', 'legend'),
  6581. '</fieldset>',
  6582. ].join(''),
  6583. })
  6584. }),
  6585. (t.createElControls_ = function () {
  6586. var e = this.localize('restore all settings to the default values')
  6587. return $('div', {
  6588. className: 'vjs-track-settings-controls',
  6589. innerHTML: [
  6590. '<button type="button" class="vjs-default-button" title="' + e + '">',
  6591. this.localize('Reset'),
  6592. '<span class="vjs-control-text"> ' + e + '</span>',
  6593. '</button>',
  6594. '<button type="button" class="vjs-done-button">' + this.localize('Done') + '</button>',
  6595. ].join(''),
  6596. })
  6597. }),
  6598. (t.content = function () {
  6599. return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
  6600. }),
  6601. (t.label = function () {
  6602. return this.localize('Caption Settings Dialog')
  6603. }),
  6604. (t.description = function () {
  6605. return this.localize('Beginning of dialog window. Escape will cancel and close the window.')
  6606. }),
  6607. (t.buildCSSClass = function () {
  6608. return n.prototype.buildCSSClass.call(this) + ' vjs-text-track-settings'
  6609. }),
  6610. (t.getValues = function () {
  6611. var i,
  6612. n,
  6613. e,
  6614. r = this
  6615. return (
  6616. (n = function (e, t, i) {
  6617. var n,
  6618. t = ((n = r.$(t.selector)), (t = t.parser), wn(n.options[n.options.selectedIndex].value, t))
  6619. return void 0 !== t && (e[i] = t), e
  6620. }),
  6621. void 0 === (e = {}) && (e = 0),
  6622. v((i = Sn)).reduce(function (e, t) {
  6623. return n(e, i[t], t)
  6624. }, e)
  6625. )
  6626. }),
  6627. (t.setValues = function (i) {
  6628. var n = this
  6629. _(Sn, function (e, t) {
  6630. !(function (e, t, i) {
  6631. if (t)
  6632. for (var n = 0; n < e.options.length; n++)
  6633. if (wn(e.options[n].value, i) === t) {
  6634. e.selectedIndex = n
  6635. break
  6636. }
  6637. })(n.$(e.selector), i[t], e.parser)
  6638. })
  6639. }),
  6640. (t.setDefaults = function () {
  6641. var i = this
  6642. _(Sn, function (e) {
  6643. var t = e.hasOwnProperty('default') ? e.default : 0
  6644. i.$(e.selector).selectedIndex = t
  6645. })
  6646. }),
  6647. (t.restoreSettings = function () {
  6648. var e
  6649. try {
  6650. e = JSON.parse(window.localStorage.getItem(Tn))
  6651. } catch (e) {
  6652. h.warn(e)
  6653. }
  6654. e && this.setValues(e)
  6655. }),
  6656. (t.saveSettings = function () {
  6657. if (this.options_.persistTextTrackSettings) {
  6658. var e = this.getValues()
  6659. try {
  6660. Object.keys(e).length ? window.localStorage.setItem(Tn, JSON.stringify(e)) : window.localStorage.removeItem(Tn)
  6661. } catch (e) {
  6662. h.warn(e)
  6663. }
  6664. }
  6665. }),
  6666. (t.updateDisplay = function () {
  6667. var e = this.player_.getChild('textTrackDisplay')
  6668. e && e.updateDisplay()
  6669. }),
  6670. (t.conditionalBlur_ = function () {
  6671. this.previouslyActiveEl_ = null
  6672. var e = this.player_.controlBar,
  6673. t = e && e.subsCapsButton,
  6674. e = e && e.captionsButton
  6675. t ? t.focus() : e && e.focus()
  6676. }),
  6677. e
  6678. )
  6679. })(At)
  6680. ),
  6681. pt.registerComponent(
  6682. 'ResizeManager',
  6683. (function (a) {
  6684. function e(e, t) {
  6685. var i,
  6686. n = t.ResizeObserver || window.ResizeObserver,
  6687. r = lt({ createEl: !(n = null === t.ResizeObserver ? !1 : n), reportTouchActivity: !1 }, t)
  6688. return (
  6689. ((i = a.call(this, e, r) || this).ResizeObserver = t.ResizeObserver || window.ResizeObserver),
  6690. (i.loadListener_ = null),
  6691. (i.resizeObserver_ = null),
  6692. (i.debouncedHandler_ = Ge(
  6693. function () {
  6694. i.resizeHandler()
  6695. },
  6696. 100,
  6697. !1,
  6698. ft(i)
  6699. )),
  6700. n
  6701. ? ((i.resizeObserver_ = new i.ResizeObserver(i.debouncedHandler_)), i.resizeObserver_.observe(e.el()))
  6702. : ((i.loadListener_ = function () {
  6703. var e, t
  6704. i.el_ &&
  6705. i.el_.contentWindow &&
  6706. ((e = i.debouncedHandler_),
  6707. (t = i.unloadListener_ =
  6708. function () {
  6709. Fe(this, 'resize', e), Fe(this, 'unload', t), (t = null)
  6710. }),
  6711. Be(i.el_.contentWindow, 'unload', t),
  6712. Be(i.el_.contentWindow, 'resize', e))
  6713. }),
  6714. i.one('load', i.loadListener_)),
  6715. i
  6716. )
  6717. }
  6718. mt(e, a)
  6719. var t = e.prototype
  6720. return (
  6721. (t.createEl = function () {
  6722. return a.prototype.createEl.call(this, 'iframe', { className: 'vjs-resize-manager', tabIndex: -1, title: this.localize('No content') }, { 'aria-hidden': 'true' })
  6723. }),
  6724. (t.resizeHandler = function () {
  6725. this.player_ && this.player_.trigger && this.player_.trigger('playerresize')
  6726. }),
  6727. (t.dispose = function () {
  6728. this.debouncedHandler_ && this.debouncedHandler_.cancel(),
  6729. this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()), this.resizeObserver_.disconnect()),
  6730. this.loadListener_ && this.off('load', this.loadListener_),
  6731. this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow),
  6732. (this.ResizeObserver = null),
  6733. (this.resizeObserver = null),
  6734. (this.debouncedHandler_ = null),
  6735. (this.loadListener_ = null),
  6736. a.prototype.dispose.call(this)
  6737. }),
  6738. e
  6739. )
  6740. })(pt)
  6741. )
  6742. var En = { trackingThreshold: 20, liveTolerance: 15 }
  6743. pt.registerComponent(
  6744. 'LiveTracker',
  6745. (function (n) {
  6746. function e(e, t) {
  6747. var t = lt(En, t, { createEl: !1 }),
  6748. i = n.call(this, e, t) || this
  6749. return (
  6750. (i.handleVisibilityChange_ = function (e) {
  6751. return i.handleVisibilityChange(e)
  6752. }),
  6753. (i.trackLiveHandler_ = function () {
  6754. return i.trackLive_()
  6755. }),
  6756. (i.handlePlay_ = function (e) {
  6757. return i.handlePlay(e)
  6758. }),
  6759. (i.handleFirstTimeupdate_ = function (e) {
  6760. return i.handleFirstTimeupdate(e)
  6761. }),
  6762. (i.handleSeeked_ = function (e) {
  6763. return i.handleSeeked(e)
  6764. }),
  6765. (i.seekToLiveEdge_ = function (e) {
  6766. return i.seekToLiveEdge(e)
  6767. }),
  6768. i.reset_(),
  6769. i.on(i.player_, 'durationchange', function (e) {
  6770. return i.handleDurationchange(e)
  6771. }),
  6772. i.on(i.player_, 'canplay', function () {
  6773. return i.toggleTracking()
  6774. }),
  6775. N && 'hidden' in document && 'visibilityState' in document && i.on(document, 'visibilitychange', i.handleVisibilityChange_),
  6776. i
  6777. )
  6778. }
  6779. mt(e, n)
  6780. var t = e.prototype
  6781. return (
  6782. (t.handleVisibilityChange = function () {
  6783. this.player_.duration() === 1 / 0 && (document.hidden ? this.stopTracking() : this.startTracking())
  6784. }),
  6785. (t.trackLive_ = function () {
  6786. var e,
  6787. t = this.player_.seekable()
  6788. t &&
  6789. t.length &&
  6790. ((e = Number(window.performance.now().toFixed(4))),
  6791. (t = -1 === this.lastTime_ ? 0 : (e - this.lastTime_) / 1e3),
  6792. (this.lastTime_ = e),
  6793. (this.pastSeekEnd_ = this.pastSeekEnd() + t),
  6794. (e = this.liveCurrentTime()),
  6795. (t = this.player_.currentTime()),
  6796. (t = this.player_.paused() || this.seekedBehindLive_ || Math.abs(e - t) > this.options_.liveTolerance),
  6797. (t = !this.timeupdateSeen_ || e === 1 / 0 ? !1 : t) !== this.behindLiveEdge_ && ((this.behindLiveEdge_ = t), this.trigger('liveedgechange')))
  6798. }),
  6799. (t.handleDurationchange = function () {
  6800. this.toggleTracking()
  6801. }),
  6802. (t.toggleTracking = function () {
  6803. this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold
  6804. ? (this.player_.options_.liveui && this.player_.addClass('vjs-liveui'), this.startTracking())
  6805. : (this.player_.removeClass('vjs-liveui'), this.stopTracking())
  6806. }),
  6807. (t.startTracking = function () {
  6808. this.isTracking() ||
  6809. (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()),
  6810. (this.trackingInterval_ = this.setInterval(this.trackLiveHandler_, 30)),
  6811. this.trackLive_(),
  6812. this.on(this.player_, ['play', 'pause'], this.trackLiveHandler_),
  6813. this.timeupdateSeen_
  6814. ? this.on(this.player_, 'seeked', this.handleSeeked_)
  6815. : (this.one(this.player_, 'play', this.handlePlay_), this.one(this.player_, 'timeupdate', this.handleFirstTimeupdate_)))
  6816. }),
  6817. (t.handleFirstTimeupdate = function () {
  6818. ;(this.timeupdateSeen_ = !0), this.on(this.player_, 'seeked', this.handleSeeked_)
  6819. }),
  6820. (t.handleSeeked = function () {
  6821. var e = Math.abs(this.liveCurrentTime() - this.player_.currentTime())
  6822. ;(this.seekedBehindLive_ = this.nextSeekedFromUser_ && 2 < e), (this.nextSeekedFromUser_ = !1), this.trackLive_()
  6823. }),
  6824. (t.handlePlay = function () {
  6825. this.one(this.player_, 'timeupdate', this.seekToLiveEdge_)
  6826. }),
  6827. (t.reset_ = function () {
  6828. ;(this.lastTime_ = -1),
  6829. (this.pastSeekEnd_ = 0),
  6830. (this.lastSeekEnd_ = -1),
  6831. (this.behindLiveEdge_ = !0),
  6832. (this.timeupdateSeen_ = !1),
  6833. (this.seekedBehindLive_ = !1),
  6834. (this.nextSeekedFromUser_ = !1),
  6835. this.clearInterval(this.trackingInterval_),
  6836. (this.trackingInterval_ = null),
  6837. this.off(this.player_, ['play', 'pause'], this.trackLiveHandler_),
  6838. this.off(this.player_, 'seeked', this.handleSeeked_),
  6839. this.off(this.player_, 'play', this.handlePlay_),
  6840. this.off(this.player_, 'timeupdate', this.handleFirstTimeupdate_),
  6841. this.off(this.player_, 'timeupdate', this.seekToLiveEdge_)
  6842. }),
  6843. (t.nextSeekedFromUser = function () {
  6844. this.nextSeekedFromUser_ = !0
  6845. }),
  6846. (t.stopTracking = function () {
  6847. this.isTracking() && (this.reset_(), this.trigger('liveedgechange'))
  6848. }),
  6849. (t.seekableEnd = function () {
  6850. for (var e = this.player_.seekable(), t = [], i = e ? e.length : 0; i--; ) t.push(e.end(i))
  6851. return t.length ? t.sort()[t.length - 1] : 1 / 0
  6852. }),
  6853. (t.seekableStart = function () {
  6854. for (var e = this.player_.seekable(), t = [], i = e ? e.length : 0; i--; ) t.push(e.start(i))
  6855. return t.length ? t.sort()[0] : 0
  6856. }),
  6857. (t.liveWindow = function () {
  6858. var e = this.liveCurrentTime()
  6859. return e === 1 / 0 ? 0 : e - this.seekableStart()
  6860. }),
  6861. (t.isLive = function () {
  6862. return this.isTracking()
  6863. }),
  6864. (t.atLiveEdge = function () {
  6865. return !this.behindLiveEdge()
  6866. }),
  6867. (t.liveCurrentTime = function () {
  6868. return this.pastSeekEnd() + this.seekableEnd()
  6869. }),
  6870. (t.pastSeekEnd = function () {
  6871. var e = this.seekableEnd()
  6872. return -1 !== this.lastSeekEnd_ && e !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0), (this.lastSeekEnd_ = e), this.pastSeekEnd_
  6873. }),
  6874. (t.behindLiveEdge = function () {
  6875. return this.behindLiveEdge_
  6876. }),
  6877. (t.isTracking = function () {
  6878. return 'number' == typeof this.trackingInterval_
  6879. }),
  6880. (t.seekToLiveEdge = function () {
  6881. ;(this.seekedBehindLive_ = !1), this.atLiveEdge() || ((this.nextSeekedFromUser_ = !1), this.player_.currentTime(this.liveCurrentTime()))
  6882. }),
  6883. (t.dispose = function () {
  6884. this.off(document, 'visibilitychange', this.handleVisibilityChange_), this.stopTracking(), n.prototype.dispose.call(this)
  6885. }),
  6886. e
  6887. )
  6888. })(pt)
  6889. )
  6890. function kn(e) {
  6891. if ((n = e.el()).hasAttribute('src')) return e.triggerSourceset(n.src), 1
  6892. var t = e.$$('source'),
  6893. i = [],
  6894. n = ''
  6895. if (t.length) {
  6896. for (var r = 0; r < t.length; r++) {
  6897. var a = t[r].src
  6898. a && -1 === i.indexOf(a) && i.push(a)
  6899. }
  6900. return !!i.length && (1 === i.length && (n = i[0]), e.triggerSourceset(n), !0)
  6901. }
  6902. }
  6903. function Cn(e, t) {
  6904. for (var i = {}, n = 0; n < e.length && !((i = Object.getOwnPropertyDescriptor(e[n], t)) && i.set && i.get); n++);
  6905. return (i.enumerable = !0), (i.configurable = !0), i
  6906. }
  6907. function In(a) {
  6908. var t,
  6909. e,
  6910. i,
  6911. s = a.el()
  6912. s.resetSourceWatch_ ||
  6913. ((t = {}),
  6914. (e = Cn([a.el(), window.HTMLMediaElement.prototype, window.Element.prototype, Ln], 'innerHTML')),
  6915. (i = function (r) {
  6916. return function () {
  6917. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  6918. var n = r.apply(s, t)
  6919. return kn(a), n
  6920. }
  6921. }),
  6922. ['append', 'appendChild', 'insertAdjacentHTML'].forEach(function (e) {
  6923. s[e] && ((t[e] = s[e]), (s[e] = i(t[e])))
  6924. }),
  6925. Object.defineProperty(s, 'innerHTML', lt(e, { set: i(e.set) })),
  6926. (s.resetSourceWatch_ = function () {
  6927. ;(s.resetSourceWatch_ = null),
  6928. Object.keys(t).forEach(function (e) {
  6929. s[e] = t[e]
  6930. }),
  6931. Object.defineProperty(s, 'innerHTML', e)
  6932. }),
  6933. a.one('sourceset', s.resetSourceWatch_))
  6934. }
  6935. function xn(i) {
  6936. var n, t, r, a
  6937. i.featuresSourceset &&
  6938. ((n = i.el()).resetSourceset_ ||
  6939. ((t = Cn([i.el(), window.HTMLMediaElement.prototype, Dn], 'src')),
  6940. (r = n.setAttribute),
  6941. (a = n.load),
  6942. Object.defineProperty(
  6943. n,
  6944. 'src',
  6945. lt(t, {
  6946. set: function (e) {
  6947. e = t.set.call(n, e)
  6948. return i.triggerSourceset(n.src), e
  6949. },
  6950. })
  6951. ),
  6952. (n.setAttribute = function (e, t) {
  6953. t = r.call(n, e, t)
  6954. return /src/i.test(e) && i.triggerSourceset(n.src), t
  6955. }),
  6956. (n.load = function () {
  6957. var e = a.call(n)
  6958. return kn(i) || (i.triggerSourceset(''), In(i)), e
  6959. }),
  6960. n.currentSrc ? i.triggerSourceset(n.currentSrc) : kn(i) || In(i),
  6961. (n.resetSourceset_ = function () {
  6962. ;(n.resetSourceset_ = null), (n.load = a), (n.setAttribute = r), Object.defineProperty(n, 'src', t), n.resetSourceWatch_ && n.resetSourceWatch_()
  6963. })))
  6964. }
  6965. function An(t, i, n, e) {
  6966. function r(e) {
  6967. return Object.defineProperty(t, i, { value: e, enumerable: !0, writable: !0 })
  6968. }
  6969. var a = {
  6970. configurable: !0,
  6971. enumerable: !0,
  6972. get: function () {
  6973. var e = n()
  6974. return r(e), e
  6975. },
  6976. }
  6977. return (e = void 0 === e ? !0 : e) && (a.set = r), Object.defineProperty(t, i, a)
  6978. }
  6979. var Pn,
  6980. Ln = Object.defineProperty({}, 'innerHTML', {
  6981. get: function () {
  6982. return this.cloneNode(!0).innerHTML
  6983. },
  6984. set: function (e) {
  6985. var t = document.createElement(this.nodeName.toLowerCase())
  6986. t.innerHTML = e
  6987. for (var i = document.createDocumentFragment(); t.childNodes.length; ) i.appendChild(t.childNodes[0])
  6988. return (this.innerText = ''), window.Element.prototype.appendChild.call(this, i), this.innerHTML
  6989. },
  6990. }),
  6991. Dn = Object.defineProperty({}, 'src', {
  6992. get: function () {
  6993. return this.hasAttribute('src') ? Rt(window.Element.prototype.getAttribute.call(this, 'src')) : ''
  6994. },
  6995. set: function (e) {
  6996. return window.Element.prototype.setAttribute.call(this, 'src', e), e
  6997. },
  6998. }),
  6999. On = (function (l) {
  7000. function s(e, t) {
  7001. var i = l.call(this, e, t) || this,
  7002. t = e.source,
  7003. n = !1
  7004. if (
  7005. ((i.featuresVideoFrameCallback = i.featuresVideoFrameCallback && 'VIDEO' === i.el_.tagName),
  7006. t && (i.el_.currentSrc !== t.src || (e.tag && 3 === e.tag.initNetworkState_)) ? i.setSource(t) : i.handleLateInit_(i.el_),
  7007. e.enableSourceset && i.setupSourcesetHandling_(),
  7008. (i.isScrubbing_ = !1),
  7009. i.el_.hasChildNodes())
  7010. ) {
  7011. for (var r = i.el_.childNodes, a = r.length, s = []; a--; ) {
  7012. var o = r[a]
  7013. 'track' === o.nodeName.toLowerCase() &&
  7014. (i.featuresNativeTextTracks
  7015. ? (i.remoteTextTrackEls().addTrackElement_(o),
  7016. i.remoteTextTracks().addTrack(o.track),
  7017. i.textTracks().addTrack(o.track),
  7018. n || i.el_.hasAttribute('crossorigin') || !Ut(o.src) || (n = !0))
  7019. : s.push(o))
  7020. }
  7021. for (var u = 0; u < s.length; u++) i.el_.removeChild(s[u])
  7022. }
  7023. return (
  7024. i.proxyNativeTracks_(),
  7025. i.featuresNativeTextTracks && n && h.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),
  7026. i.restoreMetadataTracksInIOSNativePlayer_(),
  7027. (F || H || L) && !0 === e.nativeControlsForTouch && i.setControls(!0),
  7028. i.proxyWebkitFullscreen_(),
  7029. i.triggerReady(),
  7030. i
  7031. )
  7032. }
  7033. mt(s, l)
  7034. var e = s.prototype
  7035. return (
  7036. (e.dispose = function () {
  7037. this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(), s.disposeMediaElement(this.el_), (this.options_ = null), l.prototype.dispose.call(this)
  7038. }),
  7039. (e.setupSourcesetHandling_ = function () {
  7040. xn(this)
  7041. }),
  7042. (e.restoreMetadataTracksInIOSNativePlayer_ = function () {
  7043. function e() {
  7044. i = []
  7045. for (var e = 0; e < n.length; e++) {
  7046. var t = n[e]
  7047. 'metadata' === t.kind && i.push({ track: t, storedMode: t.mode })
  7048. }
  7049. }
  7050. var i,
  7051. n = this.textTracks()
  7052. e(),
  7053. n.addEventListener('change', e),
  7054. this.on('dispose', function () {
  7055. return n.removeEventListener('change', e)
  7056. })
  7057. function r() {
  7058. for (var e = 0; e < i.length; e++) {
  7059. var t = i[e]
  7060. 'disabled' === t.track.mode && t.track.mode !== t.storedMode && (t.track.mode = t.storedMode)
  7061. }
  7062. n.removeEventListener('change', r)
  7063. }
  7064. this.on('webkitbeginfullscreen', function () {
  7065. n.removeEventListener('change', e), n.removeEventListener('change', r), n.addEventListener('change', r)
  7066. }),
  7067. this.on('webkitendfullscreen', function () {
  7068. n.removeEventListener('change', e), n.addEventListener('change', e), n.removeEventListener('change', r)
  7069. })
  7070. }),
  7071. (e.overrideNative_ = function (e, t) {
  7072. var i,
  7073. n = this
  7074. t === this['featuresNative' + e + 'Tracks'] &&
  7075. (this[(i = e.toLowerCase()) + 'TracksListeners_'] &&
  7076. Object.keys(this[i + 'TracksListeners_']).forEach(function (e) {
  7077. n.el()[i + 'Tracks'].removeEventListener(e, n[i + 'TracksListeners_'][e])
  7078. }),
  7079. (this['featuresNative' + e + 'Tracks'] = !t),
  7080. (this[i + 'TracksListeners_'] = null),
  7081. this.proxyNativeTracksForType_(i))
  7082. }),
  7083. (e.overrideNativeAudioTracks = function (e) {
  7084. this.overrideNative_('Audio', e)
  7085. }),
  7086. (e.overrideNativeVideoTracks = function (e) {
  7087. this.overrideNative_('Video', e)
  7088. }),
  7089. (e.proxyNativeTracksForType_ = function (i) {
  7090. var e,
  7091. t,
  7092. n = this,
  7093. r = ai[i],
  7094. a = this.el()[r.getterName],
  7095. s = this[r.getterName]()
  7096. this['featuresNative' + r.capitalName + 'Tracks'] &&
  7097. a &&
  7098. a.addEventListener &&
  7099. ((t = function () {
  7100. for (var e = [], t = 0; t < s.length; t++) {
  7101. for (var i = !1, n = 0; n < a.length; n++)
  7102. if (a[n] === s[t]) {
  7103. i = !0
  7104. break
  7105. }
  7106. i || e.push(s[t])
  7107. }
  7108. for (; e.length; ) s.removeTrack(e.shift())
  7109. }),
  7110. (this[r.getterName + 'Listeners_'] = e =
  7111. {
  7112. change: function (e) {
  7113. var t = { type: 'change', target: s, currentTarget: s, srcElement: s }
  7114. s.trigger(t), 'text' === i && n[si.remoteText.getterName]().trigger(t)
  7115. },
  7116. addtrack: function (e) {
  7117. s.addTrack(e.track)
  7118. },
  7119. removetrack: function (e) {
  7120. s.removeTrack(e.track)
  7121. },
  7122. }),
  7123. Object.keys(e).forEach(function (t) {
  7124. var i = e[t]
  7125. a.addEventListener(t, i),
  7126. n.on('dispose', function (e) {
  7127. return a.removeEventListener(t, i)
  7128. })
  7129. }),
  7130. this.on('loadstart', t),
  7131. this.on('dispose', function (e) {
  7132. return n.off('loadstart', t)
  7133. }))
  7134. }),
  7135. (e.proxyNativeTracks_ = function () {
  7136. var t = this
  7137. ai.names.forEach(function (e) {
  7138. t.proxyNativeTracksForType_(e)
  7139. })
  7140. }),
  7141. (e.createEl = function () {
  7142. var e,
  7143. t = this.options_.tag
  7144. ;(t && (this.options_.playerElIngest || this.movingMediaElementInDOM)) ||
  7145. (t
  7146. ? ((e = t.cloneNode(!0)), t.parentNode && t.parentNode.insertBefore(e, t), s.disposeMediaElement(t), (t = e))
  7147. : ((t = document.createElement('video')),
  7148. (e = lt({}, this.options_.tag && ae(this.options_.tag))),
  7149. (F && !0 === this.options_.nativeControlsForTouch) || delete e.controls,
  7150. re(t, b(e, { id: this.options_.techId, class: 'vjs-tech' }))),
  7151. (t.playerId = this.options_.playerId)),
  7152. 'undefined' != typeof this.options_.preload && oe(t, 'preload', this.options_.preload),
  7153. void 0 !== this.options_.disablePictureInPicture && (t.disablePictureInPicture = this.options_.disablePictureInPicture)
  7154. for (var i = ['loop', 'muted', 'playsinline', 'autoplay'], n = 0; n < i.length; n++) {
  7155. var r = i[n],
  7156. a = this.options_[r]
  7157. 'undefined' != typeof a && (a ? oe(t, r, r) : ue(t, r), (t[r] = a))
  7158. }
  7159. return t
  7160. }),
  7161. (e.handleLateInit_ = function (e) {
  7162. if (0 !== e.networkState && 3 !== e.networkState) {
  7163. if (0 === e.readyState) {
  7164. var t = !1,
  7165. i = function () {
  7166. t = !0
  7167. }
  7168. this.on('loadstart', i)
  7169. var n = function () {
  7170. t || this.trigger('loadstart')
  7171. }
  7172. return (
  7173. this.on('loadedmetadata', n),
  7174. void this.ready(function () {
  7175. this.off('loadstart', i), this.off('loadedmetadata', n), t || this.trigger('loadstart')
  7176. })
  7177. )
  7178. }
  7179. var r = ['loadstart']
  7180. r.push('loadedmetadata'),
  7181. 2 <= e.readyState && r.push('loadeddata'),
  7182. 3 <= e.readyState && r.push('canplay'),
  7183. 4 <= e.readyState && r.push('canplaythrough'),
  7184. this.ready(function () {
  7185. r.forEach(function (e) {
  7186. this.trigger(e)
  7187. }, this)
  7188. })
  7189. }
  7190. }),
  7191. (e.setScrubbing = function (e) {
  7192. this.isScrubbing_ = e
  7193. }),
  7194. (e.scrubbing = function () {
  7195. return this.isScrubbing_
  7196. }),
  7197. (e.setCurrentTime = function (e) {
  7198. try {
  7199. this.isScrubbing_ && this.el_.fastSeek && V ? this.el_.fastSeek(e) : (this.el_.currentTime = e)
  7200. } catch (e) {
  7201. h(e, 'Video is not ready. (Video.js)')
  7202. }
  7203. }),
  7204. (e.duration = function () {
  7205. var t = this
  7206. return this.el_.duration === 1 / 0 && A && M && 0 === this.el_.currentTime
  7207. ? (this.on('timeupdate', function e() {
  7208. 0 < t.el_.currentTime && (t.el_.duration === 1 / 0 && t.trigger('durationchange'), t.off('timeupdate', e))
  7209. }),
  7210. NaN)
  7211. : this.el_.duration || NaN
  7212. }),
  7213. (e.width = function () {
  7214. return this.el_.offsetWidth
  7215. }),
  7216. (e.height = function () {
  7217. return this.el_.offsetHeight
  7218. }),
  7219. (e.proxyWebkitFullscreen_ = function () {
  7220. var e,
  7221. t,
  7222. i = this
  7223. 'webkitDisplayingFullscreen' in this.el_ &&
  7224. ((e = function () {
  7225. this.trigger('fullscreenchange', { isFullscreen: !1 }), this.el_.controls && !this.options_.nativeControlsForTouch && this.controls() && (this.el_.controls = !1)
  7226. }),
  7227. (t = function () {
  7228. 'webkitPresentationMode' in this.el_ &&
  7229. 'picture-in-picture' !== this.el_.webkitPresentationMode &&
  7230. (this.one('webkitendfullscreen', e), this.trigger('fullscreenchange', { isFullscreen: !0, nativeIOSFullscreen: !0 }))
  7231. }),
  7232. this.on('webkitbeginfullscreen', t),
  7233. this.on('dispose', function () {
  7234. i.off('webkitbeginfullscreen', t), i.off('webkitendfullscreen', e)
  7235. }))
  7236. }),
  7237. (e.supportsFullScreen = function () {
  7238. if ('function' == typeof this.el_.webkitEnterFullScreen) {
  7239. var e = (window.navigator && window.navigator.userAgent) || ''
  7240. if (/Android/.test(e) || !/Chrome|Mac OS X 10.5/.test(e)) return !0
  7241. }
  7242. return !1
  7243. }),
  7244. (e.enterFullScreen = function () {
  7245. var e = this.el_
  7246. if (e.paused && e.networkState <= e.HAVE_METADATA)
  7247. Et(this.el_.play()),
  7248. this.setTimeout(function () {
  7249. e.pause()
  7250. try {
  7251. e.webkitEnterFullScreen()
  7252. } catch (e) {
  7253. this.trigger('fullscreenerror', e)
  7254. }
  7255. }, 0)
  7256. else
  7257. try {
  7258. e.webkitEnterFullScreen()
  7259. } catch (e) {
  7260. this.trigger('fullscreenerror', e)
  7261. }
  7262. }),
  7263. (e.exitFullScreen = function () {
  7264. this.el_.webkitDisplayingFullscreen ? this.el_.webkitExitFullScreen() : this.trigger('fullscreenerror', new Error('The video is not fullscreen'))
  7265. }),
  7266. (e.requestPictureInPicture = function () {
  7267. return this.el_.requestPictureInPicture()
  7268. }),
  7269. (e.requestVideoFrameCallback = function (e) {
  7270. return this.featuresVideoFrameCallback && !this.el_.webkitKeys ? this.el_.requestVideoFrameCallback(e) : l.prototype.requestVideoFrameCallback.call(this, e)
  7271. }),
  7272. (e.cancelVideoFrameCallback = function (e) {
  7273. this.featuresVideoFrameCallback && !this.el_.webkitKeys ? this.el_.cancelVideoFrameCallback(e) : l.prototype.cancelVideoFrameCallback.call(this, e)
  7274. }),
  7275. (e.src = function (e) {
  7276. if (void 0 === e) return this.el_.src
  7277. this.setSrc(e)
  7278. }),
  7279. (e.reset = function () {
  7280. s.resetMediaElement(this.el_)
  7281. }),
  7282. (e.currentSrc = function () {
  7283. return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc
  7284. }),
  7285. (e.setControls = function (e) {
  7286. this.el_.controls = !!e
  7287. }),
  7288. (e.addTextTrack = function (e, t, i) {
  7289. return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, i) : l.prototype.addTextTrack.call(this, e, t, i)
  7290. }),
  7291. (e.createRemoteTextTrack = function (e) {
  7292. if (!this.featuresNativeTextTracks) return l.prototype.createRemoteTextTrack.call(this, e)
  7293. var t = document.createElement('track')
  7294. return (
  7295. e.kind && (t.kind = e.kind),
  7296. e.label && (t.label = e.label),
  7297. (e.language || e.srclang) && (t.srclang = e.language || e.srclang),
  7298. e.default && (t.default = e.default),
  7299. e.id && (t.id = e.id),
  7300. e.src && (t.src = e.src),
  7301. t
  7302. )
  7303. }),
  7304. (e.addRemoteTextTrack = function (e, t) {
  7305. t = l.prototype.addRemoteTextTrack.call(this, e, t)
  7306. return this.featuresNativeTextTracks && this.el().appendChild(t), t
  7307. }),
  7308. (e.removeRemoteTextTrack = function (e) {
  7309. if ((l.prototype.removeRemoteTextTrack.call(this, e), this.featuresNativeTextTracks))
  7310. for (var t = this.$$('track'), i = t.length; i--; ) (e !== t[i] && e !== t[i].track) || this.el().removeChild(t[i])
  7311. }),
  7312. (e.getVideoPlaybackQuality = function () {
  7313. if ('function' == typeof this.el().getVideoPlaybackQuality) return this.el().getVideoPlaybackQuality()
  7314. var e = {}
  7315. return (
  7316. 'undefined' != typeof this.el().webkitDroppedFrameCount &&
  7317. 'undefined' != typeof this.el().webkitDecodedFrameCount &&
  7318. ((e.droppedVideoFrames = this.el().webkitDroppedFrameCount), (e.totalVideoFrames = this.el().webkitDecodedFrameCount)),
  7319. window.performance && 'function' == typeof window.performance.now
  7320. ? (e.creationTime = window.performance.now())
  7321. : window.performance &&
  7322. window.performance.timing &&
  7323. 'number' == typeof window.performance.timing.navigationStart &&
  7324. (e.creationTime = window.Date.now() - window.performance.timing.navigationStart),
  7325. e
  7326. )
  7327. }),
  7328. s
  7329. )
  7330. })(ji)
  7331. An(On, 'TEST_VID', function () {
  7332. if (X()) {
  7333. var e = document.createElement('video'),
  7334. t = document.createElement('track')
  7335. return (t.kind = 'captions'), (t.srclang = 'en'), (t.label = 'English'), e.appendChild(t), e
  7336. }
  7337. }),
  7338. (On.isSupported = function () {
  7339. try {
  7340. On.TEST_VID.volume = 0.5
  7341. } catch (e) {
  7342. return !1
  7343. }
  7344. return !(!On.TEST_VID || !On.TEST_VID.canPlayType)
  7345. }),
  7346. (On.canPlayType = function (e) {
  7347. return On.TEST_VID.canPlayType(e)
  7348. }),
  7349. (On.canPlaySource = function (e, t) {
  7350. return On.canPlayType(e.type)
  7351. }),
  7352. (On.canControlVolume = function () {
  7353. try {
  7354. var e = On.TEST_VID.volume
  7355. On.TEST_VID.volume = e / 2 + 0.1
  7356. var t = e !== On.TEST_VID.volume
  7357. return t && q
  7358. ? (window.setTimeout(function () {
  7359. On && On.prototype && (On.prototype.featuresVolumeControl = e !== On.TEST_VID.volume)
  7360. }),
  7361. !1)
  7362. : t
  7363. } catch (e) {
  7364. return !1
  7365. }
  7366. }),
  7367. (On.canMuteVolume = function () {
  7368. try {
  7369. var e = On.TEST_VID.muted
  7370. return (On.TEST_VID.muted = !e), On.TEST_VID.muted ? oe(On.TEST_VID, 'muted', 'muted') : ue(On.TEST_VID, 'muted'), e !== On.TEST_VID.muted
  7371. } catch (e) {
  7372. return !1
  7373. }
  7374. }),
  7375. (On.canControlPlaybackRate = function () {
  7376. if (A && M && R < 58) return !1
  7377. try {
  7378. var e = On.TEST_VID.playbackRate
  7379. return (On.TEST_VID.playbackRate = e / 2 + 0.1), e !== On.TEST_VID.playbackRate
  7380. } catch (e) {
  7381. return !1
  7382. }
  7383. }),
  7384. (On.canOverrideAttributes = function () {
  7385. try {
  7386. var e = function () {}
  7387. Object.defineProperty(document.createElement('video'), 'src', { get: e, set: e }),
  7388. Object.defineProperty(document.createElement('audio'), 'src', { get: e, set: e }),
  7389. Object.defineProperty(document.createElement('video'), 'innerHTML', { get: e, set: e }),
  7390. Object.defineProperty(document.createElement('audio'), 'innerHTML', { get: e, set: e })
  7391. } catch (e) {
  7392. return !1
  7393. }
  7394. return !0
  7395. }),
  7396. (On.supportsNativeTextTracks = function () {
  7397. return V || (q && M)
  7398. }),
  7399. (On.supportsNativeVideoTracks = function () {
  7400. return !(!On.TEST_VID || !On.TEST_VID.videoTracks)
  7401. }),
  7402. (On.supportsNativeAudioTracks = function () {
  7403. return !(!On.TEST_VID || !On.TEST_VID.audioTracks)
  7404. }),
  7405. (On.Events = [
  7406. 'loadstart',
  7407. 'suspend',
  7408. 'abort',
  7409. 'error',
  7410. 'emptied',
  7411. 'stalled',
  7412. 'loadedmetadata',
  7413. 'loadeddata',
  7414. 'canplay',
  7415. 'canplaythrough',
  7416. 'playing',
  7417. 'waiting',
  7418. 'seeking',
  7419. 'seeked',
  7420. 'ended',
  7421. 'durationchange',
  7422. 'timeupdate',
  7423. 'progress',
  7424. 'play',
  7425. 'pause',
  7426. 'ratechange',
  7427. 'resize',
  7428. 'volumechange',
  7429. ]),
  7430. [
  7431. ['featuresMuteControl', 'canMuteVolume'],
  7432. ['featuresPlaybackRate', 'canControlPlaybackRate'],
  7433. ['featuresSourceset', 'canOverrideAttributes'],
  7434. ['featuresNativeTextTracks', 'supportsNativeTextTracks'],
  7435. ['featuresNativeVideoTracks', 'supportsNativeVideoTracks'],
  7436. ['featuresNativeAudioTracks', 'supportsNativeAudioTracks'],
  7437. ].forEach(function (e) {
  7438. var t = e[0],
  7439. i = e[1]
  7440. An(
  7441. On.prototype,
  7442. t,
  7443. function () {
  7444. return On[i]()
  7445. },
  7446. !0
  7447. )
  7448. }),
  7449. (On.prototype.featuresVolumeControl = On.canControlVolume()),
  7450. (On.prototype.movingMediaElementInDOM = !q),
  7451. (On.prototype.featuresFullscreenResize = !0),
  7452. (On.prototype.featuresProgressEvents = !0),
  7453. (On.prototype.featuresTimeupdateEvents = !0),
  7454. (On.prototype.featuresVideoFrameCallback = !(!On.TEST_VID || !On.TEST_VID.requestVideoFrameCallback)),
  7455. (On.patchCanPlayType = function () {
  7456. 4 <= P &&
  7457. !D &&
  7458. !M &&
  7459. ((Pn = On.TEST_VID && On.TEST_VID.constructor.prototype.canPlayType),
  7460. (On.TEST_VID.constructor.prototype.canPlayType = function (e) {
  7461. return e && /^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e) ? 'maybe' : Pn.call(this, e)
  7462. }))
  7463. }),
  7464. (On.unpatchCanPlayType = function () {
  7465. var e = On.TEST_VID.constructor.prototype.canPlayType
  7466. return Pn && (On.TEST_VID.constructor.prototype.canPlayType = Pn), e
  7467. }),
  7468. On.patchCanPlayType(),
  7469. (On.disposeMediaElement = function (e) {
  7470. if (e) {
  7471. for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes(); ) e.removeChild(e.firstChild)
  7472. e.removeAttribute('src'),
  7473. 'function' == typeof e.load &&
  7474. (function () {
  7475. try {
  7476. e.load()
  7477. } catch (e) {}
  7478. })()
  7479. }
  7480. }),
  7481. (On.resetMediaElement = function (e) {
  7482. if (e) {
  7483. for (var t = e.querySelectorAll('source'), i = t.length; i--; ) e.removeChild(t[i])
  7484. e.removeAttribute('src'),
  7485. 'function' == typeof e.load &&
  7486. (function () {
  7487. try {
  7488. e.load()
  7489. } catch (e) {}
  7490. })()
  7491. }
  7492. }),
  7493. ['muted', 'defaultMuted', 'autoplay', 'controls', 'loop', 'playsinline'].forEach(function (e) {
  7494. On.prototype[e] = function () {
  7495. return this.el_[e] || this.el_.hasAttribute(e)
  7496. }
  7497. }),
  7498. ['muted', 'defaultMuted', 'autoplay', 'loop', 'playsinline'].forEach(function (t) {
  7499. On.prototype['set' + ut(t)] = function (e) {
  7500. ;(this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t)
  7501. }
  7502. }),
  7503. [
  7504. 'paused',
  7505. 'currentTime',
  7506. 'buffered',
  7507. 'volume',
  7508. 'poster',
  7509. 'preload',
  7510. 'error',
  7511. 'seeking',
  7512. 'seekable',
  7513. 'ended',
  7514. 'playbackRate',
  7515. 'defaultPlaybackRate',
  7516. 'disablePictureInPicture',
  7517. 'played',
  7518. 'networkState',
  7519. 'readyState',
  7520. 'videoWidth',
  7521. 'videoHeight',
  7522. 'crossOrigin',
  7523. ].forEach(function (e) {
  7524. On.prototype[e] = function () {
  7525. return this.el_[e]
  7526. }
  7527. }),
  7528. ['volume', 'src', 'poster', 'preload', 'playbackRate', 'defaultPlaybackRate', 'disablePictureInPicture', 'crossOrigin'].forEach(function (t) {
  7529. On.prototype['set' + ut(t)] = function (e) {
  7530. this.el_[t] = e
  7531. }
  7532. }),
  7533. ['pause', 'load', 'play'].forEach(function (e) {
  7534. On.prototype[e] = function () {
  7535. return this.el_[e]()
  7536. }
  7537. }),
  7538. ji.withSourceHandlers(On),
  7539. (On.nativeSourceHandler = {}),
  7540. (On.nativeSourceHandler.canPlayType = function (e) {
  7541. try {
  7542. return On.TEST_VID.canPlayType(e)
  7543. } catch (e) {
  7544. return ''
  7545. }
  7546. }),
  7547. (On.nativeSourceHandler.canHandleSource = function (e, t) {
  7548. if (e.type) return On.nativeSourceHandler.canPlayType(e.type)
  7549. if (e.src) {
  7550. e = Nt(e.src)
  7551. return On.nativeSourceHandler.canPlayType('video/' + e)
  7552. }
  7553. return ''
  7554. }),
  7555. (On.nativeSourceHandler.handleSource = function (e, t, i) {
  7556. t.setSrc(e.src)
  7557. }),
  7558. (On.nativeSourceHandler.dispose = function () {}),
  7559. On.registerSourceHandler(On.nativeSourceHandler),
  7560. ji.registerTech('Html5', On)
  7561. var Mn = ['progress', 'abort', 'suspend', 'emptied', 'stalled', 'loadedmetadata', 'loadeddata', 'timeupdate', 'resize', 'volumechange', 'texttrackchange'],
  7562. Rn = { canplay: 'CanPlay', canplaythrough: 'CanPlayThrough', playing: 'Playing', seeked: 'Seeked' },
  7563. Nn = ['tiny', 'xsmall', 'small', 'medium', 'large', 'xlarge', 'huge'],
  7564. Un = {}
  7565. Nn.forEach(function (e) {
  7566. var t = 'x' === e.charAt(0) ? 'x-' + e.substring(1) : e
  7567. Un[e] = 'vjs-layout-' + t
  7568. })
  7569. var Bn = { tiny: 210, xsmall: 320, small: 425, medium: 768, large: 1440, xlarge: 2560, huge: 1 / 0 },
  7570. Fn = (function (c) {
  7571. function o(e, t, i) {
  7572. var n, r
  7573. if (((e.id = e.id || t.id || 'vjs_video_' + Pe++), ((t = b(o.getTagSettings(e), t)).initChildren = !1), (t.createEl = !1), (t.evented = !1), (t.reportTouchActivity = !1), !t.language))
  7574. if ('function' == typeof e.closest) {
  7575. var a = e.closest('[lang]')
  7576. a && a.getAttribute && (t.language = a.getAttribute('lang'))
  7577. } else
  7578. for (var s = e; s && 1 === s.nodeType; ) {
  7579. if (ae(s).hasOwnProperty('lang')) {
  7580. t.language = s.getAttribute('lang')
  7581. break
  7582. }
  7583. s = s.parentNode
  7584. }
  7585. if (
  7586. (((n = c.call(this, null, t, i) || this).boundDocumentFullscreenChange_ = function (e) {
  7587. return n.documentFullscreenChange_(e)
  7588. }),
  7589. (n.boundFullWindowOnEscKey_ = function (e) {
  7590. return n.fullWindowOnEscKey(e)
  7591. }),
  7592. (n.boundUpdateStyleEl_ = function (e) {
  7593. return n.updateStyleEl_(e)
  7594. }),
  7595. (n.boundApplyInitTime_ = function (e) {
  7596. return n.applyInitTime_(e)
  7597. }),
  7598. (n.boundUpdateCurrentBreakpoint_ = function (e) {
  7599. return n.updateCurrentBreakpoint_(e)
  7600. }),
  7601. (n.boundHandleTechClick_ = function (e) {
  7602. return n.handleTechClick_(e)
  7603. }),
  7604. (n.boundHandleTechDoubleClick_ = function (e) {
  7605. return n.handleTechDoubleClick_(e)
  7606. }),
  7607. (n.boundHandleTechTouchStart_ = function (e) {
  7608. return n.handleTechTouchStart_(e)
  7609. }),
  7610. (n.boundHandleTechTouchMove_ = function (e) {
  7611. return n.handleTechTouchMove_(e)
  7612. }),
  7613. (n.boundHandleTechTouchEnd_ = function (e) {
  7614. return n.handleTechTouchEnd_(e)
  7615. }),
  7616. (n.boundHandleTechTap_ = function (e) {
  7617. return n.handleTechTap_(e)
  7618. }),
  7619. (n.isFullscreen_ = !1),
  7620. (n.log = p(n.id_)),
  7621. (n.fsApi_ = l),
  7622. (n.isPosterFromTech_ = !1),
  7623. (n.queuedCallbacks_ = []),
  7624. (n.isReady_ = !1),
  7625. (n.hasStarted_ = !1),
  7626. (n.userActive_ = !1),
  7627. (n.debugEnabled_ = !1),
  7628. (n.audioOnlyMode_ = !1),
  7629. (n.audioPosterMode_ = !1),
  7630. (n.audioOnlyCache_ = { playerHeight: null, hiddenChildren: [] }),
  7631. !n.options_ || !n.options_.techOrder || !n.options_.techOrder.length)
  7632. )
  7633. throw new Error('No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?')
  7634. ;(n.tag = e),
  7635. (n.tagAttributes = e && ae(e)),
  7636. n.language(n.options_.language),
  7637. t.languages
  7638. ? ((r = {}),
  7639. Object.getOwnPropertyNames(t.languages).forEach(function (e) {
  7640. r[e.toLowerCase()] = t.languages[e]
  7641. }),
  7642. (n.languages_ = r))
  7643. : (n.languages_ = o.prototype.options_.languages),
  7644. n.resetCache_(),
  7645. (n.poster_ = t.poster || ''),
  7646. (n.controls_ = !!t.controls),
  7647. (e.controls = !1),
  7648. e.removeAttribute('controls'),
  7649. (n.changingSrc_ = !1),
  7650. (n.playCallbacks_ = []),
  7651. (n.playTerminatedQueue_ = []),
  7652. e.hasAttribute('autoplay') ? n.autoplay(!0) : n.autoplay(n.options_.autoplay),
  7653. t.plugins &&
  7654. Object.keys(t.plugins).forEach(function (e) {
  7655. if ('function' != typeof n[e]) throw new Error('plugin "' + e + '" does not exist')
  7656. }),
  7657. (n.scrubbing_ = !1),
  7658. (n.el_ = n.createEl()),
  7659. rt(ft(n), { eventBusKey: 'el_' }),
  7660. n.fsApi_.requestFullscreen && (Be(document, n.fsApi_.fullscreenchange, n.boundDocumentFullscreenChange_), n.on(n.fsApi_.fullscreenchange, n.boundDocumentFullscreenChange_)),
  7661. n.fluid_ && n.on(['playerreset', 'resize'], n.boundUpdateStyleEl_)
  7662. i = lt(n.options_)
  7663. t.plugins &&
  7664. Object.keys(t.plugins).forEach(function (e) {
  7665. n[e](t.plugins[e])
  7666. }),
  7667. t.debug && n.debug(!0),
  7668. (n.options_.playerOptions = i),
  7669. (n.middleware_ = []),
  7670. n.playbackRates(t.playbackRates),
  7671. n.initChildren(),
  7672. n.isAudio('audio' === e.nodeName.toLowerCase()),
  7673. n.controls() ? n.addClass('vjs-controls-enabled') : n.addClass('vjs-controls-disabled'),
  7674. n.el_.setAttribute('role', 'region'),
  7675. n.isAudio() ? n.el_.setAttribute('aria-label', n.localize('Audio Player')) : n.el_.setAttribute('aria-label', n.localize('Video Player')),
  7676. n.isAudio() && n.addClass('vjs-audio'),
  7677. n.flexNotSupported_() && n.addClass('vjs-no-flex'),
  7678. F && n.addClass('vjs-touch-enabled'),
  7679. q || n.addClass('vjs-workinghover'),
  7680. (o.players[n.id_] = ft(n))
  7681. e = u.split('.')[0]
  7682. return (
  7683. n.addClass('vjs-v' + e),
  7684. n.userActive(!0),
  7685. n.reportUserActivity(),
  7686. n.one('play', function (e) {
  7687. return n.listenForUserActivity_(e)
  7688. }),
  7689. n.on('stageclick', function (e) {
  7690. return n.handleStageClick_(e)
  7691. }),
  7692. n.on('keydown', function (e) {
  7693. return n.handleKeyDown(e)
  7694. }),
  7695. n.on('languagechange', function (e) {
  7696. return n.handleLanguagechange(e)
  7697. }),
  7698. n.breakpoints(n.options_.breakpoints),
  7699. n.responsive(n.options_.responsive),
  7700. n.on('ready', function () {
  7701. n.audioPosterMode(n.options_.audioPosterMode), n.audioOnlyMode(n.options_.audioOnlyMode)
  7702. }),
  7703. n
  7704. )
  7705. }
  7706. mt(o, c)
  7707. var e = o.prototype
  7708. return (
  7709. (e.dispose = function () {
  7710. var t = this
  7711. this.trigger('dispose'),
  7712. this.off('dispose'),
  7713. Fe(document, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_),
  7714. Fe(document, 'keydown', this.boundFullWindowOnEscKey_),
  7715. this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_), (this.styleEl_ = null)),
  7716. (o.players[this.id_] = null),
  7717. this.tag && this.tag.player && (this.tag.player = null),
  7718. this.el_ && this.el_.player && (this.el_.player = null),
  7719. this.tech_ && (this.tech_.dispose(), (this.isPosterFromTech_ = !1), (this.poster_ = '')),
  7720. this.playerElIngest_ && (this.playerElIngest_ = null),
  7721. this.tag && (this.tag = null),
  7722. (qi[this.id()] = null),
  7723. oi.names.forEach(function (e) {
  7724. ;(e = oi[e]), (e = t[e.getterName]())
  7725. e && e.off && e.off()
  7726. }),
  7727. c.prototype.dispose.call(this, { restoreEl: this.options_.restoreEl })
  7728. }),
  7729. (e.createEl = function () {
  7730. var t,
  7731. i = this.tag,
  7732. e = (this.playerElIngest_ = i.parentNode && i.parentNode.hasAttribute && i.parentNode.hasAttribute('data-vjs-player')),
  7733. n = 'video-js' === this.tag.tagName.toLowerCase()
  7734. e ? (t = this.el_ = i.parentNode) : n || (t = this.el_ = c.prototype.createEl.call(this, 'div'))
  7735. var r,
  7736. a,
  7737. s = ae(i)
  7738. if (n) {
  7739. for (t = this.el_ = i, i = this.tag = document.createElement('video'); t.children.length; ) i.appendChild(t.firstChild)
  7740. ee(t, 'video-js') || te(t, 'video-js'),
  7741. t.appendChild(i),
  7742. (e = this.playerElIngest_ = t),
  7743. Object.keys(t).forEach(function (e) {
  7744. try {
  7745. i[e] = t[e]
  7746. } catch (e) {}
  7747. })
  7748. }
  7749. i.setAttribute('tabindex', '-1'),
  7750. (s.tabindex = '-1'),
  7751. (N || (M && B)) && (i.setAttribute('role', 'application'), (s.role = 'application')),
  7752. i.removeAttribute('width'),
  7753. i.removeAttribute('height'),
  7754. 'width' in s && delete s.width,
  7755. 'height' in s && delete s.height,
  7756. Object.getOwnPropertyNames(s).forEach(function (e) {
  7757. ;(n && 'class' === e) || t.setAttribute(e, s[e]), n && i.setAttribute(e, s[e])
  7758. }),
  7759. (i.playerId = i.id),
  7760. (i.id += '_html5_api'),
  7761. (i.className = 'vjs-tech'),
  7762. (i.player = t.player = this).addClass('vjs-paused'),
  7763. !0 !== window.VIDEOJS_NO_DYNAMIC_STYLE &&
  7764. ((this.styleEl_ = xe('vjs-styles-dimensions')), (r = Te('.vjs-styles-defaults')), (a = Te('head')).insertBefore(this.styleEl_, r ? r.nextSibling : a.firstChild)),
  7765. (this.fill_ = !1),
  7766. (this.fluid_ = !1),
  7767. this.width(this.options_.width),
  7768. this.height(this.options_.height),
  7769. this.fill(this.options_.fill),
  7770. this.fluid(this.options_.fluid),
  7771. this.aspectRatio(this.options_.aspectRatio),
  7772. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin)
  7773. for (var o = i.getElementsByTagName('a'), u = 0; u < o.length; u++) {
  7774. var l = o.item(u)
  7775. te(l, 'vjs-hidden'), l.setAttribute('hidden', 'hidden')
  7776. }
  7777. return (
  7778. (i.initNetworkState_ = i.networkState),
  7779. i.parentNode && !e && i.parentNode.insertBefore(t, i),
  7780. Z(i, t),
  7781. this.children_.unshift(i),
  7782. this.el_.setAttribute('lang', this.language_),
  7783. this.el_.setAttribute('translate', 'no'),
  7784. (this.el_ = t)
  7785. )
  7786. }),
  7787. (e.crossOrigin = function (e) {
  7788. if (!e) return this.techGet_('crossOrigin')
  7789. 'anonymous' === e || 'use-credentials' === e ? this.techCall_('setCrossOrigin', e) : h.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + e + '"')
  7790. }),
  7791. (e.width = function (e) {
  7792. return this.dimension('width', e)
  7793. }),
  7794. (e.height = function (e) {
  7795. return this.dimension('height', e)
  7796. }),
  7797. (e.dimension = function (e, t) {
  7798. var i = e + '_'
  7799. if (void 0 === t) return this[i] || 0
  7800. if ('' === t || 'auto' === t) return (this[i] = void 0), void this.updateStyleEl_()
  7801. var n = parseFloat(t)
  7802. isNaN(n) ? h.error('Improper value "' + t + '" supplied for for ' + e) : ((this[i] = n), this.updateStyleEl_())
  7803. }),
  7804. (e.fluid = function (e) {
  7805. var t,
  7806. i = this
  7807. if (void 0 === e) return !!this.fluid_
  7808. ;(this.fluid_ = !!e),
  7809. it(this) && this.off(['playerreset', 'resize'], this.boundUpdateStyleEl_),
  7810. e
  7811. ? (this.addClass('vjs-fluid'),
  7812. this.fill(!1),
  7813. (t = function () {
  7814. i.on(['playerreset', 'resize'], i.boundUpdateStyleEl_)
  7815. }),
  7816. it((e = this)) ? t() : (e.eventedCallbacks || (e.eventedCallbacks = []), e.eventedCallbacks.push(t)))
  7817. : this.removeClass('vjs-fluid'),
  7818. this.updateStyleEl_()
  7819. }),
  7820. (e.fill = function (e) {
  7821. if (void 0 === e) return !!this.fill_
  7822. ;(this.fill_ = !!e), e ? (this.addClass('vjs-fill'), this.fluid(!1)) : this.removeClass('vjs-fill')
  7823. }),
  7824. (e.aspectRatio = function (e) {
  7825. if (void 0 === e) return this.aspectRatio_
  7826. if (!/^\d+\:\d+$/.test(e)) throw new Error('Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.')
  7827. ;(this.aspectRatio_ = e), this.fluid(!0), this.updateStyleEl_()
  7828. }),
  7829. (e.updateStyleEl_ = function () {
  7830. var e, t, i, n
  7831. !0 !== window.VIDEOJS_NO_DYNAMIC_STYLE
  7832. ? ((n =
  7833. (i = (
  7834. void 0 !== this.aspectRatio_ && 'auto' !== this.aspectRatio_ ? this.aspectRatio_ : 0 < this.videoWidth() ? this.videoWidth() + ':' + this.videoHeight() : '16:9'
  7835. ).split(':'))[1] / i[0]),
  7836. (e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / n : this.videoWidth() || 300),
  7837. (t = void 0 !== this.height_ ? this.height_ : e * n),
  7838. (i = /^[^a-zA-Z]/.test(this.id()) ? 'dimensions-' + this.id() : this.id() + '-dimensions'),
  7839. this.addClass(i),
  7840. Ae(
  7841. this.styleEl_,
  7842. '\n .' +
  7843. i +
  7844. ' {\n width: ' +
  7845. e +
  7846. 'px;\n height: ' +
  7847. t +
  7848. 'px;\n }\n\n .' +
  7849. i +
  7850. '.vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: ' +
  7851. 100 * n +
  7852. '%;\n }\n '
  7853. ))
  7854. : ((t = 'number' == typeof this.width_ ? this.width_ : this.options_.width),
  7855. (i = 'number' == typeof this.height_ ? this.height_ : this.options_.height),
  7856. (n = this.tech_ && this.tech_.el()) && (0 <= t && (n.width = t), 0 <= i && (n.height = i)))
  7857. }),
  7858. (e.loadTech_ = function (e, t) {
  7859. var i = this
  7860. this.tech_ && this.unloadTech_()
  7861. var n = ut(e),
  7862. r = e.charAt(0).toLowerCase() + e.slice(1)
  7863. 'Html5' !== n && this.tag && (ji.getTech('Html5').disposeMediaElement(this.tag), (this.tag.player = null), (this.tag = null)), (this.techName_ = n), (this.isReady_ = !1)
  7864. var a = this.autoplay(),
  7865. s = {
  7866. source: t,
  7867. autoplay: (a = 'string' == typeof this.autoplay() || (!0 === this.autoplay() && this.options_.normalizeAutoplay) ? !1 : a),
  7868. nativeControlsForTouch: this.options_.nativeControlsForTouch,
  7869. playerId: this.id(),
  7870. techId: this.id() + '_' + r + '_api',
  7871. playsinline: this.options_.playsinline,
  7872. preload: this.options_.preload,
  7873. loop: this.options_.loop,
  7874. disablePictureInPicture: this.options_.disablePictureInPicture,
  7875. muted: this.options_.muted,
  7876. poster: this.poster(),
  7877. language: this.language(),
  7878. playerElIngest: this.playerElIngest_ || !1,
  7879. 'vtt.js': this.options_['vtt.js'],
  7880. canOverridePoster: !!this.options_.techCanOverridePoster,
  7881. enableSourceset: this.options_.enableSourceset,
  7882. Promise: this.options_.Promise,
  7883. }
  7884. oi.names.forEach(function (e) {
  7885. e = oi[e]
  7886. s[e.getterName] = i[e.privateName]
  7887. }),
  7888. b(s, this.options_[n]),
  7889. b(s, this.options_[r]),
  7890. b(s, this.options_[e.toLowerCase()]),
  7891. this.tag && (s.tag = this.tag),
  7892. t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (s.startTime = this.cache_.currentTime)
  7893. e = ji.getTech(e)
  7894. if (!e) throw new Error("No Tech named '" + n + "' exists! '" + n + "' should be registered using videojs.registerTech()'")
  7895. ;(this.tech_ = new e(s)),
  7896. this.tech_.ready(Ve(this, this.handleTechReady_), !0),
  7897. It(this.textTracksJson_ || [], this.tech_),
  7898. Mn.forEach(function (t) {
  7899. i.on(i.tech_, t, function (e) {
  7900. return i['handleTech' + ut(t) + '_'](e)
  7901. })
  7902. }),
  7903. Object.keys(Rn).forEach(function (t) {
  7904. i.on(i.tech_, t, function (e) {
  7905. 0 === i.tech_.playbackRate() && i.tech_.seeking()
  7906. ? i.queuedCallbacks_.push({ callback: i['handleTech' + Rn[t] + '_'].bind(i), event: e })
  7907. : i['handleTech' + Rn[t] + '_'](e)
  7908. })
  7909. }),
  7910. this.on(this.tech_, 'loadstart', function (e) {
  7911. return i.handleTechLoadStart_(e)
  7912. }),
  7913. this.on(this.tech_, 'sourceset', function (e) {
  7914. return i.handleTechSourceset_(e)
  7915. }),
  7916. this.on(this.tech_, 'waiting', function (e) {
  7917. return i.handleTechWaiting_(e)
  7918. }),
  7919. this.on(this.tech_, 'ended', function (e) {
  7920. return i.handleTechEnded_(e)
  7921. }),
  7922. this.on(this.tech_, 'seeking', function (e) {
  7923. return i.handleTechSeeking_(e)
  7924. }),
  7925. this.on(this.tech_, 'play', function (e) {
  7926. return i.handleTechPlay_(e)
  7927. }),
  7928. this.on(this.tech_, 'firstplay', function (e) {
  7929. return i.handleTechFirstPlay_(e)
  7930. }),
  7931. this.on(this.tech_, 'pause', function (e) {
  7932. return i.handleTechPause_(e)
  7933. }),
  7934. this.on(this.tech_, 'durationchange', function (e) {
  7935. return i.handleTechDurationChange_(e)
  7936. }),
  7937. this.on(this.tech_, 'fullscreenchange', function (e, t) {
  7938. return i.handleTechFullscreenChange_(e, t)
  7939. }),
  7940. this.on(this.tech_, 'fullscreenerror', function (e, t) {
  7941. return i.handleTechFullscreenError_(e, t)
  7942. }),
  7943. this.on(this.tech_, 'enterpictureinpicture', function (e) {
  7944. return i.handleTechEnterPictureInPicture_(e)
  7945. }),
  7946. this.on(this.tech_, 'leavepictureinpicture', function (e) {
  7947. return i.handleTechLeavePictureInPicture_(e)
  7948. }),
  7949. this.on(this.tech_, 'error', function (e) {
  7950. return i.handleTechError_(e)
  7951. }),
  7952. this.on(this.tech_, 'posterchange', function (e) {
  7953. return i.handleTechPosterChange_(e)
  7954. }),
  7955. this.on(this.tech_, 'textdata', function (e) {
  7956. return i.handleTechTextData_(e)
  7957. }),
  7958. this.on(this.tech_, 'ratechange', function (e) {
  7959. return i.handleTechRateChange_(e)
  7960. }),
  7961. this.on(this.tech_, 'loadedmetadata', this.boundUpdateStyleEl_),
  7962. this.usingNativeControls(this.techGet_('controls')),
  7963. this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(),
  7964. this.tech_.el().parentNode === this.el() || ('Html5' === n && this.tag) || Z(this.tech_.el(), this.el()),
  7965. this.tag && ((this.tag.player = null), (this.tag = null))
  7966. }),
  7967. (e.unloadTech_ = function () {
  7968. var t = this
  7969. oi.names.forEach(function (e) {
  7970. e = oi[e]
  7971. t[e.privateName] = t[e.getterName]()
  7972. }),
  7973. (this.textTracksJson_ = Ct(this.tech_)),
  7974. (this.isReady_ = !1),
  7975. this.tech_.dispose(),
  7976. (this.tech_ = !1),
  7977. this.isPosterFromTech_ && ((this.poster_ = ''), this.trigger('posterchange')),
  7978. (this.isPosterFromTech_ = !1)
  7979. }),
  7980. (e.tech = function (e) {
  7981. return (
  7982. void 0 === e && h.warn("Using the tech directly can be dangerous. I hope you know what you're doing.\nSee https://github.com/videojs/video.js/issues/2617 for more info.\n"),
  7983. this.tech_
  7984. )
  7985. }),
  7986. (e.addTechControlsListeners_ = function () {
  7987. this.removeTechControlsListeners_(),
  7988. this.on(this.tech_, 'click', this.boundHandleTechClick_),
  7989. this.on(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_),
  7990. this.on(this.tech_, 'touchstart', this.boundHandleTechTouchStart_),
  7991. this.on(this.tech_, 'touchmove', this.boundHandleTechTouchMove_),
  7992. this.on(this.tech_, 'touchend', this.boundHandleTechTouchEnd_),
  7993. this.on(this.tech_, 'tap', this.boundHandleTechTap_)
  7994. }),
  7995. (e.removeTechControlsListeners_ = function () {
  7996. this.off(this.tech_, 'tap', this.boundHandleTechTap_),
  7997. this.off(this.tech_, 'touchstart', this.boundHandleTechTouchStart_),
  7998. this.off(this.tech_, 'touchmove', this.boundHandleTechTouchMove_),
  7999. this.off(this.tech_, 'touchend', this.boundHandleTechTouchEnd_),
  8000. this.off(this.tech_, 'click', this.boundHandleTechClick_),
  8001. this.off(this.tech_, 'dblclick', this.boundHandleTechDoubleClick_)
  8002. }),
  8003. (e.handleTechReady_ = function () {
  8004. this.triggerReady(), this.cache_.volume && this.techCall_('setVolume', this.cache_.volume), this.handleTechPosterChange_(), this.handleTechDurationChange_()
  8005. }),
  8006. (e.handleTechLoadStart_ = function () {
  8007. this.removeClass('vjs-ended'),
  8008. this.removeClass('vjs-seeking'),
  8009. this.error(null),
  8010. this.handleTechDurationChange_(),
  8011. this.paused() ? (this.hasStarted(!1), this.trigger('loadstart')) : (this.trigger('loadstart'), this.trigger('firstplay')),
  8012. this.manualAutoplay_(!0 === this.autoplay() && this.options_.normalizeAutoplay ? 'play' : this.autoplay())
  8013. }),
  8014. (e.manualAutoplay_ = function (e) {
  8015. var n = this
  8016. if (this.tech_ && 'string' == typeof e) {
  8017. var t,
  8018. i = function () {
  8019. var e = n.muted()
  8020. n.muted(!0)
  8021. function t() {
  8022. n.muted(e)
  8023. }
  8024. n.playTerminatedQueue_.push(t)
  8025. var i = n.play()
  8026. if (wt(i))
  8027. return i.catch(function (e) {
  8028. throw (t(), new Error('Rejection at manualAutoplay. Restoring muted value. ' + (e || '')))
  8029. })
  8030. }
  8031. if (('any' !== e || this.muted() ? (t = 'muted' !== e || this.muted() ? this.play() : i()) : wt((t = this.play())) && (t = t.catch(i)), wt(t)))
  8032. return t
  8033. .then(function () {
  8034. n.trigger({ type: 'autoplay-success', autoplay: e })
  8035. })
  8036. .catch(function () {
  8037. n.trigger({ type: 'autoplay-failure', autoplay: e })
  8038. })
  8039. }
  8040. }),
  8041. (e.updateSourceCaches_ = function (e) {
  8042. var t = (e = void 0 === e ? '' : e),
  8043. i = ''
  8044. 'string' != typeof t && ((t = e.src), (i = e.type)),
  8045. (this.cache_.source = this.cache_.source || {}),
  8046. (this.cache_.sources = this.cache_.sources || []),
  8047. t &&
  8048. !i &&
  8049. (i = (function (e, t) {
  8050. if (!t) return ''
  8051. if (e.cache_.source.src === t && e.cache_.source.type) return e.cache_.source.type
  8052. var i = e.cache_.sources.filter(function (e) {
  8053. return e.src === t
  8054. })
  8055. if (i.length) return i[0].type
  8056. for (var n = e.$$('source'), r = 0; r < n.length; r++) {
  8057. var a = n[r]
  8058. if (a.type && a.src && a.src === t) return a.type
  8059. }
  8060. return $i(t)
  8061. })(this, t)),
  8062. (this.cache_.source = lt({}, e, { src: t, type: i }))
  8063. for (
  8064. var i = this.cache_.sources.filter(function (e) {
  8065. return e.src && e.src === t
  8066. }),
  8067. n = [],
  8068. r = this.$$('source'),
  8069. a = [],
  8070. s = 0;
  8071. s < r.length;
  8072. s++
  8073. ) {
  8074. var o = ae(r[s])
  8075. n.push(o), o.src && o.src === t && a.push(o.src)
  8076. }
  8077. a.length && !i.length ? (this.cache_.sources = n) : i.length || (this.cache_.sources = [this.cache_.source]), (this.cache_.src = t)
  8078. }),
  8079. (e.handleTechSourceset_ = function (e) {
  8080. var t,
  8081. i,
  8082. n,
  8083. r = this
  8084. this.changingSrc_ ||
  8085. ((t = function (e) {
  8086. return r.updateSourceCaches_(e)
  8087. }),
  8088. (i = this.currentSource().src),
  8089. (n = e.src),
  8090. i && !/^blob:/.test(i) && /^blob:/.test(n) && ((this.lastSource_ && (this.lastSource_.tech === n || this.lastSource_.player === i)) || (t = function () {})),
  8091. t(n),
  8092. e.src ||
  8093. this.tech_.any(['sourceset', 'loadstart'], function (e) {
  8094. 'sourceset' !== e.type && ((e = r.techGet('currentSrc')), (r.lastSource_.tech = e), r.updateSourceCaches_(e))
  8095. })),
  8096. (this.lastSource_ = { player: this.currentSource().src, tech: e.src }),
  8097. this.trigger({ src: e.src, type: 'sourceset' })
  8098. }),
  8099. (e.hasStarted = function (e) {
  8100. if (void 0 === e) return this.hasStarted_
  8101. e !== this.hasStarted_ && ((this.hasStarted_ = e), this.hasStarted_ ? (this.addClass('vjs-has-started'), this.trigger('firstplay')) : this.removeClass('vjs-has-started'))
  8102. }),
  8103. (e.handleTechPlay_ = function () {
  8104. this.removeClass('vjs-ended'), this.removeClass('vjs-paused'), this.addClass('vjs-playing'), this.hasStarted(!0), this.trigger('play')
  8105. }),
  8106. (e.handleTechRateChange_ = function () {
  8107. 0 < this.tech_.playbackRate() &&
  8108. 0 === this.cache_.lastPlaybackRate &&
  8109. (this.queuedCallbacks_.forEach(function (e) {
  8110. return e.callback(e.event)
  8111. }),
  8112. (this.queuedCallbacks_ = [])),
  8113. (this.cache_.lastPlaybackRate = this.tech_.playbackRate()),
  8114. this.trigger('ratechange')
  8115. }),
  8116. (e.handleTechWaiting_ = function () {
  8117. var t = this
  8118. this.addClass('vjs-waiting'), this.trigger('waiting')
  8119. var i = this.currentTime()
  8120. this.on('timeupdate', function e() {
  8121. i !== t.currentTime() && (t.removeClass('vjs-waiting'), t.off('timeupdate', e))
  8122. })
  8123. }),
  8124. (e.handleTechCanPlay_ = function () {
  8125. this.removeClass('vjs-waiting'), this.trigger('canplay')
  8126. }),
  8127. (e.handleTechCanPlayThrough_ = function () {
  8128. this.removeClass('vjs-waiting'), this.trigger('canplaythrough')
  8129. }),
  8130. (e.handleTechPlaying_ = function () {
  8131. this.removeClass('vjs-waiting'), this.trigger('playing')
  8132. }),
  8133. (e.handleTechSeeking_ = function () {
  8134. this.addClass('vjs-seeking'), this.trigger('seeking')
  8135. }),
  8136. (e.handleTechSeeked_ = function () {
  8137. this.removeClass('vjs-seeking'), this.removeClass('vjs-ended'), this.trigger('seeked')
  8138. }),
  8139. (e.handleTechFirstPlay_ = function () {
  8140. this.options_.starttime && (h.warn('Passing the `starttime` option to the player will be deprecated in 6.0'), this.currentTime(this.options_.starttime)),
  8141. this.addClass('vjs-has-started'),
  8142. this.trigger('firstplay')
  8143. }),
  8144. (e.handleTechPause_ = function () {
  8145. this.removeClass('vjs-playing'), this.addClass('vjs-paused'), this.trigger('pause')
  8146. }),
  8147. (e.handleTechEnded_ = function () {
  8148. this.addClass('vjs-ended'), this.removeClass('vjs-waiting'), this.options_.loop ? (this.currentTime(0), this.play()) : this.paused() || this.pause(), this.trigger('ended')
  8149. }),
  8150. (e.handleTechDurationChange_ = function () {
  8151. this.duration(this.techGet_('duration'))
  8152. }),
  8153. (e.handleTechClick_ = function (e) {
  8154. this.controls_ &&
  8155. ((void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.click && !1 === this.options_.userActions.click) ||
  8156. (void 0 !== this.options_ && void 0 !== this.options_.userActions && 'function' == typeof this.options_.userActions.click
  8157. ? this.options_.userActions.click.call(this, e)
  8158. : this.paused()
  8159. ? Et(this.play())
  8160. : this.pause()))
  8161. }),
  8162. (e.handleTechDoubleClick_ = function (t) {
  8163. this.controls_ &&
  8164. (Array.prototype.some.call(this.$$('.vjs-control-bar, .vjs-modal-dialog'), function (e) {
  8165. return e.contains(t.target)
  8166. }) ||
  8167. (void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.doubleClick && !1 === this.options_.userActions.doubleClick) ||
  8168. (void 0 !== this.options_ && void 0 !== this.options_.userActions && 'function' == typeof this.options_.userActions.doubleClick
  8169. ? this.options_.userActions.doubleClick.call(this, t)
  8170. : this.isFullscreen()
  8171. ? this.exitFullscreen()
  8172. : this.requestFullscreen()))
  8173. }),
  8174. (e.handleTechTap_ = function () {
  8175. this.userActive(!this.userActive())
  8176. }),
  8177. (e.handleTechTouchStart_ = function () {
  8178. this.userWasActive = this.userActive()
  8179. }),
  8180. (e.handleTechTouchMove_ = function () {
  8181. this.userWasActive && this.reportUserActivity()
  8182. }),
  8183. (e.handleTechTouchEnd_ = function (e) {
  8184. e.cancelable && e.preventDefault()
  8185. }),
  8186. (e.handleStageClick_ = function () {
  8187. this.reportUserActivity()
  8188. }),
  8189. (e.toggleFullscreenClass_ = function () {
  8190. this.isFullscreen() ? this.addClass('vjs-fullscreen') : this.removeClass('vjs-fullscreen')
  8191. }),
  8192. (e.documentFullscreenChange_ = function (e) {
  8193. var t = e.target.player
  8194. ;(t && t !== this) ||
  8195. ((e = this.el()),
  8196. !(t = document[this.fsApi_.fullscreenElement] === e) && e.matches
  8197. ? (t = e.matches(':' + this.fsApi_.fullscreen))
  8198. : !t && e.msMatchesSelector && (t = e.msMatchesSelector(':' + this.fsApi_.fullscreen)),
  8199. this.isFullscreen(t))
  8200. }),
  8201. (e.handleTechFullscreenChange_ = function (e, t) {
  8202. var i = this
  8203. t &&
  8204. (t.nativeIOSFullscreen &&
  8205. (this.addClass('vjs-ios-native-fs'),
  8206. this.tech_.one('webkitendfullscreen', function () {
  8207. i.removeClass('vjs-ios-native-fs')
  8208. })),
  8209. this.isFullscreen(t.isFullscreen))
  8210. }),
  8211. (e.handleTechFullscreenError_ = function (e, t) {
  8212. this.trigger('fullscreenerror', t)
  8213. }),
  8214. (e.togglePictureInPictureClass_ = function () {
  8215. this.isInPictureInPicture() ? this.addClass('vjs-picture-in-picture') : this.removeClass('vjs-picture-in-picture')
  8216. }),
  8217. (e.handleTechEnterPictureInPicture_ = function (e) {
  8218. this.isInPictureInPicture(!0)
  8219. }),
  8220. (e.handleTechLeavePictureInPicture_ = function (e) {
  8221. this.isInPictureInPicture(!1)
  8222. }),
  8223. (e.handleTechError_ = function () {
  8224. var e = this.tech_.error()
  8225. this.error(e)
  8226. }),
  8227. (e.handleTechTextData_ = function () {
  8228. this.trigger('textdata', 1 < arguments.length ? arguments[1] : null)
  8229. }),
  8230. (e.getCache = function () {
  8231. return this.cache_
  8232. }),
  8233. (e.resetCache_ = function () {
  8234. this.cache_ = {
  8235. currentTime: 0,
  8236. initTime: 0,
  8237. inactivityTimeout: this.options_.inactivityTimeout,
  8238. duration: NaN,
  8239. lastVolume: 1,
  8240. lastPlaybackRate: this.defaultPlaybackRate(),
  8241. media: null,
  8242. src: '',
  8243. source: {},
  8244. sources: [],
  8245. playbackRates: [],
  8246. volume: 1,
  8247. }
  8248. }),
  8249. (e.techCall_ = function (n, r) {
  8250. this.ready(function () {
  8251. if (n in Xi) return (e = this.middleware_), (t = this.tech_), (i = r), t[(t = n)](e.reduce(Yi(t), i))
  8252. if (n in Ki) return Gi(this.middleware_, this.tech_, n, r)
  8253. var e, t, i
  8254. try {
  8255. this.tech_ && this.tech_[n](r)
  8256. } catch (e) {
  8257. throw (h(e), e)
  8258. }
  8259. }, !0)
  8260. }),
  8261. (e.techGet_ = function (t) {
  8262. if (this.tech_ && this.tech_.isReady_) {
  8263. if (t in zi) return (e = this.middleware_), (i = this.tech_), (n = t), e.reduceRight(Yi(n), i[n]())
  8264. if (t in Ki) return Gi(this.middleware_, this.tech_, t)
  8265. var e, i, n
  8266. try {
  8267. return this.tech_[t]()
  8268. } catch (e) {
  8269. if (void 0 === this.tech_[t]) throw (h('Video.js: ' + t + ' method not defined for ' + this.techName_ + ' playback technology.', e), e)
  8270. if ('TypeError' === e.name) throw (h('Video.js: ' + t + ' unavailable on ' + this.techName_ + ' playback technology element.', e), (this.tech_.isReady_ = !1), e)
  8271. throw (h(e), e)
  8272. }
  8273. }
  8274. }),
  8275. (e.play = function () {
  8276. var t = this,
  8277. e = this.options_.Promise || window.Promise
  8278. return e
  8279. ? new e(function (e) {
  8280. t.play_(e)
  8281. })
  8282. : this.play_()
  8283. }),
  8284. (e.play_ = function (e) {
  8285. var t = this
  8286. this.playCallbacks_.push((e = void 0 === e ? Et : e))
  8287. e = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()))
  8288. if ((this.waitToPlay_ && (this.off(['ready', 'loadstart'], this.waitToPlay_), (this.waitToPlay_ = null)), !this.isReady_ || !e))
  8289. return (
  8290. (this.waitToPlay_ = function (e) {
  8291. t.play_()
  8292. }),
  8293. this.one(['ready', 'loadstart'], this.waitToPlay_),
  8294. void (e || (!V && !q) || this.load())
  8295. )
  8296. e = this.techGet_('play')
  8297. null === e ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(e)
  8298. }),
  8299. (e.runPlayTerminatedQueue_ = function () {
  8300. var e = this.playTerminatedQueue_.slice(0)
  8301. ;(this.playTerminatedQueue_ = []),
  8302. e.forEach(function (e) {
  8303. e()
  8304. })
  8305. }),
  8306. (e.runPlayCallbacks_ = function (t) {
  8307. var e = this.playCallbacks_.slice(0)
  8308. ;(this.playCallbacks_ = []),
  8309. (this.playTerminatedQueue_ = []),
  8310. e.forEach(function (e) {
  8311. e(t)
  8312. })
  8313. }),
  8314. (e.pause = function () {
  8315. this.techCall_('pause')
  8316. }),
  8317. (e.paused = function () {
  8318. return !1 !== this.techGet_('paused')
  8319. }),
  8320. (e.played = function () {
  8321. return this.techGet_('played') || vt(0, 0)
  8322. }),
  8323. (e.scrubbing = function (e) {
  8324. if ('undefined' == typeof e) return this.scrubbing_
  8325. ;(this.scrubbing_ = !!e), this.techCall_('setScrubbing', this.scrubbing_), e ? this.addClass('vjs-scrubbing') : this.removeClass('vjs-scrubbing')
  8326. }),
  8327. (e.currentTime = function (e) {
  8328. return 'undefined' != typeof e
  8329. ? (e < 0 && (e = 0),
  8330. this.isReady_ && !this.changingSrc_ && this.tech_ && this.tech_.isReady_
  8331. ? (this.techCall_('setCurrentTime', e), void (this.cache_.initTime = 0))
  8332. : ((this.cache_.initTime = e), this.off('canplay', this.boundApplyInitTime_), void this.one('canplay', this.boundApplyInitTime_)))
  8333. : ((this.cache_.currentTime = this.techGet_('currentTime') || 0), this.cache_.currentTime)
  8334. }),
  8335. (e.applyInitTime_ = function () {
  8336. this.currentTime(this.cache_.initTime)
  8337. }),
  8338. (e.duration = function (e) {
  8339. if (void 0 === e) return void 0 !== this.cache_.duration ? this.cache_.duration : NaN
  8340. ;(e = (e = parseFloat(e)) < 0 ? 1 / 0 : e) !== this.cache_.duration &&
  8341. ((this.cache_.duration = e) === 1 / 0 ? this.addClass('vjs-live') : this.removeClass('vjs-live'), isNaN(e) || this.trigger('durationchange'))
  8342. }),
  8343. (e.remainingTime = function () {
  8344. return this.duration() - this.currentTime()
  8345. }),
  8346. (e.remainingTimeDisplay = function () {
  8347. return Math.floor(this.duration()) - Math.floor(this.currentTime())
  8348. }),
  8349. (e.buffered = function () {
  8350. var e
  8351. return (e = !(e = this.techGet_('buffered')) || !e.length ? vt(0, 0) : e)
  8352. }),
  8353. (e.bufferedPercent = function () {
  8354. return _t(this.buffered(), this.duration())
  8355. }),
  8356. (e.bufferedEnd = function () {
  8357. var e = this.buffered(),
  8358. t = this.duration(),
  8359. e = e.end(e.length - 1)
  8360. return (e = t < e ? t : e)
  8361. }),
  8362. (e.volume = function (e) {
  8363. var t
  8364. return void 0 !== e
  8365. ? ((t = Math.max(0, Math.min(1, parseFloat(e)))), (this.cache_.volume = t), this.techCall_('setVolume', t), void (0 < t && this.lastVolume_(t)))
  8366. : ((t = parseFloat(this.techGet_('volume'))), isNaN(t) ? 1 : t)
  8367. }),
  8368. (e.muted = function (e) {
  8369. if (void 0 === e) return this.techGet_('muted') || !1
  8370. this.techCall_('setMuted', e)
  8371. }),
  8372. (e.defaultMuted = function (e) {
  8373. return void 0 !== e ? this.techCall_('setDefaultMuted', e) : this.techGet_('defaultMuted') || !1
  8374. }),
  8375. (e.lastVolume_ = function (e) {
  8376. if (void 0 === e || 0 === e) return this.cache_.lastVolume
  8377. this.cache_.lastVolume = e
  8378. }),
  8379. (e.supportsFullScreen = function () {
  8380. return this.techGet_('supportsFullScreen') || !1
  8381. }),
  8382. (e.isFullscreen = function (e) {
  8383. if (void 0 === e) return this.isFullscreen_
  8384. var t = this.isFullscreen_
  8385. ;(this.isFullscreen_ = Boolean(e)), this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger('fullscreenchange'), this.toggleFullscreenClass_()
  8386. }),
  8387. (e.requestFullscreen = function (s) {
  8388. var e = this.options_.Promise || window.Promise
  8389. if (e) {
  8390. var o = this
  8391. return new e(function (e, i) {
  8392. function n() {
  8393. o.off('fullscreenerror', r), o.off('fullscreenchange', t)
  8394. }
  8395. function t() {
  8396. n(), e()
  8397. }
  8398. function r(e, t) {
  8399. n(), i(t)
  8400. }
  8401. o.one('fullscreenchange', t), o.one('fullscreenerror', r)
  8402. var a = o.requestFullscreenHelper_(s)
  8403. a && (a.then(n, n), a.then(e, i))
  8404. })
  8405. }
  8406. return this.requestFullscreenHelper_()
  8407. }),
  8408. (e.requestFullscreenHelper_ = function (e) {
  8409. var t = this
  8410. if ((this.fsApi_.prefixed || ((i = (this.options_.fullscreen && this.options_.fullscreen.options) || {}), void 0 !== e && (i = e)), this.fsApi_.requestFullscreen)) {
  8411. var i = this.el_[this.fsApi_.requestFullscreen](i)
  8412. return (
  8413. i &&
  8414. i.then(
  8415. function () {
  8416. return t.isFullscreen(!0)
  8417. },
  8418. function () {
  8419. return t.isFullscreen(!1)
  8420. }
  8421. ),
  8422. i
  8423. )
  8424. }
  8425. this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow ? this.techCall_('enterFullScreen') : this.enterFullWindow()
  8426. }),
  8427. (e.exitFullscreen = function () {
  8428. var e = this.options_.Promise || window.Promise
  8429. if (e) {
  8430. var s = this
  8431. return new e(function (e, i) {
  8432. function n() {
  8433. s.off('fullscreenerror', r), s.off('fullscreenchange', t)
  8434. }
  8435. function t() {
  8436. n(), e()
  8437. }
  8438. function r(e, t) {
  8439. n(), i(t)
  8440. }
  8441. s.one('fullscreenchange', t), s.one('fullscreenerror', r)
  8442. var a = s.exitFullscreenHelper_()
  8443. a && (a.then(n, n), a.then(e, i))
  8444. })
  8445. }
  8446. return this.exitFullscreenHelper_()
  8447. }),
  8448. (e.exitFullscreenHelper_ = function () {
  8449. var e = this
  8450. if (this.fsApi_.requestFullscreen) {
  8451. var t = document[this.fsApi_.exitFullscreen]()
  8452. return (
  8453. t &&
  8454. Et(
  8455. t.then(function () {
  8456. return e.isFullscreen(!1)
  8457. })
  8458. ),
  8459. t
  8460. )
  8461. }
  8462. this.tech_.supportsFullScreen() && !0 == !this.options_.preferFullWindow ? this.techCall_('exitFullScreen') : this.exitFullWindow()
  8463. }),
  8464. (e.enterFullWindow = function () {
  8465. this.isFullscreen(!0),
  8466. (this.isFullWindow = !0),
  8467. (this.docOrigOverflow = document.documentElement.style.overflow),
  8468. Be(document, 'keydown', this.boundFullWindowOnEscKey_),
  8469. (document.documentElement.style.overflow = 'hidden'),
  8470. te(document.body, 'vjs-full-window'),
  8471. this.trigger('enterFullWindow')
  8472. }),
  8473. (e.fullWindowOnEscKey = function (e) {
  8474. ht.isEventKey(e, 'Esc') && !0 === this.isFullscreen() && (this.isFullWindow ? this.exitFullWindow() : this.exitFullscreen())
  8475. }),
  8476. (e.exitFullWindow = function () {
  8477. this.isFullscreen(!1),
  8478. (this.isFullWindow = !1),
  8479. Fe(document, 'keydown', this.boundFullWindowOnEscKey_),
  8480. (document.documentElement.style.overflow = this.docOrigOverflow),
  8481. ie(document.body, 'vjs-full-window'),
  8482. this.trigger('exitFullWindow')
  8483. }),
  8484. (e.disablePictureInPicture = function (e) {
  8485. if (void 0 === e) return this.techGet_('disablePictureInPicture')
  8486. this.techCall_('setDisablePictureInPicture', e), (this.options_.disablePictureInPicture = e), this.trigger('disablepictureinpicturechanged')
  8487. }),
  8488. (e.isInPictureInPicture = function (e) {
  8489. return void 0 !== e ? ((this.isInPictureInPicture_ = !!e), void this.togglePictureInPictureClass_()) : !!this.isInPictureInPicture_
  8490. }),
  8491. (e.requestPictureInPicture = function () {
  8492. if ('pictureInPictureEnabled' in document && !1 === this.disablePictureInPicture()) return this.techGet_('requestPictureInPicture')
  8493. }),
  8494. (e.exitPictureInPicture = function () {
  8495. if ('pictureInPictureEnabled' in document) return document.exitPictureInPicture()
  8496. }),
  8497. (e.handleKeyDown = function (e) {
  8498. var t = this.options_.userActions
  8499. t &&
  8500. t.hotkeys &&
  8501. ((function (e) {
  8502. var t = e.tagName.toLowerCase()
  8503. if (e.isContentEditable) return !0
  8504. if ('input' === t) return -1 === ['button', 'checkbox', 'hidden', 'radio', 'reset', 'submit'].indexOf(e.type)
  8505. return -1 !== ['textarea'].indexOf(t)
  8506. })(this.el_.ownerDocument.activeElement) ||
  8507. ('function' == typeof t.hotkeys ? t.hotkeys.call(this, e) : this.handleHotkeys(e)))
  8508. }),
  8509. (e.handleHotkeys = function (e) {
  8510. var t = this.options_.userActions ? this.options_.userActions.hotkeys : {},
  8511. i = t.fullscreenKey,
  8512. n = t.muteKey,
  8513. n =
  8514. void 0 === n
  8515. ? function (e) {
  8516. return ht.isEventKey(e, 'm')
  8517. }
  8518. : n,
  8519. t = t.playPauseKey,
  8520. t =
  8521. void 0 === t
  8522. ? function (e) {
  8523. return ht.isEventKey(e, 'k') || ht.isEventKey(e, 'Space')
  8524. }
  8525. : t
  8526. ;(void 0 === i
  8527. ? function (e) {
  8528. return ht.isEventKey(e, 'f')
  8529. }
  8530. : i
  8531. ).call(this, e)
  8532. ? (e.preventDefault(), e.stopPropagation(), (i = pt.getComponent('FullscreenToggle')), !1 !== document[this.fsApi_.fullscreenEnabled] && i.prototype.handleClick.call(this, e))
  8533. : n.call(this, e)
  8534. ? (e.preventDefault(), e.stopPropagation(), pt.getComponent('MuteToggle').prototype.handleClick.call(this, e))
  8535. : t.call(this, e) && (e.preventDefault(), e.stopPropagation(), pt.getComponent('PlayToggle').prototype.handleClick.call(this, e))
  8536. }),
  8537. (e.canPlayType = function (e) {
  8538. for (var t, i = 0, n = this.options_.techOrder; i < n.length; i++) {
  8539. var r = n[i],
  8540. a = ji.getTech(r)
  8541. if ((a = a || pt.getComponent(r))) {
  8542. if (a.isSupported() && (t = a.canPlayType(e))) return t
  8543. } else h.error('The "' + r + '" tech is undefined. Skipped browser support check for that tech.')
  8544. }
  8545. return ''
  8546. }),
  8547. (e.selectSource = function (e) {
  8548. function t(e, i, n) {
  8549. var r
  8550. return (
  8551. e.some(function (t) {
  8552. return i.some(function (e) {
  8553. if ((r = n(t, e))) return !0
  8554. })
  8555. }),
  8556. r
  8557. )
  8558. }
  8559. var i,
  8560. n = this,
  8561. r = this.options_.techOrder
  8562. .map(function (e) {
  8563. return [e, ji.getTech(e)]
  8564. })
  8565. .filter(function (e) {
  8566. var t = e[0],
  8567. e = e[1]
  8568. return e ? e.isSupported() : (h.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'), !1)
  8569. }),
  8570. a = function (e, t) {
  8571. var i = e[0]
  8572. if (e[1].canPlaySource(t, n.options_[i.toLowerCase()])) return { source: t, tech: i }
  8573. },
  8574. a = this.options_.sourceOrder
  8575. ? t(
  8576. e,
  8577. r,
  8578. ((i = a),
  8579. function (e, t) {
  8580. return i(t, e)
  8581. })
  8582. )
  8583. : t(r, e, a)
  8584. return a || !1
  8585. }),
  8586. (e.handleSrc_ = function (e, n) {
  8587. var r = this
  8588. if ('undefined' == typeof e) return this.cache_.src || ''
  8589. this.resetRetryOnError_ && this.resetRetryOnError_()
  8590. var t,
  8591. i,
  8592. a = Ji(e)
  8593. a.length
  8594. ? ((this.changingSrc_ = !0),
  8595. n || (this.cache_.sources = a),
  8596. this.updateSourceCaches_(a[0]),
  8597. Wi(this, a[0], function (e, t) {
  8598. var i
  8599. return (
  8600. (r.middleware_ = t),
  8601. n || (r.cache_.sources = a),
  8602. r.updateSourceCaches_(e),
  8603. r.src_(e)
  8604. ? 1 < a.length
  8605. ? r.handleSrc_(a.slice(1))
  8606. : ((r.changingSrc_ = !1),
  8607. r.setTimeout(function () {
  8608. this.error({ code: 4, message: this.options_.notSupportedMessage })
  8609. }, 0),
  8610. void r.triggerReady())
  8611. : ((t = t),
  8612. (i = r.tech_),
  8613. void t.forEach(function (e) {
  8614. return e.setTech && e.setTech(i)
  8615. }))
  8616. )
  8617. }),
  8618. this.options_.retryOnError &&
  8619. 1 < a.length &&
  8620. ((i = function () {
  8621. r.off('error', t)
  8622. }),
  8623. this.one(
  8624. 'error',
  8625. (t = function () {
  8626. r.error(null), r.handleSrc_(a.slice(1), !0)
  8627. })
  8628. ),
  8629. this.one('playing', i),
  8630. (this.resetRetryOnError_ = function () {
  8631. r.off('error', t), r.off('playing', i)
  8632. })))
  8633. : this.setTimeout(function () {
  8634. this.error({ code: 4, message: this.options_.notSupportedMessage })
  8635. }, 0)
  8636. }),
  8637. (e.src = function (e) {
  8638. return this.handleSrc_(e, !1)
  8639. }),
  8640. (e.src_ = function (e) {
  8641. var t,
  8642. i,
  8643. n = this,
  8644. r = this.selectSource([e])
  8645. return (
  8646. !r ||
  8647. ((t = r.tech),
  8648. (i = this.techName_),
  8649. ut(t) !== ut(i)
  8650. ? ((this.changingSrc_ = !0),
  8651. this.loadTech_(r.tech, r.source),
  8652. this.tech_.ready(function () {
  8653. n.changingSrc_ = !1
  8654. }))
  8655. : this.ready(function () {
  8656. this.tech_.constructor.prototype.hasOwnProperty('setSource') ? this.techCall_('setSource', e) : this.techCall_('src', e.src), (this.changingSrc_ = !1)
  8657. }, !0),
  8658. !1)
  8659. )
  8660. }),
  8661. (e.load = function () {
  8662. this.techCall_('load')
  8663. }),
  8664. (e.reset = function () {
  8665. var e = this,
  8666. t = this.options_.Promise || window.Promise
  8667. this.paused() || !t
  8668. ? this.doReset_()
  8669. : Et(
  8670. this.play().then(function () {
  8671. return e.doReset_()
  8672. })
  8673. )
  8674. }),
  8675. (e.doReset_ = function () {
  8676. this.tech_ && this.tech_.clearTracks('text'),
  8677. this.resetCache_(),
  8678. this.poster(''),
  8679. this.loadTech_(this.options_.techOrder[0], null),
  8680. this.techCall_('reset'),
  8681. this.resetControlBarUI_(),
  8682. it(this) && this.trigger('playerreset')
  8683. }),
  8684. (e.resetControlBarUI_ = function () {
  8685. this.resetProgressBar_(), this.resetPlaybackRate_(), this.resetVolumeBar_()
  8686. }),
  8687. (e.resetProgressBar_ = function () {
  8688. this.currentTime(0)
  8689. var e = this.controlBar || {},
  8690. t = e.durationDisplay,
  8691. e = e.remainingTimeDisplay
  8692. t && t.updateContent(), e && e.updateContent()
  8693. }),
  8694. (e.resetPlaybackRate_ = function () {
  8695. this.playbackRate(this.defaultPlaybackRate()), this.handleTechRateChange_()
  8696. }),
  8697. (e.resetVolumeBar_ = function () {
  8698. this.volume(1), this.trigger('volumechange')
  8699. }),
  8700. (e.currentSources = function () {
  8701. var e = this.currentSource(),
  8702. t = []
  8703. return 0 !== Object.keys(e).length && t.push(e), this.cache_.sources || t
  8704. }),
  8705. (e.currentSource = function () {
  8706. return this.cache_.source || {}
  8707. }),
  8708. (e.currentSrc = function () {
  8709. return (this.currentSource() && this.currentSource().src) || ''
  8710. }),
  8711. (e.currentType = function () {
  8712. return (this.currentSource() && this.currentSource().type) || ''
  8713. }),
  8714. (e.preload = function (e) {
  8715. return void 0 !== e ? (this.techCall_('setPreload', e), void (this.options_.preload = e)) : this.techGet_('preload')
  8716. }),
  8717. (e.autoplay = function (e) {
  8718. if (void 0 === e) return this.options_.autoplay || !1
  8719. var t
  8720. ;('string' == typeof e && /(any|play|muted)/.test(e)) || (!0 === e && this.options_.normalizeAutoplay)
  8721. ? ((this.options_.autoplay = e), this.manualAutoplay_('string' == typeof e ? e : 'play'), (t = !1))
  8722. : (this.options_.autoplay = !!e),
  8723. (t = 'undefined' == typeof t ? this.options_.autoplay : t),
  8724. this.tech_ && this.techCall_('setAutoplay', t)
  8725. }),
  8726. (e.playsinline = function (e) {
  8727. return void 0 !== e ? (this.techCall_('setPlaysinline', e), (this.options_.playsinline = e), this) : this.techGet_('playsinline')
  8728. }),
  8729. (e.loop = function (e) {
  8730. return void 0 !== e ? (this.techCall_('setLoop', e), void (this.options_.loop = e)) : this.techGet_('loop')
  8731. }),
  8732. (e.poster = function (e) {
  8733. if (void 0 === e) return this.poster_
  8734. ;(e = e || '') !== this.poster_ && ((this.poster_ = e), this.techCall_('setPoster', e), (this.isPosterFromTech_ = !1), this.trigger('posterchange'))
  8735. }),
  8736. (e.handleTechPosterChange_ = function () {
  8737. var e
  8738. ;(this.poster_ && !this.options_.techCanOverridePoster) ||
  8739. !this.tech_ ||
  8740. !this.tech_.poster ||
  8741. ((e = this.tech_.poster() || '') !== this.poster_ && ((this.poster_ = e), (this.isPosterFromTech_ = !0), this.trigger('posterchange')))
  8742. }),
  8743. (e.controls = function (e) {
  8744. if (void 0 === e) return !!this.controls_
  8745. this.controls_ !== (e = !!e) &&
  8746. ((this.controls_ = e),
  8747. this.usingNativeControls() && this.techCall_('setControls', e),
  8748. this.controls_
  8749. ? (this.removeClass('vjs-controls-disabled'),
  8750. this.addClass('vjs-controls-enabled'),
  8751. this.trigger('controlsenabled'),
  8752. this.usingNativeControls() || this.addTechControlsListeners_())
  8753. : (this.removeClass('vjs-controls-enabled'),
  8754. this.addClass('vjs-controls-disabled'),
  8755. this.trigger('controlsdisabled'),
  8756. this.usingNativeControls() || this.removeTechControlsListeners_()))
  8757. }),
  8758. (e.usingNativeControls = function (e) {
  8759. if (void 0 === e) return !!this.usingNativeControls_
  8760. this.usingNativeControls_ !== (e = !!e) &&
  8761. ((this.usingNativeControls_ = e),
  8762. this.usingNativeControls_
  8763. ? (this.addClass('vjs-using-native-controls'), this.trigger('usingnativecontrols'))
  8764. : (this.removeClass('vjs-using-native-controls'), this.trigger('usingcustomcontrols')))
  8765. }),
  8766. (e.error = function (t) {
  8767. var i = this
  8768. if (void 0 === t) return this.error_ || null
  8769. if (
  8770. (a('beforeerror').forEach(function (e) {
  8771. e = e(i, t)
  8772. ;(T(e) && !Array.isArray(e)) || 'string' == typeof e || 'number' == typeof e || null === e
  8773. ? (t = e)
  8774. : i.log.error('please return a value that MediaError expects in beforeerror hooks')
  8775. }),
  8776. this.options_.suppressNotSupportedError && t && 4 === t.code)
  8777. ) {
  8778. var e = function () {
  8779. this.error(t)
  8780. }
  8781. return (
  8782. (this.options_.suppressNotSupportedError = !1),
  8783. this.any(['click', 'touchstart'], e),
  8784. void this.one('loadstart', function () {
  8785. this.off(['click', 'touchstart'], e)
  8786. })
  8787. )
  8788. }
  8789. if (null === t) return (this.error_ = t), this.removeClass('vjs-error'), void (this.errorDisplay && this.errorDisplay.close())
  8790. ;(this.error_ = new bt(t)),
  8791. this.addClass('vjs-error'),
  8792. h.error('(CODE:' + this.error_.code + ' ' + bt.errorTypes[this.error_.code] + ')', this.error_.message, this.error_),
  8793. this.trigger('error'),
  8794. a('error').forEach(function (e) {
  8795. return e(i, i.error_)
  8796. })
  8797. }),
  8798. (e.reportUserActivity = function (e) {
  8799. this.userActivity_ = !0
  8800. }),
  8801. (e.userActive = function (e) {
  8802. if (void 0 === e) return this.userActive_
  8803. if ((e = !!e) !== this.userActive_) {
  8804. if (((this.userActive_ = e), this.userActive_))
  8805. return (this.userActivity_ = !0), this.removeClass('vjs-user-inactive'), this.addClass('vjs-user-active'), void this.trigger('useractive')
  8806. this.tech_ &&
  8807. this.tech_.one('mousemove', function (e) {
  8808. e.stopPropagation(), e.preventDefault()
  8809. }),
  8810. (this.userActivity_ = !1),
  8811. this.removeClass('vjs-user-active'),
  8812. this.addClass('vjs-user-inactive'),
  8813. this.trigger('userinactive')
  8814. }
  8815. }),
  8816. (e.listenForUserActivity_ = function () {
  8817. var t,
  8818. i,
  8819. n,
  8820. r = Ve(this, this.reportUserActivity),
  8821. e = function (e) {
  8822. r(), this.clearInterval(t)
  8823. }
  8824. this.on('mousedown', function () {
  8825. r(), this.clearInterval(t), (t = this.setInterval(r, 250))
  8826. }),
  8827. this.on('mousemove', function (e) {
  8828. ;(e.screenX === i && e.screenY === n) || ((i = e.screenX), (n = e.screenY), r())
  8829. }),
  8830. this.on('mouseup', e),
  8831. this.on('mouseleave', e)
  8832. var a,
  8833. e = this.getChild('controlBar')
  8834. !e ||
  8835. q ||
  8836. A ||
  8837. (e.on('mouseenter', function (e) {
  8838. 0 !== this.player().options_.inactivityTimeout && (this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout),
  8839. (this.player().options_.inactivityTimeout = 0)
  8840. }),
  8841. e.on('mouseleave', function (e) {
  8842. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout
  8843. })),
  8844. this.on('keydown', r),
  8845. this.on('keyup', r),
  8846. this.setInterval(function () {
  8847. var e
  8848. this.userActivity_ &&
  8849. ((this.userActivity_ = !1),
  8850. this.userActive(!0),
  8851. this.clearTimeout(a),
  8852. (e = this.options_.inactivityTimeout) <= 0 ||
  8853. (a = this.setTimeout(function () {
  8854. this.userActivity_ || this.userActive(!1)
  8855. }, e)))
  8856. }, 250)
  8857. }),
  8858. (e.playbackRate = function (e) {
  8859. if (void 0 === e) return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_('playbackRate') : 1
  8860. this.techCall_('setPlaybackRate', e)
  8861. }),
  8862. (e.defaultPlaybackRate = function (e) {
  8863. return void 0 !== e ? this.techCall_('setDefaultPlaybackRate', e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_('defaultPlaybackRate') : 1
  8864. }),
  8865. (e.isAudio = function (e) {
  8866. if (void 0 === e) return !!this.isAudio_
  8867. this.isAudio_ = !!e
  8868. }),
  8869. (e.enableAudioOnlyUI_ = function () {
  8870. var t = this
  8871. this.addClass('vjs-audio-only-mode')
  8872. var e = this.children(),
  8873. i = this.getChild('ControlBar'),
  8874. n = i && i.currentHeight()
  8875. e.forEach(function (e) {
  8876. e !== i && e.el_ && !e.hasClass('vjs-hidden') && (e.hide(), t.audioOnlyCache_.hiddenChildren.push(e))
  8877. }),
  8878. (this.audioOnlyCache_.playerHeight = this.currentHeight()),
  8879. this.height(n),
  8880. this.trigger('audioonlymodechange')
  8881. }),
  8882. (e.disableAudioOnlyUI_ = function () {
  8883. this.removeClass('vjs-audio-only-mode'),
  8884. this.audioOnlyCache_.hiddenChildren.forEach(function (e) {
  8885. return e.show()
  8886. }),
  8887. this.height(this.audioOnlyCache_.playerHeight),
  8888. this.trigger('audioonlymodechange')
  8889. }),
  8890. (e.audioOnlyMode = function (e) {
  8891. var t = this
  8892. if ('boolean' != typeof e || e === this.audioOnlyMode_) return this.audioOnlyMode_
  8893. this.audioOnlyMode_ = e
  8894. var i = this.options_.Promise || window.Promise
  8895. if (i) {
  8896. if (e) {
  8897. var n = []
  8898. return (
  8899. this.isInPictureInPicture() && n.push(this.exitPictureInPicture()),
  8900. this.isFullscreen() && n.push(this.exitFullscreen()),
  8901. this.audioPosterMode() && n.push(this.audioPosterMode(!1)),
  8902. i.all(n).then(function () {
  8903. return t.enableAudioOnlyUI_()
  8904. })
  8905. )
  8906. }
  8907. return i.resolve().then(function () {
  8908. return t.disableAudioOnlyUI_()
  8909. })
  8910. }
  8911. e ? (this.isInPictureInPicture() && this.exitPictureInPicture(), this.isFullscreen() && this.exitFullscreen(), this.enableAudioOnlyUI_()) : this.disableAudioOnlyUI_()
  8912. }),
  8913. (e.enablePosterModeUI_ = function () {
  8914. ;(this.tech_ && this.tech_).hide(), this.addClass('vjs-audio-poster-mode'), this.trigger('audiopostermodechange')
  8915. }),
  8916. (e.disablePosterModeUI_ = function () {
  8917. ;(this.tech_ && this.tech_).show(), this.removeClass('vjs-audio-poster-mode'), this.trigger('audiopostermodechange')
  8918. }),
  8919. (e.audioPosterMode = function (e) {
  8920. var t = this
  8921. if ('boolean' != typeof e || e === this.audioPosterMode_) return this.audioPosterMode_
  8922. this.audioPosterMode_ = e
  8923. var i = this.options_.Promise || window.Promise
  8924. return i
  8925. ? e
  8926. ? (this.audioOnlyMode() ? this.audioOnlyMode(!1) : i.resolve()).then(function () {
  8927. t.enablePosterModeUI_()
  8928. })
  8929. : i.resolve().then(function () {
  8930. t.disablePosterModeUI_()
  8931. })
  8932. : e
  8933. ? (this.audioOnlyMode() && this.audioOnlyMode(!1), void this.enablePosterModeUI_())
  8934. : void this.disablePosterModeUI_()
  8935. }),
  8936. (e.addTextTrack = function (e, t, i) {
  8937. if (this.tech_) return this.tech_.addTextTrack(e, t, i)
  8938. }),
  8939. (e.addRemoteTextTrack = function (e, t) {
  8940. if (this.tech_) return this.tech_.addRemoteTextTrack(e, t)
  8941. }),
  8942. (e.removeRemoteTextTrack = function (e) {
  8943. var t = (t = (e = void 0 === e ? {} : e).track) || e
  8944. if (this.tech_) return this.tech_.removeRemoteTextTrack(t)
  8945. }),
  8946. (e.getVideoPlaybackQuality = function () {
  8947. return this.techGet_('getVideoPlaybackQuality')
  8948. }),
  8949. (e.videoWidth = function () {
  8950. return (this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth()) || 0
  8951. }),
  8952. (e.videoHeight = function () {
  8953. return (this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight()) || 0
  8954. }),
  8955. (e.language = function (e) {
  8956. if (void 0 === e) return this.language_
  8957. this.language_ !== String(e).toLowerCase() && ((this.language_ = String(e).toLowerCase()), it(this) && this.trigger('languagechange'))
  8958. }),
  8959. (e.languages = function () {
  8960. return lt(o.prototype.options_.languages, this.languages_)
  8961. }),
  8962. (e.toJSON = function () {
  8963. var e = lt(this.options_),
  8964. t = e.tracks
  8965. e.tracks = []
  8966. for (var i = 0; i < t.length; i++) {
  8967. var n = t[i]
  8968. ;((n = lt(n)).player = void 0), (e.tracks[i] = n)
  8969. }
  8970. return e
  8971. }),
  8972. (e.createModal = function (e, t) {
  8973. var i = this
  8974. ;(t = t || {}).content = e || ''
  8975. var n = new At(this, t)
  8976. return (
  8977. this.addChild(n),
  8978. n.on('dispose', function () {
  8979. i.removeChild(n)
  8980. }),
  8981. n.open(),
  8982. n
  8983. )
  8984. }),
  8985. (e.updateCurrentBreakpoint_ = function () {
  8986. if (this.responsive())
  8987. for (var e = this.currentBreakpoint(), t = this.currentWidth(), i = 0; i < Nn.length; i++) {
  8988. var n = Nn[i]
  8989. if (t <= this.breakpoints_[n]) {
  8990. if (e === n) return
  8991. e && this.removeClass(Un[e]), this.addClass(Un[n]), (this.breakpoint_ = n)
  8992. break
  8993. }
  8994. }
  8995. }),
  8996. (e.removeCurrentBreakpoint_ = function () {
  8997. var e = this.currentBreakpointClass()
  8998. ;(this.breakpoint_ = ''), e && this.removeClass(e)
  8999. }),
  9000. (e.breakpoints = function (e) {
  9001. return void 0 === e || ((this.breakpoint_ = ''), (this.breakpoints_ = b({}, Bn, e)), this.updateCurrentBreakpoint_()), b(this.breakpoints_)
  9002. }),
  9003. (e.responsive = function (e) {
  9004. return void 0 === e
  9005. ? this.responsive_
  9006. : (e = Boolean(e)) !== this.responsive_
  9007. ? ((this.responsive_ = e)
  9008. ? (this.on('playerresize', this.boundUpdateCurrentBreakpoint_), this.updateCurrentBreakpoint_())
  9009. : (this.off('playerresize', this.boundUpdateCurrentBreakpoint_), this.removeCurrentBreakpoint_()),
  9010. e)
  9011. : void 0
  9012. }),
  9013. (e.currentBreakpoint = function () {
  9014. return this.breakpoint_
  9015. }),
  9016. (e.currentBreakpointClass = function () {
  9017. return Un[this.breakpoint_] || ''
  9018. }),
  9019. (e.loadMedia = function (e, t) {
  9020. var i,
  9021. n,
  9022. r,
  9023. a = this
  9024. e &&
  9025. 'object' == typeof e &&
  9026. (this.reset(),
  9027. (this.cache_.media = lt(e)),
  9028. (i = (r = this.cache_.media).artwork),
  9029. (n = r.poster),
  9030. (e = r.src),
  9031. (r = r.textTracks),
  9032. !i && n && (this.cache_.media.artwork = [{ src: n, type: $i(n) }]),
  9033. e && this.src(e),
  9034. n && this.poster(n),
  9035. Array.isArray(r) &&
  9036. r.forEach(function (e) {
  9037. return a.addRemoteTextTrack(e, !1)
  9038. }),
  9039. this.ready(t))
  9040. }),
  9041. (e.getMedia = function () {
  9042. if (this.cache_.media) return lt(this.cache_.media)
  9043. var e = this.poster(),
  9044. t = {
  9045. src: this.currentSources(),
  9046. textTracks: Array.prototype.map.call(this.remoteTextTracks(), function (e) {
  9047. return { kind: e.kind, label: e.label, language: e.language, src: e.src }
  9048. }),
  9049. }
  9050. return e && ((t.poster = e), (t.artwork = [{ src: t.poster, type: $i(t.poster) }])), t
  9051. }),
  9052. (o.getTagSettings = function (e) {
  9053. var t,
  9054. i = { sources: [], tracks: [] },
  9055. n = ae(e),
  9056. r = n['data-setup']
  9057. if (
  9058. (ee(e, 'vjs-fill') && (n.fill = !0),
  9059. ee(e, 'vjs-fluid') && (n.fluid = !0),
  9060. null !== r && ((r = (t = St(r || '{}'))[0]), (t = t[1]), r && h.error(r), b(n, t)),
  9061. b(i, n),
  9062. e.hasChildNodes())
  9063. )
  9064. for (var a = e.childNodes, s = 0, o = a.length; s < o; s++) {
  9065. var u = a[s],
  9066. l = u.nodeName.toLowerCase()
  9067. 'source' === l ? i.sources.push(ae(u)) : 'track' === l && i.tracks.push(ae(u))
  9068. }
  9069. return i
  9070. }),
  9071. (e.flexNotSupported_ = function () {
  9072. var e = document.createElement('i')
  9073. return !('flexBasis' in e.style || 'webkitFlexBasis' in e.style || 'mozFlexBasis' in e.style || 'msFlexBasis' in e.style || 'msFlexOrder' in e.style)
  9074. }),
  9075. (e.debug = function (e) {
  9076. if (void 0 === e) return this.debugEnabled_
  9077. e
  9078. ? (this.trigger('debugon'), (this.previousLogLevel_ = this.log.level), this.log.level('debug'), (this.debugEnabled_ = !0))
  9079. : (this.trigger('debugoff'), this.log.level(this.previousLogLevel_), (this.previousLogLevel_ = void 0), (this.debugEnabled_ = !1))
  9080. }),
  9081. (e.playbackRates = function (e) {
  9082. if (void 0 === e) return this.cache_.playbackRates
  9083. Array.isArray(e) &&
  9084. e.every(function (e) {
  9085. return 'number' == typeof e
  9086. }) &&
  9087. ((this.cache_.playbackRates = e), this.trigger('playbackrateschange'))
  9088. }),
  9089. o
  9090. )
  9091. })(pt)
  9092. oi.names.forEach(function (e) {
  9093. var t = oi[e]
  9094. Fn.prototype[t.getterName] = function () {
  9095. return this.tech_ ? this.tech_[t.getterName]() : ((this[t.privateName] = this[t.privateName] || new t.ListClass()), this[t.privateName])
  9096. }
  9097. }),
  9098. (Fn.prototype.crossorigin = Fn.prototype.crossOrigin),
  9099. (Fn.players = {})
  9100. k = window.navigator
  9101. ;(Fn.prototype.options_ = {
  9102. techOrder: ji.defaultTechOrder_,
  9103. html5: {},
  9104. inactivityTimeout: 2e3,
  9105. playbackRates: [],
  9106. liveui: !1,
  9107. children: ['mediaLoader', 'posterImage', 'textTrackDisplay', 'loadingSpinner', 'bigPlayButton', 'liveTracker', 'controlBar', 'errorDisplay', 'textTrackSettings', 'resizeManager'],
  9108. language: (k && ((k.languages && k.languages[0]) || k.userLanguage || k.language)) || 'en',
  9109. languages: {},
  9110. notSupportedMessage: 'No compatible source was found for this media.',
  9111. normalizeAutoplay: !1,
  9112. fullscreen: { options: { navigationUI: 'hide' } },
  9113. breakpoints: {},
  9114. responsive: !1,
  9115. audioOnlyMode: !1,
  9116. audioPosterMode: !1,
  9117. }),
  9118. ['ended', 'seeking', 'seekable', 'networkState', 'readyState'].forEach(function (e) {
  9119. Fn.prototype[e] = function () {
  9120. return this.techGet_(e)
  9121. }
  9122. }),
  9123. Mn.forEach(function (e) {
  9124. Fn.prototype['handleTech' + ut(e) + '_'] = function () {
  9125. return this.trigger(e)
  9126. }
  9127. }),
  9128. pt.registerComponent('Player', Fn)
  9129. var jn = m(function (i) {
  9130. function n(e, t) {
  9131. return (
  9132. (i.exports = n =
  9133. Object.setPrototypeOf ||
  9134. function (e, t) {
  9135. return (e.__proto__ = t), e
  9136. }),
  9137. n(e, t)
  9138. )
  9139. }
  9140. i.exports = n
  9141. })
  9142. function Hn(e) {
  9143. return Qn.hasOwnProperty(e)
  9144. }
  9145. function qn(e) {
  9146. return Hn(e) ? Qn[e] : void 0
  9147. }
  9148. function Vn(e, t, i) {
  9149. ;(i = (i ? 'before' : '') + 'pluginsetup'), e.trigger(i, t), e.trigger(i + ':' + t.name, t)
  9150. }
  9151. function Wn(t, i) {
  9152. function n() {
  9153. Vn(this, { name: t, plugin: i, instance: null }, !0)
  9154. var e = i.apply(this, arguments)
  9155. return $n(this, t), Vn(this, { name: t, plugin: i, instance: e }), e
  9156. }
  9157. return (
  9158. Object.keys(i).forEach(function (e) {
  9159. n[e] = i[e]
  9160. }),
  9161. n
  9162. )
  9163. }
  9164. function Gn(r, a) {
  9165. return (
  9166. (a.prototype.name = r),
  9167. function () {
  9168. Vn(this, { name: r, plugin: a, instance: null }, !0)
  9169. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  9170. var n = Xn(a, [this].concat(t))
  9171. return (
  9172. (this[r] = function () {
  9173. return n
  9174. }),
  9175. Vn(this, n.getEventHash()),
  9176. n
  9177. )
  9178. }
  9179. )
  9180. }
  9181. var zn = function () {
  9182. if ('undefined' == typeof Reflect || !Reflect.construct) return !1
  9183. if (Reflect.construct.sham) return !1
  9184. if ('function' == typeof Proxy) return !0
  9185. try {
  9186. return Date.prototype.toString.call(Reflect.construct(Date, [], function () {})), !0
  9187. } catch (e) {
  9188. return !1
  9189. }
  9190. },
  9191. Xn = m(function (n) {
  9192. function r(e, t, i) {
  9193. return (
  9194. zn()
  9195. ? (n.exports = r = Reflect.construct)
  9196. : (n.exports = r =
  9197. function (e, t, i) {
  9198. var n = [null]
  9199. n.push.apply(n, t)
  9200. n = new (Function.bind.apply(e, n))()
  9201. return i && jn(n, i.prototype), n
  9202. }),
  9203. r.apply(null, arguments)
  9204. )
  9205. }
  9206. n.exports = r
  9207. }),
  9208. Kn = 'plugin',
  9209. Yn = 'activePlugins_',
  9210. Qn = {},
  9211. $n = function (e, t) {
  9212. ;(e[Yn] = e[Yn] || {}), (e[Yn][t] = !0)
  9213. },
  9214. Jn = (function () {
  9215. function i(e) {
  9216. if (this.constructor === i) throw new Error('Plugin must be sub-classed; not directly instantiated.')
  9217. ;(this.player = e),
  9218. this.log || (this.log = this.player.log.createLogger(this.name)),
  9219. rt(this),
  9220. delete this.trigger,
  9221. st(this, this.constructor.defaultState),
  9222. $n(e, this.name),
  9223. (this.dispose = this.dispose.bind(this)),
  9224. e.on('dispose', this.dispose)
  9225. }
  9226. var e = i.prototype
  9227. return (
  9228. (e.version = function () {
  9229. return this.constructor.VERSION
  9230. }),
  9231. (e.getEventHash = function (e) {
  9232. return ((e = void 0 === e ? {} : e).name = this.name), (e.plugin = this.constructor), (e.instance = this), e
  9233. }),
  9234. (e.trigger = function (e, t) {
  9235. return je(this.eventBusEl_, e, this.getEventHash((t = void 0 === t ? {} : t)))
  9236. }),
  9237. (e.handleStateChanged = function (e) {}),
  9238. (e.dispose = function () {
  9239. var e = this.name,
  9240. t = this.player
  9241. this.trigger('dispose'), this.off(), t.off('dispose', this.dispose), (t[Yn][e] = !1), (this.player = this.state = null), (t[e] = Gn(e, Qn[e]))
  9242. }),
  9243. (i.isBasic = function (e) {
  9244. e = 'string' == typeof e ? qn(e) : e
  9245. return 'function' == typeof e && !i.prototype.isPrototypeOf(e.prototype)
  9246. }),
  9247. (i.registerPlugin = function (e, t) {
  9248. if ('string' != typeof e) throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + typeof e + '.')
  9249. if (Hn(e)) h.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!')
  9250. else if (Fn.prototype.hasOwnProperty(e)) throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!')
  9251. if ('function' != typeof t) throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + typeof t + '.')
  9252. return (Qn[e] = t), e !== Kn && (i.isBasic(t) ? (Fn.prototype[e] = Wn(e, t)) : (Fn.prototype[e] = Gn(e, t))), t
  9253. }),
  9254. (i.deregisterPlugin = function (e) {
  9255. if (e === Kn) throw new Error('Cannot de-register base plugin.')
  9256. Hn(e) && (delete Qn[e], delete Fn.prototype[e])
  9257. }),
  9258. (i.getPlugins = function (e) {
  9259. var i
  9260. return (
  9261. (e = void 0 === e ? Object.keys(Qn) : e).forEach(function (e) {
  9262. var t = qn(e)
  9263. t && ((i = i || {})[e] = t)
  9264. }),
  9265. i
  9266. )
  9267. }),
  9268. (i.getPluginVersion = function (e) {
  9269. e = qn(e)
  9270. return (e && e.VERSION) || ''
  9271. }),
  9272. i
  9273. )
  9274. })()
  9275. ;(Jn.getPlugin = qn),
  9276. (Jn.BASE_PLUGIN_NAME = Kn),
  9277. Jn.registerPlugin(Kn, Jn),
  9278. (Fn.prototype.usingPlugin = function (e) {
  9279. return !!this[Yn] && !0 === this[Yn][e]
  9280. }),
  9281. (Fn.prototype.hasPlugin = function (e) {
  9282. return !!Hn(e)
  9283. })
  9284. var Zn = function (e, t) {
  9285. if ('function' != typeof t && null !== t) throw new TypeError('Super expression must either be null or a function')
  9286. ;(e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } })), t && jn(e, t)
  9287. },
  9288. er = function (e) {
  9289. return 0 === e.indexOf('#') ? e.slice(1) : e
  9290. }
  9291. function tr(e, t, i) {
  9292. if ((r = tr.getPlayer(e))) return t && h.warn('Player "' + e + '" is already initialised. Options will not be applied.'), i && r.ready(i), r
  9293. var n = 'string' == typeof e ? Te('#' + er(e)) : e
  9294. if (!K(n)) throw new TypeError('The element or ID supplied is not valid. (videojs)')
  9295. ;(n.ownerDocument.defaultView && n.ownerDocument.body.contains(n)) || h.warn('The element supplied is not included in the DOM'),
  9296. !0 === (t = t || {}).restoreEl && (t.restoreEl = (n.parentNode && n.parentNode.hasAttribute('data-vjs-player') ? n.parentNode : n).cloneNode(!0)),
  9297. a('beforesetup').forEach(function (e) {
  9298. e = e(n, lt(t))
  9299. T(e) && !Array.isArray(e) ? (t = lt(t, e)) : h.error('please return an object in beforesetup hooks')
  9300. })
  9301. var r = new (pt.getComponent('Player'))(n, t, i)
  9302. return (
  9303. a('setup').forEach(function (e) {
  9304. return e(r)
  9305. }),
  9306. r
  9307. )
  9308. }
  9309. ;(tr.hooks_ = i),
  9310. (tr.hooks = a),
  9311. (tr.hook = function (e, t) {
  9312. a(e, t)
  9313. }),
  9314. (tr.hookOnce = function (i, e) {
  9315. a(
  9316. i,
  9317. [].concat(e).map(function (t) {
  9318. return function e() {
  9319. return n(i, e), t.apply(void 0, arguments)
  9320. }
  9321. })
  9322. )
  9323. }),
  9324. (tr.removeHook = n),
  9325. !0 !== window.VIDEOJS_NO_DYNAMIC_STYLE &&
  9326. X() &&
  9327. ((ar = Te('.vjs-styles-defaults')) ||
  9328. ((ar = xe('vjs-styles-defaults')),
  9329. (k = Te('head')) && k.insertBefore(ar, k.firstChild),
  9330. Ae(ar, '\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid:not(.vjs-audio-only-mode) {\n padding-top: 56.25%\n }\n '))),
  9331. Ce(1, tr),
  9332. (tr.VERSION = u),
  9333. (tr.options = Fn.prototype.options_),
  9334. (tr.getPlayers = function () {
  9335. return Fn.players
  9336. }),
  9337. (tr.getPlayer = function (e) {
  9338. var t = Fn.players
  9339. if ('string' == typeof e) {
  9340. var i = er(e),
  9341. n = t[i]
  9342. if (n) return n
  9343. i = Te('#' + i)
  9344. } else i = e
  9345. if (K(i)) {
  9346. ;(e = i.player), (i = i.playerId)
  9347. if (e || t[i]) return e || t[i]
  9348. }
  9349. }),
  9350. (tr.getAllPlayers = function () {
  9351. return Object.keys(Fn.players)
  9352. .map(function (e) {
  9353. return Fn.players[e]
  9354. })
  9355. .filter(Boolean)
  9356. }),
  9357. (tr.players = Fn.players),
  9358. (tr.getComponent = pt.getComponent),
  9359. (tr.registerComponent = function (e, t) {
  9360. ji.isTech(t) && h.warn('The ' + e + ' tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)'), pt.registerComponent.call(pt, e, t)
  9361. }),
  9362. (tr.getTech = ji.getTech),
  9363. (tr.registerTech = ji.registerTech),
  9364. (tr.use = function (e, t) {
  9365. ;(Hi[e] = Hi[e] || []), Hi[e].push(t)
  9366. }),
  9367. Object.defineProperty(tr, 'middleware', { value: {}, writeable: !1, enumerable: !0 }),
  9368. Object.defineProperty(tr.middleware, 'TERMINATOR', { value: Vi, writeable: !1, enumerable: !0 }),
  9369. (tr.browser = W),
  9370. (tr.TOUCH_ENABLED = F),
  9371. (tr.extend = function (e, t) {
  9372. var i,
  9373. n = function () {
  9374. e.apply(this, arguments)
  9375. },
  9376. r = {}
  9377. for (i in ('object' == typeof (t = void 0 === t ? {} : t) ? (t.constructor !== Object.prototype.constructor && (n = t.constructor), (r = t)) : 'function' == typeof t && (n = t),
  9378. Zn(n, e),
  9379. e && (n.super_ = e),
  9380. r))
  9381. r.hasOwnProperty(i) && (n.prototype[i] = r[i])
  9382. return n
  9383. }),
  9384. (tr.mergeOptions = lt),
  9385. (tr.bind = Ve),
  9386. (tr.registerPlugin = Jn.registerPlugin),
  9387. (tr.deregisterPlugin = Jn.deregisterPlugin),
  9388. (tr.plugin = function (e, t) {
  9389. return h.warn('videojs.plugin() is deprecated; use videojs.registerPlugin() instead'), Jn.registerPlugin(e, t)
  9390. }),
  9391. (tr.getPlugins = Jn.getPlugins),
  9392. (tr.getPlugin = Jn.getPlugin),
  9393. (tr.getPluginVersion = Jn.getPluginVersion),
  9394. (tr.addLanguage = function (e, t) {
  9395. var i
  9396. return (e = ('' + e).toLowerCase()), (tr.options.languages = lt(tr.options.languages, (((i = {})[e] = t), i))), tr.options.languages[e]
  9397. }),
  9398. (tr.log = h),
  9399. (tr.createLogger = p),
  9400. (tr.createTimeRange = tr.createTimeRanges = vt),
  9401. (tr.formatTime = ln),
  9402. (tr.setFormatTime = function (e) {
  9403. un = e
  9404. }),
  9405. (tr.resetFormatTime = function () {
  9406. un = on
  9407. }),
  9408. (tr.parseUrl = Mt),
  9409. (tr.isCrossOrigin = Ut),
  9410. (tr.EventTarget = ze),
  9411. (tr.on = Be),
  9412. (tr.one = He),
  9413. (tr.off = Fe),
  9414. (tr.trigger = je),
  9415. (tr.xhr = Jt),
  9416. (tr.TextTrack = ri),
  9417. (tr.AudioTrack = x),
  9418. (tr.VideoTrack = U),
  9419. ['isEl', 'isTextNode', 'createEl', 'hasClass', 'addClass', 'removeClass', 'toggleClass', 'setAttributes', 'getAttributes', 'emptyEl', 'appendContent', 'insertContent'].forEach(function (e) {
  9420. tr[e] = function () {
  9421. return h.warn('videojs.' + e + '() is deprecated; use videojs.dom.' + e + '() instead'), we[e].apply(null, arguments)
  9422. }
  9423. }),
  9424. (tr.computedStyle = w),
  9425. (tr.dom = we),
  9426. (tr.url = zt),
  9427. (tr.defineLazyProperty = An),
  9428. tr.addLanguage('en', { 'Non-Fullscreen': 'Exit Fullscreen' })
  9429. function ir(e, t) {
  9430. if (/^[a-z]+:/i.test(t)) return t
  9431. ;/^data:/.test(e) && (e = (window.location && window.location.href) || '')
  9432. var i = 'function' == typeof window.URL,
  9433. n = /^\/\//.test(e),
  9434. r = !window.location && !/\/\//i.test(e)
  9435. if ((i ? (e = new window.URL(e, window.location || rr)) : /\/\//i.test(e) || (e = nr.buildAbsoluteURL((window.location && window.location.href) || '', e)), i)) {
  9436. i = new URL(t, e)
  9437. return r ? i.href.slice(rr.length) : n ? i.href.slice(i.protocol.length) : i.href
  9438. }
  9439. return nr.buildAbsoluteURL(e, t)
  9440. }
  9441. var nr = m(function (e, t) {
  9442. var i, a, n, r, s
  9443. ;(i = /^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/),
  9444. (a = /^([^\/?#]*)([^]*)$/),
  9445. (n = /(?:\/|^)\.(?=\/)/g),
  9446. (r = /(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g),
  9447. (s = {
  9448. buildAbsoluteURL: function (e, t, i) {
  9449. if (((i = i || {}), (e = e.trim()), !(t = t.trim()))) {
  9450. if (!i.alwaysNormalize) return e
  9451. var n = s.parseURL(e)
  9452. if (!n) throw new Error('Error trying to parse base URL.')
  9453. return (n.path = s.normalizePath(n.path)), s.buildURLFromParts(n)
  9454. }
  9455. n = s.parseURL(t)
  9456. if (!n) throw new Error('Error trying to parse relative URL.')
  9457. if (n.scheme) return i.alwaysNormalize ? ((n.path = s.normalizePath(n.path)), s.buildURLFromParts(n)) : t
  9458. t = s.parseURL(e)
  9459. if (!t) throw new Error('Error trying to parse base URL.')
  9460. !t.netLoc && t.path && '/' !== t.path[0] && ((r = a.exec(t.path)), (t.netLoc = r[1]), (t.path = r[2])), t.netLoc && !t.path && (t.path = '/')
  9461. var r,
  9462. e = { scheme: t.scheme, netLoc: n.netLoc, path: null, params: n.params, query: n.query, fragment: n.fragment }
  9463. return (
  9464. n.netLoc ||
  9465. ((e.netLoc = t.netLoc),
  9466. '/' !== n.path[0] &&
  9467. (n.path
  9468. ? ((r = (r = t.path).substring(0, r.lastIndexOf('/') + 1) + n.path), (e.path = s.normalizePath(r)))
  9469. : ((e.path = t.path), n.params || ((e.params = t.params), n.query || (e.query = t.query))))),
  9470. null === e.path && (e.path = i.alwaysNormalize ? s.normalizePath(n.path) : n.path),
  9471. s.buildURLFromParts(e)
  9472. )
  9473. },
  9474. parseURL: function (e) {
  9475. e = i.exec(e)
  9476. return e ? { scheme: e[1] || '', netLoc: e[2] || '', path: e[3] || '', params: e[4] || '', query: e[5] || '', fragment: e[6] || '' } : null
  9477. },
  9478. normalizePath: function (e) {
  9479. for (e = e.split('').reverse().join('').replace(n, ''); e.length !== (e = e.replace(r, '')).length; );
  9480. return e.split('').reverse().join('')
  9481. },
  9482. buildURLFromParts: function (e) {
  9483. return e.scheme + e.netLoc + e.path + e.params + e.query + e.fragment
  9484. },
  9485. }),
  9486. (e.exports = s)
  9487. }),
  9488. rr = 'http://example.com',
  9489. ar = (function () {
  9490. function e() {
  9491. this.listeners = {}
  9492. }
  9493. var t = e.prototype
  9494. return (
  9495. (t.on = function (e, t) {
  9496. this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t)
  9497. }),
  9498. (t.off = function (e, t) {
  9499. if (!this.listeners[e]) return !1
  9500. t = this.listeners[e].indexOf(t)
  9501. return (this.listeners[e] = this.listeners[e].slice(0)), this.listeners[e].splice(t, 1), -1 < t
  9502. }),
  9503. (t.trigger = function (e) {
  9504. var t = this.listeners[e]
  9505. if (t)
  9506. if (2 === arguments.length) for (var i = t.length, n = 0; n < i; ++n) t[n].call(this, arguments[1])
  9507. else for (var r = Array.prototype.slice.call(arguments, 1), a = t.length, s = 0; s < a; ++s) t[s].apply(this, r)
  9508. }),
  9509. (t.dispose = function () {
  9510. this.listeners = {}
  9511. }),
  9512. (t.pipe = function (t) {
  9513. this.on('data', function (e) {
  9514. t.push(e)
  9515. })
  9516. }),
  9517. e
  9518. )
  9519. })(),
  9520. sr = function (e) {
  9521. return window.atob ? window.atob(e) : Buffer.from(e, 'base64').toString('binary')
  9522. }
  9523. function or(e) {
  9524. for (var t = sr(e), i = new Uint8Array(t.length), n = 0; n < t.length; n++) i[n] = t.charCodeAt(n)
  9525. return i
  9526. }
  9527. /*! @name m3u8-parser @version 4.7.1 @license Apache-2.0 */ function ur(e) {
  9528. var t = /([0-9.]*)?@?([0-9.]*)?/.exec(e || ''),
  9529. e = {}
  9530. return t[1] && (e.length = parseInt(t[1], 10)), t[2] && (e.offset = parseInt(t[2], 10)), e
  9531. }
  9532. function lr(e) {
  9533. for (var t, i = e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')), n = {}, r = i.length; r--; )
  9534. '' !== i[r] &&
  9535. (((t = /([^=]*)=(.*)/.exec(i[r]).slice(1))[0] = t[0].replace(/^\s+|\s+$/g, '')),
  9536. (t[1] = t[1].replace(/^\s+|\s+$/g, '')),
  9537. (t[1] = t[1].replace(/^['"](.*)['"]$/g, '$1')),
  9538. (n[t[0]] = t[1]))
  9539. return n
  9540. }
  9541. function cr(t) {
  9542. var i = {}
  9543. return (
  9544. Object.keys(t).forEach(function (e) {
  9545. i[
  9546. e.toLowerCase().replace(/-(\w)/g, function (e) {
  9547. return e[1].toUpperCase()
  9548. })
  9549. ] = t[e]
  9550. }),
  9551. i
  9552. )
  9553. }
  9554. function dr(e) {
  9555. var t,
  9556. i,
  9557. n,
  9558. r,
  9559. a = e.serverControl,
  9560. s = e.targetDuration,
  9561. o = e.partTargetDuration
  9562. a &&
  9563. ((t = '#EXT-X-SERVER-CONTROL'),
  9564. (i = 'holdBack'),
  9565. (n = 'partHoldBack'),
  9566. (r = s && 3 * s),
  9567. (e = o && 2 * o),
  9568. s && !a.hasOwnProperty(i) && ((a[i] = r), this.trigger('info', { message: t + ' defaulting HOLD-BACK to targetDuration * 3 (' + r + ').' })),
  9569. r && a[i] < r && (this.trigger('warn', { message: t + ' clamping HOLD-BACK (' + a[i] + ') to targetDuration * 3 (' + r + ')' }), (a[i] = r)),
  9570. o && !a.hasOwnProperty(n) && ((a[n] = 3 * o), this.trigger('info', { message: t + ' defaulting PART-HOLD-BACK to partTargetDuration * 3 (' + a[n] + ').' })),
  9571. o && a[n] < e && (this.trigger('warn', { message: t + ' clamping PART-HOLD-BACK (' + a[n] + ') to partTargetDuration * 2 (' + e + ').' }), (a[n] = e)))
  9572. }
  9573. function hr(e) {
  9574. return (
  9575. e &&
  9576. e.replace(/avc1\.(\d+)\.(\d+)/i, function (e, t, i) {
  9577. return 'avc1.' + ('00' + Number(t).toString(16)).slice(-2) + '00' + ('00' + Number(i).toString(16)).slice(-2)
  9578. })
  9579. )
  9580. }
  9581. function pr(e) {
  9582. var e = (e = void 0 === e ? '' : e).split(','),
  9583. a = []
  9584. return (
  9585. e.forEach(function (n) {
  9586. var r
  9587. ;(n = n.trim()),
  9588. Ar.forEach(function (e) {
  9589. var t,
  9590. i = xr[e].exec(n.toLowerCase())
  9591. !i || i.length <= 1 || ((r = e), (t = n.substring(0, i[1].length)), (i = n.replace(t, '')), a.push({ type: t, details: i, mediaType: e }))
  9592. }),
  9593. r || a.push({ type: n, details: '', mediaType: 'unknown' })
  9594. }),
  9595. a
  9596. )
  9597. }
  9598. function fr(e) {
  9599. return xr.audio.test((e = void 0 === e ? '' : e).trim().toLowerCase())
  9600. }
  9601. function mr(e) {
  9602. if (e && 'string' == typeof e) {
  9603. var t = e
  9604. .toLowerCase()
  9605. .split(',')
  9606. .map(function (e) {
  9607. return hr(e.trim())
  9608. }),
  9609. i = 'video'
  9610. 1 === t.length && fr(t[0]) ? (i = 'audio') : 1 === t.length && ((n = t[0]), xr.text.test((n = void 0 === n ? '' : n).trim().toLowerCase())) && (i = 'application')
  9611. var n = 'mp4'
  9612. return (
  9613. t.every(function (e) {
  9614. return xr.mp4.test(e)
  9615. })
  9616. ? (n = 'mp4')
  9617. : t.every(function (e) {
  9618. return xr.webm.test(e)
  9619. })
  9620. ? (n = 'webm')
  9621. : t.every(function (e) {
  9622. return xr.ogg.test(e)
  9623. }) && (n = 'ogg'),
  9624. i + '/' + n + ';codecs="' + e + '"'
  9625. )
  9626. }
  9627. }
  9628. function gr(e) {
  9629. return void 0 === e && (e = ''), (window.MediaSource && window.MediaSource.isTypeSupported && window.MediaSource.isTypeSupported(mr(e))) || !1
  9630. }
  9631. function yr(e) {
  9632. return (e = void 0 === e ? '' : e)
  9633. .toLowerCase()
  9634. .split(',')
  9635. .every(function (e) {
  9636. e = e.trim()
  9637. for (var t = 0; t < Pr.length; t++) if (xr['muxer' + Pr[t]].test(e)) return !0
  9638. return !1
  9639. })
  9640. }
  9641. function vr(e) {
  9642. return Dr.test(e) ? 'hls' : Or.test(e) ? 'dash' : 'application/vnd.videojs.vhs+json' === e ? 'vhs-json' : null
  9643. }
  9644. function _r(e) {
  9645. return 'function' === ArrayBuffer.isView ? ArrayBuffer.isView(e) : e && e.buffer instanceof ArrayBuffer
  9646. }
  9647. function br(e) {
  9648. return e instanceof Uint8Array
  9649. ? e
  9650. : (Array.isArray(e) || Mr(e) || e instanceof ArrayBuffer || (e = 'number' != typeof e || ('number' == typeof e && e != e) ? 0 : [e]),
  9651. new Uint8Array((e && e.buffer) || e, (e && e.byteOffset) || 0, (e && e.byteLength) || 0))
  9652. }
  9653. function Tr(e, t) {
  9654. var i = void 0 !== (t = (void 0 === t ? {} : t).le) && t
  9655. e = Rr((e = ('bigint' != typeof e && 'number' != typeof e) || ('number' == typeof e && e != e) ? 0 : e))
  9656. for (var n = ((t = e), Math.ceil(t.toString(2).length / 8)), r = new Uint8Array(new ArrayBuffer(n)), a = 0; a < n; a++) {
  9657. var s = i ? a : Math.abs(a + 1 - r.length)
  9658. ;(r[s] = Number((e / Nr[a]) & Rr(255))), e < 0 && ((r[s] = Math.abs(~r[s])), (r[s] -= 0 === a ? 1 : 2))
  9659. }
  9660. return r
  9661. }
  9662. function Sr(e, t) {
  9663. if ('string' != typeof (e = 'string' != typeof e && e && 'function' == typeof e.toString ? e.toString() : e)) return new Uint8Array()
  9664. t || (e = unescape(encodeURIComponent(e)))
  9665. for (var i = new Uint8Array(e.length), n = 0; n < e.length; n++) i[n] = e.charCodeAt(n)
  9666. return i
  9667. }
  9668. function wr(i, e, t) {
  9669. var n = void 0 === t ? {} : t,
  9670. r = void 0 === (t = n.offset) ? 0 : t,
  9671. a = void 0 === (n = n.mask) ? [] : n
  9672. return (
  9673. (i = br(i)),
  9674. (n = (e = br(e)).every || Array.prototype.every),
  9675. e.length &&
  9676. i.length - r >= e.length &&
  9677. n.call(e, function (e, t) {
  9678. return e === (a[t] ? a[t] & i[r + t] : i[r + t])
  9679. })
  9680. )
  9681. }
  9682. var Er = (function (t) {
  9683. function e() {
  9684. var e = t.call(this) || this
  9685. return (e.buffer = ''), e
  9686. }
  9687. return (
  9688. mt(e, t),
  9689. (e.prototype.push = function (e) {
  9690. var t
  9691. for (this.buffer += e, t = this.buffer.indexOf('\n'); -1 < t; t = this.buffer.indexOf('\n'))
  9692. this.trigger('data', this.buffer.substring(0, t)), (this.buffer = this.buffer.substring(t + 1))
  9693. }),
  9694. e
  9695. )
  9696. })(ar),
  9697. kr = String.fromCharCode(9),
  9698. Cr = (function (t) {
  9699. function e() {
  9700. var e = t.call(this) || this
  9701. return (e.customParsers = []), (e.tagMappers = []), e
  9702. }
  9703. mt(e, t)
  9704. var i = e.prototype
  9705. return (
  9706. (i.push = function (i) {
  9707. var r,
  9708. a,
  9709. s = this
  9710. 0 !== (i = i.trim()).length &&
  9711. ('#' === i[0]
  9712. ? this.tagMappers
  9713. .reduce(
  9714. function (e, t) {
  9715. t = t(i)
  9716. return t === i ? e : e.concat([t])
  9717. },
  9718. [i]
  9719. )
  9720. .forEach(function (e) {
  9721. for (var t, i, n = 0; n < s.customParsers.length; n++) if (s.customParsers[n].call(s, e)) return
  9722. if (0 === e.indexOf('#EXT'))
  9723. if (((e = e.replace('\r', '')), (r = /^#EXTM3U/.exec(e)))) s.trigger('data', { type: 'tag', tagType: 'm3u' })
  9724. else {
  9725. if ((r = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e)))
  9726. return (a = { type: 'tag', tagType: 'inf' }), r[1] && (a.duration = parseFloat(r[1])), r[2] && (a.title = r[2]), void s.trigger('data', a)
  9727. if ((r = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e)))
  9728. return (a = { type: 'tag', tagType: 'targetduration' }), r[1] && (a.duration = parseInt(r[1], 10)), void s.trigger('data', a)
  9729. if ((r = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(e)))
  9730. return (a = { type: 'tag', tagType: 'version' }), r[1] && (a.version = parseInt(r[1], 10)), void s.trigger('data', a)
  9731. if ((r = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e)))
  9732. return (a = { type: 'tag', tagType: 'media-sequence' }), r[1] && (a.number = parseInt(r[1], 10)), void s.trigger('data', a)
  9733. if ((r = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e)))
  9734. return (a = { type: 'tag', tagType: 'discontinuity-sequence' }), r[1] && (a.number = parseInt(r[1], 10)), void s.trigger('data', a)
  9735. if ((r = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e)))
  9736. return (a = { type: 'tag', tagType: 'playlist-type' }), r[1] && (a.playlistType = r[1]), void s.trigger('data', a)
  9737. if ((r = /^#EXT-X-BYTERANGE:?(.*)?$/.exec(e))) return (a = g(ur(r[1]), { type: 'tag', tagType: 'byterange' })), void s.trigger('data', a)
  9738. if ((r = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e)))
  9739. return (a = { type: 'tag', tagType: 'allow-cache' }), r[1] && (a.allowed = !/NO/.test(r[1])), void s.trigger('data', a)
  9740. if ((r = /^#EXT-X-MAP:?(.*)$/.exec(e)))
  9741. return (
  9742. (a = { type: 'tag', tagType: 'map' }),
  9743. r[1] && ((t = lr(r[1])).URI && (a.uri = t.URI), t.BYTERANGE && (a.byterange = ur(t.BYTERANGE))),
  9744. void s.trigger('data', a)
  9745. )
  9746. if ((r = /^#EXT-X-STREAM-INF:?(.*)$/.exec(e)))
  9747. return (
  9748. (a = { type: 'tag', tagType: 'stream-inf' }),
  9749. r[1] &&
  9750. ((a.attributes = lr(r[1])),
  9751. a.attributes.RESOLUTION &&
  9752. ((i = {}),
  9753. (t = a.attributes.RESOLUTION.split('x'))[0] && (i.width = parseInt(t[0], 10)),
  9754. t[1] && (i.height = parseInt(t[1], 10)),
  9755. (a.attributes.RESOLUTION = i)),
  9756. a.attributes.BANDWIDTH && (a.attributes.BANDWIDTH = parseInt(a.attributes.BANDWIDTH, 10)),
  9757. a.attributes['PROGRAM-ID'] && (a.attributes['PROGRAM-ID'] = parseInt(a.attributes['PROGRAM-ID'], 10))),
  9758. void s.trigger('data', a)
  9759. )
  9760. if ((r = /^#EXT-X-MEDIA:?(.*)$/.exec(e))) return (a = { type: 'tag', tagType: 'media' }), r[1] && (a.attributes = lr(r[1])), void s.trigger('data', a)
  9761. if ((r = /^#EXT-X-ENDLIST/.exec(e))) s.trigger('data', { type: 'tag', tagType: 'endlist' })
  9762. else {
  9763. if (!(r = /^#EXT-X-DISCONTINUITY/.exec(e)))
  9764. return (r = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))
  9765. ? ((a = { type: 'tag', tagType: 'program-date-time' }),
  9766. r[1] && ((a.dateTimeString = r[1]), (a.dateTimeObject = new Date(r[1]))),
  9767. void s.trigger('data', a))
  9768. : (r = /^#EXT-X-KEY:?(.*)$/.exec(e))
  9769. ? ((a = { type: 'tag', tagType: 'key' }),
  9770. r[1] &&
  9771. ((a.attributes = lr(r[1])),
  9772. a.attributes.IV &&
  9773. ('0x' === a.attributes.IV.substring(0, 2).toLowerCase() && (a.attributes.IV = a.attributes.IV.substring(2)),
  9774. (a.attributes.IV = a.attributes.IV.match(/.{8}/g)),
  9775. (a.attributes.IV[0] = parseInt(a.attributes.IV[0], 16)),
  9776. (a.attributes.IV[1] = parseInt(a.attributes.IV[1], 16)),
  9777. (a.attributes.IV[2] = parseInt(a.attributes.IV[2], 16)),
  9778. (a.attributes.IV[3] = parseInt(a.attributes.IV[3], 16)),
  9779. (a.attributes.IV = new Uint32Array(a.attributes.IV)))),
  9780. void s.trigger('data', a))
  9781. : (r = /^#EXT-X-START:?(.*)$/.exec(e))
  9782. ? ((a = { type: 'tag', tagType: 'start' }),
  9783. r[1] &&
  9784. ((a.attributes = lr(r[1])),
  9785. (a.attributes['TIME-OFFSET'] = parseFloat(a.attributes['TIME-OFFSET'])),
  9786. (a.attributes.PRECISE = /YES/.test(a.attributes.PRECISE))),
  9787. void s.trigger('data', a))
  9788. : (r = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))
  9789. ? ((a = { type: 'tag', tagType: 'cue-out-cont' }), r[1] ? (a.data = r[1]) : (a.data = ''), void s.trigger('data', a))
  9790. : (r = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))
  9791. ? ((a = { type: 'tag', tagType: 'cue-out' }), r[1] ? (a.data = r[1]) : (a.data = ''), void s.trigger('data', a))
  9792. : (r = /^#EXT-X-CUE-IN:?(.*)?$/.exec(e))
  9793. ? ((a = { type: 'tag', tagType: 'cue-in' }), r[1] ? (a.data = r[1]) : (a.data = ''), void s.trigger('data', a))
  9794. : (r = /^#EXT-X-SKIP:(.*)$/.exec(e)) && r[1]
  9795. ? (((a = { type: 'tag', tagType: 'skip' }).attributes = lr(r[1])),
  9796. a.attributes.hasOwnProperty('SKIPPED-SEGMENTS') && (a.attributes['SKIPPED-SEGMENTS'] = parseInt(a.attributes['SKIPPED-SEGMENTS'], 10)),
  9797. a.attributes.hasOwnProperty('RECENTLY-REMOVED-DATERANGES') &&
  9798. (a.attributes['RECENTLY-REMOVED-DATERANGES'] = a.attributes['RECENTLY-REMOVED-DATERANGES'].split(kr)),
  9799. void s.trigger('data', a))
  9800. : (r = /^#EXT-X-PART:(.*)$/.exec(e)) && r[1]
  9801. ? (((a = { type: 'tag', tagType: 'part' }).attributes = lr(r[1])),
  9802. ['DURATION'].forEach(function (e) {
  9803. a.attributes.hasOwnProperty(e) && (a.attributes[e] = parseFloat(a.attributes[e]))
  9804. }),
  9805. ['INDEPENDENT', 'GAP'].forEach(function (e) {
  9806. a.attributes.hasOwnProperty(e) && (a.attributes[e] = /YES/.test(a.attributes[e]))
  9807. }),
  9808. a.attributes.hasOwnProperty('BYTERANGE') && (a.attributes.byterange = ur(a.attributes.BYTERANGE)),
  9809. void s.trigger('data', a))
  9810. : (r = /^#EXT-X-SERVER-CONTROL:(.*)$/.exec(e)) && r[1]
  9811. ? (((a = { type: 'tag', tagType: 'server-control' }).attributes = lr(r[1])),
  9812. ['CAN-SKIP-UNTIL', 'PART-HOLD-BACK', 'HOLD-BACK'].forEach(function (e) {
  9813. a.attributes.hasOwnProperty(e) && (a.attributes[e] = parseFloat(a.attributes[e]))
  9814. }),
  9815. ['CAN-SKIP-DATERANGES', 'CAN-BLOCK-RELOAD'].forEach(function (e) {
  9816. a.attributes.hasOwnProperty(e) && (a.attributes[e] = /YES/.test(a.attributes[e]))
  9817. }),
  9818. void s.trigger('data', a))
  9819. : (r = /^#EXT-X-PART-INF:(.*)$/.exec(e)) && r[1]
  9820. ? (((a = { type: 'tag', tagType: 'part-inf' }).attributes = lr(r[1])),
  9821. ['PART-TARGET'].forEach(function (e) {
  9822. a.attributes.hasOwnProperty(e) && (a.attributes[e] = parseFloat(a.attributes[e]))
  9823. }),
  9824. void s.trigger('data', a))
  9825. : (r = /^#EXT-X-PRELOAD-HINT:(.*)$/.exec(e)) && r[1]
  9826. ? (((a = { type: 'tag', tagType: 'preload-hint' }).attributes = lr(r[1])),
  9827. ['BYTERANGE-START', 'BYTERANGE-LENGTH'].forEach(function (e) {
  9828. var t
  9829. a.attributes.hasOwnProperty(e) &&
  9830. ((a.attributes[e] = parseInt(a.attributes[e], 10)),
  9831. (t = 'BYTERANGE-LENGTH' === e ? 'length' : 'offset'),
  9832. (a.attributes.byterange = a.attributes.byterange || {}),
  9833. (a.attributes.byterange[t] = a.attributes[e]),
  9834. delete a.attributes[e])
  9835. }),
  9836. void s.trigger('data', a))
  9837. : (r = /^#EXT-X-RENDITION-REPORT:(.*)$/.exec(e)) && r[1]
  9838. ? (((a = { type: 'tag', tagType: 'rendition-report' }).attributes = lr(r[1])),
  9839. ['LAST-MSN', 'LAST-PART'].forEach(function (e) {
  9840. a.attributes.hasOwnProperty(e) && (a.attributes[e] = parseInt(a.attributes[e], 10))
  9841. }),
  9842. void s.trigger('data', a))
  9843. : void s.trigger('data', { type: 'tag', data: e.slice(4) })
  9844. s.trigger('data', { type: 'tag', tagType: 'discontinuity' })
  9845. }
  9846. }
  9847. else s.trigger('data', { type: 'comment', text: e.slice(1) })
  9848. })
  9849. : this.trigger('data', { type: 'uri', uri: i }))
  9850. }),
  9851. (i.addParser = function (e) {
  9852. var t = this,
  9853. i = e.expression,
  9854. n = e.customType,
  9855. r = e.dataParser,
  9856. a = e.segment
  9857. 'function' != typeof r &&
  9858. (r = function (e) {
  9859. return e
  9860. }),
  9861. this.customParsers.push(function (e) {
  9862. if (i.exec(e)) return t.trigger('data', { type: 'custom', data: r(e), customType: n, segment: a }), !0
  9863. })
  9864. }),
  9865. (i.addTagMapper = function (e) {
  9866. var t = e.expression,
  9867. i = e.map
  9868. this.tagMappers.push(function (e) {
  9869. return t.test(e) ? i(e) : e
  9870. })
  9871. }),
  9872. e
  9873. )
  9874. })(ar),
  9875. Ir = (function (t) {
  9876. function e() {
  9877. var e = t.call(this) || this
  9878. ;(e.lineStream = new Er()), (e.parseStream = new Cr()), e.lineStream.pipe(e.parseStream)
  9879. var n,
  9880. r,
  9881. a = ft(e),
  9882. o = [],
  9883. u = {},
  9884. l = !1,
  9885. c = { AUDIO: {}, VIDEO: {}, 'CLOSED-CAPTIONS': {}, SUBTITLES: {} },
  9886. d = 0
  9887. e.manifest = { allowCache: !0, discontinuityStarts: [], segments: [] }
  9888. var h = 0,
  9889. p = 0
  9890. return (
  9891. e.on('end', function () {
  9892. u.uri ||
  9893. (!u.parts && !u.preloadHints) ||
  9894. (!u.map && n && (u.map = n), !u.key && r && (u.key = r), u.timeline || 'number' != typeof d || (u.timeline = d), (e.manifest.preloadSegment = u))
  9895. }),
  9896. e.parseStream.on('data', function (s) {
  9897. var t, i
  9898. ;({
  9899. tag: function () {
  9900. ;((
  9901. {
  9902. version: function () {
  9903. s.version && (this.manifest.version = s.version)
  9904. },
  9905. 'allow-cache': function () {
  9906. ;(this.manifest.allowCache = s.allowed),
  9907. 'allowed' in s || (this.trigger('info', { message: 'defaulting allowCache to YES' }), (this.manifest.allowCache = !0))
  9908. },
  9909. byterange: function () {
  9910. var e = {}
  9911. 'length' in s && (((u.byterange = e).length = s.length), 'offset' in s || (s.offset = h)),
  9912. 'offset' in s && ((u.byterange = e).offset = s.offset),
  9913. (h = e.offset + e.length)
  9914. },
  9915. endlist: function () {
  9916. this.manifest.endList = !0
  9917. },
  9918. inf: function () {
  9919. 'mediaSequence' in this.manifest || ((this.manifest.mediaSequence = 0), this.trigger('info', { message: 'defaulting media sequence to zero' })),
  9920. 'discontinuitySequence' in this.manifest ||
  9921. ((this.manifest.discontinuitySequence = 0), this.trigger('info', { message: 'defaulting discontinuity sequence to zero' })),
  9922. 0 < s.duration && (u.duration = s.duration),
  9923. 0 === s.duration && ((u.duration = 0.01), this.trigger('info', { message: 'updating zero segment duration to a small value' })),
  9924. (this.manifest.segments = o)
  9925. },
  9926. key: function () {
  9927. if (s.attributes)
  9928. if ('NONE' !== s.attributes.METHOD)
  9929. if (s.attributes.URI) {
  9930. if ('com.apple.streamingkeydelivery' === s.attributes.KEYFORMAT)
  9931. return (
  9932. (this.manifest.contentProtection = this.manifest.contentProtection || {}),
  9933. void (this.manifest.contentProtection['com.apple.fps.1_0'] = { attributes: s.attributes })
  9934. )
  9935. if ('com.microsoft.playready' === s.attributes.KEYFORMAT)
  9936. return (
  9937. (this.manifest.contentProtection = this.manifest.contentProtection || {}),
  9938. void (this.manifest.contentProtection['com.microsoft.playready'] = { uri: s.attributes.URI })
  9939. )
  9940. if ('urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed' === s.attributes.KEYFORMAT)
  9941. return -1 === ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'].indexOf(s.attributes.METHOD)
  9942. ? void this.trigger('warn', { message: 'invalid key method provided for Widevine' })
  9943. : ('SAMPLE-AES-CENC' === s.attributes.METHOD &&
  9944. this.trigger('warn', { message: 'SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead' }),
  9945. 'data:text/plain;base64,' !== s.attributes.URI.substring(0, 23)
  9946. ? void this.trigger('warn', { message: 'invalid key URI provided for Widevine' })
  9947. : s.attributes.KEYID && '0x' === s.attributes.KEYID.substring(0, 2)
  9948. ? ((this.manifest.contentProtection = this.manifest.contentProtection || {}),
  9949. void (this.manifest.contentProtection['com.widevine.alpha'] = {
  9950. attributes: { schemeIdUri: s.attributes.KEYFORMAT, keyId: s.attributes.KEYID.substring(2) },
  9951. pssh: or(s.attributes.URI.split(',')[1]),
  9952. }))
  9953. : void this.trigger('warn', { message: 'invalid key ID provided for Widevine' }))
  9954. s.attributes.METHOD || this.trigger('warn', { message: 'defaulting key method to AES-128' }),
  9955. (r = { method: s.attributes.METHOD || 'AES-128', uri: s.attributes.URI }),
  9956. 'undefined' != typeof s.attributes.IV && (r.iv = s.attributes.IV)
  9957. } else this.trigger('warn', { message: 'ignoring key declaration without URI' })
  9958. else r = null
  9959. else this.trigger('warn', { message: 'ignoring key declaration without attribute list' })
  9960. },
  9961. 'media-sequence': function () {
  9962. isFinite(s.number) ? (this.manifest.mediaSequence = s.number) : this.trigger('warn', { message: 'ignoring invalid media sequence: ' + s.number })
  9963. },
  9964. 'discontinuity-sequence': function () {
  9965. isFinite(s.number)
  9966. ? ((this.manifest.discontinuitySequence = s.number), (d = s.number))
  9967. : this.trigger('warn', { message: 'ignoring invalid discontinuity sequence: ' + s.number })
  9968. },
  9969. 'playlist-type': function () {
  9970. ;/VOD|EVENT/.test(s.playlistType)
  9971. ? (this.manifest.playlistType = s.playlistType)
  9972. : this.trigger('warn', { message: 'ignoring unknown playlist type: ' + s.playlist })
  9973. },
  9974. map: function () {
  9975. ;(n = {}), s.uri && (n.uri = s.uri), s.byterange && (n.byterange = s.byterange), r && (n.key = r)
  9976. },
  9977. 'stream-inf': function () {
  9978. ;(this.manifest.playlists = o),
  9979. (this.manifest.mediaGroups = this.manifest.mediaGroups || c),
  9980. s.attributes
  9981. ? (u.attributes || (u.attributes = {}), g(u.attributes, s.attributes))
  9982. : this.trigger('warn', { message: 'ignoring empty stream-inf attributes' })
  9983. },
  9984. media: function () {
  9985. var e
  9986. ;(this.manifest.mediaGroups = this.manifest.mediaGroups || c),
  9987. s.attributes && s.attributes.TYPE && s.attributes['GROUP-ID'] && s.attributes.NAME
  9988. ? (((e = this.manifest.mediaGroups[s.attributes.TYPE])[s.attributes['GROUP-ID']] = e[s.attributes['GROUP-ID']] || {}),
  9989. (t = e[s.attributes['GROUP-ID']]),
  9990. (i = { default: /yes/i.test(s.attributes.DEFAULT) }).default ? (i.autoselect = !0) : (i.autoselect = /yes/i.test(s.attributes.AUTOSELECT)),
  9991. s.attributes.LANGUAGE && (i.language = s.attributes.LANGUAGE),
  9992. s.attributes.URI && (i.uri = s.attributes.URI),
  9993. s.attributes['INSTREAM-ID'] && (i.instreamId = s.attributes['INSTREAM-ID']),
  9994. s.attributes.CHARACTERISTICS && (i.characteristics = s.attributes.CHARACTERISTICS),
  9995. s.attributes.FORCED && (i.forced = /yes/i.test(s.attributes.FORCED)),
  9996. (t[s.attributes.NAME] = i))
  9997. : this.trigger('warn', { message: 'ignoring incomplete or missing media group' })
  9998. },
  9999. discontinuity: function () {
  10000. ;(d += 1), (u.discontinuity = !0), this.manifest.discontinuityStarts.push(o.length)
  10001. },
  10002. 'program-date-time': function () {
  10003. 'undefined' == typeof this.manifest.dateTimeString &&
  10004. ((this.manifest.dateTimeString = s.dateTimeString), (this.manifest.dateTimeObject = s.dateTimeObject)),
  10005. (u.dateTimeString = s.dateTimeString),
  10006. (u.dateTimeObject = s.dateTimeObject)
  10007. },
  10008. targetduration: function () {
  10009. !isFinite(s.duration) || s.duration < 0
  10010. ? this.trigger('warn', { message: 'ignoring invalid target duration: ' + s.duration })
  10011. : ((this.manifest.targetDuration = s.duration), dr.call(this, this.manifest))
  10012. },
  10013. start: function () {
  10014. s.attributes && !isNaN(s.attributes['TIME-OFFSET'])
  10015. ? (this.manifest.start = { timeOffset: s.attributes['TIME-OFFSET'], precise: s.attributes.PRECISE })
  10016. : this.trigger('warn', { message: 'ignoring start declaration without appropriate attribute list' })
  10017. },
  10018. 'cue-out': function () {
  10019. u.cueOut = s.data
  10020. },
  10021. 'cue-out-cont': function () {
  10022. u.cueOutCont = s.data
  10023. },
  10024. 'cue-in': function () {
  10025. u.cueIn = s.data
  10026. },
  10027. skip: function () {
  10028. ;(this.manifest.skip = cr(s.attributes)), this.warnOnMissingAttributes_('#EXT-X-SKIP', s.attributes, ['SKIPPED-SEGMENTS'])
  10029. },
  10030. part: function () {
  10031. var i = this
  10032. l = !0
  10033. var e = this.manifest.segments.length,
  10034. t = cr(s.attributes)
  10035. ;(u.parts = u.parts || []),
  10036. u.parts.push(t),
  10037. t.byterange && (t.byterange.hasOwnProperty('offset') || (t.byterange.offset = p), (p = t.byterange.offset + t.byterange.length))
  10038. var n = u.parts.length - 1
  10039. this.warnOnMissingAttributes_('#EXT-X-PART #' + n + ' for segment #' + e, s.attributes, ['URI', 'DURATION']),
  10040. this.manifest.renditionReports &&
  10041. this.manifest.renditionReports.forEach(function (e, t) {
  10042. e.hasOwnProperty('lastPart') || i.trigger('warn', { message: '#EXT-X-RENDITION-REPORT #' + t + ' lacks required attribute(s): LAST-PART' })
  10043. })
  10044. },
  10045. 'server-control': function () {
  10046. var e = (this.manifest.serverControl = cr(s.attributes))
  10047. e.hasOwnProperty('canBlockReload') ||
  10048. ((e.canBlockReload = !1), this.trigger('info', { message: '#EXT-X-SERVER-CONTROL defaulting CAN-BLOCK-RELOAD to false' })),
  10049. dr.call(this, this.manifest),
  10050. e.canSkipDateranges &&
  10051. !e.hasOwnProperty('canSkipUntil') &&
  10052. this.trigger('warn', { message: '#EXT-X-SERVER-CONTROL lacks required attribute CAN-SKIP-UNTIL which is required when CAN-SKIP-DATERANGES is set' })
  10053. },
  10054. 'preload-hint': function () {
  10055. var e = this.manifest.segments.length,
  10056. t = cr(s.attributes),
  10057. i = t.type && 'PART' === t.type
  10058. ;(u.preloadHints = u.preloadHints || []),
  10059. u.preloadHints.push(t),
  10060. t.byterange && (t.byterange.hasOwnProperty('offset') || ((t.byterange.offset = i ? p : 0), i && (p = t.byterange.offset + t.byterange.length)))
  10061. var n = u.preloadHints.length - 1
  10062. if ((this.warnOnMissingAttributes_('#EXT-X-PRELOAD-HINT #' + n + ' for segment #' + e, s.attributes, ['TYPE', 'URI']), t.type))
  10063. for (var r = 0; r < u.preloadHints.length - 1; r++) {
  10064. var a = u.preloadHints[r]
  10065. a.type &&
  10066. a.type === t.type &&
  10067. this.trigger('warn', {
  10068. message: '#EXT-X-PRELOAD-HINT #' + n + ' for segment #' + e + ' has the same TYPE ' + t.type + ' as preload hint #' + r,
  10069. })
  10070. }
  10071. },
  10072. 'rendition-report': function () {
  10073. var e = cr(s.attributes)
  10074. ;(this.manifest.renditionReports = this.manifest.renditionReports || []), this.manifest.renditionReports.push(e)
  10075. var t = this.manifest.renditionReports.length - 1,
  10076. e = ['LAST-MSN', 'URI']
  10077. l && e.push('LAST-PART'), this.warnOnMissingAttributes_('#EXT-X-RENDITION-REPORT #' + t, s.attributes, e)
  10078. },
  10079. 'part-inf': function () {
  10080. ;(this.manifest.partInf = cr(s.attributes)),
  10081. this.warnOnMissingAttributes_('#EXT-X-PART-INF', s.attributes, ['PART-TARGET']),
  10082. this.manifest.partInf.partTarget && (this.manifest.partTargetDuration = this.manifest.partInf.partTarget),
  10083. dr.call(this, this.manifest)
  10084. },
  10085. }[s.tagType] || function () {}
  10086. ).call(a))
  10087. },
  10088. uri: function () {
  10089. ;(u.uri = s.uri),
  10090. o.push(u),
  10091. !this.manifest.targetDuration ||
  10092. 'duration' in u ||
  10093. (this.trigger('warn', { message: 'defaulting segment duration to the target duration' }), (u.duration = this.manifest.targetDuration)),
  10094. r && (u.key = r),
  10095. (u.timeline = d),
  10096. n && (u.map = n),
  10097. (p = 0),
  10098. (u = {})
  10099. },
  10100. comment: function () {},
  10101. custom: function () {
  10102. s.segment
  10103. ? ((u.custom = u.custom || {}), (u.custom[s.customType] = s.data))
  10104. : ((this.manifest.custom = this.manifest.custom || {}), (this.manifest.custom[s.customType] = s.data))
  10105. },
  10106. }[s.type].call(a))
  10107. }),
  10108. e
  10109. )
  10110. }
  10111. mt(e, t)
  10112. var i = e.prototype
  10113. return (
  10114. (i.warnOnMissingAttributes_ = function (e, t, i) {
  10115. var n = []
  10116. i.forEach(function (e) {
  10117. t.hasOwnProperty(e) || n.push(e)
  10118. }),
  10119. n.length && this.trigger('warn', { message: e + ' lacks required attribute(s): ' + n.join(', ') })
  10120. }),
  10121. (i.push = function (e) {
  10122. this.lineStream.push(e)
  10123. }),
  10124. (i.end = function () {
  10125. this.lineStream.push('\n'), this.trigger('end')
  10126. }),
  10127. (i.addParser = function (e) {
  10128. this.parseStream.addParser(e)
  10129. }),
  10130. (i.addTagMapper = function (e) {
  10131. this.parseStream.addTagMapper(e)
  10132. }),
  10133. e
  10134. )
  10135. })(ar),
  10136. xr = {
  10137. mp4: /^(av0?1|avc0?[1234]|vp0?9|flac|opus|mp3|mp4a|mp4v|stpp.ttml.im1t)/,
  10138. webm: /^(vp0?[89]|av0?1|opus|vorbis)/,
  10139. ogg: /^(vp0?[89]|theora|flac|opus|vorbis)/,
  10140. video: /^(av0?1|avc0?[1234]|vp0?[89]|hvc1|hev1|theora|mp4v)/,
  10141. audio: /^(mp4a|flac|vorbis|opus|ac-[34]|ec-3|alac|mp3|speex|aac)/,
  10142. text: /^(stpp.ttml.im1t)/,
  10143. muxerVideo: /^(avc0?1)/,
  10144. muxerAudio: /^(mp4a)/,
  10145. muxerText: /a^/,
  10146. },
  10147. Ar = ['video', 'audio', 'text'],
  10148. Pr = ['Video', 'Audio', 'Text'],
  10149. Lr = 'mp4a.40.2',
  10150. Dr = /^(audio|video|application)\/(x-|vnd\.apple\.)?mpegurl/i,
  10151. Or = /^application\/dash\+xml/i,
  10152. Mr = _r,
  10153. Rr = window.BigInt || Number,
  10154. Nr = [Rr('0x1'), Rr('0x100'), Rr('0x10000'), Rr('0x1000000'), Rr('0x100000000'), Rr('0x10000000000'), Rr('0x1000000000000'), Rr('0x100000000000000'), Rr('0x10000000000000000')]
  10155. function Ur(e, t) {
  10156. return (t = void 0 === t ? Object : t) && 'function' == typeof t.freeze ? t.freeze(e) : e
  10157. }
  10158. var Br = Ur({
  10159. HTML: 'text/html',
  10160. isHTML: function (e) {
  10161. return e === Br.HTML
  10162. },
  10163. XML_APPLICATION: 'application/xml',
  10164. XML_TEXT: 'text/xml',
  10165. XML_XHTML_APPLICATION: 'application/xhtml+xml',
  10166. XML_SVG_IMAGE: 'image/svg+xml',
  10167. }),
  10168. Fr = Ur({
  10169. HTML: 'http://www.w3.org/1999/xhtml',
  10170. isHTML: function (e) {
  10171. return e === Fr.HTML
  10172. },
  10173. SVG: 'http://www.w3.org/2000/svg',
  10174. XML: 'http://www.w3.org/XML/1998/namespace',
  10175. XMLNS: 'http://www.w3.org/2000/xmlns/',
  10176. }),
  10177. jr = { freeze: Ur, MIME_TYPE: Br, NAMESPACE: Fr },
  10178. Hr = jr.NAMESPACE
  10179. function qr(e) {
  10180. return '' !== e
  10181. }
  10182. function Vr(e, t) {
  10183. return e.hasOwnProperty(t) || (e[t] = !0), e
  10184. }
  10185. function Wr(e) {
  10186. if (!e) return []
  10187. e = (e = e) ? e.split(/[\t\n\f\r ]+/).filter(qr) : []
  10188. return Object.keys(e.reduce(Vr, {}))
  10189. }
  10190. function Gr(e, t) {
  10191. for (var i in e) t[i] = e[i]
  10192. }
  10193. function zr(e, t) {
  10194. var i,
  10195. n = e.prototype
  10196. n instanceof t || (((i = function () {}).prototype = t.prototype), Gr(n, (i = new i())), (e.prototype = n = i)), n.constructor != e && (n.constructor = e)
  10197. }
  10198. var W = {},
  10199. Xr = (W.ELEMENT_NODE = 1),
  10200. Kr = (W.ATTRIBUTE_NODE = 2),
  10201. Yr = (W.TEXT_NODE = 3),
  10202. Qr = (W.CDATA_SECTION_NODE = 4),
  10203. $r = (W.ENTITY_REFERENCE_NODE = 5),
  10204. Jr = ((W.ENTITY_NODE = 6), (W.PROCESSING_INSTRUCTION_NODE = 7)),
  10205. Zr = (W.COMMENT_NODE = 8),
  10206. ea = (W.DOCUMENT_NODE = 9),
  10207. ta = (W.DOCUMENT_TYPE_NODE = 10),
  10208. ia = (W.DOCUMENT_FRAGMENT_NODE = 11),
  10209. x = ((W.NOTATION_NODE = 12), {}),
  10210. na = {}
  10211. ;(x.INDEX_SIZE_ERR = ((na[1] = 'Index size error'), 1)), (x.DOMSTRING_SIZE_ERR = ((na[2] = 'DOMString size error'), 2))
  10212. x.HIERARCHY_REQUEST_ERR = ((na[3] = 'Hierarchy request error'), 3)
  10213. ;(x.WRONG_DOCUMENT_ERR = ((na[4] = 'Wrong document'), 4)),
  10214. (x.INVALID_CHARACTER_ERR = ((na[5] = 'Invalid character'), 5)),
  10215. (x.NO_DATA_ALLOWED_ERR = ((na[6] = 'No data allowed'), 6)),
  10216. (x.NO_MODIFICATION_ALLOWED_ERR = ((na[7] = 'No modification allowed'), 7))
  10217. x.NOT_FOUND_ERR = ((na[8] = 'Not found'), 8)
  10218. x.NOT_SUPPORTED_ERR = ((na[9] = 'Not supported'), 9)
  10219. var ra
  10220. x.INUSE_ATTRIBUTE_ERR = ((na[10] = 'Attribute in use'), 10)
  10221. function aa(e, t) {
  10222. var i
  10223. return (
  10224. t instanceof Error ? (i = t) : ((i = this), Error.call(this, na[e]), (this.message = na[e]), Error.captureStackTrace && Error.captureStackTrace(this, aa)),
  10225. (i.code = e),
  10226. t && (this.message = this.message + ': ' + t),
  10227. i
  10228. )
  10229. }
  10230. function sa() {}
  10231. function oa(e, t) {
  10232. ;(this._node = e), (this._refresh = t), ua(this)
  10233. }
  10234. function ua(e) {
  10235. var t,
  10236. i = e._node._inc || e._node.ownerDocument._inc
  10237. e._inc != i && ((t = e._refresh(e._node)), Fa(e, 'length', t.length), Gr(t, e), (e._inc = i))
  10238. }
  10239. function la() {}
  10240. function ca(e, t) {
  10241. for (var i = e.length; i--; ) if (e[i] === t) return i
  10242. }
  10243. function da(e, t, i, n) {
  10244. n ? (t[ca(t, n)] = i) : (t[t.length++] = i),
  10245. !e ||
  10246. ((t = (i.ownerElement = e).ownerDocument) &&
  10247. (n && va(t, e, n), (e = e), (i = i), (t = t) && t._inc++, i.namespaceURI === Hr.XMLNS && (e._nsMap[i.prefix ? i.localName : ''] = i.value)))
  10248. }
  10249. function ha(e, t, i) {
  10250. var n = ca(t, i)
  10251. if (!(0 <= n)) throw aa(8, new Error(e.tagName + '@' + i))
  10252. for (var r, a = t.length - 1; n < a; ) t[n] = t[++n]
  10253. ;(t.length = a), !e || ((r = e.ownerDocument) && (va(r, e, i), (i.ownerElement = null)))
  10254. }
  10255. function pa() {}
  10256. function fa() {}
  10257. function ma(e) {
  10258. return ('<' == e ? '&lt;' : '>' == e && '&gt;') || ('&' == e && '&amp;') || ('"' == e && '&quot;') || '&#' + e.charCodeAt() + ';'
  10259. }
  10260. function ga(e, t) {
  10261. if (t(e)) return 1
  10262. if ((e = e.firstChild))
  10263. do {
  10264. if (ga(e, t)) return 1
  10265. } while ((e = e.nextSibling))
  10266. }
  10267. function ya() {}
  10268. function va(e, t, i) {
  10269. e && e._inc++, i.namespaceURI === Hr.XMLNS && delete t._nsMap[i.prefix ? i.localName : '']
  10270. }
  10271. function _a(e, t, i) {
  10272. if (e && e._inc) {
  10273. e._inc++
  10274. var n = t.childNodes
  10275. if (i) n[n.length++] = i
  10276. else {
  10277. for (var r = t.firstChild, a = 0; r; ) r = (n[a++] = r).nextSibling
  10278. n.length = a
  10279. }
  10280. }
  10281. }
  10282. function ba(e, t) {
  10283. var i = t.previousSibling,
  10284. n = t.nextSibling
  10285. return i ? (i.nextSibling = n) : (e.firstChild = n), n ? (n.previousSibling = i) : (e.lastChild = i), _a(e.ownerDocument, e), t
  10286. }
  10287. function Ta(e, t, i) {
  10288. var n = t.parentNode
  10289. if ((n && n.removeChild(t), t.nodeType === ia)) {
  10290. var r = t.firstChild
  10291. if (null == r) return t
  10292. var a = t.lastChild
  10293. } else r = a = t
  10294. n = i ? i.previousSibling : e.lastChild
  10295. for (
  10296. r.previousSibling = n, a.nextSibling = i, n ? (n.nextSibling = r) : (e.firstChild = r), null == i ? (e.lastChild = a) : (i.previousSibling = a);
  10297. (r.parentNode = e), r !== a && (r = r.nextSibling);
  10298. );
  10299. return _a(e.ownerDocument || e, e), t.nodeType == ia && (t.firstChild = t.lastChild = null), t
  10300. }
  10301. function Sa() {
  10302. this._nsMap = {}
  10303. }
  10304. function wa() {}
  10305. function Ea() {}
  10306. function ka() {}
  10307. function Ca() {}
  10308. function Ia() {}
  10309. function xa() {}
  10310. function Aa() {}
  10311. function Pa() {}
  10312. function La() {}
  10313. function Da() {}
  10314. function Oa() {}
  10315. function Ma() {}
  10316. function Ra(e, t) {
  10317. var i,
  10318. n = [],
  10319. r = (9 == this.nodeType && this.documentElement) || this,
  10320. a = r.prefix,
  10321. s = r.namespaceURI
  10322. return Ba(this, n, e, t, (i = s && null == a && null == (a = r.lookupPrefix(s)) ? [{ namespace: s, prefix: null }] : i)), n.join('')
  10323. }
  10324. function Na(e, t, i) {
  10325. var n = e.prefix || '',
  10326. r = e.namespaceURI
  10327. if (r && ('xml' !== n || r !== Hr.XML) && r !== Hr.XMLNS) {
  10328. for (var a = i.length; a--; ) {
  10329. var s = i[a]
  10330. if (s.prefix === n) return s.namespace !== r
  10331. }
  10332. return 1
  10333. }
  10334. }
  10335. function Ua(e, t, i) {
  10336. e.push(' ', t, '="', i.replace(/[<&"]/g, ma), '"')
  10337. }
  10338. function Ba(e, t, i, n, r) {
  10339. if (((r = r || []), n)) {
  10340. if (!(e = n(e))) return
  10341. if ('string' == typeof e) return void t.push(e)
  10342. }
  10343. switch (e.nodeType) {
  10344. case Xr:
  10345. var a = e.attributes,
  10346. s = a.length,
  10347. o = e.firstChild,
  10348. u = e.tagName,
  10349. l = u
  10350. if (!(i = Hr.isHTML(e.namespaceURI) || i) && !e.prefix && e.namespaceURI) {
  10351. for (var c, d = 0; d < a.length; d++)
  10352. if ('xmlns' === a.item(d).name) {
  10353. c = a.item(d).value
  10354. break
  10355. }
  10356. if (!c)
  10357. for (var h = r.length - 1; 0 <= h; h--)
  10358. if ('' === (p = r[h]).prefix && p.namespace === e.namespaceURI) {
  10359. c = p.namespace
  10360. break
  10361. }
  10362. if (c !== e.namespaceURI)
  10363. for (var p, h = r.length - 1; 0 <= h; h--)
  10364. if ((p = r[h]).namespace === e.namespaceURI) {
  10365. p.prefix && (l = p.prefix + ':' + u)
  10366. break
  10367. }
  10368. }
  10369. t.push('<', l)
  10370. for (var f = 0; f < s; f++)
  10371. 'xmlns' == (m = a.item(f)).prefix ? r.push({ prefix: m.localName, namespace: m.value }) : 'xmlns' == m.nodeName && r.push({ prefix: '', namespace: m.value })
  10372. for (var m, g, y, f = 0; f < s; f++)
  10373. Na((m = a.item(f)), 0, r) && (Ua(t, (g = m.prefix || '') ? 'xmlns:' + g : 'xmlns', (y = m.namespaceURI)), r.push({ prefix: g, namespace: y })), Ba(m, t, i, n, r)
  10374. if (
  10375. (u === l && Na(e, 0, r) && (Ua(t, (g = e.prefix || '') ? 'xmlns:' + g : 'xmlns', (y = e.namespaceURI)), r.push({ prefix: g, namespace: y })),
  10376. o || (i && !/^(?:meta|link|img|br|hr|input)$/i.test(u)))
  10377. ) {
  10378. if ((t.push('>'), i && /^script$/i.test(u))) for (; o; ) o.data ? t.push(o.data) : Ba(o, t, i, n, r.slice()), (o = o.nextSibling)
  10379. else for (; o; ) Ba(o, t, i, n, r.slice()), (o = o.nextSibling)
  10380. t.push('</', l, '>')
  10381. } else t.push('/>')
  10382. return
  10383. case ea:
  10384. case ia:
  10385. for (o = e.firstChild; o; ) Ba(o, t, i, n, r.slice()), (o = o.nextSibling)
  10386. return
  10387. case Kr:
  10388. return Ua(t, e.name, e.value), 0
  10389. case Yr:
  10390. return t.push(e.data.replace(/[<&]/g, ma).replace(/]]>/g, ']]&gt;'))
  10391. case Qr:
  10392. return t.push('<![CDATA[', e.data, ']]>')
  10393. case Zr:
  10394. return t.push('\x3c!--', e.data, '--\x3e')
  10395. case ta:
  10396. var v = e.publicId,
  10397. _ = e.systemId
  10398. return (
  10399. t.push('<!DOCTYPE ', e.name),
  10400. void (v
  10401. ? (t.push(' PUBLIC ', v), _ && '.' != _ && t.push(' ', _), t.push('>'))
  10402. : _ && '.' != _
  10403. ? t.push(' SYSTEM ', _, '>')
  10404. : ((_ = e.internalSubset) && t.push(' [', _, ']'), t.push('>')))
  10405. )
  10406. case Jr:
  10407. return t.push('<?', e.target, ' ', e.data, '?>')
  10408. case $r:
  10409. return t.push('&', e.nodeName, ';')
  10410. default:
  10411. t.push('??', e.nodeName)
  10412. }
  10413. }
  10414. function Fa(e, t, i) {
  10415. e[t] = i
  10416. }
  10417. ;(x.INVALID_STATE_ERR = ((na[11] = 'Invalid state'), 11)),
  10418. (x.SYNTAX_ERR = ((na[12] = 'Syntax error'), 12)),
  10419. (x.INVALID_MODIFICATION_ERR = ((na[13] = 'Invalid modification'), 13)),
  10420. (x.NAMESPACE_ERR = ((na[14] = 'Invalid namespace'), 14)),
  10421. (x.INVALID_ACCESS_ERR = ((na[15] = 'Invalid access'), 15)),
  10422. (aa.prototype = Error.prototype),
  10423. Gr(x, aa),
  10424. (sa.prototype = {
  10425. length: 0,
  10426. item: function (e) {
  10427. return this[e] || null
  10428. },
  10429. toString: function (e, t) {
  10430. for (var i = [], n = 0; n < this.length; n++) Ba(this[n], i, e, t)
  10431. return i.join('')
  10432. },
  10433. }),
  10434. (oa.prototype.item = function (e) {
  10435. return ua(this), this[e]
  10436. }),
  10437. zr(oa, sa),
  10438. (la.prototype = {
  10439. length: 0,
  10440. item: sa.prototype.item,
  10441. getNamedItem: function (e) {
  10442. for (var t = this.length; t--; ) {
  10443. var i = this[t]
  10444. if (i.nodeName == e) return i
  10445. }
  10446. },
  10447. setNamedItem: function (e) {
  10448. var t = e.ownerElement
  10449. if (t && t != this._ownerElement) throw new aa(10)
  10450. t = this.getNamedItem(e.nodeName)
  10451. return da(this._ownerElement, this, e, t), t
  10452. },
  10453. setNamedItemNS: function (e) {
  10454. var t = e.ownerElement
  10455. if (t && t != this._ownerElement) throw new aa(10)
  10456. return (t = this.getNamedItemNS(e.namespaceURI, e.localName)), da(this._ownerElement, this, e, t), t
  10457. },
  10458. removeNamedItem: function (e) {
  10459. e = this.getNamedItem(e)
  10460. return ha(this._ownerElement, this, e), e
  10461. },
  10462. removeNamedItemNS: function (e, t) {
  10463. t = this.getNamedItemNS(e, t)
  10464. return ha(this._ownerElement, this, t), t
  10465. },
  10466. getNamedItemNS: function (e, t) {
  10467. for (var i = this.length; i--; ) {
  10468. var n = this[i]
  10469. if (n.localName == t && n.namespaceURI == e) return n
  10470. }
  10471. return null
  10472. },
  10473. }),
  10474. (pa.prototype = {
  10475. hasFeature: function (e, t) {
  10476. return !0
  10477. },
  10478. createDocument: function (e, t, i) {
  10479. var n = new ya()
  10480. return (n.implementation = this), (n.childNodes = new sa()), (n.doctype = i || null), i && n.appendChild(i), t && ((t = n.createElementNS(e, t)), n.appendChild(t)), n
  10481. },
  10482. createDocumentType: function (e, t, i) {
  10483. var n = new xa()
  10484. return (n.name = e), (n.nodeName = e), (n.publicId = t || ''), (n.systemId = i || ''), n
  10485. },
  10486. }),
  10487. (fa.prototype = {
  10488. firstChild: null,
  10489. lastChild: null,
  10490. previousSibling: null,
  10491. nextSibling: null,
  10492. attributes: null,
  10493. parentNode: null,
  10494. childNodes: null,
  10495. ownerDocument: null,
  10496. nodeValue: null,
  10497. namespaceURI: null,
  10498. prefix: null,
  10499. localName: null,
  10500. insertBefore: function (e, t) {
  10501. return Ta(this, e, t)
  10502. },
  10503. replaceChild: function (e, t) {
  10504. this.insertBefore(e, t), t && this.removeChild(t)
  10505. },
  10506. removeChild: function (e) {
  10507. return ba(this, e)
  10508. },
  10509. appendChild: function (e) {
  10510. return this.insertBefore(e, null)
  10511. },
  10512. hasChildNodes: function () {
  10513. return null != this.firstChild
  10514. },
  10515. cloneNode: function (e) {
  10516. return (function e(t, i, n) {
  10517. var r = new i.constructor()
  10518. for (var a in i) {
  10519. var s = i[a]
  10520. 'object' != typeof s && s != r[a] && (r[a] = s)
  10521. }
  10522. i.childNodes && (r.childNodes = new sa())
  10523. r.ownerDocument = t
  10524. switch (r.nodeType) {
  10525. case Xr:
  10526. var o = i.attributes,
  10527. u = (r.attributes = new la()),
  10528. l = o.length
  10529. u._ownerElement = r
  10530. for (var c = 0; c < l; c++) r.setAttributeNode(e(t, o.item(c), !0))
  10531. break
  10532. case Kr:
  10533. n = !0
  10534. }
  10535. if (n) for (var d = i.firstChild; d; ) r.appendChild(e(t, d, n)), (d = d.nextSibling)
  10536. return r
  10537. })(this.ownerDocument || this, this, e)
  10538. },
  10539. normalize: function () {
  10540. for (var e = this.firstChild; e; ) {
  10541. var t = e.nextSibling
  10542. t && t.nodeType == Yr && e.nodeType == Yr ? (this.removeChild(t), e.appendData(t.data)) : (e.normalize(), (e = t))
  10543. }
  10544. },
  10545. isSupported: function (e, t) {
  10546. return this.ownerDocument.implementation.hasFeature(e, t)
  10547. },
  10548. hasAttributes: function () {
  10549. return 0 < this.attributes.length
  10550. },
  10551. lookupPrefix: function (e) {
  10552. for (var t = this; t; ) {
  10553. var i = t._nsMap
  10554. if (i) for (var n in i) if (i[n] == e) return n
  10555. t = t.nodeType == Kr ? t.ownerDocument : t.parentNode
  10556. }
  10557. return null
  10558. },
  10559. lookupNamespaceURI: function (e) {
  10560. for (var t = this; t; ) {
  10561. var i = t._nsMap
  10562. if (i && e in i) return i[e]
  10563. t = t.nodeType == Kr ? t.ownerDocument : t.parentNode
  10564. }
  10565. return null
  10566. },
  10567. isDefaultNamespace: function (e) {
  10568. return null == this.lookupPrefix(e)
  10569. },
  10570. }),
  10571. Gr(W, fa),
  10572. Gr(W, fa.prototype),
  10573. (ya.prototype = {
  10574. nodeName: '#document',
  10575. nodeType: ea,
  10576. doctype: null,
  10577. documentElement: null,
  10578. _inc: 1,
  10579. insertBefore: function (e, t) {
  10580. if (e.nodeType != ia) return null == this.documentElement && e.nodeType == Xr && (this.documentElement = e), Ta(this, e, t), (e.ownerDocument = this), e
  10581. for (var i = e.firstChild; i; ) {
  10582. var n = i.nextSibling
  10583. this.insertBefore(i, t), (i = n)
  10584. }
  10585. return e
  10586. },
  10587. removeChild: function (e) {
  10588. return this.documentElement == e && (this.documentElement = null), ba(this, e)
  10589. },
  10590. importNode: function (e, t) {
  10591. return (function e(t, i, n) {
  10592. var r
  10593. switch (i.nodeType) {
  10594. case Xr:
  10595. ;(r = i.cloneNode(!1)).ownerDocument = t
  10596. case ia:
  10597. break
  10598. case Kr:
  10599. n = !0
  10600. }
  10601. r = r || i.cloneNode(!1)
  10602. r.ownerDocument = t
  10603. r.parentNode = null
  10604. if (n) for (var a = i.firstChild; a; ) r.appendChild(e(t, a, n)), (a = a.nextSibling)
  10605. return r
  10606. })(this, e, t)
  10607. },
  10608. getElementById: function (t) {
  10609. var i = null
  10610. return (
  10611. ga(this.documentElement, function (e) {
  10612. if (e.nodeType == Xr && e.getAttribute('id') == t) return (i = e), !0
  10613. }),
  10614. i
  10615. )
  10616. },
  10617. getElementsByClassName: function (s) {
  10618. var o = Wr(s)
  10619. return new oa(this, function (r) {
  10620. var a = []
  10621. return (
  10622. 0 < o.length &&
  10623. ga(r.documentElement, function (e) {
  10624. var t, i, n
  10625. e === r ||
  10626. e.nodeType !== Xr ||
  10627. ((t = e.getAttribute('class')) &&
  10628. ((i = s === t) ||
  10629. ((t = Wr(t)),
  10630. (i = o.every(
  10631. ((n = t),
  10632. function (e) {
  10633. return n && -1 !== n.indexOf(e)
  10634. })
  10635. ))),
  10636. i && a.push(e)))
  10637. }),
  10638. a
  10639. )
  10640. })
  10641. },
  10642. createElement: function (e) {
  10643. var t = new Sa()
  10644. return (t.ownerDocument = this), (t.nodeName = e), (t.tagName = e), (t.localName = e), (t.childNodes = new sa()), ((t.attributes = new la())._ownerElement = t)
  10645. },
  10646. createDocumentFragment: function () {
  10647. var e = new Da()
  10648. return (e.ownerDocument = this), (e.childNodes = new sa()), e
  10649. },
  10650. createTextNode: function (e) {
  10651. var t = new ka()
  10652. return (t.ownerDocument = this), t.appendData(e), t
  10653. },
  10654. createComment: function (e) {
  10655. var t = new Ca()
  10656. return (t.ownerDocument = this), t.appendData(e), t
  10657. },
  10658. createCDATASection: function (e) {
  10659. var t = new Ia()
  10660. return (t.ownerDocument = this), t.appendData(e), t
  10661. },
  10662. createProcessingInstruction: function (e, t) {
  10663. var i = new Oa()
  10664. return (i.ownerDocument = this), (i.tagName = i.target = e), (i.nodeValue = i.data = t), i
  10665. },
  10666. createAttribute: function (e) {
  10667. var t = new wa()
  10668. return (t.ownerDocument = this), (t.name = e), (t.nodeName = e), (t.localName = e), (t.specified = !0), t
  10669. },
  10670. createEntityReference: function (e) {
  10671. var t = new La()
  10672. return (t.ownerDocument = this), (t.nodeName = e), t
  10673. },
  10674. createElementNS: function (e, t) {
  10675. var i = new Sa(),
  10676. n = t.split(':'),
  10677. r = (i.attributes = new la())
  10678. return (
  10679. (i.childNodes = new sa()),
  10680. (i.ownerDocument = this),
  10681. (i.nodeName = t),
  10682. (i.tagName = t),
  10683. (i.namespaceURI = e),
  10684. 2 == n.length ? ((i.prefix = n[0]), (i.localName = n[1])) : (i.localName = t),
  10685. (r._ownerElement = i)
  10686. )
  10687. },
  10688. createAttributeNS: function (e, t) {
  10689. var i = new wa(),
  10690. n = t.split(':')
  10691. return (
  10692. (i.ownerDocument = this), (i.nodeName = t), (i.name = t), (i.namespaceURI = e), (i.specified = !0), 2 == n.length ? ((i.prefix = n[0]), (i.localName = n[1])) : (i.localName = t), i
  10693. )
  10694. },
  10695. }),
  10696. zr(ya, fa),
  10697. (ya.prototype.getElementsByTagName = (Sa.prototype = {
  10698. nodeType: Xr,
  10699. hasAttribute: function (e) {
  10700. return null != this.getAttributeNode(e)
  10701. },
  10702. getAttribute: function (e) {
  10703. e = this.getAttributeNode(e)
  10704. return (e && e.value) || ''
  10705. },
  10706. getAttributeNode: function (e) {
  10707. return this.attributes.getNamedItem(e)
  10708. },
  10709. setAttribute: function (e, t) {
  10710. e = this.ownerDocument.createAttribute(e)
  10711. ;(e.value = e.nodeValue = '' + t), this.setAttributeNode(e)
  10712. },
  10713. removeAttribute: function (e) {
  10714. e = this.getAttributeNode(e)
  10715. e && this.removeAttributeNode(e)
  10716. },
  10717. appendChild: function (e) {
  10718. return e.nodeType === ia
  10719. ? this.insertBefore(e, null)
  10720. : (function (e, t) {
  10721. var i = t.parentNode
  10722. i && ((n = e.lastChild), i.removeChild(t), (n = e.lastChild))
  10723. var n = e.lastChild
  10724. return (t.parentNode = e), (t.previousSibling = n), (t.nextSibling = null), n ? (n.nextSibling = t) : (e.firstChild = t), (e.lastChild = t), _a(e.ownerDocument, e, t), t
  10725. })(this, e)
  10726. },
  10727. setAttributeNode: function (e) {
  10728. return this.attributes.setNamedItem(e)
  10729. },
  10730. setAttributeNodeNS: function (e) {
  10731. return this.attributes.setNamedItemNS(e)
  10732. },
  10733. removeAttributeNode: function (e) {
  10734. return this.attributes.removeNamedItem(e.nodeName)
  10735. },
  10736. removeAttributeNS: function (e, t) {
  10737. t = this.getAttributeNodeNS(e, t)
  10738. t && this.removeAttributeNode(t)
  10739. },
  10740. hasAttributeNS: function (e, t) {
  10741. return null != this.getAttributeNodeNS(e, t)
  10742. },
  10743. getAttributeNS: function (e, t) {
  10744. t = this.getAttributeNodeNS(e, t)
  10745. return (t && t.value) || ''
  10746. },
  10747. setAttributeNS: function (e, t, i) {
  10748. t = this.ownerDocument.createAttributeNS(e, t)
  10749. ;(t.value = t.nodeValue = '' + i), this.setAttributeNode(t)
  10750. },
  10751. getAttributeNodeNS: function (e, t) {
  10752. return this.attributes.getNamedItemNS(e, t)
  10753. },
  10754. getElementsByTagName: function (n) {
  10755. return new oa(this, function (t) {
  10756. var i = []
  10757. return (
  10758. ga(t, function (e) {
  10759. e === t || e.nodeType != Xr || ('*' !== n && e.tagName != n) || i.push(e)
  10760. }),
  10761. i
  10762. )
  10763. })
  10764. },
  10765. getElementsByTagNameNS: function (n, r) {
  10766. return new oa(this, function (t) {
  10767. var i = []
  10768. return (
  10769. ga(t, function (e) {
  10770. e === t || e.nodeType !== Xr || ('*' !== n && e.namespaceURI !== n) || ('*' !== r && e.localName != r) || i.push(e)
  10771. }),
  10772. i
  10773. )
  10774. })
  10775. },
  10776. }).getElementsByTagName),
  10777. (ya.prototype.getElementsByTagNameNS = Sa.prototype.getElementsByTagNameNS),
  10778. zr(Sa, fa),
  10779. (wa.prototype.nodeType = Kr),
  10780. zr(wa, fa),
  10781. (Ea.prototype = {
  10782. data: '',
  10783. substringData: function (e, t) {
  10784. return this.data.substring(e, e + t)
  10785. },
  10786. appendData: function (e) {
  10787. ;(e = this.data + e), (this.nodeValue = this.data = e), (this.length = e.length)
  10788. },
  10789. insertData: function (e, t) {
  10790. this.replaceData(e, 0, t)
  10791. },
  10792. appendChild: function (e) {
  10793. throw new Error(na[3])
  10794. },
  10795. deleteData: function (e, t) {
  10796. this.replaceData(e, t, '')
  10797. },
  10798. replaceData: function (e, t, i) {
  10799. var n = this.data.substring(0, e),
  10800. t = this.data.substring(e + t)
  10801. ;(this.nodeValue = this.data = i = n + i + t), (this.length = i.length)
  10802. },
  10803. }),
  10804. zr(Ea, fa),
  10805. (ka.prototype = {
  10806. nodeName: '#text',
  10807. nodeType: Yr,
  10808. splitText: function (e) {
  10809. var t = (i = this.data).substring(e),
  10810. i = i.substring(0, e)
  10811. ;(this.data = this.nodeValue = i), (this.length = i.length)
  10812. t = this.ownerDocument.createTextNode(t)
  10813. return this.parentNode && this.parentNode.insertBefore(t, this.nextSibling), t
  10814. },
  10815. }),
  10816. zr(ka, Ea),
  10817. (Ca.prototype = { nodeName: '#comment', nodeType: Zr }),
  10818. zr(Ca, Ea),
  10819. (Ia.prototype = { nodeName: '#cdata-section', nodeType: Qr }),
  10820. zr(Ia, Ea),
  10821. (xa.prototype.nodeType = ta),
  10822. zr(xa, fa),
  10823. (Aa.prototype.nodeType = 12),
  10824. zr(Aa, fa),
  10825. (Pa.prototype.nodeType = 6),
  10826. zr(Pa, fa),
  10827. (La.prototype.nodeType = $r),
  10828. zr(La, fa),
  10829. (Da.prototype.nodeName = '#document-fragment'),
  10830. (Da.prototype.nodeType = ia),
  10831. zr(Da, fa),
  10832. (Oa.prototype.nodeType = Jr),
  10833. zr(Oa, fa),
  10834. (Ma.prototype.serializeToString = function (e, t, i) {
  10835. return Ra.call(e, t, i)
  10836. }),
  10837. (fa.prototype.toString = Ra)
  10838. try {
  10839. Object.defineProperty &&
  10840. ((ra = function e(t) {
  10841. switch (t.nodeType) {
  10842. case Xr:
  10843. case ia:
  10844. var i = []
  10845. for (t = t.firstChild; t; ) 7 !== t.nodeType && 8 !== t.nodeType && i.push(e(t)), (t = t.nextSibling)
  10846. return i.join('')
  10847. default:
  10848. return t.nodeValue
  10849. }
  10850. }),
  10851. Object.defineProperty(oa.prototype, 'length', {
  10852. get: function () {
  10853. return ua(this), this.$$length
  10854. },
  10855. }),
  10856. Object.defineProperty(fa.prototype, 'textContent', {
  10857. get: function () {
  10858. return ra(this)
  10859. },
  10860. set: function (e) {
  10861. switch (this.nodeType) {
  10862. case Xr:
  10863. case ia:
  10864. for (; this.firstChild; ) this.removeChild(this.firstChild)
  10865. ;(e || String(e)) && this.appendChild(this.ownerDocument.createTextNode(e))
  10866. break
  10867. default:
  10868. ;(this.data = e), (this.value = e), (this.nodeValue = e)
  10869. }
  10870. },
  10871. }),
  10872. (Fa = function (e, t, i) {
  10873. e['$$' + t] = i
  10874. }))
  10875. } catch (e) {}
  10876. var U = { DocumentType: xa, DOMException: aa, DOMImplementation: pa, Element: Sa, Node: fa, NodeList: sa, XMLSerializer: Ma },
  10877. ja = m(function (e, t) {
  10878. var i = jr.freeze
  10879. ;(t.XML_ENTITIES = i({ amp: '&', apos: "'", gt: '>', lt: '<', quot: '"' })),
  10880. (t.HTML_ENTITIES = i({
  10881. lt: '<',
  10882. gt: '>',
  10883. amp: '&',
  10884. quot: '"',
  10885. apos: "'",
  10886. Agrave: 'À',
  10887. Aacute: 'Á',
  10888. Acirc: 'Â',
  10889. Atilde: 'Ã',
  10890. Auml: 'Ä',
  10891. Aring: 'Å',
  10892. AElig: 'Æ',
  10893. Ccedil: 'Ç',
  10894. Egrave: 'È',
  10895. Eacute: 'É',
  10896. Ecirc: 'Ê',
  10897. Euml: 'Ë',
  10898. Igrave: 'Ì',
  10899. Iacute: 'Í',
  10900. Icirc: 'Î',
  10901. Iuml: 'Ï',
  10902. ETH: 'Ð',
  10903. Ntilde: 'Ñ',
  10904. Ograve: 'Ò',
  10905. Oacute: 'Ó',
  10906. Ocirc: 'Ô',
  10907. Otilde: 'Õ',
  10908. Ouml: 'Ö',
  10909. Oslash: 'Ø',
  10910. Ugrave: 'Ù',
  10911. Uacute: 'Ú',
  10912. Ucirc: 'Û',
  10913. Uuml: 'Ü',
  10914. Yacute: 'Ý',
  10915. THORN: 'Þ',
  10916. szlig: 'ß',
  10917. agrave: 'à',
  10918. aacute: 'á',
  10919. acirc: 'â',
  10920. atilde: 'ã',
  10921. auml: 'ä',
  10922. aring: 'å',
  10923. aelig: 'æ',
  10924. ccedil: 'ç',
  10925. egrave: 'è',
  10926. eacute: 'é',
  10927. ecirc: 'ê',
  10928. euml: 'ë',
  10929. igrave: 'ì',
  10930. iacute: 'í',
  10931. icirc: 'î',
  10932. iuml: 'ï',
  10933. eth: 'ð',
  10934. ntilde: 'ñ',
  10935. ograve: 'ò',
  10936. oacute: 'ó',
  10937. ocirc: 'ô',
  10938. otilde: 'õ',
  10939. ouml: 'ö',
  10940. oslash: 'ø',
  10941. ugrave: 'ù',
  10942. uacute: 'ú',
  10943. ucirc: 'û',
  10944. uuml: 'ü',
  10945. yacute: 'ý',
  10946. thorn: 'þ',
  10947. yuml: 'ÿ',
  10948. nbsp: ' ',
  10949. iexcl: '¡',
  10950. cent: '¢',
  10951. pound: '£',
  10952. curren: '¤',
  10953. yen: '¥',
  10954. brvbar: '¦',
  10955. sect: '§',
  10956. uml: '¨',
  10957. copy: '©',
  10958. ordf: 'ª',
  10959. laquo: '«',
  10960. not: '¬',
  10961. shy: '­­',
  10962. reg: '®',
  10963. macr: '¯',
  10964. deg: '°',
  10965. plusmn: '±',
  10966. sup2: '²',
  10967. sup3: '³',
  10968. acute: '´',
  10969. micro: 'µ',
  10970. para: '¶',
  10971. middot: '·',
  10972. cedil: '¸',
  10973. sup1: '¹',
  10974. ordm: 'º',
  10975. raquo: '»',
  10976. frac14: '¼',
  10977. frac12: '½',
  10978. frac34: '¾',
  10979. iquest: '¿',
  10980. times: '×',
  10981. divide: '÷',
  10982. forall: '∀',
  10983. part: '∂',
  10984. exist: '∃',
  10985. empty: '∅',
  10986. nabla: '∇',
  10987. isin: '∈',
  10988. notin: '∉',
  10989. ni: '∋',
  10990. prod: '∏',
  10991. sum: '∑',
  10992. minus: '−',
  10993. lowast: '∗',
  10994. radic: '√',
  10995. prop: '∝',
  10996. infin: '∞',
  10997. ang: '∠',
  10998. and: '∧',
  10999. or: '∨',
  11000. cap: '∩',
  11001. cup: '∪',
  11002. int: '∫',
  11003. there4: '∴',
  11004. sim: '∼',
  11005. cong: '≅',
  11006. asymp: '≈',
  11007. ne: '≠',
  11008. equiv: '≡',
  11009. le: '≤',
  11010. ge: '≥',
  11011. sub: '⊂',
  11012. sup: '⊃',
  11013. nsub: '⊄',
  11014. sube: '⊆',
  11015. supe: '⊇',
  11016. oplus: '⊕',
  11017. otimes: '⊗',
  11018. perp: '⊥',
  11019. sdot: '⋅',
  11020. Alpha: 'Α',
  11021. Beta: 'Β',
  11022. Gamma: 'Γ',
  11023. Delta: 'Δ',
  11024. Epsilon: 'Ε',
  11025. Zeta: 'Ζ',
  11026. Eta: 'Η',
  11027. Theta: 'Θ',
  11028. Iota: 'Ι',
  11029. Kappa: 'Κ',
  11030. Lambda: 'Λ',
  11031. Mu: 'Μ',
  11032. Nu: 'Ν',
  11033. Xi: 'Ξ',
  11034. Omicron: 'Ο',
  11035. Pi: 'Π',
  11036. Rho: 'Ρ',
  11037. Sigma: 'Σ',
  11038. Tau: 'Τ',
  11039. Upsilon: 'Υ',
  11040. Phi: 'Φ',
  11041. Chi: 'Χ',
  11042. Psi: 'Ψ',
  11043. Omega: 'Ω',
  11044. alpha: 'α',
  11045. beta: 'β',
  11046. gamma: 'γ',
  11047. delta: 'δ',
  11048. epsilon: 'ε',
  11049. zeta: 'ζ',
  11050. eta: 'η',
  11051. theta: 'θ',
  11052. iota: 'ι',
  11053. kappa: 'κ',
  11054. lambda: 'λ',
  11055. mu: 'μ',
  11056. nu: 'ν',
  11057. xi: 'ξ',
  11058. omicron: 'ο',
  11059. pi: 'π',
  11060. rho: 'ρ',
  11061. sigmaf: 'ς',
  11062. sigma: 'σ',
  11063. tau: 'τ',
  11064. upsilon: 'υ',
  11065. phi: 'φ',
  11066. chi: 'χ',
  11067. psi: 'ψ',
  11068. omega: 'ω',
  11069. thetasym: 'ϑ',
  11070. upsih: 'ϒ',
  11071. piv: 'ϖ',
  11072. OElig: 'Œ',
  11073. oelig: 'œ',
  11074. Scaron: 'Š',
  11075. scaron: 'š',
  11076. Yuml: 'Ÿ',
  11077. fnof: 'ƒ',
  11078. circ: 'ˆ',
  11079. tilde: '˜',
  11080. ensp: ' ',
  11081. emsp: ' ',
  11082. thinsp: ' ',
  11083. zwnj: '‌',
  11084. zwj: '‍',
  11085. lrm: '‎',
  11086. rlm: '‏',
  11087. ndash: '–',
  11088. mdash: '—',
  11089. lsquo: '‘',
  11090. rsquo: '’',
  11091. sbquo: '‚',
  11092. ldquo: '“',
  11093. rdquo: '”',
  11094. bdquo: '„',
  11095. dagger: '†',
  11096. Dagger: '‡',
  11097. bull: '•',
  11098. hellip: '…',
  11099. permil: '‰',
  11100. prime: '′',
  11101. Prime: '″',
  11102. lsaquo: '‹',
  11103. rsaquo: '›',
  11104. oline: '‾',
  11105. euro: '€',
  11106. trade: '™',
  11107. larr: '←',
  11108. uarr: '↑',
  11109. rarr: '→',
  11110. darr: '↓',
  11111. harr: '↔',
  11112. crarr: '↵',
  11113. lceil: '⌈',
  11114. rceil: '⌉',
  11115. lfloor: '⌊',
  11116. rfloor: '⌋',
  11117. loz: '◊',
  11118. spades: '♠',
  11119. clubs: '♣',
  11120. hearts: '♥',
  11121. diams: '♦',
  11122. })),
  11123. (t.entityMap = t.HTML_ENTITIES)
  11124. })
  11125. ja.XML_ENTITIES, ja.HTML_ENTITIES, ja.entityMap
  11126. var Ha = jr.NAMESPACE,
  11127. zt = /[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,
  11128. ar = new RegExp('[\\-\\.0-9' + zt.source.slice(1, -1) + '\\u00B7\\u0300-\\u036F\\u203F-\\u2040]'),
  11129. qa = new RegExp('^' + zt.source + ar.source + '*(?::' + zt.source + ar.source + '*)?$'),
  11130. Va = 0,
  11131. Wa = 1,
  11132. Ga = 2,
  11133. za = 3,
  11134. Xa = 4,
  11135. Ka = 5,
  11136. Ya = 6,
  11137. Qa = 7
  11138. function $a(e, t) {
  11139. ;(this.message = e), (this.locator = t), Error.captureStackTrace && Error.captureStackTrace(this, $a)
  11140. }
  11141. function Ja() {}
  11142. function Za(e, t) {
  11143. return (t.lineNumber = e.lineNumber), (t.columnNumber = e.columnNumber), t
  11144. }
  11145. function es(e, t, i) {
  11146. for (var n = e.tagName, r = null, a = e.length; a--; ) {
  11147. var s = e[a],
  11148. o = s.qName,
  11149. u = s.value,
  11150. o = 0 < (c = o.indexOf(':')) ? ((l = s.prefix = o.slice(0, c)), (d = o.slice(c + 1)), 'xmlns' === l && d) : ((l = null), 'xmlns' === (d = o) && '')
  11151. ;(s.localName = d), !1 !== o && (null == r && ((r = {}), ts(i, (i = {}))), (i[o] = r[o] = u), (s.uri = Ha.XMLNS), t.startPrefixMapping(o, u))
  11152. }
  11153. for (var l, a = e.length; a--; ) (l = (s = e[a]).prefix) && ('xml' === l && (s.uri = Ha.XML), 'xmlns' !== l && (s.uri = i[l || '']))
  11154. var c,
  11155. d = 0 < (c = n.indexOf(':')) ? ((l = e.prefix = n.slice(0, c)), (e.localName = n.slice(c + 1))) : ((l = null), (e.localName = n)),
  11156. h = (e.uri = i[l || ''])
  11157. if ((t.startElement(h, d, n, e), !e.closed)) return (e.currentNSMap = i), (e.localNSMap = r), 1
  11158. if ((t.endElement(h, d, n), r)) for (l in r) t.endPrefixMapping(l)
  11159. }
  11160. function ts(e, t) {
  11161. for (var i in e) t[i] = e[i]
  11162. }
  11163. function is() {
  11164. this.attributeNames = {}
  11165. }
  11166. ;(($a.prototype = new Error()).name = $a.name),
  11167. (Ja.prototype = {
  11168. parse: function (e, t, i) {
  11169. var n = this.domBuilder
  11170. n.startDocument(),
  11171. ts(t, (t = {})),
  11172. (function (i, e, n, r, a) {
  11173. function s(e) {
  11174. var t = e.slice(1, -1)
  11175. return t in n
  11176. ? n[t]
  11177. : '#' === t.charAt(0)
  11178. ? 65535 < (t = parseInt(t.substr(1).replace('x', '0x')))
  11179. ? ((t -= 65536), String.fromCharCode(55296 + (t >> 10), 56320 + (1023 & t)))
  11180. : String.fromCharCode(t)
  11181. : (a.error('entity not found:' + e), e)
  11182. }
  11183. function t(e) {
  11184. var t
  11185. f < e && ((t = i.substring(f, e).replace(/&#?\w+;/g, s)), d && o(f), r.characters(t, 0, e - f), (f = e))
  11186. }
  11187. function o(e, t) {
  11188. for (; l <= e && (t = c.exec(i)); ) (u = t.index), (l = u + t[0].length), d.lineNumber++
  11189. d.columnNumber = e - u + 1
  11190. }
  11191. var u = 0,
  11192. l = 0,
  11193. c = /.*(?:\r\n?|\n)|.*$/g,
  11194. d = r.locator,
  11195. h = [{ currentNSMap: e }],
  11196. p = {},
  11197. f = 0
  11198. for (;;) {
  11199. try {
  11200. var m,
  11201. g,
  11202. y = i.indexOf('<', f)
  11203. if (y < 0) return i.substr(f).match(/^\s*$/) || ((m = r.doc), (g = m.createTextNode(i.substr(f))), m.appendChild(g), (r.currentElement = g))
  11204. switch ((f < y && t(y), i.charAt(y + 1))) {
  11205. case '/':
  11206. var v = i.indexOf('>', y + 3),
  11207. _ = i.substring(y + 2, v).replace(/[ \t\n\r]+$/g, ''),
  11208. b = h.pop()
  11209. v < 0
  11210. ? ((_ = i.substring(y + 2).replace(/[\s<].*/, '')), a.error('end tag name: ' + _ + ' is not complete:' + b.tagName), (v = y + 1 + _.length))
  11211. : _.match(/\s</) && ((_ = _.replace(/[\s<].*/, '')), a.error('end tag name: ' + _ + ' maybe not complete'), (v = y + 1 + _.length))
  11212. var T = b.localNSMap,
  11213. S = b.tagName == _
  11214. if (S || (b.tagName && b.tagName.toLowerCase() == _.toLowerCase())) {
  11215. if ((r.endElement(b.uri, b.localName, _), T)) for (var w in T) r.endPrefixMapping(w)
  11216. S || a.fatalError('end tag name: ' + _ + ' is not match the current start tagName:' + b.tagName)
  11217. } else h.push(b)
  11218. v++
  11219. break
  11220. case '?':
  11221. d && o(y),
  11222. (v = (function (e, t, i) {
  11223. var n = e.indexOf('?>', t)
  11224. if (n) {
  11225. t = e.substring(t, n).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/)
  11226. return t ? (t[0].length, i.processingInstruction(t[1], t[2]), n + 2) : -1
  11227. }
  11228. return -1
  11229. })(i, y, r))
  11230. break
  11231. case '!':
  11232. d && o(y),
  11233. (v = (function (e, t, i, n) {
  11234. {
  11235. if ('-' === e.charAt(t + 2)) {
  11236. if ('-' !== e.charAt(t + 3)) return -1
  11237. var r = e.indexOf('--\x3e', t + 4)
  11238. return t < r ? (i.comment(e, t + 4, r - t - 4), r + 3) : (n.error('Unclosed comment'), -1)
  11239. }
  11240. if ('CDATA[' == e.substr(t + 3, 6)) {
  11241. r = e.indexOf(']]>', t + 9)
  11242. return i.startCDATA(), i.characters(e, t + 9, r - t - 9), i.endCDATA(), r + 3
  11243. }
  11244. var a = (function (e, t) {
  11245. var i,
  11246. n = [],
  11247. r = /'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g
  11248. ;(r.lastIndex = t), r.exec(e)
  11249. for (; (i = r.exec(e)); ) if ((n.push(i), i[1])) return n
  11250. })(e, t),
  11251. n = a.length
  11252. if (1 < n && /!doctype/i.test(a[0][0])) {
  11253. ;(r = a[1][0]), (e = !1), (t = !1)
  11254. 3 < n && (/^public$/i.test(a[2][0]) ? ((e = a[3][0]), (t = 4 < n && a[4][0])) : /^system$/i.test(a[2][0]) && (t = a[3][0]))
  11255. n = a[n - 1]
  11256. return i.startDTD(r, e, t), i.endDTD(), n.index + n[0].length
  11257. }
  11258. }
  11259. return -1
  11260. })(i, y, r, a))
  11261. break
  11262. default:
  11263. d && o(y)
  11264. var E = new is(),
  11265. k = h[h.length - 1].currentNSMap,
  11266. v = (function (e, t, n, i, r, a) {
  11267. function s(e, t, i) {
  11268. n.attributeNames.hasOwnProperty(e) && a.fatalError('Attribute ' + e + ' redefined'), n.addValue(e, t, i)
  11269. }
  11270. var o,
  11271. u = ++t,
  11272. l = Va
  11273. for (;;) {
  11274. var c = e.charAt(u)
  11275. switch (c) {
  11276. case '=':
  11277. if (l === Wa) (o = e.slice(t, u)), (l = za)
  11278. else {
  11279. if (l !== Ga) throw new Error('attribute equal must after attrName')
  11280. l = za
  11281. }
  11282. break
  11283. case "'":
  11284. case '"':
  11285. if (l === za || l === Wa) {
  11286. if ((l === Wa && (a.warning('attribute value must after "="'), (o = e.slice(t, u))), (t = u + 1), !(0 < (u = e.indexOf(c, t)))))
  11287. throw new Error("attribute value no end '" + c + "' match")
  11288. ;(d = e.slice(t, u).replace(/&#?\w+;/g, r)), s(o, d, t - 1), (l = Ka)
  11289. } else {
  11290. if (l != Xa) throw new Error('attribute value must after "="')
  11291. ;(d = e.slice(t, u).replace(/&#?\w+;/g, r)),
  11292. s(o, d, t),
  11293. a.warning('attribute "' + o + '" missed start quot(' + c + ')!!'),
  11294. (t = u + 1),
  11295. (l = Ka)
  11296. }
  11297. break
  11298. case '/':
  11299. switch (l) {
  11300. case Va:
  11301. n.setTagName(e.slice(t, u))
  11302. case Ka:
  11303. case Ya:
  11304. case Qa:
  11305. ;(l = Qa), (n.closed = !0)
  11306. case Xa:
  11307. case Wa:
  11308. case Ga:
  11309. break
  11310. default:
  11311. throw new Error("attribute invalid close char('/')")
  11312. }
  11313. break
  11314. case '':
  11315. return a.error('unexpected end of input'), l == Va && n.setTagName(e.slice(t, u)), u
  11316. case '>':
  11317. switch (l) {
  11318. case Va:
  11319. n.setTagName(e.slice(t, u))
  11320. case Ka:
  11321. case Ya:
  11322. case Qa:
  11323. break
  11324. case Xa:
  11325. case Wa:
  11326. '/' === (d = e.slice(t, u)).slice(-1) && ((n.closed = !0), (d = d.slice(0, -1)))
  11327. case Ga:
  11328. l === Ga && (d = o),
  11329. l == Xa
  11330. ? (a.warning('attribute "' + d + '" missed quot(")!'), s(o, d.replace(/&#?\w+;/g, r), t))
  11331. : ((Ha.isHTML(i['']) && d.match(/^(?:disabled|checked|selected)$/i)) ||
  11332. a.warning('attribute "' + d + '" missed value!! "' + d + '" instead!!'),
  11333. s(d, d, t))
  11334. break
  11335. case za:
  11336. throw new Error('attribute value missed!!')
  11337. }
  11338. return u
  11339. case '€':
  11340. c = ' '
  11341. default:
  11342. if (c <= ' ')
  11343. switch (l) {
  11344. case Va:
  11345. n.setTagName(e.slice(t, u)), (l = Ya)
  11346. break
  11347. case Wa:
  11348. ;(o = e.slice(t, u)), (l = Ga)
  11349. break
  11350. case Xa:
  11351. var d = e.slice(t, u).replace(/&#?\w+;/g, r)
  11352. a.warning('attribute "' + d + '" missed quot(")!!'), s(o, d, t)
  11353. case Ka:
  11354. l = Ya
  11355. }
  11356. else
  11357. switch (l) {
  11358. case Ga:
  11359. n.tagName,
  11360. (Ha.isHTML(i['']) && o.match(/^(?:disabled|checked|selected)$/i)) ||
  11361. a.warning('attribute "' + o + '" missed value!! "' + o + '" instead2!!'),
  11362. s(o, o, t),
  11363. (t = u),
  11364. (l = Wa)
  11365. break
  11366. case Ka:
  11367. a.warning('attribute space is required"' + o + '"!!')
  11368. case Ya:
  11369. ;(l = Wa), (t = u)
  11370. break
  11371. case za:
  11372. ;(l = Xa), (t = u)
  11373. break
  11374. case Qa:
  11375. throw new Error("elements closed character '/' and '>' must be connected to")
  11376. }
  11377. }
  11378. u++
  11379. }
  11380. })(i, y, E, k, s, a),
  11381. C = E.length
  11382. if (
  11383. (!E.closed &&
  11384. (function (e, t, i, n) {
  11385. var r = n[i]
  11386. null == r && ((r = e.lastIndexOf('</' + i + '>')) < t && (r = e.lastIndexOf('</' + i)), (n[i] = r))
  11387. return r < t
  11388. })(i, v, E.tagName, p) &&
  11389. ((E.closed = !0), n.nbsp || a.warning('unclosed xml attribute')),
  11390. d && C)
  11391. ) {
  11392. for (var I = Za(d, {}), x = 0; x < C; x++) {
  11393. var A = E[x]
  11394. o(A.offset), (A.locator = Za(d, {}))
  11395. }
  11396. ;(r.locator = I), es(E, r, k) && h.push(E), (r.locator = d)
  11397. } else es(E, r, k) && h.push(E)
  11398. Ha.isHTML(E.uri) && !E.closed
  11399. ? (v = (function (e, t, i, n, r) {
  11400. if (/^(?:script|textarea)$/i.test(i)) {
  11401. var a = e.indexOf('</' + i + '>', t),
  11402. e = e.substring(t + 1, a)
  11403. if (/[&<]/.test(e)) return /^script$/i.test(i) || (e = e.replace(/&#?\w+;/g, n)), r.characters(e, 0, e.length), a
  11404. }
  11405. return t + 1
  11406. })(i, v, E.tagName, s, r))
  11407. : v++
  11408. }
  11409. } catch (e) {
  11410. if (e instanceof $a) throw e
  11411. a.error('element parse error: ' + e), (v = -1)
  11412. }
  11413. f < v ? (f = v) : t(Math.max(y, f) + 1)
  11414. }
  11415. })(e, t, i, n, this.errorHandler),
  11416. n.endDocument()
  11417. },
  11418. }),
  11419. (is.prototype = {
  11420. setTagName: function (e) {
  11421. if (!qa.test(e)) throw new Error('invalid tagName:' + e)
  11422. this.tagName = e
  11423. },
  11424. addValue: function (e, t, i) {
  11425. if (!qa.test(e)) throw new Error('invalid attribute:' + e)
  11426. ;(this.attributeNames[e] = this.length), (this[this.length++] = { qName: e, value: t, offset: i })
  11427. },
  11428. length: 0,
  11429. getLocalName: function (e) {
  11430. return this[e].localName
  11431. },
  11432. getLocator: function (e) {
  11433. return this[e].locator
  11434. },
  11435. getQName: function (e) {
  11436. return this[e].qName
  11437. },
  11438. getURI: function (e) {
  11439. return this[e].uri
  11440. },
  11441. getValue: function (e) {
  11442. return this[e].value
  11443. },
  11444. })
  11445. var x = { XMLReader: Ja, ParseError: $a },
  11446. ns = U.DOMImplementation,
  11447. rs = jr.NAMESPACE,
  11448. as = x.ParseError,
  11449. ss = x.XMLReader
  11450. function os(e) {
  11451. this.options = e || { locator: {} }
  11452. }
  11453. function us() {
  11454. this.cdata = !1
  11455. }
  11456. function ls(e, t) {
  11457. ;(t.lineNumber = e.lineNumber), (t.columnNumber = e.columnNumber)
  11458. }
  11459. function cs(e) {
  11460. if (e) return '\n@' + (e.systemId || '') + '#[line:' + e.lineNumber + ',col:' + e.columnNumber + ']'
  11461. }
  11462. function ds(e, t, i) {
  11463. return 'string' == typeof e ? e.substr(t, i) : e.length >= t + i || t ? new java.lang.String(e, t, i) + '' : e
  11464. }
  11465. function hs(e, t) {
  11466. ;(e.currentElement || e.doc).appendChild(t)
  11467. }
  11468. ;(os.prototype.parseFromString = function (e, t) {
  11469. var i = this.options,
  11470. n = new ss(),
  11471. r = i.domBuilder || new us(),
  11472. a = i.errorHandler,
  11473. s = i.locator,
  11474. o = i.xmlns || {},
  11475. u = /\/x?html?$/.test(t),
  11476. t = u ? ja.HTML_ENTITIES : ja.XML_ENTITIES
  11477. return (
  11478. s && r.setDocumentLocator(s),
  11479. (n.errorHandler = (function (n, e, r) {
  11480. if (!n) {
  11481. if (e instanceof us) return e
  11482. n = e
  11483. }
  11484. var a = {},
  11485. s = n instanceof Function
  11486. function t(t) {
  11487. var i = n[t]
  11488. !i &&
  11489. s &&
  11490. (i =
  11491. 2 == n.length
  11492. ? function (e) {
  11493. n(t, e)
  11494. }
  11495. : n),
  11496. (a[t] = i
  11497. ? function (e) {
  11498. i('[xmldom ' + t + ']\t' + e + cs(r))
  11499. }
  11500. : function () {})
  11501. }
  11502. return (r = r || {}), t('warning'), t('error'), t('fatalError'), a
  11503. })(a, r, s)),
  11504. (n.domBuilder = i.domBuilder || r),
  11505. u && (o[''] = rs.HTML),
  11506. (o.xml = o.xml || rs.XML),
  11507. e && 'string' == typeof e ? n.parse(e, o, t) : n.errorHandler.error('invalid doc source'),
  11508. r.doc
  11509. )
  11510. }),
  11511. (us.prototype = {
  11512. startDocument: function () {
  11513. ;(this.doc = new ns().createDocument(null, null, null)), this.locator && (this.doc.documentURI = this.locator.systemId)
  11514. },
  11515. startElement: function (e, t, i, n) {
  11516. var r = this.doc,
  11517. a = r.createElementNS(e, i || t),
  11518. s = n.length
  11519. hs(this, a), (this.currentElement = a), this.locator && ls(this.locator, a)
  11520. for (var o = 0; o < s; o++) {
  11521. var e = n.getURI(o),
  11522. u = n.getValue(o),
  11523. i = n.getQName(o),
  11524. l = r.createAttributeNS(e, i)
  11525. this.locator && ls(n.getLocator(o), l), (l.value = l.nodeValue = u), a.setAttributeNode(l)
  11526. }
  11527. },
  11528. endElement: function (e, t, i) {
  11529. var n = this.currentElement
  11530. n.tagName, (this.currentElement = n.parentNode)
  11531. },
  11532. startPrefixMapping: function (e, t) {},
  11533. endPrefixMapping: function (e) {},
  11534. processingInstruction: function (e, t) {
  11535. t = this.doc.createProcessingInstruction(e, t)
  11536. this.locator && ls(this.locator, t), hs(this, t)
  11537. },
  11538. ignorableWhitespace: function (e, t, i) {},
  11539. characters: function (e, t, i) {
  11540. var n
  11541. ;(e = ds.apply(this, arguments)) &&
  11542. ((n = this.cdata ? this.doc.createCDATASection(e) : this.doc.createTextNode(e)),
  11543. this.currentElement ? this.currentElement.appendChild(n) : /^\s*$/.test(e) && this.doc.appendChild(n),
  11544. this.locator && ls(this.locator, n))
  11545. },
  11546. skippedEntity: function (e) {},
  11547. endDocument: function () {
  11548. this.doc.normalize()
  11549. },
  11550. setDocumentLocator: function (e) {
  11551. ;(this.locator = e) && (e.lineNumber = 0)
  11552. },
  11553. comment: function (e, t, i) {
  11554. e = ds.apply(this, arguments)
  11555. e = this.doc.createComment(e)
  11556. this.locator && ls(this.locator, e), hs(this, e)
  11557. },
  11558. startCDATA: function () {
  11559. this.cdata = !0
  11560. },
  11561. endCDATA: function () {
  11562. this.cdata = !1
  11563. },
  11564. startDTD: function (e, t, i) {
  11565. var n = this.doc.implementation
  11566. n && n.createDocumentType && ((i = n.createDocumentType(e, t, i)), this.locator && ls(this.locator, i), hs(this, i), (this.doc.doctype = i))
  11567. },
  11568. warning: function (e) {},
  11569. error: function (e) {},
  11570. fatalError: function (e) {
  11571. throw new as(e, this.locator)
  11572. },
  11573. }),
  11574. 'endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl'.replace(/\w+/g, function (e) {
  11575. us.prototype[e] = function () {
  11576. return null
  11577. }
  11578. })
  11579. function ps(e) {
  11580. return !!e && 'object' == typeof e
  11581. }
  11582. function fs() {
  11583. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  11584. return t.reduce(function (t, i) {
  11585. return (
  11586. 'object' != typeof i ||
  11587. Object.keys(i).forEach(function (e) {
  11588. Array.isArray(t[e]) && Array.isArray(i[e]) ? (t[e] = t[e].concat(i[e])) : ps(t[e]) && ps(i[e]) ? (t[e] = fs(t[e], i[e])) : (t[e] = i[e])
  11589. }),
  11590. t
  11591. )
  11592. }, {})
  11593. }
  11594. function ms(t) {
  11595. return Object.keys(t).map(function (e) {
  11596. return t[e]
  11597. })
  11598. }
  11599. function gs(e) {
  11600. return e.reduce(function (e, t) {
  11601. return e.concat(t)
  11602. }, [])
  11603. }
  11604. function ys(e) {
  11605. if (!e.length) return []
  11606. for (var t = [], i = 0; i < e.length; i++) t.push(e[i])
  11607. return t
  11608. }
  11609. function vs(e, t) {
  11610. for (var i = 0; i < e.length; i++) if (t(e[i])) return i
  11611. return -1
  11612. }
  11613. function _s(e) {
  11614. var t = e.baseUrl,
  11615. i = void 0 === (n = e.source) ? '' : n,
  11616. n = void 0 === (n = e.range) ? '' : n,
  11617. e = void 0 === (e = e.indexRange) ? '' : e,
  11618. i = { uri: i, resolvedUri: ir((void 0 === t ? '' : t) || '', i) }
  11619. return (
  11620. (n || e) &&
  11621. ((n = (n || e).split('-')),
  11622. (e = window.BigInt ? window.BigInt(n[0]) : parseInt(n[0], 10)),
  11623. (n = window.BigInt ? window.BigInt(n[1]) : parseInt(n[1], 10)),
  11624. e < Number.MAX_SAFE_INTEGER && 'bigint' == typeof e && (e = Number(e)),
  11625. 'bigint' ==
  11626. typeof (n =
  11627. 'bigint' == typeof (n = n < Number.MAX_SAFE_INTEGER && 'bigint' == typeof n ? Number(n) : n) || 'bigint' == typeof e
  11628. ? window.BigInt(n) - window.BigInt(e) + window.BigInt(1)
  11629. : n - e + 1) &&
  11630. n < Number.MAX_SAFE_INTEGER &&
  11631. (n = Number(n)),
  11632. (i.byterange = { length: n, offset: e })),
  11633. i
  11634. )
  11635. }
  11636. function bs(e) {
  11637. return e && 'number' != typeof e && (e = parseInt(e, 10)), isNaN(e) ? null : e
  11638. }
  11639. function Ts(e) {
  11640. var a,
  11641. t = e.type,
  11642. i = e.duration,
  11643. n = e.timescale,
  11644. r = void 0 === n ? 1 : n,
  11645. s = e.periodDuration,
  11646. o = e.sourceDuration,
  11647. e = (function (e, t) {
  11648. for (var i = [], n = e; n < t; n++) i.push(n)
  11649. return i
  11650. })((n = go[t](e)).start, n.end).map(
  11651. ((a = e),
  11652. function (e) {
  11653. var t = a.duration,
  11654. i = a.timescale,
  11655. n = a.periodStart,
  11656. r = a.startNumber
  11657. return { number: (void 0 === r ? 1 : r) + e, duration: t / (void 0 === i ? 1 : i), timeline: n, time: e * t }
  11658. })
  11659. )
  11660. return 'static' === t && (e[(t = e.length - 1)].duration = ('number' == typeof s ? s : o) - (i / r) * t), e
  11661. }
  11662. function Ss(e) {
  11663. var t = e.baseUrl,
  11664. i = void 0 === (u = e.initialization) ? {} : u,
  11665. n = e.sourceDuration,
  11666. r = void 0 === (o = e.indexRange) ? '' : o,
  11667. a = e.periodStart,
  11668. s = e.presentationTime,
  11669. o = void 0 === (u = e.number) ? 0 : u,
  11670. u = e.duration
  11671. if (!t) throw new Error(po)
  11672. return (
  11673. (i = _s({ baseUrl: t, source: i.sourceURL, range: i.range })),
  11674. ((r = _s({ baseUrl: t, source: t, indexRange: r })).map = i),
  11675. u ? (e = Ts(e)).length && ((r.duration = e[0].duration), (r.timeline = e[0].timeline)) : n && ((r.duration = n), (r.timeline = a)),
  11676. (r.presentationTime = s || a),
  11677. (r.number = o),
  11678. [r]
  11679. )
  11680. }
  11681. function ws(e, t, i) {
  11682. for (
  11683. var n = e.sidx.map || null,
  11684. r = e.sidx.duration,
  11685. a = e.timeline || 0,
  11686. s = (s = e.sidx.byterange).offset + s.length,
  11687. o = t.timescale,
  11688. u = t.references.filter(function (e) {
  11689. return 1 !== e.referenceType
  11690. }),
  11691. l = [],
  11692. c = e.endList ? 'static' : 'dynamic',
  11693. d = e.sidx.timeline,
  11694. h = d,
  11695. p = e.mediaSequence || 0,
  11696. f = 'bigint' == typeof t.firstOffset ? window.BigInt(s) + t.firstOffset : s + t.firstOffset,
  11697. m = 0;
  11698. m < u.length;
  11699. m++
  11700. ) {
  11701. var g = t.references[m],
  11702. y = g.referencedSize,
  11703. v = g.subsegmentDuration,
  11704. g = void 0,
  11705. g = 'bigint' == typeof f ? f + window.BigInt(y) - window.BigInt(1) : f + y - 1,
  11706. g = Ss({ baseUrl: i, timescale: o, timeline: a, periodStart: d, presentationTime: h, number: p, duration: v, sourceDuration: r, indexRange: f + '-' + g, type: c })[0]
  11707. n && (g.map = n), l.push(g), (f += 'bigint' == typeof f ? window.BigInt(y) : y), (h += v / o), p++
  11708. }
  11709. return (e.segments = l), e
  11710. }
  11711. function Es(e) {
  11712. return (
  11713. (i = function (e) {
  11714. return e.timeline
  11715. }),
  11716. ms(
  11717. e.reduce(function (t, e) {
  11718. return (
  11719. e.forEach(function (e) {
  11720. t[i(e)] = e
  11721. }),
  11722. t
  11723. )
  11724. }, {})
  11725. ).sort(function (e, t) {
  11726. return e.timeline > t.timeline ? 1 : -1
  11727. })
  11728. )
  11729. var i
  11730. }
  11731. function ks(e) {
  11732. var r,
  11733. a,
  11734. s = []
  11735. return (
  11736. (r = e),
  11737. (a = function (e, t, i, n) {
  11738. s = s.concat(e.playlists || [])
  11739. }),
  11740. yo.forEach(function (e) {
  11741. for (var t in r.mediaGroups[e])
  11742. for (var i in r.mediaGroups[e][t]) {
  11743. var n = r.mediaGroups[e][t][i]
  11744. a(n, e, t, i)
  11745. }
  11746. }),
  11747. s
  11748. )
  11749. }
  11750. function Cs(e) {
  11751. var i = e.playlist,
  11752. e = e.mediaSequence
  11753. ;(i.mediaSequence = e),
  11754. i.segments.forEach(function (e, t) {
  11755. e.number = i.mediaSequence + t
  11756. })
  11757. }
  11758. function Is(e) {
  11759. var r,
  11760. a,
  11761. t = e.oldManifest,
  11762. i = e.newManifest,
  11763. n = t.playlists.concat(ks(t)),
  11764. e = i.playlists.concat(ks(i))
  11765. return (
  11766. (i.timelineStarts = Es([t.timelineStarts, i.timelineStarts])),
  11767. (n = { oldPlaylists: n, newPlaylists: e, timelineStarts: i.timelineStarts }),
  11768. (r = n.oldPlaylists),
  11769. (e = n.newPlaylists),
  11770. (a = n.timelineStarts),
  11771. e.forEach(function (t) {
  11772. t.discontinuitySequence = vs(a, function (e) {
  11773. return e.timeline === t.timeline
  11774. })
  11775. var e = (function (e, t) {
  11776. for (var i = 0; i < e.length; i++) if (e[i].attributes.NAME === t) return e[i]
  11777. return null
  11778. })(r, t.attributes.NAME)
  11779. if (e && !t.sidx) {
  11780. var i = t.segments[0],
  11781. n = vs(e.segments, function (e) {
  11782. return Math.abs(e.presentationTime - i.presentationTime) < 1 / 60
  11783. })
  11784. if (-1 === n)
  11785. return (
  11786. Cs({ playlist: t, mediaSequence: e.mediaSequence + e.segments.length }),
  11787. (t.segments[0].discontinuity = !0),
  11788. t.discontinuityStarts.unshift(0),
  11789. void (((!e.segments.length && t.timeline > e.timeline) || (e.segments.length && t.timeline > e.segments[e.segments.length - 1].timeline)) && t.discontinuitySequence--)
  11790. )
  11791. e.segments[n].discontinuity && !i.discontinuity && ((i.discontinuity = !0), t.discontinuityStarts.unshift(0), t.discontinuitySequence--),
  11792. Cs({ playlist: t, mediaSequence: e.segments[n].number })
  11793. }
  11794. }),
  11795. i
  11796. )
  11797. }
  11798. function xs(e) {
  11799. return (
  11800. e &&
  11801. e.uri +
  11802. '-' +
  11803. ((t = e.byterange),
  11804. (e = 'bigint' == typeof t.offset || 'bigint' == typeof t.length ? window.BigInt(t.offset) + window.BigInt(t.length) - window.BigInt(1) : t.offset + t.length - 1),
  11805. t.offset + '-' + e)
  11806. )
  11807. var t
  11808. }
  11809. function As(e) {
  11810. return ms(
  11811. e.reduce(function (e, t) {
  11812. var i,
  11813. n = t.attributes.id + (t.attributes.lang || '')
  11814. return (
  11815. e[n]
  11816. ? (t.segments && (t.segments[0] && (t.segments[0].discontinuity = !0), (i = e[n].segments).push.apply(i, t.segments)),
  11817. t.attributes.contentProtection && (e[n].attributes.contentProtection = t.attributes.contentProtection))
  11818. : ((e[n] = t), (e[n].attributes.timelineStarts = [])),
  11819. e[n].attributes.timelineStarts.push({ start: t.attributes.periodStart, timeline: t.attributes.periodStart }),
  11820. e
  11821. )
  11822. }, {})
  11823. ).map(function (e) {
  11824. var t, n
  11825. return (
  11826. (e.discontinuityStarts =
  11827. ((t = e.segments || []),
  11828. (n = 'discontinuity'),
  11829. t.reduce(function (e, t, i) {
  11830. return t[n] && e.push(i), e
  11831. }, []))),
  11832. e
  11833. )
  11834. })
  11835. }
  11836. function Ps(e, t) {
  11837. var i = xs(e.sidx)
  11838. return (i = i && t[i] && t[i].sidx) && ws(e, i, e.sidx.resolvedUri), e
  11839. }
  11840. function Ls(e, h, p) {
  11841. var f
  11842. return (
  11843. void 0 === h && (h = {}),
  11844. void 0 === p && (p = !1),
  11845. (e = e.reduce(function (e, t) {
  11846. var i = (t.attributes.role && t.attributes.role.value) || '',
  11847. n = t.attributes.lang || '',
  11848. r = t.attributes.label || 'main'
  11849. e[(r = n && !t.attributes.label ? t.attributes.lang + (i ? ' (' + i + ')' : '') : r)] || (e[r] = { language: n, autoselect: !0, default: 'main' === i, playlists: [], uri: '' })
  11850. var a,
  11851. s,
  11852. o,
  11853. u,
  11854. l,
  11855. c,
  11856. d,
  11857. u = Ps(
  11858. ((s = p),
  11859. (o = (a = t).attributes),
  11860. (u = a.segments),
  11861. (l = a.sidx),
  11862. (c = a.mediaSequence),
  11863. (d = a.discontinuitySequence),
  11864. (n = a.discontinuityStarts),
  11865. (u = {
  11866. attributes: (((a = { NAME: o.id, BANDWIDTH: o.bandwidth, CODECS: o.codecs })['PROGRAM-ID'] = 1), a),
  11867. uri: '',
  11868. endList: 'static' === o.type,
  11869. timeline: o.periodStart,
  11870. resolvedUri: '',
  11871. targetDuration: o.duration,
  11872. discontinuitySequence: d,
  11873. discontinuityStarts: n,
  11874. timelineStarts: o.timelineStarts,
  11875. mediaSequence: c,
  11876. segments: u,
  11877. }),
  11878. o.contentProtection && (u.contentProtection = o.contentProtection),
  11879. l && (u.sidx = l),
  11880. s && ((u.attributes.AUDIO = 'audio'), (u.attributes.SUBTITLES = 'subs')),
  11881. u),
  11882. h
  11883. )
  11884. return e[r].playlists.push(u), 'undefined' == typeof f && 'main' === i && ((f = t).default = !0), e
  11885. }, {})),
  11886. f || (e[Object.keys(e)[0]].default = !0),
  11887. e
  11888. )
  11889. }
  11890. function Ds(e) {
  11891. var t = e.attributes,
  11892. i = e.segments,
  11893. n = e.sidx,
  11894. r = e.discontinuityStarts,
  11895. i = {
  11896. attributes:
  11897. (((e = { NAME: t.id, AUDIO: 'audio', SUBTITLES: 'subs', RESOLUTION: { width: t.width, height: t.height }, CODECS: t.codecs, BANDWIDTH: t.bandwidth })['PROGRAM-ID'] = 1), e),
  11898. uri: '',
  11899. endList: 'static' === t.type,
  11900. timeline: t.periodStart,
  11901. resolvedUri: '',
  11902. targetDuration: t.duration,
  11903. discontinuityStarts: r,
  11904. timelineStarts: t.timelineStarts,
  11905. segments: i,
  11906. }
  11907. return t.contentProtection && (i.contentProtection = t.contentProtection), n && (i.sidx = n), i
  11908. }
  11909. function Os(e) {
  11910. return 'video/mp4' === (e = e.attributes).mimeType || 'video/webm' === e.mimeType || 'video' === e.contentType
  11911. }
  11912. function Ms(e) {
  11913. return 'audio/mp4' === (e = e.attributes).mimeType || 'audio/webm' === e.mimeType || 'audio' === e.contentType
  11914. }
  11915. function Rs(e) {
  11916. return 'text/vtt' === (e = e.attributes).mimeType || 'text' === e.contentType
  11917. }
  11918. function Ns(i) {
  11919. return i
  11920. ? Object.keys(i).reduce(function (e, t) {
  11921. t = i[t]
  11922. return e.concat(t.playlists)
  11923. }, [])
  11924. : []
  11925. }
  11926. function Us(e) {
  11927. var t = e.dashPlaylists,
  11928. i = e.locations,
  11929. n = void 0 === (c = e.sidxMapping) ? {} : c,
  11930. r = e.previousManifest
  11931. if (!t.length) return {}
  11932. var a = (d = t[0].attributes).sourceDuration,
  11933. s = d.type,
  11934. o = d.suggestedPresentationDelay,
  11935. u = d.minimumUpdatePeriod,
  11936. l = As(t.filter(Os)).map(Ds),
  11937. c = As(t.filter(Ms)),
  11938. e = As(t.filter(Rs)),
  11939. d = t
  11940. .map(function (e) {
  11941. return e.attributes.captionServices
  11942. })
  11943. .filter(Boolean),
  11944. a = {
  11945. allowCache: !0,
  11946. discontinuityStarts: [],
  11947. segments: [],
  11948. endList: !0,
  11949. mediaGroups: (((t = { AUDIO: {}, VIDEO: {} })['CLOSED-CAPTIONS'] = {}), (t.SUBTITLES = {}), t),
  11950. uri: '',
  11951. duration: a,
  11952. playlists: (function (e, t) {
  11953. if ((void 0 === t && (t = {}), !Object.keys(t).length)) return e
  11954. for (var i in e) e[i] = Ps(e[i], t)
  11955. return e
  11956. })(l, n),
  11957. }
  11958. 0 <= u && (a.minimumUpdatePeriod = 1e3 * u), i && (a.locations = i), 'dynamic' === s && (a.suggestedPresentationDelay = o)
  11959. var h,
  11960. p,
  11961. o = 0 === a.playlists.length,
  11962. o = c.length ? Ls(c, n, o) : null,
  11963. n = e.length
  11964. ? (void 0 === (h = n) && (h = {}),
  11965. e.reduce(function (e, t) {
  11966. var i = t.attributes.lang || 'text'
  11967. return (
  11968. e[i] || (e[i] = { language: i, default: !1, autoselect: !1, playlists: [], uri: '' }),
  11969. e[i].playlists.push(
  11970. Ps(
  11971. (function (e) {
  11972. var t = e.attributes,
  11973. i = e.segments,
  11974. n = e.mediaSequence,
  11975. r = e.discontinuityStarts,
  11976. a = e.discontinuitySequence
  11977. 'undefined' == typeof i &&
  11978. ((i = [{ uri: t.baseUrl, timeline: t.periodStart, resolvedUri: t.baseUrl || '', duration: t.sourceDuration, number: 0 }]), (t.duration = t.sourceDuration))
  11979. ;(e = { NAME: t.id, BANDWIDTH: t.bandwidth })['PROGRAM-ID'] = 1
  11980. return (
  11981. t.codecs && (e.CODECS = t.codecs),
  11982. {
  11983. attributes: e,
  11984. uri: '',
  11985. endList: 'static' === t.type,
  11986. timeline: t.periodStart,
  11987. resolvedUri: t.baseUrl || '',
  11988. targetDuration: t.duration,
  11989. timelineStarts: t.timelineStarts,
  11990. discontinuityStarts: r,
  11991. discontinuitySequence: a,
  11992. mediaSequence: n,
  11993. segments: i,
  11994. }
  11995. )
  11996. })(t),
  11997. h
  11998. )
  11999. ),
  12000. e
  12001. )
  12002. }, {}))
  12003. : null,
  12004. l = (e = l.concat(Ns(o), Ns(n))).map(function (e) {
  12005. return e.timelineStarts
  12006. })
  12007. return (
  12008. (a.timelineStarts = Es(l)),
  12009. (e = e),
  12010. (p = a.timelineStarts),
  12011. e.forEach(function (t) {
  12012. ;(t.mediaSequence = 0),
  12013. (t.discontinuitySequence = vs(p, function (e) {
  12014. return e.timeline === t.timeline
  12015. })),
  12016. t.segments &&
  12017. t.segments.forEach(function (e, t) {
  12018. e.number = t
  12019. })
  12020. }),
  12021. o && (a.mediaGroups.AUDIO.audio = o),
  12022. n && (a.mediaGroups.SUBTITLES.subs = n),
  12023. d.length &&
  12024. (a.mediaGroups['CLOSED-CAPTIONS'].cc = d.reduce(function (n, e) {
  12025. return (
  12026. e &&
  12027. e.forEach(function (e) {
  12028. var t = e.channel,
  12029. i = e.language
  12030. ;(n[i] = { autoselect: !1, default: !1, instreamId: t, language: i }),
  12031. e.hasOwnProperty('aspectRatio') && (n[i].aspectRatio = e.aspectRatio),
  12032. e.hasOwnProperty('easyReader') && (n[i].easyReader = e.easyReader),
  12033. e.hasOwnProperty('3D') && (n[i]['3D'] = e['3D'])
  12034. }),
  12035. n
  12036. )
  12037. }, {})),
  12038. r ? Is({ oldManifest: r, newManifest: a }) : a
  12039. )
  12040. }
  12041. function Bs(e, t) {
  12042. for (
  12043. var i,
  12044. n,
  12045. r,
  12046. a,
  12047. s,
  12048. o,
  12049. u = e.type,
  12050. l = e.minimumUpdatePeriod,
  12051. c = void 0 === l ? 0 : l,
  12052. d = void 0 === (l = e.media) ? '' : l,
  12053. h = e.sourceDuration,
  12054. p = void 0 === (l = e.timescale) ? 1 : l,
  12055. f = void 0 === (l = e.startNumber) ? 1 : l,
  12056. m = e.periodStart,
  12057. g = [],
  12058. y = -1,
  12059. v = 0;
  12060. v < t.length;
  12061. v++
  12062. ) {
  12063. var _ = t[v],
  12064. b = _.d,
  12065. T = _.r || 0,
  12066. S = _.t || 0
  12067. y < 0 && (y = S), S && y < S && (y = S)
  12068. var w,
  12069. E = void 0
  12070. E =
  12071. T < 0
  12072. ? (w = v + 1) === t.length
  12073. ? 'dynamic' === u && 0 < c && 0 < d.indexOf('$Number$')
  12074. ? ((i = y),
  12075. (n = b),
  12076. (_ = o = s = a = r = void 0),
  12077. (r = (S = e).NOW),
  12078. (a = S.clientOffset),
  12079. (s = S.availabilityStartTime),
  12080. (o = S.timescale),
  12081. (_ = S.periodStart),
  12082. (S = S.minimumUpdatePeriod),
  12083. Math.ceil((((r + a) / 1e3 + (void 0 === S ? 0 : S) - (s + (void 0 === _ ? 0 : _))) * (void 0 === o ? 1 : o) - i) / n))
  12084. : (h * p - y) / b
  12085. : (t[w].t - y) / b
  12086. : T + 1
  12087. for (var k = f + g.length + E, C = f + g.length; C < k; ) g.push({ number: C, duration: b / p, time: y, timeline: m }), (y += b), C++
  12088. }
  12089. return g
  12090. }
  12091. function Fs(e, t) {
  12092. return e.replace(
  12093. vo,
  12094. ((r = t),
  12095. function (e, t, i, n) {
  12096. if ('$$' === e) return '$'
  12097. if ('undefined' == typeof r[t]) return e
  12098. e = '' + r[t]
  12099. return 'RepresentationID' === t || (n = i ? parseInt(n, 10) : 1) <= e.length ? e : new Array(n - e.length + 1).join('0') + e
  12100. })
  12101. )
  12102. var r
  12103. }
  12104. function js(r, e) {
  12105. var a = { RepresentationID: r.id, Bandwidth: r.bandwidth || 0 },
  12106. t = void 0 === (t = r.initialization) ? { sourceURL: '', range: '' } : t,
  12107. s = _s({ baseUrl: r.baseUrl, source: Fs(t.sourceURL, a), range: t.range })
  12108. return ((t = e), (e = r).duration || t ? (e.duration ? Ts(e) : Bs(e, t)) : [{ number: e.startNumber || 1, duration: e.sourceDuration, time: 0, timeline: e.periodStart }]).map(function (e) {
  12109. ;(a.Number = e.number), (a.Time = e.time)
  12110. var t = Fs(r.media || '', a),
  12111. i = r.timescale || 1,
  12112. n = r.presentationTimeOffset || 0,
  12113. i = r.periodStart + (e.time - n) / i
  12114. return { uri: t, timeline: e.timeline, duration: e.duration, resolvedUri: ir(r.baseUrl || '', t), map: s, number: e.number, presentationTime: i }
  12115. })
  12116. }
  12117. function Hs(r, e) {
  12118. var t = r.duration,
  12119. i = void 0 === (i = r.segmentUrls) ? [] : i,
  12120. a = r.periodStart
  12121. if ((!t && !e) || (t && e)) throw new Error(fo)
  12122. var n,
  12123. s = i.map(function (e) {
  12124. return (
  12125. (i = e),
  12126. (e = (t = r).baseUrl),
  12127. (t = t.initialization),
  12128. (t = _s({ baseUrl: e, source: (t = void 0 === t ? {} : t).sourceURL, range: t.range })),
  12129. ((i = _s({ baseUrl: e, source: i.media, range: i.mediaRange })).map = t),
  12130. i
  12131. )
  12132. var t, i
  12133. })
  12134. return (
  12135. t && (n = Ts(r)),
  12136. (n = e ? Bs(r, e) : n)
  12137. .map(function (e, t) {
  12138. if (s[t]) {
  12139. var i = s[t],
  12140. n = r.timescale || 1,
  12141. t = r.presentationTimeOffset || 0
  12142. return (i.timeline = e.timeline), (i.duration = e.duration), (i.number = e.number), (i.presentationTime = a + (e.time - t) / n), i
  12143. }
  12144. })
  12145. .filter(function (e) {
  12146. return e
  12147. })
  12148. )
  12149. }
  12150. function qs(e) {
  12151. var t,
  12152. i = e.attributes,
  12153. n = e.segmentInfo
  12154. n.template ? ((a = js), (t = fs(i, n.template))) : n.base ? ((a = Ss), (t = fs(i, n.base))) : n.list && ((a = Hs), (t = fs(i, n.list)))
  12155. var r = { attributes: i }
  12156. if (!a) return r
  12157. var a,
  12158. e = a(t, n.segmentTimeline)
  12159. return (
  12160. t.duration
  12161. ? ((i = t.duration), (a = t.timescale), (t.duration = i / (void 0 === a ? 1 : a)))
  12162. : e.length
  12163. ? (t.duration = e.reduce(function (e, t) {
  12164. return Math.max(e, Math.ceil(t.duration))
  12165. }, 0))
  12166. : (t.duration = 0),
  12167. (r.attributes = t),
  12168. (r.segments = e),
  12169. n.base && t.indexRange && ((r.sidx = e[0]), (r.segments = [])),
  12170. r
  12171. )
  12172. }
  12173. function Vs(e, t) {
  12174. return ys(e.childNodes).filter(function (e) {
  12175. return e.tagName === t
  12176. })
  12177. }
  12178. function Ws(e) {
  12179. return e.textContent.trim()
  12180. }
  12181. function Gs(e) {
  12182. if (!(r = /P(?:(\d*)Y)?(?:(\d*)M)?(?:(\d*)D)?(?:T(?:(\d*)H)?(?:(\d*)M)?(?:([\d.]*)S)?)?/.exec(e))) return 0
  12183. var t = (a = r.slice(1))[0],
  12184. i = a[1],
  12185. n = a[2],
  12186. e = a[3],
  12187. r = a[4],
  12188. a = a[5]
  12189. return 31536e3 * parseFloat(t || 0) + 2592e3 * parseFloat(i || 0) + 86400 * parseFloat(n || 0) + 3600 * parseFloat(e || 0) + 60 * parseFloat(r || 0) + parseFloat(a || 0)
  12190. }
  12191. function zs(e) {
  12192. return e && e.attributes
  12193. ? ys(e.attributes).reduce(function (e, t) {
  12194. var i = _o[t.name] || _o.DEFAULT
  12195. return (e[t.name] = i(t.value)), e
  12196. }, {})
  12197. : {}
  12198. }
  12199. function Xs(e, i) {
  12200. return i.length
  12201. ? gs(
  12202. e.map(function (t) {
  12203. return i.map(function (e) {
  12204. return ir(t, Ws(e))
  12205. })
  12206. })
  12207. )
  12208. : e
  12209. }
  12210. function Ks(e) {
  12211. var t = Vs(e, 'SegmentTemplate')[0],
  12212. i = Vs(e, 'SegmentList')[0],
  12213. n =
  12214. i &&
  12215. Vs(i, 'SegmentURL').map(function (e) {
  12216. return fs({ tag: 'SegmentURL' }, zs(e))
  12217. }),
  12218. r = Vs(e, 'SegmentBase')[0],
  12219. e = (a = i || t) && Vs(a, 'SegmentTimeline')[0],
  12220. a = (a = i || r || t) && Vs(a, 'Initialization')[0]
  12221. ;(t = t && zs(t)) && a ? (t.initialization = a && zs(a)) : t && t.initialization && (t.initialization = { sourceURL: t.initialization })
  12222. var s = { template: t, segmentTimeline: e && Vs(e, 'S').map(zs), list: i && fs(zs(i), { segmentUrls: n, initialization: zs(a) }), base: r && fs(zs(r), { initialization: zs(a) }) }
  12223. return (
  12224. Object.keys(s).forEach(function (e) {
  12225. s[e] || delete s[e]
  12226. }),
  12227. s
  12228. )
  12229. }
  12230. function Ys(u, l, c) {
  12231. return function (e) {
  12232. var t = zs(e),
  12233. i = Xs(l, Vs(e, 'BaseURL')),
  12234. n = Vs(e, 'Role')[0],
  12235. n = { role: zs(n) },
  12236. t = fs(u, t, n),
  12237. n = Vs(e, 'Accessibility')[0],
  12238. n =
  12239. 'urn:scte:dash:cc:cea-608:2015' === (n = zs(n)).schemeIdUri
  12240. ? ('string' != typeof n.value ? [] : n.value.split(';')).map(function (e) {
  12241. var t, i, n
  12242. return /^CC\d=/.test((n = e)) ? ((i = (t = e.split('='))[0]), (n = t[1])) : /^CC\d$/.test(e) && (i = e), { channel: i, language: n }
  12243. })
  12244. : 'urn:scte:dash:cc:cea-708:2015' === n.schemeIdUri
  12245. ? ('string' != typeof n.value ? [] : n.value.split(';')).map(function (e) {
  12246. var t,
  12247. i,
  12248. n = { channel: void 0, language: void 0, aspectRatio: 1, easyReader: 0, '3D': 0 }
  12249. return (
  12250. /=/.test(e)
  12251. ? ((t = (i = e.split('='))[0]),
  12252. (i = void 0 === (i = i[1]) ? '' : i),
  12253. (n.channel = t),
  12254. (n.language = e),
  12255. i.split(',').forEach(function (e) {
  12256. var t = e.split(':'),
  12257. e = t[0],
  12258. t = t[1]
  12259. 'lang' === e ? (n.language = t) : 'er' === e ? (n.easyReader = Number(t)) : 'war' === e ? (n.aspectRatio = Number(t)) : '3D' === e && (n['3D'] = Number(t))
  12260. }))
  12261. : (n.language = e),
  12262. n.channel && (n.channel = 'SERVICE' + n.channel),
  12263. n
  12264. )
  12265. })
  12266. : void 0
  12267. n && (t = fs(t, { captionServices: n }))
  12268. n = Vs(e, 'Label')[0]
  12269. n && n.childNodes.length && ((r = n.childNodes[0].nodeValue.trim()), (t = fs(t, { label: r })))
  12270. var r = Vs(e, 'ContentProtection').reduce(function (e, t) {
  12271. var i = zs(t)
  12272. i.schemeIdUri && (i.schemeIdUri = i.schemeIdUri.toLowerCase())
  12273. var n = bo[i.schemeIdUri]
  12274. return n && ((e[n] = { attributes: i }), (t = Vs(t, 'cenc:pssh')[0]) && ((t = Ws(t)), (e[n].pssh = t && or(t)))), e
  12275. }, {})
  12276. Object.keys(r).length && (t = fs(t, { contentProtection: r }))
  12277. var a,
  12278. s,
  12279. o,
  12280. r = Ks(e),
  12281. e = Vs(e, 'Representation'),
  12282. r = fs(c, r)
  12283. return gs(
  12284. e.map(
  12285. ((a = t),
  12286. (s = i),
  12287. (o = r),
  12288. function (e) {
  12289. var t = Vs(e, 'BaseURL'),
  12290. t = Xs(s, t),
  12291. i = fs(a, zs(e)),
  12292. n = Ks(e)
  12293. return t.map(function (e) {
  12294. return { segmentInfo: fs(o, n), attributes: fs(i, { baseUrl: e }) }
  12295. })
  12296. })
  12297. )
  12298. )
  12299. }
  12300. }
  12301. function Qs(e, t) {
  12302. var i = (t = void 0 === t ? {} : t),
  12303. n = void 0 === (a = i.manifestUri) ? '' : a,
  12304. t = void 0 === (r = i.NOW) ? Date.now() : r,
  12305. r = void 0 === (a = i.clientOffset) ? 0 : a
  12306. if (!(i = Vs(e, 'Period')).length) throw new Error(lo)
  12307. var a = Vs(e, 'Location'),
  12308. s = zs(e),
  12309. e = Xs([n], Vs(e, 'BaseURL'))
  12310. ;(s.type = s.type || 'static'), (s.sourceDuration = s.mediaPresentationDuration || 0), (s.NOW = t), (s.clientOffset = r), a.length && (s.locations = a.map(Ws))
  12311. var o,
  12312. u,
  12313. l = []
  12314. return (
  12315. i.forEach(function (e, t) {
  12316. var i,
  12317. n = zs(e),
  12318. r = l[t - 1]
  12319. ;(n.start =
  12320. ((i = { attributes: n, priorPeriodAttributes: r ? r.attributes : null, mpdType: s.type }),
  12321. (t = i.attributes),
  12322. (r = i.priorPeriodAttributes),
  12323. (i = i.mpdType),
  12324. 'number' == typeof t.start ? t.start : r && 'number' == typeof r.start && 'number' == typeof r.duration ? r.start + r.duration : r || 'static' !== i ? null : 0)),
  12325. l.push({ node: e, attributes: n })
  12326. }),
  12327. {
  12328. locations: s.locations,
  12329. representationInfo: gs(
  12330. l.map(
  12331. ((o = s),
  12332. (u = e),
  12333. function (e, t) {
  12334. var i = Xs(u, Vs(e.node, 'BaseURL')),
  12335. n = fs(o, { periodStart: e.attributes.start })
  12336. 'number' == typeof e.attributes.duration && (n.periodDuration = e.attributes.duration)
  12337. var r = Vs(e.node, 'AdaptationSet'),
  12338. e = Ks(e.node)
  12339. return gs(r.map(Ys(n, i, e)))
  12340. })
  12341. )
  12342. ),
  12343. }
  12344. )
  12345. }
  12346. function $s(e) {
  12347. if ('' === e) throw new Error(co)
  12348. var t,
  12349. i,
  12350. n = new uo()
  12351. try {
  12352. i = (t = n.parseFromString(e, 'application/xml')) && 'MPD' === t.documentElement.tagName ? t.documentElement : null
  12353. } catch (e) {}
  12354. if (!i || (i && 0 < i.getElementsByTagName('parsererror').length)) throw new Error(ho)
  12355. return i
  12356. }
  12357. function Js(e, t) {
  12358. void 0 === t && (t = {})
  12359. var i = Qs($s(e), t),
  12360. e = i.representationInfo.map(qs)
  12361. return Us({ dashPlaylists: e, locations: i.locations, sidxMapping: t.sidxMapping, previousManifest: t.previousManifest })
  12362. }
  12363. function Zs(e) {
  12364. return (function (e) {
  12365. e = Vs(e, 'UTCTiming')[0]
  12366. if (!e) return null
  12367. var t = zs(e)
  12368. switch (t.schemeIdUri) {
  12369. case 'urn:mpeg:dash:utc:http-head:2014':
  12370. case 'urn:mpeg:dash:utc:http-head:2012':
  12371. t.method = 'HEAD'
  12372. break
  12373. case 'urn:mpeg:dash:utc:http-xsdate:2014':
  12374. case 'urn:mpeg:dash:utc:http-iso:2014':
  12375. case 'urn:mpeg:dash:utc:http-xsdate:2012':
  12376. case 'urn:mpeg:dash:utc:http-iso:2012':
  12377. t.method = 'GET'
  12378. break
  12379. case 'urn:mpeg:dash:utc:direct:2014':
  12380. case 'urn:mpeg:dash:utc:direct:2012':
  12381. ;(t.method = 'DIRECT'), (t.value = Date.parse(t.value))
  12382. break
  12383. case 'urn:mpeg:dash:utc:http-ntp:2014':
  12384. case 'urn:mpeg:dash:utc:ntp:2014':
  12385. case 'urn:mpeg:dash:utc:sntp:2014':
  12386. default:
  12387. throw new Error(mo)
  12388. }
  12389. return t
  12390. })($s(e))
  12391. }
  12392. function eo(e, t) {
  12393. return (
  12394. void 0 === t && (t = 0),
  12395. (e = br(e)).length - t < 10 || !wr(e, Eo, { offset: t })
  12396. ? t
  12397. : eo(
  12398. e,
  12399. (t += (function (e, t) {
  12400. void 0 === t && (t = 0)
  12401. var i = (e = br(e))[t + 5],
  12402. t = (e[t + 6] << 21) | (e[t + 7] << 14) | (e[t + 8] << 7) | e[t + 9]
  12403. return (16 & i) >> 4 ? 20 + t : 10 + t
  12404. })(e, t))
  12405. )
  12406. )
  12407. }
  12408. function to(e) {
  12409. return 'string' == typeof e ? Sr(e) : e
  12410. }
  12411. function io(e, t, i) {
  12412. var n
  12413. void 0 === i && (i = !1), (n = t), (t = Array.isArray(n) ? n.map(to) : [to(n)]), (e = br(e))
  12414. var r = []
  12415. if (!t.length) return r
  12416. for (var a = 0; a < e.length; ) {
  12417. var s = ((e[a] << 24) | (e[a + 1] << 16) | (e[a + 2] << 8) | e[a + 3]) >>> 0,
  12418. o = e.subarray(a + 4, a + 8)
  12419. if (0 == s) break
  12420. var u = a + s
  12421. if (u > e.length) {
  12422. if (i) break
  12423. u = e.length
  12424. }
  12425. s = e.subarray(a + 8, u)
  12426. wr(o, t[0]) && (1 === t.length ? r.push(s) : r.push.apply(r, io(s, t.slice(1), i))), (a = u)
  12427. }
  12428. return r
  12429. }
  12430. function no(e, t, i, n) {
  12431. void 0 === i && (i = !0), void 0 === n && (n = !1)
  12432. var r = (function (e) {
  12433. for (var t = 1, i = 0; i < Co.length && !(e & Co[i]); i++) t++
  12434. return t
  12435. })(e[t]),
  12436. a = e.subarray(t, t + r)
  12437. return (
  12438. i && ((a = Array.prototype.slice.call(e, t, t + r))[0] ^= Co[r - 1]),
  12439. {
  12440. length: r,
  12441. value: (function (n, e) {
  12442. var t = void 0 === e ? {} : e,
  12443. e = t.signed,
  12444. e = void 0 !== e && e,
  12445. t = t.le,
  12446. r = void 0 !== t && t
  12447. n = br(n)
  12448. ;(t = r ? 'reduce' : 'reduceRight'),
  12449. (t = (n[t] || Array.prototype[t]).call(
  12450. n,
  12451. function (e, t, i) {
  12452. i = r ? i : Math.abs(i + 1 - n.length)
  12453. return e + Rr(t) * Nr[i]
  12454. },
  12455. Rr(0)
  12456. ))
  12457. return !e || ((e = Nr[n.length] / Rr(2) - Rr(1)) < (t = Rr(t)) && ((t -= e), (t -= e), (t -= Rr(2)))), Number(t)
  12458. })(a, { signed: n }),
  12459. bytes: a,
  12460. }
  12461. )
  12462. }
  12463. function ro(e) {
  12464. return 'string' == typeof e ? e.match(/.{1,2}/g).map(ro) : 'number' == typeof e ? Tr(e) : e
  12465. }
  12466. function ao(e, t, i) {
  12467. if (i >= t.length) return t.length
  12468. var n = no(t, i, !1)
  12469. if (wr(e.bytes, n.bytes)) return i
  12470. var r = no(t, i + n.length)
  12471. return ao(e, t, i + r.length + r.value + n.length)
  12472. }
  12473. function so(e, t) {
  12474. var i
  12475. ;(i = t), (t = Array.isArray(i) ? i.map(ro) : [ro(i)]), (e = br(e))
  12476. var n = []
  12477. if (!t.length) return n
  12478. for (var r = 0; r < e.length; ) {
  12479. var a = no(e, r, !1),
  12480. s = no(e, r + a.length),
  12481. o = r + a.length + s.length
  12482. 127 === s.value && ((s.value = ao(a, e, o)), s.value !== e.length && (s.value -= o))
  12483. var u = o + s.value > e.length ? e.length : o + s.value,
  12484. u = e.subarray(o, u)
  12485. wr(t[0], a.bytes) && (1 === t.length ? n.push(u) : (n = n.concat(so(u, t.slice(1))))), (r += a.length + s.length + u.length)
  12486. }
  12487. return n
  12488. }
  12489. function oo(e, t, i, n) {
  12490. void 0 === n && (n = 1 / 0), (e = br(e)), (i = [].concat(i))
  12491. for (var r, a = 0, s = 0; a < e.length && (s < n || r); ) {
  12492. var o = void 0
  12493. if ((wr(e.subarray(a), Io) ? (o = 4) : wr(e.subarray(a), xo) && (o = 3), o)) {
  12494. if ((s++, r))
  12495. return (function (e) {
  12496. for (var t = [], i = 1; i < e.length - 2; ) wr(e.subarray(i, i + 3), Ao) && (t.push(i + 2), i++), i++
  12497. if (0 === t.length) return e
  12498. for (var n = e.length - t.length, r = new Uint8Array(n), a = 0, i = 0; i < n; a++, i++) a === t[0] && (a++, t.shift()), (r[i] = e[a])
  12499. return r
  12500. })(e.subarray(r, a))
  12501. var u = void 0
  12502. 'h264' === t ? (u = 31 & e[a + o]) : 'h265' === t && (u = (e[a + o] >> 1) & 63), -1 !== i.indexOf(u) && (r = a + o), (a += o + ('h264' === t ? 1 : 2))
  12503. } else a++
  12504. }
  12505. return e.subarray(0, 0)
  12506. }
  12507. var uo = { __DOMHandler: us, DOMParser: os, DOMImplementation: U.DOMImplementation, XMLSerializer: U.XMLSerializer }.DOMParser,
  12508. lo = 'INVALID_NUMBER_OF_PERIOD',
  12509. co = 'DASH_EMPTY_MANIFEST',
  12510. ho = 'DASH_INVALID_XML',
  12511. po = 'NO_BASE_URL',
  12512. fo = 'SEGMENT_TIME_UNSPECIFIED',
  12513. mo = 'UNSUPPORTED_UTC_TIMING_SCHEME',
  12514. go = {
  12515. static: function (e) {
  12516. var t = e.duration,
  12517. i = e.timescale,
  12518. n = void 0 === i ? 1 : i,
  12519. r = e.sourceDuration,
  12520. i = e.periodDuration,
  12521. e = bs(e.endNumber),
  12522. n = t / n
  12523. return 'number' == typeof e ? { start: 0, end: e } : 'number' == typeof i ? { start: 0, end: i / n } : { start: 0, end: r / n }
  12524. },
  12525. dynamic: function (e) {
  12526. var t = e.NOW,
  12527. i = e.clientOffset,
  12528. n = e.availabilityStartTime,
  12529. r = e.timescale,
  12530. a = void 0 === r ? 1 : r,
  12531. s = e.duration,
  12532. o = e.periodStart,
  12533. u = void 0 === o ? 0 : o,
  12534. r = e.minimumUpdatePeriod,
  12535. o = void 0 === r ? 0 : r,
  12536. r = e.timeShiftBufferDepth,
  12537. r = void 0 === r ? 1 / 0 : r,
  12538. e = bs(e.endNumber),
  12539. i = (t + i) / 1e3,
  12540. u = n + u,
  12541. o = Math.ceil(((i + o - u) * a) / s),
  12542. r = Math.floor(((i - u - r) * a) / s),
  12543. s = Math.floor(((i - u) * a) / s)
  12544. return { start: Math.max(0, r), end: 'number' == typeof e ? e : Math.min(o, s) }
  12545. },
  12546. },
  12547. yo = ['AUDIO', 'SUBTITLES'],
  12548. vo = /\$([A-z]*)(?:(%0)([0-9]+)d)?\$/g,
  12549. _o = {
  12550. mediaPresentationDuration: Gs,
  12551. availabilityStartTime: function (e) {
  12552. return /^\d+-\d+-\d+T\d+:\d+:\d+(\.\d+)?$/.test((e = e)) && (e += 'Z'), Date.parse(e) / 1e3
  12553. },
  12554. minimumUpdatePeriod: Gs,
  12555. suggestedPresentationDelay: Gs,
  12556. type: function (e) {
  12557. return e
  12558. },
  12559. timeShiftBufferDepth: Gs,
  12560. start: Gs,
  12561. width: function (e) {
  12562. return parseInt(e, 10)
  12563. },
  12564. height: function (e) {
  12565. return parseInt(e, 10)
  12566. },
  12567. bandwidth: function (e) {
  12568. return parseInt(e, 10)
  12569. },
  12570. startNumber: function (e) {
  12571. return parseInt(e, 10)
  12572. },
  12573. timescale: function (e) {
  12574. return parseInt(e, 10)
  12575. },
  12576. presentationTimeOffset: function (e) {
  12577. return parseInt(e, 10)
  12578. },
  12579. duration: function (e) {
  12580. var t = parseInt(e, 10)
  12581. return isNaN(t) ? Gs(e) : t
  12582. },
  12583. d: function (e) {
  12584. return parseInt(e, 10)
  12585. },
  12586. t: function (e) {
  12587. return parseInt(e, 10)
  12588. },
  12589. r: function (e) {
  12590. return parseInt(e, 10)
  12591. },
  12592. DEFAULT: function (e) {
  12593. return e
  12594. },
  12595. },
  12596. bo = {
  12597. 'urn:uuid:1077efec-c0b2-4d02-ace3-3c1e52e2fb4b': 'org.w3.clearkey',
  12598. 'urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed': 'com.widevine.alpha',
  12599. 'urn:uuid:9a04f079-9840-4286-ab92-e65be0885f95': 'com.microsoft.playready',
  12600. 'urn:uuid:f239e769-efa3-4850-9c16-a903c6932efb': 'com.adobe.primetime',
  12601. },
  12602. To = Math.pow(2, 32),
  12603. So = function (e) {
  12604. var t = new DataView(e.buffer, e.byteOffset, e.byteLength)
  12605. return t.getBigUint64 ? ((e = t.getBigUint64(0)) < Number.MAX_SAFE_INTEGER ? Number(e) : e) : t.getUint32(0) * To + t.getUint32(4)
  12606. },
  12607. wo = function (e) {
  12608. var t = new DataView(e.buffer, e.byteOffset, e.byteLength),
  12609. i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), references: [], referenceId: t.getUint32(4), timescale: t.getUint32(8) },
  12610. n = 12
  12611. 0 === i.version
  12612. ? ((i.earliestPresentationTime = t.getUint32(n)), (i.firstOffset = t.getUint32(n + 4)), (n += 8))
  12613. : ((i.earliestPresentationTime = So(e.subarray(n))), (i.firstOffset = So(e.subarray(n + 8))), (n += 16))
  12614. var r = t.getUint16((n += 2))
  12615. for (n += 2; 0 < r; n += 12, r--)
  12616. i.references.push({
  12617. referenceType: (128 & e[n]) >>> 7,
  12618. referencedSize: 2147483647 & t.getUint32(n),
  12619. subsegmentDuration: t.getUint32(n + 4),
  12620. startsWithSap: !!(128 & e[n + 8]),
  12621. sapType: (112 & e[n + 8]) >>> 4,
  12622. sapDeltaTime: 268435455 & t.getUint32(n + 8),
  12623. })
  12624. return i
  12625. },
  12626. Eo = br([73, 68, 51]),
  12627. ko = {
  12628. EBML: br([26, 69, 223, 163]),
  12629. DocType: br([66, 130]),
  12630. Segment: br([24, 83, 128, 103]),
  12631. SegmentInfo: br([21, 73, 169, 102]),
  12632. Tracks: br([22, 84, 174, 107]),
  12633. Track: br([174]),
  12634. TrackNumber: br([215]),
  12635. DefaultDuration: br([35, 227, 131]),
  12636. TrackEntry: br([174]),
  12637. TrackType: br([131]),
  12638. FlagDefault: br([136]),
  12639. CodecID: br([134]),
  12640. CodecPrivate: br([99, 162]),
  12641. VideoTrack: br([224]),
  12642. AudioTrack: br([225]),
  12643. Cluster: br([31, 67, 182, 117]),
  12644. Timestamp: br([231]),
  12645. TimestampScale: br([42, 215, 177]),
  12646. BlockGroup: br([160]),
  12647. BlockDuration: br([155]),
  12648. Block: br([161]),
  12649. SimpleBlock: br([163]),
  12650. },
  12651. Co = [128, 64, 32, 16, 8, 4, 2, 1],
  12652. Io = br([0, 0, 0, 1]),
  12653. xo = br([0, 0, 1]),
  12654. Ao = br([0, 0, 3]),
  12655. Po = {
  12656. webm: br([119, 101, 98, 109]),
  12657. matroska: br([109, 97, 116, 114, 111, 115, 107, 97]),
  12658. flac: br([102, 76, 97, 67]),
  12659. ogg: br([79, 103, 103, 83]),
  12660. ac3: br([11, 119]),
  12661. riff: br([82, 73, 70, 70]),
  12662. avi: br([65, 86, 73]),
  12663. wav: br([87, 65, 86, 69]),
  12664. '3gp': br([102, 116, 121, 112, 51, 103]),
  12665. mp4: br([102, 116, 121, 112]),
  12666. fmp4: br([115, 116, 121, 112]),
  12667. mov: br([102, 116, 121, 112, 113, 116]),
  12668. moov: br([109, 111, 111, 118]),
  12669. moof: br([109, 111, 111, 102]),
  12670. },
  12671. Lo = {
  12672. aac: function (e) {
  12673. var t = eo(e)
  12674. return wr(e, [255, 16], { offset: t, mask: [255, 22] })
  12675. },
  12676. mp3: function (e) {
  12677. var t = eo(e)
  12678. return wr(e, [255, 2], { offset: t, mask: [255, 6] })
  12679. },
  12680. webm: function (e) {
  12681. e = so(e, [ko.EBML, ko.DocType])[0]
  12682. return wr(e, Po.webm)
  12683. },
  12684. mkv: function (e) {
  12685. e = so(e, [ko.EBML, ko.DocType])[0]
  12686. return wr(e, Po.matroska)
  12687. },
  12688. mp4: function (e) {
  12689. return (
  12690. !Lo['3gp'](e) && !Lo.mov(e) && (!(!wr(e, Po.mp4, { offset: 4 }) && !wr(e, Po.fmp4, { offset: 4 })) || !(!wr(e, Po.moof, { offset: 4 }) && !wr(e, Po.moov, { offset: 4 })) || void 0)
  12691. )
  12692. },
  12693. mov: function (e) {
  12694. return wr(e, Po.mov, { offset: 4 })
  12695. },
  12696. '3gp': function (e) {
  12697. return wr(e, Po['3gp'], { offset: 4 })
  12698. },
  12699. ac3: function (e) {
  12700. var t = eo(e)
  12701. return wr(e, Po.ac3, { offset: t })
  12702. },
  12703. ts: function (e) {
  12704. if (e.length < 189 && 1 <= e.length) return 71 === e[0]
  12705. for (var t = 0; t + 188 < e.length && t < 188; ) {
  12706. if (71 === e[t] && 71 === e[t + 188]) return !0
  12707. t += 1
  12708. }
  12709. return !1
  12710. },
  12711. flac: function (e) {
  12712. var t = eo(e)
  12713. return wr(e, Po.flac, { offset: t })
  12714. },
  12715. ogg: function (e) {
  12716. return wr(e, Po.ogg)
  12717. },
  12718. avi: function (e) {
  12719. return wr(e, Po.riff) && wr(e, Po.avi, { offset: 8 })
  12720. },
  12721. wav: function (e) {
  12722. return wr(e, Po.riff) && wr(e, Po.wav, { offset: 8 })
  12723. },
  12724. h264: function (e) {
  12725. return oo(e, 'h264', 7, 3).length
  12726. },
  12727. h265: function (e) {
  12728. return oo(e, 'h265', [32, 33], 3).length
  12729. },
  12730. },
  12731. Do = Object.keys(Lo)
  12732. .filter(function (e) {
  12733. return 'ts' !== e && 'h264' !== e && 'h265' !== e
  12734. })
  12735. .concat(['ts', 'h264', 'h265'])
  12736. Do.forEach(function (e) {
  12737. var t = Lo[e]
  12738. Lo[e] = function (e) {
  12739. return t(br(e))
  12740. }
  12741. })
  12742. function Oo(e) {
  12743. e = br(e)
  12744. for (var t = 0; t < Do.length; t++) {
  12745. var i = Do[t]
  12746. if (dl[i](e)) return i
  12747. }
  12748. return ''
  12749. }
  12750. function Mo(e, t, i) {
  12751. return e && i && i.responseURL && t !== i.responseURL ? i.responseURL : t
  12752. }
  12753. function Ro(e) {
  12754. return tr.log.debug ? tr.log.debug.bind(tr, 'VHS:', e + ' >') : function () {}
  12755. }
  12756. function No(e, t) {
  12757. var i,
  12758. n = []
  12759. if (e && e.length) for (i = 0; i < e.length; i++) t(e.start(i), e.end(i)) && n.push([e.start(i), e.end(i)])
  12760. return tr.createTimeRanges(n)
  12761. }
  12762. function Uo(e, i) {
  12763. return No(e, function (e, t) {
  12764. return e - 0.1 <= i && i <= t + 0.1
  12765. })
  12766. }
  12767. function Bo(e, t) {
  12768. return No(e, function (e) {
  12769. return t <= e - fl
  12770. })
  12771. }
  12772. function Fo(e) {
  12773. var t = []
  12774. if (!e || !e.length) return ''
  12775. for (var i = 0; i < e.length; i++) t.push(e.start(i) + ' => ' + e.end(i))
  12776. return t.join(', ')
  12777. }
  12778. function jo(e) {
  12779. for (var t = [], i = 0; i < e.length; i++) t.push({ start: e.start(i), end: e.end(i) })
  12780. return t
  12781. }
  12782. function Ho(e) {
  12783. if (e && e.length && e.end) return e.end(e.length - 1)
  12784. }
  12785. function qo(e, t) {
  12786. var i = 0
  12787. if (!e || !e.length) return i
  12788. for (var n = 0; n < e.length; n++) {
  12789. var r = e.start(n),
  12790. a = e.end(n)
  12791. a < t || (i += r < t && t <= a ? a - t : a - r)
  12792. }
  12793. return i
  12794. }
  12795. function Vo(t, e) {
  12796. if (!e.preload) return e.duration
  12797. var i = 0
  12798. return (
  12799. (e.parts || []).forEach(function (e) {
  12800. i += e.duration
  12801. }),
  12802. (e.preloadHints || []).forEach(function (e) {
  12803. 'PART' === e.type && (i += t.partTargetDuration)
  12804. }),
  12805. i
  12806. )
  12807. }
  12808. function Wo(e) {
  12809. return (e.segments || []).reduce(function (i, n, r) {
  12810. return (
  12811. n.parts
  12812. ? n.parts.forEach(function (e, t) {
  12813. i.push({ duration: e.duration, segmentIndex: r, partIndex: t, part: e, segment: n })
  12814. })
  12815. : i.push({ duration: n.duration, segmentIndex: r, partIndex: null, segment: n, part: null }),
  12816. i
  12817. )
  12818. }, [])
  12819. }
  12820. function Go(e) {
  12821. return ((e = e.segments && e.segments.length && e.segments[e.segments.length - 1]) && e.parts) || []
  12822. }
  12823. function zo(e) {
  12824. var t = e.preloadSegment
  12825. if (t) {
  12826. ;(e = t.parts),
  12827. (t = (t.preloadHints || []).reduce(function (e, t) {
  12828. return e + ('PART' === t.type ? 1 : 0)
  12829. }, 0))
  12830. return (t += e && e.length ? e.length : 0)
  12831. }
  12832. }
  12833. function Xo(e, t) {
  12834. return t.endList
  12835. ? 0
  12836. : e && e.suggestedPresentationDelay
  12837. ? e.suggestedPresentationDelay
  12838. : (e = 0 < Go(t).length) && t.serverControl && t.serverControl.partHoldBack
  12839. ? t.serverControl.partHoldBack
  12840. : e && t.partTargetDuration
  12841. ? 3 * t.partTargetDuration
  12842. : t.serverControl && t.serverControl.holdBack
  12843. ? t.serverControl.holdBack
  12844. : t.targetDuration
  12845. ? 3 * t.targetDuration
  12846. : 0
  12847. }
  12848. function Ko(e, t, i) {
  12849. if ((t = 'undefined' == typeof t ? e.mediaSequence + e.segments.length : t) < e.mediaSequence) return 0
  12850. var n = (function (e, t) {
  12851. var i = 0,
  12852. n = t - e.mediaSequence,
  12853. r = e.segments[n]
  12854. if (r) {
  12855. if ('undefined' != typeof r.start) return { result: r.start, precise: !0 }
  12856. if ('undefined' != typeof r.end) return { result: r.end - r.duration, precise: !0 }
  12857. }
  12858. for (; n--; ) {
  12859. if ('undefined' != typeof (r = e.segments[n]).end) return { result: i + r.end, precise: !0 }
  12860. if (((i += Vo(e, r)), 'undefined' != typeof r.start)) return { result: i + r.start, precise: !0 }
  12861. }
  12862. return { result: i, precise: !1 }
  12863. })(e, t)
  12864. return n.precise
  12865. ? n.result
  12866. : (t = (function (e, t) {
  12867. for (var i, n = 0, r = t - e.mediaSequence; r < e.segments.length; r++) {
  12868. if ('undefined' != typeof (i = e.segments[r]).start) return { result: i.start - n, precise: !0 }
  12869. if (((n += Vo(e, i)), 'undefined' != typeof i.end)) return { result: i.end - n, precise: !0 }
  12870. }
  12871. return { result: -1, precise: !1 }
  12872. })(e, t)).precise
  12873. ? t.result
  12874. : n.result + i
  12875. }
  12876. function Yo(e, t, i) {
  12877. if (!e) return 0
  12878. if (('number' != typeof i && (i = 0), 'undefined' == typeof t)) {
  12879. if (e.totalDuration) return e.totalDuration
  12880. if (!e.endList) return window.Infinity
  12881. }
  12882. return Ko(e, t, i)
  12883. }
  12884. function Qo(e) {
  12885. var t = e.defaultDuration,
  12886. i = e.durationList,
  12887. n = e.startIndex,
  12888. r = e.endIndex,
  12889. a = 0
  12890. if ((r < n && ((n = (e = [r, n])[0]), (r = e[1])), n < 0)) {
  12891. for (var s = n; s < Math.min(0, r); s++) a += t
  12892. n = 0
  12893. }
  12894. for (var o = n; o < r; o++) a += i[o].duration
  12895. return a
  12896. }
  12897. function $o(e, t, i, n) {
  12898. return e && e.segments
  12899. ? e.endList
  12900. ? Yo(e)
  12901. : null === t
  12902. ? null
  12903. : ((t = Ko(e, e.mediaSequence + e.segments.length, (t = t || 0))), i && (t -= n = 'number' == typeof n ? n : Xo(null, e)), Math.max(0, t))
  12904. : null
  12905. }
  12906. function Jo(e) {
  12907. return e.excludeUntil && e.excludeUntil > Date.now()
  12908. }
  12909. function Zo(e) {
  12910. return e.excludeUntil && e.excludeUntil === 1 / 0
  12911. }
  12912. function eu(e) {
  12913. var t = Jo(e)
  12914. return !e.disabled && !t
  12915. }
  12916. function tu(e, t) {
  12917. return t.attributes && t.attributes[e]
  12918. }
  12919. function iu(e, t) {
  12920. if (1 === e.playlists.length) return !0
  12921. var i = t.attributes.BANDWIDTH || Number.MAX_VALUE
  12922. return (
  12923. 0 ===
  12924. e.playlists.filter(function (e) {
  12925. return !!eu(e) && (e.attributes.BANDWIDTH || 0) < i
  12926. }).length
  12927. )
  12928. }
  12929. function nu(e, t) {
  12930. return (
  12931. !((!e && !t) || (!e && t) || (e && !t)) &&
  12932. (e === t || !(!e.id || !t.id || e.id !== t.id) || !(!e.resolvedUri || !t.resolvedUri || e.resolvedUri !== t.resolvedUri) || !(!e.uri || !t.uri || e.uri !== t.uri))
  12933. )
  12934. }
  12935. function ru(e, t) {
  12936. var i,
  12937. n = (e && e.mediaGroups && e.mediaGroups.AUDIO) || {},
  12938. r = !1
  12939. for (i in n) {
  12940. for (var a in n[i]) if ((r = t(n[i][a]))) break
  12941. if (r) break
  12942. }
  12943. return !!r
  12944. }
  12945. function au(i) {
  12946. if (!i || !i.playlists || !i.playlists.length)
  12947. return ru(i, function (e) {
  12948. return (e.playlists && e.playlists.length) || e.uri
  12949. })
  12950. for (var e = 0; e < i.playlists.length; e++) {
  12951. var t = (function (e) {
  12952. var t = i.playlists[e],
  12953. e = t.attributes && t.attributes.CODECS
  12954. return (e && e.split(',').every(fr)) ||
  12955. ru(i, function (e) {
  12956. return nu(t, e)
  12957. })
  12958. ? 'continue'
  12959. : { v: !1 }
  12960. })(e)
  12961. if ('continue' !== t && 'object' == typeof t) return t.v
  12962. }
  12963. return !0
  12964. }
  12965. function su(e, t) {
  12966. return e + '-' + t
  12967. }
  12968. function ou(r, a) {
  12969. r.mediaGroups &&
  12970. ['AUDIO', 'SUBTITLES'].forEach(function (e) {
  12971. if (r.mediaGroups[e])
  12972. for (var t in r.mediaGroups[e])
  12973. for (var i in r.mediaGroups[e][t]) {
  12974. var n = r.mediaGroups[e][t][i]
  12975. a(n, e, t, i)
  12976. }
  12977. })
  12978. }
  12979. function uu(e) {
  12980. var t = e.playlist,
  12981. i = e.uri,
  12982. e = e.id
  12983. ;(t.id = e), (t.playlistErrors_ = 0), i && (t.uri = i), (t.attributes = t.attributes || {})
  12984. }
  12985. function lu(o, e) {
  12986. o.uri = e
  12987. for (var t = 0; t < o.playlists.length; t++) o.playlists[t].uri || (o.playlists[t].uri = 'placeholder-uri-' + t)
  12988. var i,
  12989. u = au(o)
  12990. ou(o, function (e, t, i, n) {
  12991. var r = 'placeholder-uri-' + t + '-' + i + '-' + n
  12992. if (!e.playlists || !e.playlists.length) {
  12993. if (u && 'AUDIO' === t && !e.uri)
  12994. for (var a = 0; a < o.playlists.length; a++) {
  12995. var s = o.playlists[a]
  12996. if (s.attributes && s.attributes.AUDIO && s.attributes.AUDIO === i) return
  12997. }
  12998. e.playlists = [g({}, e)]
  12999. }
  13000. e.playlists.forEach(function (e, t) {
  13001. var i = su(t, r)
  13002. e.uri ? (e.resolvedUri = e.resolvedUri || pl(o.uri, e.uri)) : ((e.uri = 0 === t ? r : i), (e.resolvedUri = e.uri)),
  13003. (e.id = e.id || i),
  13004. (e.attributes = e.attributes || {}),
  13005. (o.playlists[e.id] = e),
  13006. (o.playlists[e.uri] = e)
  13007. })
  13008. }),
  13009. (function (e) {
  13010. for (var t = e.playlists.length; t--; ) {
  13011. var i = e.playlists[t]
  13012. uu({ playlist: i, id: su(t, i.uri) }),
  13013. (i.resolvedUri = pl(e.uri, i.uri)),
  13014. (e.playlists[i.id] = i),
  13015. (e.playlists[i.uri] = i).attributes.BANDWIDTH || yl.warn('Invalid playlist STREAM-INF detected. Missing BANDWIDTH attribute.')
  13016. }
  13017. })(o),
  13018. ou((i = o), function (e) {
  13019. e.uri && (e.resolvedUri = pl(i.uri, e.uri))
  13020. })
  13021. }
  13022. function cu(e, t, i) {
  13023. var n = e.slice(),
  13024. r = t.slice()
  13025. i = i || 0
  13026. for (var a, s = [], o = 0; o < r.length; o++) {
  13027. var u = n[o + i],
  13028. l = r[o]
  13029. u
  13030. ? ((a = u.map || a),
  13031. s.push(
  13032. (function (e, t) {
  13033. if (!e) return t
  13034. var i = vl(e, t)
  13035. if ((e.preloadHints && !t.preloadHints && delete i.preloadHints, e.parts && !t.parts)) delete i.parts
  13036. else if (e.parts && t.parts) for (var n = 0; n < t.parts.length; n++) e.parts && e.parts[n] && (i.parts[n] = vl(e.parts[n], t.parts[n]))
  13037. return !e.skipped && t.skipped && (i.skipped = !1), e.preload && !t.preload && (i.preload = !1), i
  13038. })(u, l)
  13039. ))
  13040. : (a && !l.map && (l.map = a), s.push(l))
  13041. }
  13042. return s
  13043. }
  13044. function du(e, t) {
  13045. !e.resolvedUri && e.uri && (e.resolvedUri = pl(t, e.uri)),
  13046. e.key && !e.key.resolvedUri && (e.key.resolvedUri = pl(t, e.key.uri)),
  13047. e.map && !e.map.resolvedUri && (e.map.resolvedUri = pl(t, e.map.uri)),
  13048. e.map && e.map.key && !e.map.key.resolvedUri && (e.map.key.resolvedUri = pl(t, e.map.key.uri)),
  13049. e.parts &&
  13050. e.parts.length &&
  13051. e.parts.forEach(function (e) {
  13052. e.resolvedUri || (e.resolvedUri = pl(t, e.uri))
  13053. }),
  13054. e.preloadHints &&
  13055. e.preloadHints.length &&
  13056. e.preloadHints.forEach(function (e) {
  13057. e.resolvedUri || (e.resolvedUri = pl(t, e.uri))
  13058. })
  13059. }
  13060. function hu(e) {
  13061. var t = e.segments || [],
  13062. i = e.preloadSegment
  13063. if (i && i.parts && i.parts.length) {
  13064. if (i.preloadHints) for (var n = 0; n < i.preloadHints.length; n++) if ('MAP' === i.preloadHints[n].type) return t
  13065. ;(i.duration = e.targetDuration), (i.preload = !0), t.push(i)
  13066. }
  13067. return t
  13068. }
  13069. function pu(e, t) {
  13070. return (
  13071. e === t || (e.segments && t.segments && e.segments.length === t.segments.length && e.endList === t.endList && e.mediaSequence === t.mediaSequence && e.preloadSegment === t.preloadSegment)
  13072. )
  13073. }
  13074. function fu(e, a, t) {
  13075. void 0 === t && (t = pu)
  13076. var i = vl(e, {}),
  13077. n = i.playlists[a.id]
  13078. if (!n) return null
  13079. if (t(n, a)) return null
  13080. a.segments = hu(a)
  13081. var s = vl(n, a)
  13082. if ((s.preloadSegment && !a.preloadSegment && delete s.preloadSegment, n.segments)) {
  13083. if (a.skip) {
  13084. a.segments = a.segments || []
  13085. for (var r = 0; r < a.skip.skippedSegments; r++) a.segments.unshift({ skipped: !0 })
  13086. }
  13087. s.segments = cu(n.segments, a.segments, a.mediaSequence - n.mediaSequence)
  13088. }
  13089. s.segments.forEach(function (e) {
  13090. du(e, s.resolvedUri)
  13091. })
  13092. for (var o = 0; o < i.playlists.length; o++) i.playlists[o].id === a.id && (i.playlists[o] = s)
  13093. return (
  13094. (i.playlists[a.id] = s),
  13095. (i.playlists[a.uri] = s),
  13096. ou(e, function (e, t, i, n) {
  13097. if (e.playlists) for (var r = 0; r < e.playlists.length; r++) a.id === e.playlists[r].id && (e.playlists[r] = s)
  13098. }),
  13099. i
  13100. )
  13101. }
  13102. function mu(e, t) {
  13103. var i = e.segments || [],
  13104. n = i[i.length - 1],
  13105. n = ((i = n && n.parts && n.parts[n.parts.length - 1]) && i.duration) || (n && n.duration)
  13106. return t && n ? 1e3 * n : 500 * (e.partTargetDuration || e.targetDuration || 10)
  13107. }
  13108. function gu(e, t, i, n) {
  13109. var r = 'arraybuffer' === e.responseType ? e.response : e.responseText
  13110. !t &&
  13111. r &&
  13112. ((e.responseTime = Date.now()),
  13113. (e.roundTripTime = e.responseTime - e.requestTime),
  13114. (e.bytesReceived = r.byteLength || r.length),
  13115. e.bandwidth || (e.bandwidth = Math.floor((e.bytesReceived / e.roundTripTime) * 8 * 1e3))),
  13116. i.headers && (e.responseHeaders = i.headers),
  13117. t && 'ETIMEDOUT' === t.code && (e.timedout = !0),
  13118. n((t = !t && !e.aborted && 200 !== i.statusCode && 206 !== i.statusCode && 0 !== i.statusCode ? new Error('XHR Failed with a response of: ' + (e && (r || e.responseText))) : t), e)
  13119. }
  13120. function yu() {
  13121. function a(e, i) {
  13122. e = Tl({ timeout: 45e3 }, e)
  13123. var t = a.beforeRequest || tr.Vhs.xhr.beforeRequest
  13124. !t || 'function' != typeof t || ((t = t(e)) && (e = t))
  13125. var n = (!0 === tr.Vhs.xhr.original ? bl : tr.Vhs.xhr)(e, function (e, t) {
  13126. return gu(n, e, t, i)
  13127. }),
  13128. r = n.abort
  13129. return (
  13130. (n.abort = function () {
  13131. return (n.aborted = !0), r.apply(n, arguments)
  13132. }),
  13133. (n.uri = e.uri),
  13134. (n.requestTime = Date.now()),
  13135. n
  13136. )
  13137. }
  13138. return (a.original = !0), a
  13139. }
  13140. function vu(e) {
  13141. var t,
  13142. i = {}
  13143. return (
  13144. e.byterange &&
  13145. (i.Range =
  13146. ((t = e.byterange),
  13147. (e = t.offset),
  13148. (t = 'bigint' == typeof t.offset || 'bigint' == typeof t.length ? window.BigInt(t.offset) + window.BigInt(t.length) - window.BigInt(1) : t.offset + t.length - 1),
  13149. 'bytes=' + e + '-' + t)),
  13150. i
  13151. )
  13152. }
  13153. function _u(e, t) {
  13154. return (e = e.toString(16)), '00'.substring(0, 2 - e.length) + e + (t % 2 ? ' ' : '')
  13155. }
  13156. function bu(e) {
  13157. return 32 <= e && e < 126 ? String.fromCharCode(e) : '.'
  13158. }
  13159. function Tu(i) {
  13160. var n = {}
  13161. return (
  13162. Object.keys(i).forEach(function (e) {
  13163. var t = i[e]
  13164. _r(t) ? (n[e] = { bytes: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength }) : (n[e] = t)
  13165. }),
  13166. n
  13167. )
  13168. }
  13169. function Su(e) {
  13170. var t = e.byterange || { length: 1 / 0, offset: 0 }
  13171. return [t.length, t.offset, e.resolvedUri].join(',')
  13172. }
  13173. function wu(e) {
  13174. return e.resolvedUri
  13175. }
  13176. function Eu(e) {
  13177. for (var t = Array.prototype.slice.call(e), i = '', n = 0; n < t.length / 16; n++)
  13178. i +=
  13179. t
  13180. .slice(16 * n, 16 * n + 16)
  13181. .map(_u)
  13182. .join('') +
  13183. ' ' +
  13184. t
  13185. .slice(16 * n, 16 * n + 16)
  13186. .map(bu)
  13187. .join('') +
  13188. '\n'
  13189. return i
  13190. }
  13191. function ku(e) {
  13192. var t = e.playlist,
  13193. i = e.time,
  13194. n = void 0 === i ? void 0 : i
  13195. if (!(i = e.callback)) throw new Error('getProgramTime: callback must be provided')
  13196. return t && void 0 !== n
  13197. ? (e = (function (e, t) {
  13198. if (!t || !t.segments || 0 === t.segments.length) return null
  13199. for (var i, n = 0, r = 0; r < t.segments.length && !(e <= (n = (i = t.segments[r]).videoTimingInfo ? i.videoTimingInfo.transmuxedPresentationEnd : n + i.duration)); r++);
  13200. var a = t.segments[t.segments.length - 1]
  13201. if (a.videoTimingInfo && a.videoTimingInfo.transmuxedPresentationEnd < e) return null
  13202. if (n < e) {
  13203. if (e > n + 0.25 * a.duration) return null
  13204. i = a
  13205. }
  13206. return { segment: i, estimatedStart: i.videoTimingInfo ? i.videoTimingInfo.transmuxedPresentationStart : n - i.duration, type: i.videoTimingInfo ? 'accurate' : 'estimate' }
  13207. })(n, t))
  13208. ? 'estimate' === e.type
  13209. ? i({ message: 'Accurate programTime could not be determined. Please seek to e.seekTime and try again', seekTime: e.estimatedStart })
  13210. : ((t = { mediaSeconds: n }),
  13211. (e = (function (e, t) {
  13212. if (!t.dateTimeObject) return null
  13213. var i = t.videoTimingInfo.transmuxerPrependedSeconds,
  13214. i = e - (t.videoTimingInfo.transmuxedPresentationStart + i)
  13215. return new Date(t.dateTimeObject.getTime() + 1e3 * i)
  13216. })(n, e.segment)) && (t.programDateTime = e.toISOString()),
  13217. i(null, t))
  13218. : i({ message: 'valid programTime was not found' })
  13219. : i({ message: 'getProgramTime: playlist and time must be provided' })
  13220. }
  13221. function Cu(e) {
  13222. var t = e.programTime,
  13223. i = e.playlist,
  13224. n = e.retryCount,
  13225. r = void 0 === n ? 2 : n,
  13226. a = e.seekTo,
  13227. s = e.pauseAfterSeek,
  13228. o = void 0 === s || s,
  13229. u = e.tech,
  13230. l = e.callback
  13231. if (!l) throw new Error('seekToProgramTime: callback must be provided')
  13232. return 'undefined' != typeof t && i && a
  13233. ? i.endList || u.hasStarted_
  13234. ? (function (e) {
  13235. if (!e.segments || 0 === e.segments.length) return !1
  13236. for (var t = 0; t < e.segments.length; t++) if (!e.segments[t].dateTimeObject) return !1
  13237. return !0
  13238. })(i)
  13239. ? (n = (function (e, t) {
  13240. var i
  13241. try {
  13242. i = new Date(e)
  13243. } catch (e) {
  13244. return null
  13245. }
  13246. if (!t || !t.segments || 0 === t.segments.length) return null
  13247. if (i < (r = t.segments[0]).dateTimeObject) return null
  13248. for (var n = 0; n < t.segments.length - 1; n++) {
  13249. var r = t.segments[n]
  13250. if (i < t.segments[n + 1].dateTimeObject) break
  13251. }
  13252. var a,
  13253. s = t.segments[t.segments.length - 1],
  13254. e = s.dateTimeObject,
  13255. a = s.videoTimingInfo ? (a = s.videoTimingInfo).transmuxedPresentationEnd - a.transmuxedPresentationStart - a.transmuxerPrependedSeconds : s.duration + 0.25 * s.duration
  13256. return new Date(e.getTime() + 1e3 * a) < i
  13257. ? null
  13258. : {
  13259. segment: (r = e < i ? s : r),
  13260. estimatedStart: r.videoTimingInfo ? r.videoTimingInfo.transmuxedPresentationStart : gl.duration(t, t.mediaSequence + t.segments.indexOf(r)),
  13261. type: r.videoTimingInfo ? 'accurate' : 'estimate',
  13262. }
  13263. })(t, i))
  13264. ? ((s = n.segment),
  13265. (e = (function (e, t) {
  13266. var i
  13267. try {
  13268. ;(n = new Date(e)), (i = new Date(t))
  13269. } catch (e) {}
  13270. var n = n.getTime()
  13271. return (i.getTime() - n) / 1e3
  13272. })(s.dateTimeObject, t)),
  13273. 'estimate' === n.type
  13274. ? 0 === r
  13275. ? l({ message: t + ' is not buffered yet. Try again' })
  13276. : (a(n.estimatedStart + e),
  13277. void u.one('seeked', function () {
  13278. Cu({ programTime: t, playlist: i, retryCount: r - 1, seekTo: a, pauseAfterSeek: o, tech: u, callback: l })
  13279. }))
  13280. : ((e = s.start + e),
  13281. u.one('seeked', function () {
  13282. return l(null, u.currentTime())
  13283. }),
  13284. o && u.pause(),
  13285. void a(e)))
  13286. : l({ message: t + ' was not found in the stream' })
  13287. : l({ message: 'programDateTime tags must be provided in the manifest ' + i.resolvedUri })
  13288. : l({ message: 'player must be playing a live stream to start buffering' })
  13289. : l({ message: 'seekToProgramTime: programTime, seekTo and playlist must be provided' })
  13290. }
  13291. function Iu(e, t) {
  13292. if (4 === e.readyState) return t()
  13293. }
  13294. function xu(e, t, r) {
  13295. function n(e, t, i, n) {
  13296. return t.abort(), (o = !0), r(e, t, i, n)
  13297. }
  13298. function i(e, t) {
  13299. if (!o) {
  13300. if (e) return n(e, t, '', s)
  13301. var i = t.responseText.substring((s && s.byteLength) || 0, t.responseText.length)
  13302. if (
  13303. ((s = (function () {
  13304. for (var e = arguments.length, t = new Array(e), i = 0; i < e; i++) t[i] = arguments[i]
  13305. if (
  13306. (t = t.filter(function (e) {
  13307. return e && (e.byteLength || e.length) && 'string' != typeof e
  13308. })).length <= 1
  13309. )
  13310. return br(t[0])
  13311. var n = t.reduce(function (e, t, i) {
  13312. return e + (t.byteLength || t.length)
  13313. }, 0),
  13314. r = new Uint8Array(n),
  13315. a = 0
  13316. return (
  13317. t.forEach(function (e) {
  13318. ;(e = br(e)), r.set(e, a), (a += e.byteLength)
  13319. }),
  13320. r
  13321. )
  13322. })(s, Sr(i, !0))),
  13323. (a = a || eo(s)),
  13324. s.length < 10 || (a && s.length < a + 2))
  13325. )
  13326. return Iu(t, function () {
  13327. return n(e, t, '', s)
  13328. })
  13329. i = Oo(s)
  13330. return ('ts' === i && s.length < 188) || (!i && s.length < 376)
  13331. ? Iu(t, function () {
  13332. return n(e, t, '', s)
  13333. })
  13334. : n(null, t, i, s)
  13335. }
  13336. }
  13337. var a,
  13338. s = [],
  13339. o = !1,
  13340. u = t(
  13341. {
  13342. uri: e,
  13343. beforeSend: function (t) {
  13344. t.overrideMimeType('text/plain; charset=x-user-defined'),
  13345. t.addEventListener('progress', function (e) {
  13346. return e.total, e.loaded, gu(t, null, { statusCode: t.status }, i)
  13347. })
  13348. },
  13349. },
  13350. function (e, t) {
  13351. return gu(u, e, t, i)
  13352. }
  13353. )
  13354. return u
  13355. }
  13356. function Au(e, t) {
  13357. if (!pu(e, t)) return !1
  13358. if (e.sidx && t.sidx && (e.sidx.offset !== t.sidx.offset || e.sidx.length !== t.sidx.length)) return !1
  13359. if ((!e.sidx && t.sidx) || (e.sidx && !t.sidx)) return !1
  13360. if ((e.segments && !t.segments) || (!e.segments && t.segments)) return !1
  13361. if (!e.segments && !t.segments) return !0
  13362. for (var i = 0; i < e.segments.length; i++) {
  13363. var n = e.segments[i],
  13364. r = t.segments[i]
  13365. if (n.uri !== r.uri) return !1
  13366. if (n.byterange || r.byterange) {
  13367. ;(n = n.byterange), (r = r.byterange)
  13368. if ((n && !r) || (!n && r)) return !1
  13369. if (n.offset !== r.offset || n.length !== r.length) return !1
  13370. }
  13371. }
  13372. return !0
  13373. }
  13374. function Pu(e, t) {
  13375. var i,
  13376. n = {}
  13377. for (i in e) {
  13378. var r = e[i].sidx
  13379. if (r) {
  13380. var a = xs(r)
  13381. if (!t[a]) break
  13382. var s = t[a].sidxInfo
  13383. ;(s = s),
  13384. (r = r),
  13385. (Boolean(!s.map && !r.map) || Boolean(s.map && r.map && s.map.byterange.offset === r.map.byterange.offset && s.map.byterange.length === r.map.byterange.length)) &&
  13386. s.uri === r.uri &&
  13387. s.byterange.offset === r.byterange.offset &&
  13388. s.byterange.length === r.byterange.length &&
  13389. (n[a] = t[a])
  13390. }
  13391. }
  13392. return n
  13393. }
  13394. function Lu(e) {
  13395. return (e.on = e.addEventListener), (e.off = e.removeEventListener), e
  13396. }
  13397. function Du(i) {
  13398. var n = i.transmuxer,
  13399. e = i.bytes,
  13400. t = i.audioAppendStart,
  13401. r = i.gopsToAlignWith,
  13402. a = i.remux,
  13403. s = i.onData,
  13404. o = i.onTrackInfo,
  13405. u = i.onAudioTimingInfo,
  13406. l = i.onVideoTimingInfo,
  13407. c = i.onVideoSegmentTimingInfo,
  13408. d = i.onAudioSegmentTimingInfo,
  13409. h = i.onId3,
  13410. p = i.onCaptions,
  13411. f = i.onDone,
  13412. m = i.onEndedTimeline,
  13413. g = i.onTransmuxerLog,
  13414. y = i.isEndOfTimeline,
  13415. v = { buffer: [] },
  13416. _ = y
  13417. ;(n.onmessage = function (e) {
  13418. var t
  13419. n.currentTransmux === i &&
  13420. ('data' === e.data.action &&
  13421. (function (e, t, i) {
  13422. var n = e.data.segment,
  13423. r = n.type,
  13424. a = n.initSegment,
  13425. s = n.captions,
  13426. o = n.captionStreams,
  13427. u = n.metadata,
  13428. l = n.videoFrameDtsTime,
  13429. n = n.videoFramePtsTime
  13430. t.buffer.push({ captions: s, captionStreams: o, metadata: u })
  13431. ;(e = e.data.segment.boxes || { data: e.data.segment.data }),
  13432. (a = { type: r, data: new Uint8Array(e.data, e.data.byteOffset, e.data.byteLength), initSegment: new Uint8Array(a.data, a.byteOffset, a.byteLength) })
  13433. 'undefined' != typeof l && (a.videoFrameDtsTime = l), 'undefined' != typeof n && (a.videoFramePtsTime = n), i(a)
  13434. })(e, v, s),
  13435. 'trackinfo' === e.data.action && o(e.data.trackInfo),
  13436. 'gopInfo' === e.data.action && (v.gopInfo = e.data.gopInfo),
  13437. 'audioTimingInfo' === e.data.action && u(e.data.audioTimingInfo),
  13438. 'videoTimingInfo' === e.data.action && l(e.data.videoTimingInfo),
  13439. 'videoSegmentTimingInfo' === e.data.action && c(e.data.videoSegmentTimingInfo),
  13440. 'audioSegmentTimingInfo' === e.data.action && d(e.data.audioSegmentTimingInfo),
  13441. 'id3Frame' === e.data.action && h([e.data.id3Frame], e.data.id3Frame.dispatchType),
  13442. 'caption' === e.data.action && p(e.data.caption),
  13443. 'endedtimeline' === e.data.action && ((_ = !1), m()),
  13444. 'log' === e.data.action && g(e.data.log),
  13445. 'transmuxed' === e.data.type && (_ || ((n.onmessage = null), (e = (t = { transmuxedData: v, callback: f }).transmuxedData), (t = t.callback), (e.buffer = []), t(e), Cl(n))))
  13446. }),
  13447. t && n.postMessage({ action: 'setAudioAppendStart', appendStart: t }),
  13448. Array.isArray(r) && n.postMessage({ action: 'alignGopsWith', gopsToAlignWith: r }),
  13449. 'undefined' != typeof a && n.postMessage({ action: 'setRemux', remux: a }),
  13450. e.byteLength &&
  13451. ((r = e instanceof ArrayBuffer ? e : e.buffer),
  13452. (a = e instanceof ArrayBuffer ? 0 : e.byteOffset),
  13453. n.postMessage({ action: 'push', data: r, byteOffset: a, byteLength: e.byteLength }, [r])),
  13454. y && n.postMessage({ action: 'endTimeline' }),
  13455. n.postMessage({ action: 'flush' })
  13456. }
  13457. function Ou(e, t) {
  13458. e.postMessage({ action: t }), Cl(e)
  13459. }
  13460. function Mu(e, t) {
  13461. if (!t.currentTransmux) return (t.currentTransmux = e), Ou(t, e), 0
  13462. t.transmuxQueue.push(Ou.bind(null, t, e))
  13463. }
  13464. function Ru(e) {
  13465. if (!e.transmuxer.currentTransmux) return (e.transmuxer.currentTransmux = e), void Du(e)
  13466. e.transmuxer.transmuxQueue.push(e)
  13467. }
  13468. function Nu(i) {
  13469. var n = i.transmuxer,
  13470. r = i.endAction || i.action,
  13471. a = i.callback,
  13472. e = g({}, i, { endAction: null, transmuxer: null, callback: null }),
  13473. t = function e(t) {
  13474. t.data.action === r &&
  13475. (n.removeEventListener('message', e),
  13476. t.data.data && ((t.data.data = new Uint8Array(t.data.data, i.byteOffset || 0, i.byteLength || t.data.data.byteLength)), i.data && (i.data = t.data.data)),
  13477. a(t.data))
  13478. }
  13479. n.addEventListener('message', t),
  13480. i.data
  13481. ? ((t = i.data instanceof ArrayBuffer), (e.byteOffset = t ? 0 : i.data.byteOffset), (e.byteLength = i.data.byteLength), (t = [t ? i.data : i.data.buffer]), n.postMessage(e, t))
  13482. : n.postMessage(e)
  13483. }
  13484. function Uu(e) {
  13485. e.forEach(function (e) {
  13486. e.abort()
  13487. })
  13488. }
  13489. function Bu(e, t) {
  13490. return t.timedout
  13491. ? { status: t.status, message: 'HLS request timed-out at URL: ' + t.uri, code: Pl, xhr: t }
  13492. : t.aborted
  13493. ? { status: t.status, message: 'HLS request aborted at URL: ' + t.uri, code: Ll, xhr: t }
  13494. : e
  13495. ? { status: t.status, message: 'HLS request errored at URL: ' + t.uri, code: Al, xhr: t }
  13496. : 'arraybuffer' === t.responseType && 0 === t.response.byteLength
  13497. ? { status: t.status, message: 'Empty HLS response at URL: ' + t.uri, code: Al, xhr: t }
  13498. : null
  13499. }
  13500. function Fu(a, s, o) {
  13501. return function (e, t) {
  13502. var i = t.response,
  13503. e = Bu(e, t)
  13504. if (e) return o(e, a)
  13505. if (16 !== i.byteLength) return o({ status: t.status, message: 'Invalid HLS key at URL: ' + t.uri, code: Al, xhr: t }, a)
  13506. for (var i = new DataView(i), n = new Uint32Array([i.getUint32(0), i.getUint32(4), i.getUint32(8), i.getUint32(12)]), r = 0; r < s.length; r++) s[r].bytes = n
  13507. return o(null, a)
  13508. }
  13509. }
  13510. function ju(i, n) {
  13511. var e = Oo(i.map.bytes)
  13512. if ('mp4' !== e) {
  13513. var t = i.map.resolvedUri || i.map.uri
  13514. return n({ internal: !0, message: 'Found unsupported ' + (e || 'unknown') + ' container for initialization segment at URL: ' + t, code: Al })
  13515. }
  13516. Nu({
  13517. action: 'probeMp4Tracks',
  13518. data: i.map.bytes,
  13519. transmuxer: i.transmuxer,
  13520. callback: function (e) {
  13521. var t = e.tracks,
  13522. e = e.data
  13523. return (
  13524. (i.map.bytes = e),
  13525. t.forEach(function (e) {
  13526. ;(i.map.tracks = i.map.tracks || {}),
  13527. i.map.tracks[e.type] ||
  13528. ('number' == typeof (i.map.tracks[e.type] = e).id && e.timescale && ((i.map.timescales = i.map.timescales || {}), (i.map.timescales[e.id] = e.timescale)))
  13529. }),
  13530. n(null)
  13531. )
  13532. },
  13533. })
  13534. }
  13535. function Hu(e) {
  13536. var i = e.segment,
  13537. n = e.finishProcessingFn,
  13538. r = e.responseType
  13539. return function (e, t) {
  13540. e = Bu(e, t)
  13541. if (e) return n(e, i)
  13542. e =
  13543. 'arraybuffer' !== r && t.responseText
  13544. ? (function (e) {
  13545. for (var t = new Uint8Array(new ArrayBuffer(e.length)), i = 0; i < e.length; i++) t[i] = e.charCodeAt(i)
  13546. return t.buffer
  13547. })(t.responseText.substring(i.lastReachedChar || 0))
  13548. : t.response
  13549. return (
  13550. (i.stats = { bandwidth: (t = t).bandwidth, bytesReceived: t.bytesReceived || 0, roundTripTime: t.roundTripTime || 0 }),
  13551. i.key ? (i.encryptedBytes = new Uint8Array(e)) : (i.bytes = new Uint8Array(e)),
  13552. n(null, i)
  13553. )
  13554. }
  13555. }
  13556. function qu(e) {
  13557. var i = e.segment,
  13558. t = e.bytes,
  13559. n = e.trackInfoFn,
  13560. r = e.timingInfoFn,
  13561. a = e.videoSegmentTimingInfoFn,
  13562. s = e.audioSegmentTimingInfoFn,
  13563. o = e.id3Fn,
  13564. u = e.captionsFn,
  13565. l = e.isEndOfTimeline,
  13566. c = e.endedTimelineFn,
  13567. d = e.dataFn,
  13568. h = e.doneFn,
  13569. p = e.onTransmuxerLog,
  13570. e = (i.map && i.map.tracks) || {},
  13571. f = Boolean(e.audio && e.video),
  13572. m = r.bind(null, i, 'audio', 'start'),
  13573. g = r.bind(null, i, 'audio', 'end'),
  13574. y = r.bind(null, i, 'video', 'start'),
  13575. v = r.bind(null, i, 'video', 'end')
  13576. Nu({
  13577. action: 'probeTs',
  13578. transmuxer: i.transmuxer,
  13579. data: t,
  13580. baseStartTime: i.baseStartTime,
  13581. callback: function (e) {
  13582. i.bytes = t = e.data
  13583. e = e.result
  13584. e && (n(i, { hasAudio: e.hasAudio, hasVideo: e.hasVideo, isMuxed: f }), (n = null), e.hasAudio && !f && m(e.audioStart), e.hasVideo && y(e.videoStart), (y = m = null)),
  13585. Ru({
  13586. bytes: t,
  13587. transmuxer: i.transmuxer,
  13588. audioAppendStart: i.audioAppendStart,
  13589. gopsToAlignWith: i.gopsToAlignWith,
  13590. remux: f,
  13591. onData: function (e) {
  13592. ;(e.type = 'combined' === e.type ? 'video' : e.type), d(i, e)
  13593. },
  13594. onTrackInfo: function (e) {
  13595. n && (f && (e.isMuxed = !0), n(i, e))
  13596. },
  13597. onAudioTimingInfo: function (e) {
  13598. m && 'undefined' != typeof e.start && (m(e.start), (m = null)), g && 'undefined' != typeof e.end && g(e.end)
  13599. },
  13600. onVideoTimingInfo: function (e) {
  13601. y && 'undefined' != typeof e.start && (y(e.start), (y = null)), v && 'undefined' != typeof e.end && v(e.end)
  13602. },
  13603. onVideoSegmentTimingInfo: function (e) {
  13604. a(e)
  13605. },
  13606. onAudioSegmentTimingInfo: function (e) {
  13607. s(e)
  13608. },
  13609. onId3: function (e, t) {
  13610. o(i, e, t)
  13611. },
  13612. onCaptions: function (e) {
  13613. u(i, [e])
  13614. },
  13615. isEndOfTimeline: l,
  13616. onEndedTimeline: function () {
  13617. c()
  13618. },
  13619. onTransmuxerLog: p,
  13620. onDone: function (e) {
  13621. h && ((e.type = 'combined' === e.type ? 'video' : e.type), h(null, i, e))
  13622. },
  13623. })
  13624. },
  13625. })
  13626. }
  13627. function Vu(e) {
  13628. var i = e.segment,
  13629. n = e.bytes,
  13630. t = e.trackInfoFn,
  13631. r = e.timingInfoFn,
  13632. a = e.videoSegmentTimingInfoFn,
  13633. s = e.audioSegmentTimingInfoFn,
  13634. o = e.id3Fn,
  13635. u = e.captionsFn,
  13636. l = e.isEndOfTimeline,
  13637. c = e.endedTimelineFn,
  13638. d = e.dataFn,
  13639. h = e.doneFn,
  13640. p = e.onTransmuxerLog,
  13641. f = new Uint8Array(n)
  13642. if (0 < io(f, ['moof']).length) {
  13643. i.isFmp4 = !0
  13644. var m = i.map.tracks,
  13645. g = { isFmp4: !0, hasVideo: !!m.video, hasAudio: !!m.audio }
  13646. m.audio && m.audio.codec && 'enca' !== m.audio.codec && (g.audioCodec = m.audio.codec),
  13647. m.video && m.video.codec && 'encv' !== m.video.codec && (g.videoCodec = m.video.codec),
  13648. m.video && m.audio && (g.isMuxed = !0),
  13649. t(i, g)
  13650. var y = function (e) {
  13651. d(i, { data: f, type: g.hasAudio && !g.isMuxed ? 'audio' : 'video' }), e && e.length && u(i, e), h(null, i, {})
  13652. }
  13653. Nu({
  13654. action: 'probeMp4StartTime',
  13655. timescales: i.map.timescales,
  13656. data: f,
  13657. transmuxer: i.transmuxer,
  13658. callback: function (e) {
  13659. var t = e.data,
  13660. e = e.startTime
  13661. ;(n = t.buffer),
  13662. (i.bytes = f = t),
  13663. g.hasAudio && !g.isMuxed && r(i, 'audio', 'start', e),
  13664. g.hasVideo && r(i, 'video', 'start', e),
  13665. m.video && t.byteLength && i.transmuxer
  13666. ? Nu({
  13667. action: 'pushMp4Captions',
  13668. endAction: 'mp4Captions',
  13669. transmuxer: i.transmuxer,
  13670. data: f,
  13671. timescales: i.map.timescales,
  13672. trackIds: [m.video.id],
  13673. callback: function (e) {
  13674. ;(n = e.data.buffer),
  13675. (i.bytes = f = e.data),
  13676. e.logs.forEach(function (e) {
  13677. p(tr.mergeOptions(e, { stream: 'mp4CaptionParser' }))
  13678. }),
  13679. y(e.captions)
  13680. },
  13681. })
  13682. : y()
  13683. },
  13684. })
  13685. } else if (i.transmuxer) {
  13686. if (('undefined' == typeof i.container && (i.container = Oo(f)), 'ts' !== i.container && 'aac' !== i.container)) return t(i, { hasAudio: !1, hasVideo: !1 }), h(null, i, {}), 0
  13687. qu({
  13688. segment: i,
  13689. bytes: n,
  13690. trackInfoFn: t,
  13691. timingInfoFn: r,
  13692. videoSegmentTimingInfoFn: a,
  13693. audioSegmentTimingInfoFn: s,
  13694. id3Fn: o,
  13695. captionsFn: u,
  13696. isEndOfTimeline: l,
  13697. endedTimelineFn: c,
  13698. dataFn: d,
  13699. doneFn: h,
  13700. onTransmuxerLog: p,
  13701. })
  13702. } else h(null, i, {})
  13703. }
  13704. function Wu(e, i) {
  13705. var n = e.id,
  13706. t = e.key,
  13707. r = e.encryptedBytes,
  13708. a = e.decryptionWorker,
  13709. e = function e(t) {
  13710. t.data.source === n && (a.removeEventListener('message', e), (t = t.data.decrypted), i(new Uint8Array(t.bytes, t.byteOffset, t.byteLength)))
  13711. }
  13712. a.addEventListener('message', e),
  13713. (e = t.bytes.slice ? t.bytes.slice() : new Uint32Array(Array.prototype.slice.call(t.bytes))),
  13714. a.postMessage(Tu({ source: n, encrypted: r, key: e, iv: t.iv }), [r.buffer, e.buffer])
  13715. }
  13716. function Gu(e) {
  13717. var i = e.activeXhrs,
  13718. m = e.decryptionWorker,
  13719. g = e.trackInfoFn,
  13720. y = e.timingInfoFn,
  13721. v = e.videoSegmentTimingInfoFn,
  13722. _ = e.audioSegmentTimingInfoFn,
  13723. b = e.id3Fn,
  13724. T = e.captionsFn,
  13725. S = e.isEndOfTimeline,
  13726. w = e.endedTimelineFn,
  13727. E = e.dataFn,
  13728. k = e.doneFn,
  13729. C = e.onTransmuxerLog,
  13730. n = 0,
  13731. r = !1
  13732. return function (e, f) {
  13733. if (!r) {
  13734. if (e) return (r = !0), Uu(i), k(e, f)
  13735. if ((n += 1) === i.length) {
  13736. var t = function () {
  13737. if (f.encryptedBytes)
  13738. return (
  13739. (t = (e = {
  13740. decryptionWorker: m,
  13741. segment: f,
  13742. trackInfoFn: g,
  13743. timingInfoFn: y,
  13744. videoSegmentTimingInfoFn: v,
  13745. audioSegmentTimingInfoFn: _,
  13746. id3Fn: b,
  13747. captionsFn: T,
  13748. isEndOfTimeline: S,
  13749. endedTimelineFn: w,
  13750. dataFn: E,
  13751. doneFn: k,
  13752. onTransmuxerLog: C,
  13753. }).decryptionWorker),
  13754. (i = e.segment),
  13755. (n = e.trackInfoFn),
  13756. (r = e.timingInfoFn),
  13757. (a = e.videoSegmentTimingInfoFn),
  13758. (s = e.audioSegmentTimingInfoFn),
  13759. (o = e.id3Fn),
  13760. (u = e.captionsFn),
  13761. (l = e.isEndOfTimeline),
  13762. (c = e.endedTimelineFn),
  13763. (d = e.dataFn),
  13764. (h = e.doneFn),
  13765. (p = e.onTransmuxerLog),
  13766. void Wu({ id: i.requestId, key: i.key, encryptedBytes: i.encryptedBytes, decryptionWorker: t }, function (e) {
  13767. ;(i.bytes = e),
  13768. Vu({
  13769. segment: i,
  13770. bytes: i.bytes,
  13771. trackInfoFn: n,
  13772. timingInfoFn: r,
  13773. videoSegmentTimingInfoFn: a,
  13774. audioSegmentTimingInfoFn: s,
  13775. id3Fn: o,
  13776. captionsFn: u,
  13777. isEndOfTimeline: l,
  13778. endedTimelineFn: c,
  13779. dataFn: d,
  13780. doneFn: h,
  13781. onTransmuxerLog: p,
  13782. })
  13783. })
  13784. )
  13785. var e, t, i, n, r, a, s, o, u, l, c, d, h, p
  13786. Vu({
  13787. segment: f,
  13788. bytes: f.bytes,
  13789. trackInfoFn: g,
  13790. timingInfoFn: y,
  13791. videoSegmentTimingInfoFn: v,
  13792. audioSegmentTimingInfoFn: _,
  13793. id3Fn: b,
  13794. captionsFn: T,
  13795. isEndOfTimeline: S,
  13796. endedTimelineFn: w,
  13797. dataFn: E,
  13798. doneFn: k,
  13799. onTransmuxerLog: C,
  13800. })
  13801. }
  13802. if (((f.endOfAllRequests = Date.now()), f.map && f.map.encryptedBytes && !f.map.bytes))
  13803. return Wu({ decryptionWorker: m, id: f.requestId + '-init', encryptedBytes: f.map.encryptedBytes, key: f.map.key }, function (e) {
  13804. ;(f.map.bytes = e),
  13805. ju(f, function (e) {
  13806. return e ? (Uu(i), k(e, f)) : void t()
  13807. })
  13808. })
  13809. t()
  13810. }
  13811. }
  13812. }
  13813. }
  13814. function zu(e) {
  13815. var n = e.segment,
  13816. r = e.progressFn
  13817. return (
  13818. e.trackInfoFn,
  13819. e.timingInfoFn,
  13820. e.videoSegmentTimingInfoFn,
  13821. e.audioSegmentTimingInfoFn,
  13822. e.id3Fn,
  13823. e.captionsFn,
  13824. e.isEndOfTimeline,
  13825. e.endedTimelineFn,
  13826. e.dataFn,
  13827. function (e) {
  13828. var t,
  13829. i = e.target
  13830. if (!i.aborted)
  13831. return (
  13832. (n.stats = tr.mergeOptions(
  13833. n.stats,
  13834. ((i = (t = e).target),
  13835. ((i = { bandwidth: 1 / 0, bytesReceived: 0, roundTripTime: Date.now() - i.requestTime || 0 }).bytesReceived = t.loaded),
  13836. (i.bandwidth = Math.floor((i.bytesReceived / i.roundTripTime) * 8 * 1e3)),
  13837. i)
  13838. )),
  13839. !n.stats.firstBytesReceivedAt && n.stats.bytesReceived && (n.stats.firstBytesReceivedAt = Date.now()),
  13840. r(e, n)
  13841. )
  13842. }
  13843. )
  13844. }
  13845. function Xu(e) {
  13846. var t,
  13847. i,
  13848. n,
  13849. r = e.xhr,
  13850. a = e.xhrOptions,
  13851. s = e.decryptionWorker,
  13852. o = e.segment,
  13853. u = e.abortFn,
  13854. l = e.progressFn,
  13855. c = e.trackInfoFn,
  13856. d = e.timingInfoFn,
  13857. h = e.videoSegmentTimingInfoFn,
  13858. p = e.audioSegmentTimingInfoFn,
  13859. f = e.id3Fn,
  13860. m = e.captionsFn,
  13861. g = e.isEndOfTimeline,
  13862. y = e.endedTimelineFn,
  13863. v = e.dataFn,
  13864. _ = e.doneFn,
  13865. e = e.onTransmuxerLog,
  13866. b = [],
  13867. _ = Gu({
  13868. activeXhrs: b,
  13869. decryptionWorker: s,
  13870. trackInfoFn: c,
  13871. timingInfoFn: d,
  13872. videoSegmentTimingInfoFn: h,
  13873. audioSegmentTimingInfoFn: p,
  13874. id3Fn: f,
  13875. captionsFn: m,
  13876. isEndOfTimeline: g,
  13877. endedTimelineFn: y,
  13878. dataFn: v,
  13879. doneFn: _,
  13880. onTransmuxerLog: e,
  13881. })
  13882. o.key &&
  13883. !o.key.bytes &&
  13884. ((e = [o.key]),
  13885. o.map && !o.map.bytes && o.map.key && o.map.key.resolvedUri === o.key.resolvedUri && e.push(o.map.key),
  13886. (e = r(tr.mergeOptions(a, { uri: o.key.resolvedUri, responseType: 'arraybuffer' }), Fu(o, e, _))),
  13887. b.push(e)),
  13888. o.map &&
  13889. !o.map.bytes &&
  13890. (!o.map.key ||
  13891. (o.key && o.key.resolvedUri === o.map.key.resolvedUri) ||
  13892. ((t = r(tr.mergeOptions(a, { uri: o.map.key.resolvedUri, responseType: 'arraybuffer' }), Fu(o, [o.map.key], _))), b.push(t)),
  13893. (t = r(
  13894. tr.mergeOptions(a, { uri: o.map.resolvedUri, responseType: 'arraybuffer', headers: vu(o.map) }),
  13895. ((i = (t = { segment: o, finishProcessingFn: _ }).segment),
  13896. (n = t.finishProcessingFn),
  13897. function (e, t) {
  13898. e = Bu(e, t)
  13899. if (e) return n(e, i)
  13900. e = new Uint8Array(t.response)
  13901. if (i.map.key) return (i.map.encryptedBytes = e), n(null, i)
  13902. ;(i.map.bytes = e),
  13903. ju(i, function (e) {
  13904. return e ? ((e.xhr = t), (e.status = t.status), n(e, i)) : void n(null, i)
  13905. })
  13906. })
  13907. )),
  13908. b.push(t)),
  13909. (a = tr.mergeOptions(a, { uri: (o.part && o.part.resolvedUri) || o.resolvedUri, responseType: 'arraybuffer', headers: vu(o) })),
  13910. (a = r(a, Hu({ segment: o, finishProcessingFn: _, responseType: a.responseType }))).addEventListener(
  13911. 'progress',
  13912. zu({
  13913. segment: o,
  13914. progressFn: l,
  13915. trackInfoFn: c,
  13916. timingInfoFn: d,
  13917. videoSegmentTimingInfoFn: h,
  13918. audioSegmentTimingInfoFn: p,
  13919. id3Fn: f,
  13920. captionsFn: m,
  13921. isEndOfTimeline: g,
  13922. endedTimelineFn: y,
  13923. dataFn: v,
  13924. })
  13925. ),
  13926. b.push(a)
  13927. var T = {}
  13928. return (
  13929. b.forEach(function (e) {
  13930. var t, i
  13931. e.addEventListener(
  13932. 'loadend',
  13933. ((t = (e = { loadendState: T, abortFn: u }).loadendState),
  13934. (i = e.abortFn),
  13935. function (e) {
  13936. e.target.aborted && i && !t.calledAbortFn && (i(), (t.calledAbortFn = !0))
  13937. })
  13938. )
  13939. }),
  13940. function () {
  13941. return Uu(b)
  13942. }
  13943. )
  13944. }
  13945. function Ku(e, t) {
  13946. return (t = t.attributes || {}), e && e.mediaGroups && e.mediaGroups.AUDIO && t.AUDIO && e.mediaGroups.AUDIO[t.AUDIO]
  13947. }
  13948. function Yu(e) {
  13949. var n = {}
  13950. return (
  13951. e.forEach(function (e) {
  13952. var t = e.mediaType,
  13953. i = e.type,
  13954. e = e.details
  13955. ;(n[t] = n[t] || []), n[t].push(hr('' + i + e))
  13956. }),
  13957. Object.keys(n).forEach(function (e) {
  13958. return 1 < n[e].length
  13959. ? (Dl('multiple ' + e + ' codecs found as attributes: ' + n[e].join(', ') + '. Setting playlist codecs to null so that we wait for mux.js to probe segments for real codecs.'),
  13960. void (n[e] = null))
  13961. : void (n[e] = n[e][0])
  13962. }),
  13963. n
  13964. )
  13965. }
  13966. function Qu(e) {
  13967. var t = 0
  13968. return e.audio && t++, e.video && t++, t
  13969. }
  13970. function $u(e, t) {
  13971. var i,
  13972. n = t.attributes || {},
  13973. r = Yu(
  13974. (function (e) {
  13975. e = e.attributes || {}
  13976. if (e.CODECS) return pr(e.CODECS)
  13977. })(t) || []
  13978. )
  13979. return (
  13980. Ku(e, t) &&
  13981. !r.audio &&
  13982. !(function (e, t) {
  13983. if (!Ku(e, t)) return !0
  13984. var i,
  13985. t = t.attributes || {},
  13986. n = e.mediaGroups.AUDIO[t.AUDIO]
  13987. for (i in n) if (!n[i].uri && !n[i].playlists) return !0
  13988. return !1
  13989. })(e, t) &&
  13990. (i = Yu(
  13991. (function (e, t) {
  13992. if (!e.mediaGroups.AUDIO || !t) return null
  13993. var i,
  13994. n = e.mediaGroups.AUDIO[t]
  13995. if (!n) return null
  13996. for (i in n) {
  13997. var r = n[i]
  13998. if (r.default && r.playlists) return pr(r.playlists[0].attributes.CODECS)
  13999. }
  14000. return null
  14001. })(e, n.AUDIO) || []
  14002. )).audio &&
  14003. (r.audio = i.audio),
  14004. r
  14005. )
  14006. }
  14007. function Ju(e) {
  14008. if (e && e.playlist) {
  14009. var t = e.playlist
  14010. return JSON.stringify({ id: t.id, bandwidth: e.bandwidth, width: e.width, height: e.height, codecs: (t.attributes && t.attributes.CODECS) || '' })
  14011. }
  14012. }
  14013. function Zu(e, t) {
  14014. return (e = e && window.getComputedStyle(e)) ? e[t] : ''
  14015. }
  14016. function el(e, n) {
  14017. var r = e.slice()
  14018. e.sort(function (e, t) {
  14019. var i = n(e, t)
  14020. return 0 === i ? r.indexOf(e) - r.indexOf(t) : i
  14021. })
  14022. }
  14023. function tl(e, t) {
  14024. var i, n
  14025. return (i = (i = e.attributes.BANDWIDTH ? e.attributes.BANDWIDTH : i) || window.Number.MAX_VALUE) - (n = (n = t.attributes.BANDWIDTH ? t.attributes.BANDWIDTH : n) || window.Number.MAX_VALUE)
  14026. }
  14027. function il(e, t, i, n, r, a) {
  14028. if (e) {
  14029. var s = { bandwidth: t, width: i, height: n, limitRenditionByPlayerDimensions: r },
  14030. o = e.playlists
  14031. gl.isAudioOnly(e) && ((o = a.getAudioTrackPlaylists_()), (s.audioOnly = !0))
  14032. var u = o.map(function (e) {
  14033. var t = e.attributes && e.attributes.RESOLUTION && e.attributes.RESOLUTION.width,
  14034. i = e.attributes && e.attributes.RESOLUTION && e.attributes.RESOLUTION.height,
  14035. n = e.attributes && e.attributes.BANDWIDTH
  14036. return { bandwidth: n || window.Number.MAX_VALUE, width: t, height: i, playlist: e }
  14037. })
  14038. el(u, function (e, t) {
  14039. return e.bandwidth - t.bandwidth
  14040. })
  14041. var l = (u = u.filter(function (e) {
  14042. return !gl.isIncompatible(e.playlist)
  14043. })).filter(function (e) {
  14044. return gl.isEnabled(e.playlist)
  14045. }),
  14046. e = (l = !l.length
  14047. ? u.filter(function (e) {
  14048. return !gl.isDisabled(e.playlist)
  14049. })
  14050. : l).filter(function (e) {
  14051. return e.bandwidth * El.BANDWIDTH_VARIANCE < t
  14052. }),
  14053. c = e[e.length - 1],
  14054. o = e.filter(function (e) {
  14055. return e.bandwidth === c.bandwidth
  14056. })[0]
  14057. if (!1 === r) {
  14058. var d = o || l[0] || u[0]
  14059. if (d && d.playlist) {
  14060. r = o ? 'bandwidthBestRep' : 'sortedPlaylistReps'
  14061. return l[0] && (r = 'enabledPlaylistReps'), Ol('choosing ' + Ju(d) + ' using ' + r + ' with options', s), d.playlist
  14062. }
  14063. return Ol('could not choose a playlist with options', s), null
  14064. }
  14065. d = e.filter(function (e) {
  14066. return e.width && e.height
  14067. })
  14068. el(d, function (e, t) {
  14069. return e.width - t.width
  14070. })
  14071. var h,
  14072. p,
  14073. f,
  14074. e = d.filter(function (e) {
  14075. return e.width === i && e.height === n
  14076. }),
  14077. c = e[e.length - 1],
  14078. e = e.filter(function (e) {
  14079. return e.bandwidth === c.bandwidth
  14080. })[0]
  14081. e ||
  14082. ((p = (h = d.filter(function (e) {
  14083. return e.width > i || e.height > n
  14084. })).filter(function (e) {
  14085. return e.width === h[0].width && e.height === h[0].height
  14086. })),
  14087. (c = p[p.length - 1]),
  14088. (p = p.filter(function (e) {
  14089. return e.bandwidth === c.bandwidth
  14090. })[0])),
  14091. a.experimentalLeastPixelDiffSelector &&
  14092. ((m = d.map(function (e) {
  14093. return (e.pixelDiff = Math.abs(e.width - i) + Math.abs(e.height - n)), e
  14094. })),
  14095. el(m, function (e, t) {
  14096. return e.pixelDiff === t.pixelDiff ? t.bandwidth - e.bandwidth : e.pixelDiff - t.pixelDiff
  14097. }),
  14098. (f = m[0]))
  14099. var m = f || p || e || o || l[0] || u[0]
  14100. if (m && m.playlist) {
  14101. u = 'sortedPlaylistReps'
  14102. return (
  14103. f ? (u = 'leastPixelDiffRep') : p ? (u = 'resolutionPlusOneRep') : e ? (u = 'resolutionBestRep') : o ? (u = 'bandwidthBestRep') : l[0] && (u = 'enabledPlaylistReps'),
  14104. Ol('choosing ' + Ju(m) + ' using ' + u + ' with options', s),
  14105. m.playlist
  14106. )
  14107. }
  14108. return Ol('could not choose a playlist with options', s), null
  14109. }
  14110. }
  14111. function nl(e) {
  14112. var t = e.inbandTextTracks,
  14113. i = e.metadataArray,
  14114. r = e.timestampOffset,
  14115. n = e.videoDuration
  14116. if (i) {
  14117. var a = window.WebKitDataCue || window.VTTCue,
  14118. s = t.metadataTrack_
  14119. if (
  14120. s &&
  14121. (i.forEach(function (e) {
  14122. var n = e.cueTime + r
  14123. !('number' != typeof n || window.isNaN(n) || n < 0) &&
  14124. n < 1 / 0 &&
  14125. e.frames.forEach(function (e) {
  14126. var t,
  14127. i = new a(n, n, e.value || e.url || e.data || '')
  14128. ;(i.frame = e),
  14129. (i.value = e),
  14130. (t = i),
  14131. Object.defineProperties(t.frame, {
  14132. id: {
  14133. get: function () {
  14134. return tr.log.warn('cue.frame.id is deprecated. Use cue.value.key instead.'), t.value.key
  14135. },
  14136. },
  14137. value: {
  14138. get: function () {
  14139. return tr.log.warn('cue.frame.value is deprecated. Use cue.value.data instead.'), t.value.data
  14140. },
  14141. },
  14142. privateData: {
  14143. get: function () {
  14144. return tr.log.warn('cue.frame.privateData is deprecated. Use cue.value.data instead.'), t.value.data
  14145. },
  14146. },
  14147. }),
  14148. s.addCue(i)
  14149. })
  14150. }),
  14151. s.cues && s.cues.length)
  14152. ) {
  14153. for (var o = s.cues, u = [], l = 0; l < o.length; l++) o[l] && u.push(o[l])
  14154. var c = u.reduce(function (e, t) {
  14155. var i = e[t.startTime] || []
  14156. return i.push(t), (e[t.startTime] = i), e
  14157. }, {}),
  14158. d = Object.keys(c).sort(function (e, t) {
  14159. return Number(e) - Number(t)
  14160. })
  14161. d.forEach(function (e, t) {
  14162. var e = c[e],
  14163. i = Number(d[t + 1]) || n
  14164. e.forEach(function (e) {
  14165. e.endTime = i
  14166. })
  14167. })
  14168. }
  14169. }
  14170. }
  14171. function rl(e, t, i) {
  14172. var n, r
  14173. if (i && i.cues) for (n = i.cues.length; n--; ) (r = i.cues[n]).startTime >= e && r.endTime <= t && i.removeCue(r)
  14174. }
  14175. function al(e) {
  14176. return 'number' == typeof e && isFinite(e)
  14177. }
  14178. function sl(e) {
  14179. var t = e.startOfSegment,
  14180. i = e.duration,
  14181. n = e.segment,
  14182. r = e.part,
  14183. a = e.playlist,
  14184. s = a.mediaSequence,
  14185. o = a.id,
  14186. u = a.segments,
  14187. l = e.mediaIndex,
  14188. c = e.partIndex,
  14189. d = e.timeline,
  14190. h = (void 0 === u ? [] : u).length - 1,
  14191. p = 'mediaIndex/partIndex increment'
  14192. return (
  14193. e.getMediaInfoForTime ? (p = 'getMediaInfoForTime (' + e.getMediaInfoForTime + ')') : e.isSyncRequest && (p = 'getSyncSegmentCandidate (isSyncRequest)'),
  14194. e.independent && (p += ' with independent ' + e.independent),
  14195. (a = 'number' == typeof c),
  14196. (u = e.segment.uri ? 'segment' : 'pre-segment'),
  14197. (e = a ? zo({ preloadSegment: n }) - 1 : 0),
  14198. u +
  14199. ' [' +
  14200. (s + l) +
  14201. '/' +
  14202. (s + h) +
  14203. ']' +
  14204. (a ? ' part [' + c + '/' + e + ']' : '') +
  14205. ' segment start/end [' +
  14206. n.start +
  14207. ' => ' +
  14208. n.end +
  14209. ']' +
  14210. (a ? ' part start/end [' + r.start + ' => ' + r.end + ']' : '') +
  14211. ' startOfSegment [' +
  14212. t +
  14213. '] duration [' +
  14214. i +
  14215. '] timeline [' +
  14216. d +
  14217. '] selected by [' +
  14218. p +
  14219. '] playlist [' +
  14220. o +
  14221. ']'
  14222. )
  14223. }
  14224. function ol(e) {
  14225. return e + 'TimingInfo'
  14226. }
  14227. function ul(e) {
  14228. var t = e.timelineChangeController,
  14229. i = e.currentTimeline,
  14230. n = e.segmentTimeline,
  14231. r = e.loaderType,
  14232. e = e.audioDisabled
  14233. if (i !== n) {
  14234. if ('audio' === r) {
  14235. i = t.lastTimelineChange({ type: 'main' })
  14236. return !i || i.to !== n
  14237. }
  14238. if ('main' === r && e) {
  14239. t = t.pendingTimelineChange({ type: 'audio' })
  14240. return t && t.to === n ? !1 : !0
  14241. }
  14242. }
  14243. }
  14244. function ll(e) {
  14245. var t = e.segmentDuration,
  14246. e = e.maxDuration
  14247. return !!t && Math.round(t) > e + fl
  14248. }
  14249. function cl(e, t) {
  14250. if ('hls' !== t) return null
  14251. var n,
  14252. r,
  14253. i =
  14254. ((n = { audioTimingInfo: e.audioTimingInfo, videoTimingInfo: e.videoTimingInfo }),
  14255. (r = 0),
  14256. ['video', 'audio'].forEach(function (e) {
  14257. var t,
  14258. i = n[e + 'TimingInfo']
  14259. i &&
  14260. ((e = i.start),
  14261. (i = i.end),
  14262. 'bigint' == typeof e || 'bigint' == typeof i ? (t = window.BigInt(i) - window.BigInt(e)) : 'number' == typeof e && 'number' == typeof i && (t = i - e),
  14263. 'undefined' != typeof t && r < t && (r = t))
  14264. }),
  14265. (r = 'bigint' == typeof r && r < Number.MAX_SAFE_INTEGER ? Number(r) : r))
  14266. if (!i) return null
  14267. var a = e.playlist.targetDuration,
  14268. s = ll({ segmentDuration: i, maxDuration: 2 * a }),
  14269. t = ll({ segmentDuration: i, maxDuration: a }),
  14270. a =
  14271. 'Segment with index ' +
  14272. e.mediaIndex +
  14273. ' from playlist ' +
  14274. e.playlist.id +
  14275. ' has a duration of ' +
  14276. i +
  14277. ' when the reported duration is ' +
  14278. e.duration +
  14279. ' and the target duration is ' +
  14280. a +
  14281. '. For HLS content, a duration in excess of the target duration may result in playback issues. See the HLS specification section on EXT-X-TARGETDURATION for more details: https://tools.ietf.org/html/draft-pantos-http-live-streaming-23#section-4.3.3.1'
  14282. return s || t ? { severity: s ? 'warn' : 'info', message: a } : null
  14283. }
  14284. var dl = Lo,
  14285. hl = 9e4,
  14286. pl = ir,
  14287. fl = 1 / 30,
  14288. ml = tr.createTimeRange,
  14289. gl = {
  14290. liveEdgeDelay: Xo,
  14291. duration: Yo,
  14292. seekable: function (e, t, i) {
  14293. var n = t || 0,
  14294. i = $o(e, t, !0, i)
  14295. return null === i ? ml() : ml(n, i)
  14296. },
  14297. getMediaInfoForTime: function (e) {
  14298. for (
  14299. var t = e.playlist,
  14300. i = e.currentTime,
  14301. n = e.startingSegmentIndex,
  14302. r = e.startingPartIndex,
  14303. a = e.startTime,
  14304. s = e.experimentalExactManifestTimings,
  14305. o = i - a,
  14306. u = Wo(t),
  14307. l = 0,
  14308. c = 0;
  14309. c < u.length;
  14310. c++
  14311. ) {
  14312. var d = u[c]
  14313. if (n === d.segmentIndex && ('number' != typeof r || 'number' != typeof d.partIndex || r === d.partIndex)) {
  14314. l = c
  14315. break
  14316. }
  14317. }
  14318. if (o < 0) {
  14319. if (0 < l)
  14320. for (var h = l - 1; 0 <= h; h--) {
  14321. var p = u[h]
  14322. if (((o += p.duration), s)) {
  14323. if (o < 0) continue
  14324. } else if (o + fl <= 0) continue
  14325. return { partIndex: p.partIndex, segmentIndex: p.segmentIndex, startTime: a - Qo({ defaultDuration: t.targetDuration, durationList: u, startIndex: l, endIndex: h }) }
  14326. }
  14327. return { partIndex: (u[0] && u[0].partIndex) || null, segmentIndex: (u[0] && u[0].segmentIndex) || 0, startTime: i }
  14328. }
  14329. if (l < 0) {
  14330. for (var f = l; f < 0; f++) if ((o -= t.targetDuration) < 0) return { partIndex: (u[0] && u[0].partIndex) || null, segmentIndex: (u[0] && u[0].segmentIndex) || 0, startTime: i }
  14331. l = 0
  14332. }
  14333. for (var m = l; m < u.length; m++) {
  14334. var g = u[m]
  14335. if (((o -= g.duration), s)) {
  14336. if (0 < o) continue
  14337. } else if (0 <= o - fl) continue
  14338. return { partIndex: g.partIndex, segmentIndex: g.segmentIndex, startTime: a + Qo({ defaultDuration: t.targetDuration, durationList: u, startIndex: l, endIndex: m }) }
  14339. }
  14340. return { segmentIndex: u[u.length - 1].segmentIndex, partIndex: u[u.length - 1].partIndex, startTime: i }
  14341. },
  14342. isEnabled: eu,
  14343. isDisabled: function (e) {
  14344. return e.disabled
  14345. },
  14346. isBlacklisted: Jo,
  14347. isIncompatible: Zo,
  14348. playlistEnd: $o,
  14349. isAes: function (e) {
  14350. for (var t = 0; t < e.segments.length; t++) if (e.segments[t].key) return !0
  14351. return !1
  14352. },
  14353. hasAttribute: tu,
  14354. estimateSegmentRequestTime: function (e, t, i, n) {
  14355. return tu('BANDWIDTH', i) ? (e * i.attributes.BANDWIDTH - 8 * (n = void 0 === n ? 0 : n)) / t : NaN
  14356. },
  14357. isLowestEnabledRendition: iu,
  14358. isAudioOnly: au,
  14359. playlistMatch: nu,
  14360. segmentDurationWithParts: Vo,
  14361. },
  14362. yl = tr.log,
  14363. vl = tr.mergeOptions,
  14364. W = tr.EventTarget,
  14365. _l = (function (a) {
  14366. function e(e, t, i) {
  14367. var n
  14368. if ((void 0 === i && (i = {}), (n = a.call(this) || this), !e)) throw new Error('A non-empty playlist URL or object is required')
  14369. n.logger_ = Ro('PlaylistLoader')
  14370. var r = i.withCredentials,
  14371. r = void 0 !== r && r,
  14372. i = i.handleManifestRedirects,
  14373. i = void 0 !== i && i
  14374. ;(n.src = e), (n.vhs_ = t), (n.withCredentials = r), (n.handleManifestRedirects = i)
  14375. t = t.options_
  14376. return (
  14377. (n.customTagParsers = (t && t.customTagParsers) || []),
  14378. (n.customTagMappers = (t && t.customTagMappers) || []),
  14379. (n.experimentalLLHLS = (t && t.experimentalLLHLS) || !1),
  14380. tr.browser.IE_VERSION && (n.experimentalLLHLS = !1),
  14381. (n.state = 'HAVE_NOTHING'),
  14382. (n.handleMediaupdatetimeout_ = n.handleMediaupdatetimeout_.bind(ft(n))),
  14383. n.on('mediaupdatetimeout', n.handleMediaupdatetimeout_),
  14384. n
  14385. )
  14386. }
  14387. mt(e, a)
  14388. var t = e.prototype
  14389. return (
  14390. (t.handleMediaupdatetimeout_ = function () {
  14391. var e,
  14392. t,
  14393. i = this
  14394. 'HAVE_METADATA' === this.state &&
  14395. ((e = this.media()),
  14396. (t = pl(this.master.uri, e.uri)),
  14397. this.experimentalLLHLS &&
  14398. (t = (function (e, t) {
  14399. if (t.endList || !t.serverControl) return e
  14400. var i,
  14401. n,
  14402. r,
  14403. a,
  14404. s = {}
  14405. return (
  14406. t.serverControl.canBlockReload &&
  14407. ((r = t.preloadSegment),
  14408. (i = t.mediaSequence + t.segments.length),
  14409. r && ((n = r.parts || []), -1 < (r = zo(t) - 1) && r != n.length - 1 && (s._HLS_part = r), (-1 < r || n.length) && i--),
  14410. (s._HLS_msn = i)),
  14411. t.serverControl && t.serverControl.canSkipUntil && (s._HLS_skip = t.serverControl.canSkipDateranges ? 'v2' : 'YES'),
  14412. Object.keys(s).length &&
  14413. ((a = new window.URL(e)),
  14414. ['_HLS_skip', '_HLS_msn', '_HLS_part'].forEach(function (e) {
  14415. s.hasOwnProperty(e) && a.searchParams.set(e, s[e])
  14416. }),
  14417. (e = a.toString())),
  14418. e
  14419. )
  14420. })(t, e)),
  14421. (this.state = 'HAVE_CURRENT_METADATA'),
  14422. (this.request = this.vhs_.xhr({ uri: t, withCredentials: this.withCredentials }, function (e, t) {
  14423. if (i.request)
  14424. return e
  14425. ? i.playlistRequestError(i.request, i.media(), 'HAVE_METADATA')
  14426. : void i.haveMetadata({ playlistString: i.request.responseText, url: i.media().uri, id: i.media().id })
  14427. })))
  14428. }),
  14429. (t.playlistRequestError = function (e, t, i) {
  14430. var n = t.uri,
  14431. t = t.id
  14432. ;(this.request = null),
  14433. i && (this.state = i),
  14434. (this.error = {
  14435. playlist: this.master.playlists[t],
  14436. status: e.status,
  14437. message: 'HLS playlist request error at URL: ' + n + '.',
  14438. responseText: e.responseText,
  14439. code: 500 <= e.status ? 4 : 2,
  14440. }),
  14441. this.trigger('error')
  14442. }),
  14443. (t.parseManifest_ = function (e) {
  14444. var t = this,
  14445. i = e.url
  14446. return (function (e) {
  14447. var t = e.onwarn,
  14448. i = e.oninfo,
  14449. n = e.manifestString,
  14450. r = e.customTagParsers,
  14451. a = void 0 === r ? [] : r,
  14452. r = e.customTagMappers,
  14453. r = void 0 === r ? [] : r,
  14454. e = e.experimentalLLHLS,
  14455. s = new Ir()
  14456. t && s.on('warn', t),
  14457. i && s.on('info', i),
  14458. a.forEach(function (e) {
  14459. return s.addParser(e)
  14460. }),
  14461. r.forEach(function (e) {
  14462. return s.addTagMapper(e)
  14463. }),
  14464. s.push(n),
  14465. s.end()
  14466. var o = s.manifest
  14467. e ||
  14468. (['preloadSegment', 'skip', 'serverControl', 'renditionReports', 'partInf', 'partTargetDuration'].forEach(function (e) {
  14469. o.hasOwnProperty(e) && delete o[e]
  14470. }),
  14471. o.segments &&
  14472. o.segments.forEach(function (t) {
  14473. ;['parts', 'preloadHints'].forEach(function (e) {
  14474. t.hasOwnProperty(e) && delete t[e]
  14475. })
  14476. })),
  14477. o.targetDuration ||
  14478. ((u = 10),
  14479. o.segments &&
  14480. o.segments.length &&
  14481. (u = o.segments.reduce(function (e, t) {
  14482. return Math.max(e, t.duration)
  14483. }, 0)),
  14484. t && t('manifest has no targetDuration defaulting to ' + u),
  14485. (o.targetDuration = u))
  14486. var u = Go(o)
  14487. return (
  14488. u.length &&
  14489. !o.partTargetDuration &&
  14490. ((u = u.reduce(function (e, t) {
  14491. return Math.max(e, t.duration)
  14492. }, 0)),
  14493. t &&
  14494. (t('manifest has no partTargetDuration defaulting to ' + u),
  14495. yl.error(
  14496. 'LL-HLS manifest has parts but lacks required #EXT-X-PART-INF:PART-TARGET value. See https://datatracker.ietf.org/doc/html/draft-pantos-hls-rfc8216bis-09#section-4.4.3.7. Playback is not guaranteed.'
  14497. )),
  14498. (o.partTargetDuration = u)),
  14499. o
  14500. )
  14501. })({
  14502. onwarn: function (e) {
  14503. e = e.message
  14504. return t.logger_('m3u8-parser warn for ' + i + ': ' + e)
  14505. },
  14506. oninfo: function (e) {
  14507. e = e.message
  14508. return t.logger_('m3u8-parser info for ' + i + ': ' + e)
  14509. },
  14510. manifestString: e.manifestString,
  14511. customTagParsers: this.customTagParsers,
  14512. customTagMappers: this.customTagMappers,
  14513. experimentalLLHLS: this.experimentalLLHLS,
  14514. })
  14515. }),
  14516. (t.haveMetadata = function (e) {
  14517. var t = e.playlistString,
  14518. i = e.playlistObject,
  14519. n = e.url,
  14520. e = e.id
  14521. ;(this.request = null), (this.state = 'HAVE_METADATA')
  14522. t = i || this.parseManifest_({ url: n, manifestString: t })
  14523. ;(t.lastRequest = Date.now()), uu({ playlist: t, uri: n, id: e })
  14524. n = fu(this.master, t)
  14525. ;(this.targetDuration = t.partTargetDuration || t.targetDuration),
  14526. (this.pendingMedia_ = null),
  14527. n ? ((this.master = n), (this.media_ = this.master.playlists[e])) : this.trigger('playlistunchanged'),
  14528. this.updateMediaUpdateTimeout_(mu(this.media(), !!n)),
  14529. this.trigger('loadedplaylist')
  14530. }),
  14531. (t.dispose = function () {
  14532. this.trigger('dispose'), this.stopRequest(), window.clearTimeout(this.mediaUpdateTimeout), window.clearTimeout(this.finalRenditionTimeout), this.off()
  14533. }),
  14534. (t.stopRequest = function () {
  14535. var e
  14536. this.request && ((e = this.request), (this.request = null), (e.onreadystatechange = null), e.abort())
  14537. }),
  14538. (t.media = function (i, e) {
  14539. var n = this
  14540. if (!i) return this.media_
  14541. if ('HAVE_NOTHING' === this.state) throw new Error('Cannot switch media playlist from ' + this.state)
  14542. if ('string' == typeof i) {
  14543. if (!this.master.playlists[i]) throw new Error('Unknown playlist URI: ' + i)
  14544. i = this.master.playlists[i]
  14545. }
  14546. if ((window.clearTimeout(this.finalRenditionTimeout), e)) {
  14547. var t = ((i.partTargetDuration || i.targetDuration) / 2) * 1e3 || 5e3
  14548. this.finalRenditionTimeout = window.setTimeout(this.media.bind(this, i, !1), t)
  14549. } else {
  14550. var r = this.state,
  14551. e = !this.media_ || i.id !== this.media_.id,
  14552. t = this.master.playlists[i.id]
  14553. if ((t && t.endList) || (i.endList && i.segments.length))
  14554. return (
  14555. this.request && ((this.request.onreadystatechange = null), this.request.abort(), (this.request = null)),
  14556. (this.state = 'HAVE_METADATA'),
  14557. (this.media_ = i),
  14558. void (e && (this.trigger('mediachanging'), 'HAVE_MASTER' === r ? this.trigger('loadedmetadata') : this.trigger('mediachange')))
  14559. )
  14560. if ((this.updateMediaUpdateTimeout_(mu(i, !0)), e)) {
  14561. if (((this.state = 'SWITCHING_MEDIA'), this.request)) {
  14562. if (i.resolvedUri === this.request.url) return
  14563. ;(this.request.onreadystatechange = null), this.request.abort(), (this.request = null)
  14564. }
  14565. this.media_ && this.trigger('mediachanging'),
  14566. (this.pendingMedia_ = i),
  14567. (this.request = this.vhs_.xhr({ uri: i.resolvedUri, withCredentials: this.withCredentials }, function (e, t) {
  14568. if (n.request) {
  14569. if (((i.lastRequest = Date.now()), (i.resolvedUri = Mo(n.handleManifestRedirects, i.resolvedUri, t)), e)) return n.playlistRequestError(n.request, i, r)
  14570. n.haveMetadata({ playlistString: t.responseText, url: i.uri, id: i.id }), 'HAVE_MASTER' === r ? n.trigger('loadedmetadata') : n.trigger('mediachange')
  14571. }
  14572. }))
  14573. }
  14574. }
  14575. }),
  14576. (t.pause = function () {
  14577. this.mediaUpdateTimeout && (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)),
  14578. this.stopRequest(),
  14579. 'HAVE_NOTHING' === this.state && (this.started = !1),
  14580. 'SWITCHING_MEDIA' === this.state
  14581. ? this.media_
  14582. ? (this.state = 'HAVE_METADATA')
  14583. : (this.state = 'HAVE_MASTER')
  14584. : 'HAVE_CURRENT_METADATA' === this.state && (this.state = 'HAVE_METADATA')
  14585. }),
  14586. (t.load = function (e) {
  14587. var t = this
  14588. this.mediaUpdateTimeout && (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null))
  14589. var i = this.media()
  14590. e
  14591. ? ((e = i ? ((i.partTargetDuration || i.targetDuration) / 2) * 1e3 : 5e3),
  14592. (this.mediaUpdateTimeout = window.setTimeout(function () {
  14593. ;(t.mediaUpdateTimeout = null), t.load()
  14594. }, e)))
  14595. : this.started
  14596. ? i && !i.endList
  14597. ? this.trigger('mediaupdatetimeout')
  14598. : this.trigger('loadedplaylist')
  14599. : this.start()
  14600. }),
  14601. (t.updateMediaUpdateTimeout_ = function (e) {
  14602. var t = this
  14603. this.mediaUpdateTimeout && (window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)),
  14604. this.media() &&
  14605. !this.media().endList &&
  14606. (this.mediaUpdateTimeout = window.setTimeout(function () {
  14607. ;(t.mediaUpdateTimeout = null), t.trigger('mediaupdatetimeout'), t.updateMediaUpdateTimeout_(e)
  14608. }, e))
  14609. }),
  14610. (t.start = function () {
  14611. var i = this
  14612. if (((this.started = !0), 'object' == typeof this.src))
  14613. return (
  14614. this.src.uri || (this.src.uri = window.location.href),
  14615. (this.src.resolvedUri = this.src.uri),
  14616. void setTimeout(function () {
  14617. i.setupInitialPlaylist(i.src)
  14618. }, 0)
  14619. )
  14620. this.request = this.vhs_.xhr({ uri: this.src, withCredentials: this.withCredentials }, function (e, t) {
  14621. if (i.request) {
  14622. if (((i.request = null), e))
  14623. return (
  14624. (i.error = { status: t.status, message: 'HLS playlist request error at URL: ' + i.src + '.', responseText: t.responseText, code: 2 }),
  14625. 'HAVE_NOTHING' === i.state && (i.started = !1),
  14626. i.trigger('error')
  14627. )
  14628. i.src = Mo(i.handleManifestRedirects, i.src, t)
  14629. t = i.parseManifest_({ manifestString: t.responseText, url: i.src })
  14630. i.setupInitialPlaylist(t)
  14631. }
  14632. })
  14633. }),
  14634. (t.srcUri = function () {
  14635. return 'string' == typeof this.src ? this.src : this.src.uri
  14636. }),
  14637. (t.setupInitialPlaylist = function (e) {
  14638. if (((this.state = 'HAVE_MASTER'), e.playlists))
  14639. return (
  14640. (this.master = e),
  14641. lu(this.master, this.srcUri()),
  14642. e.playlists.forEach(function (t) {
  14643. ;(t.segments = hu(t)),
  14644. t.segments.forEach(function (e) {
  14645. du(e, t.resolvedUri)
  14646. })
  14647. }),
  14648. this.trigger('loadedplaylist'),
  14649. void (this.request || this.media(this.master.playlists[0]))
  14650. )
  14651. var t,
  14652. i,
  14653. n,
  14654. r = this.srcUri() || window.location.href
  14655. ;(this.master =
  14656. ((i = su(0, (t = r))),
  14657. ((n = {
  14658. mediaGroups: { AUDIO: {}, VIDEO: {}, 'CLOSED-CAPTIONS': {}, SUBTITLES: {} },
  14659. uri: window.location.href,
  14660. resolvedUri: window.location.href,
  14661. playlists: [{ uri: t, id: i, resolvedUri: t, attributes: {} }],
  14662. }).playlists[i] = n.playlists[0]),
  14663. (n.playlists[t] = n.playlists[0]),
  14664. n)),
  14665. this.haveMetadata({ playlistObject: e, url: r, id: this.master.playlists[0].id }),
  14666. this.trigger('loadedmetadata')
  14667. }),
  14668. e
  14669. )
  14670. })(W),
  14671. bl = tr.xhr,
  14672. Tl = tr.mergeOptions,
  14673. zt = Object.freeze({
  14674. __proto__: null,
  14675. createTransferableMessage: Tu,
  14676. initSegmentId: Su,
  14677. segmentKeyId: wu,
  14678. hexDump: Eu,
  14679. tagDump: function (e) {
  14680. e = e.bytes
  14681. return Eu(e)
  14682. },
  14683. textRanges: function (e) {
  14684. for (var t, i, n = '', r = 0; r < e.length; r++) n += ((i = r), (t = e).start(i) + '-' + t.end(i) + ' ')
  14685. return n
  14686. },
  14687. }),
  14688. ar = tr.EventTarget,
  14689. Sl = tr.mergeOptions,
  14690. wl = (function (a) {
  14691. function e(e, t, i, n) {
  14692. var r
  14693. void 0 === i && (i = {}), ((r = a.call(this) || this).masterPlaylistLoader_ = n || ft(r)), n || (r.isMaster_ = !0)
  14694. ;(n = i.withCredentials), (n = void 0 !== n && n), (i = i.handleManifestRedirects), (i = void 0 !== i && i)
  14695. if (((r.vhs_ = t), (r.withCredentials = n), (r.handleManifestRedirects = i), !e)) throw new Error('A non-empty playlist URL or object is required')
  14696. return (
  14697. r.on('minimumUpdatePeriod', function () {
  14698. r.refreshXml_()
  14699. }),
  14700. r.on('mediaupdatetimeout', function () {
  14701. r.refreshMedia_(r.media().id)
  14702. }),
  14703. (r.state = 'HAVE_NOTHING'),
  14704. (r.loadedPlaylists_ = {}),
  14705. (r.logger_ = Ro('DashPlaylistLoader')),
  14706. r.isMaster_ ? ((r.masterPlaylistLoader_.srcUrl = e), (r.masterPlaylistLoader_.sidxMapping_ = {})) : (r.childPlaylist_ = e),
  14707. r
  14708. )
  14709. }
  14710. mt(e, a)
  14711. var t = e.prototype
  14712. return (
  14713. (t.requestErrored_ = function (e, t, i) {
  14714. return (
  14715. !this.request ||
  14716. ((this.request = null),
  14717. e
  14718. ? ((this.error = 'object' != typeof e || e instanceof Error ? { status: t.status, message: 'DASH request error at URL: ' + t.uri, response: t.response, code: 2 } : e),
  14719. i && (this.state = i),
  14720. this.trigger('error'),
  14721. !0)
  14722. : void 0)
  14723. )
  14724. }),
  14725. (t.addSidxSegments_ = function (a, n, r) {
  14726. var s,
  14727. o,
  14728. u = this,
  14729. l = a.sidx && xs(a.sidx)
  14730. a.sidx && l && !this.masterPlaylistLoader_.sidxMapping_[l]
  14731. ? ((s = Mo(this.handleManifestRedirects, a.sidx.resolvedUri)),
  14732. (o = function (e, t) {
  14733. if (!u.requestErrored_(e, t, n)) {
  14734. var i,
  14735. e = u.masterPlaylistLoader_.sidxMapping_
  14736. try {
  14737. i = wo(br(t.response).subarray(8))
  14738. } catch (e) {
  14739. return void u.requestErrored_(e, t, n)
  14740. }
  14741. return (e[l] = { sidxInfo: a.sidx, sidx: i }), ws(a, i, a.sidx.resolvedUri), r(!0)
  14742. }
  14743. }),
  14744. (this.request = xu(s, this.vhs_.xhr, function (e, t, i, n) {
  14745. if (e) return o(e, t)
  14746. if (!i || 'mp4' !== i)
  14747. return o(
  14748. {
  14749. status: t.status,
  14750. message: 'Unsupported ' + (i || 'unknown') + ' container type for sidx segment at URL: ' + s,
  14751. response: '',
  14752. playlist: a,
  14753. internal: !0,
  14754. blacklistDuration: 1 / 0,
  14755. code: 2,
  14756. },
  14757. t
  14758. )
  14759. var r = a.sidx.byterange,
  14760. i = r.offset,
  14761. r = r.length
  14762. if (n.length >= r + i) return o(e, { response: n.subarray(i, i + r), status: t.status, uri: t.uri })
  14763. u.request = u.vhs_.xhr({ uri: s, responseType: 'arraybuffer', headers: vu({ byterange: a.sidx.byterange }) }, o)
  14764. })))
  14765. : (this.mediaRequest_ = window.setTimeout(function () {
  14766. return r(!1)
  14767. }, 0))
  14768. }),
  14769. (t.dispose = function () {
  14770. this.trigger('dispose'),
  14771. this.stopRequest(),
  14772. (this.loadedPlaylists_ = {}),
  14773. window.clearTimeout(this.minimumUpdatePeriodTimeout_),
  14774. window.clearTimeout(this.mediaRequest_),
  14775. window.clearTimeout(this.mediaUpdateTimeout),
  14776. (this.mediaUpdateTimeout = null),
  14777. (this.mediaRequest_ = null),
  14778. (this.minimumUpdatePeriodTimeout_ = null),
  14779. this.masterPlaylistLoader_.createMupOnMedia_ &&
  14780. (this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_), (this.masterPlaylistLoader_.createMupOnMedia_ = null)),
  14781. this.off()
  14782. }),
  14783. (t.hasPendingRequest = function () {
  14784. return this.request || this.mediaRequest_
  14785. }),
  14786. (t.stopRequest = function () {
  14787. var e
  14788. this.request && ((e = this.request), (this.request = null), (e.onreadystatechange = null), e.abort())
  14789. }),
  14790. (t.media = function (t) {
  14791. var i = this
  14792. if (!t) return this.media_
  14793. if ('HAVE_NOTHING' === this.state) throw new Error('Cannot switch media playlist from ' + this.state)
  14794. var n = this.state
  14795. if ('string' == typeof t) {
  14796. if (!this.masterPlaylistLoader_.master.playlists[t]) throw new Error('Unknown playlist URI: ' + t)
  14797. t = this.masterPlaylistLoader_.master.playlists[t]
  14798. }
  14799. var e = !this.media_ || t.id !== this.media_.id
  14800. if (e && this.loadedPlaylists_[t.id] && this.loadedPlaylists_[t.id].endList)
  14801. return (this.state = 'HAVE_METADATA'), (this.media_ = t), void (e && (this.trigger('mediachanging'), this.trigger('mediachange')))
  14802. e &&
  14803. (this.media_ && this.trigger('mediachanging'),
  14804. this.addSidxSegments_(t, n, function (e) {
  14805. i.haveMetadata({ startingState: n, playlist: t })
  14806. }))
  14807. }),
  14808. (t.haveMetadata = function (e) {
  14809. var t = e.startingState,
  14810. e = e.playlist
  14811. ;(this.state = 'HAVE_METADATA'),
  14812. (this.loadedPlaylists_[e.id] = e),
  14813. (this.mediaRequest_ = null),
  14814. this.refreshMedia_(e.id),
  14815. 'HAVE_MASTER' === t ? this.trigger('loadedmetadata') : this.trigger('mediachange')
  14816. }),
  14817. (t.pause = function () {
  14818. this.masterPlaylistLoader_.createMupOnMedia_ && (this.off('loadedmetadata', this.masterPlaylistLoader_.createMupOnMedia_), (this.masterPlaylistLoader_.createMupOnMedia_ = null)),
  14819. this.stopRequest(),
  14820. window.clearTimeout(this.mediaUpdateTimeout),
  14821. (this.mediaUpdateTimeout = null),
  14822. this.isMaster_ && (window.clearTimeout(this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_), (this.masterPlaylistLoader_.minimumUpdatePeriodTimeout_ = null)),
  14823. 'HAVE_NOTHING' === this.state && (this.started = !1)
  14824. }),
  14825. (t.load = function (e) {
  14826. var t = this
  14827. window.clearTimeout(this.mediaUpdateTimeout), (this.mediaUpdateTimeout = null)
  14828. var i = this.media()
  14829. e
  14830. ? ((e = i ? (i.targetDuration / 2) * 1e3 : 5e3),
  14831. (this.mediaUpdateTimeout = window.setTimeout(function () {
  14832. return t.load()
  14833. }, e)))
  14834. : this.started
  14835. ? i && !i.endList
  14836. ? (this.isMaster_ && !this.minimumUpdatePeriodTimeout_ && (this.trigger('minimumUpdatePeriod'), this.updateMinimumUpdatePeriodTimeout_()),
  14837. this.trigger('mediaupdatetimeout'))
  14838. : this.trigger('loadedplaylist')
  14839. : this.start()
  14840. }),
  14841. (t.start = function () {
  14842. var i = this
  14843. ;(this.started = !0),
  14844. this.isMaster_
  14845. ? this.requestMaster_(function (e, t) {
  14846. i.haveMaster_(), i.hasPendingRequest() || i.media_ || i.media(i.masterPlaylistLoader_.master.playlists[0])
  14847. })
  14848. : (this.mediaRequest_ = window.setTimeout(function () {
  14849. return i.haveMaster_()
  14850. }, 0))
  14851. }),
  14852. (t.requestMaster_ = function (n) {
  14853. var r = this
  14854. this.request = this.vhs_.xhr({ uri: this.masterPlaylistLoader_.srcUrl, withCredentials: this.withCredentials }, function (e, t) {
  14855. if (!r.requestErrored_(e, t)) {
  14856. var i = t.responseText !== r.masterPlaylistLoader_.masterXml_
  14857. return (
  14858. (r.masterPlaylistLoader_.masterXml_ = t.responseText),
  14859. t.responseHeaders && t.responseHeaders.date ? (r.masterLoaded_ = Date.parse(t.responseHeaders.date)) : (r.masterLoaded_ = Date.now()),
  14860. (r.masterPlaylistLoader_.srcUrl = Mo(r.handleManifestRedirects, r.masterPlaylistLoader_.srcUrl, t)),
  14861. i
  14862. ? (r.handleMaster_(),
  14863. void r.syncClientServerClock_(function () {
  14864. return n(t, i)
  14865. }))
  14866. : n(t, i)
  14867. )
  14868. }
  14869. 'HAVE_NOTHING' === r.state && (r.started = !1)
  14870. })
  14871. }),
  14872. (t.syncClientServerClock_ = function (i) {
  14873. var n = this,
  14874. r = Zs(this.masterPlaylistLoader_.masterXml_)
  14875. return null === r
  14876. ? ((this.masterPlaylistLoader_.clientOffset_ = this.masterLoaded_ - Date.now()), i())
  14877. : 'DIRECT' === r.method
  14878. ? ((this.masterPlaylistLoader_.clientOffset_ = r.value - Date.now()), i())
  14879. : void (this.request = this.vhs_.xhr({ uri: pl(this.masterPlaylistLoader_.srcUrl, r.value), method: r.method, withCredentials: this.withCredentials }, function (e, t) {
  14880. if (n.request) {
  14881. if (e) return (n.masterPlaylistLoader_.clientOffset_ = n.masterLoaded_ - Date.now()), i()
  14882. t = 'HEAD' === r.method ? (t.responseHeaders && t.responseHeaders.date ? Date.parse(t.responseHeaders.date) : n.masterLoaded_) : Date.parse(t.responseText)
  14883. ;(n.masterPlaylistLoader_.clientOffset_ = t - Date.now()), i()
  14884. }
  14885. }))
  14886. }),
  14887. (t.haveMaster_ = function () {
  14888. ;(this.state = 'HAVE_MASTER'), this.isMaster_ ? this.trigger('loadedplaylist') : this.media_ || this.media(this.childPlaylist_)
  14889. }),
  14890. (t.handleMaster_ = function () {
  14891. this.mediaRequest_ = null
  14892. var e,
  14893. t,
  14894. i,
  14895. n,
  14896. r = this.masterPlaylistLoader_.master,
  14897. t =
  14898. ((a = {
  14899. masterXml: this.masterPlaylistLoader_.masterXml_,
  14900. srcUrl: this.masterPlaylistLoader_.srcUrl,
  14901. clientOffset: this.masterPlaylistLoader_.clientOffset_,
  14902. sidxMapping: this.masterPlaylistLoader_.sidxMapping_,
  14903. previousManifest: r,
  14904. }),
  14905. (e = a.masterXml),
  14906. (t = a.srcUrl),
  14907. (i = a.clientOffset),
  14908. (n = a.sidxMapping),
  14909. (a = a.previousManifest),
  14910. (a = Js(e, { manifestUri: t, clientOffset: i, sidxMapping: n, previousManifest: a })),
  14911. lu(a, t),
  14912. a)
  14913. r &&
  14914. (t = (function (e, t, i) {
  14915. for (var a = !0, s = Sl(e, { duration: t.duration, minimumUpdatePeriod: t.minimumUpdatePeriod, timelineStarts: t.timelineStarts }), n = 0; n < t.playlists.length; n++) {
  14916. var r,
  14917. o = t.playlists[n]
  14918. o.sidx && ((r = xs(o.sidx)), i && i[r] && i[r].sidx && ws(o, i[r].sidx, o.sidx.resolvedUri))
  14919. o = fu(s, o, Au)
  14920. o && ((s = o), (a = !1))
  14921. }
  14922. return (
  14923. ou(t, function (e, t, i, n) {
  14924. var r
  14925. e.playlists &&
  14926. e.playlists.length &&
  14927. ((r = e.playlists[0].id), (e = fu(s, e.playlists[0], Au)) && (((s = e).mediaGroups[t][i][n].playlists[0] = s.playlists[r]), (a = !1)))
  14928. }),
  14929. (a = t.minimumUpdatePeriod === e.minimumUpdatePeriod && a) ? null : s
  14930. )
  14931. })(r, t, this.masterPlaylistLoader_.sidxMapping_)),
  14932. (this.masterPlaylistLoader_.master = t || r)
  14933. var a = this.masterPlaylistLoader_.master.locations && this.masterPlaylistLoader_.master.locations[0]
  14934. return (
  14935. a && a !== this.masterPlaylistLoader_.srcUrl && (this.masterPlaylistLoader_.srcUrl = a),
  14936. (!r || (t && t.minimumUpdatePeriod !== r.minimumUpdatePeriod)) && this.updateMinimumUpdatePeriodTimeout_(),
  14937. Boolean(t)
  14938. )
  14939. }),
  14940. (t.updateMinimumUpdatePeriodTimeout_ = function () {
  14941. var e = this.masterPlaylistLoader_
  14942. e.createMupOnMedia_ && (e.off('loadedmetadata', e.createMupOnMedia_), (e.createMupOnMedia_ = null)),
  14943. e.minimumUpdatePeriodTimeout_ && (window.clearTimeout(e.minimumUpdatePeriodTimeout_), (e.minimumUpdatePeriodTimeout_ = null))
  14944. var t = e.master && e.master.minimumUpdatePeriod
  14945. 0 === t && (e.media() ? (t = 1e3 * e.media().targetDuration) : ((e.createMupOnMedia_ = e.updateMinimumUpdatePeriodTimeout_), e.one('loadedmetadata', e.createMupOnMedia_))),
  14946. 'number' != typeof t || t <= 0 ? t < 0 && this.logger_('found invalid minimumUpdatePeriod of ' + t + ', not setting a timeout') : this.createMUPTimeout_(t)
  14947. }),
  14948. (t.createMUPTimeout_ = function (e) {
  14949. var t = this.masterPlaylistLoader_
  14950. t.minimumUpdatePeriodTimeout_ = window.setTimeout(function () {
  14951. ;(t.minimumUpdatePeriodTimeout_ = null), t.trigger('minimumUpdatePeriod'), t.createMUPTimeout_(e)
  14952. }, e)
  14953. }),
  14954. (t.refreshXml_ = function () {
  14955. var i = this
  14956. this.requestMaster_(function (e, t) {
  14957. var r, a
  14958. t &&
  14959. (i.media_ && (i.media_ = i.masterPlaylistLoader_.master.playlists[i.media_.id]),
  14960. (i.masterPlaylistLoader_.sidxMapping_ =
  14961. ((t = i.masterPlaylistLoader_.master),
  14962. (r = i.masterPlaylistLoader_.sidxMapping_),
  14963. (a = Pu(t.playlists, r)),
  14964. ou(t, function (e, t, i, n) {
  14965. e.playlists && e.playlists.length && ((e = e.playlists), (a = Sl(a, Pu(e, r))))
  14966. }),
  14967. a)),
  14968. i.addSidxSegments_(i.media(), i.state, function (e) {
  14969. i.refreshMedia_(i.media().id)
  14970. }))
  14971. })
  14972. }),
  14973. (t.refreshMedia_ = function (e) {
  14974. var t = this
  14975. if (!e) throw new Error('refreshMedia_ must take a media id')
  14976. this.media_ && this.isMaster_ && this.handleMaster_()
  14977. var i = this.masterPlaylistLoader_.master.playlists,
  14978. n = !this.media_ || this.media_ !== i[e]
  14979. n ? (this.media_ = i[e]) : this.trigger('playlistunchanged'),
  14980. this.mediaUpdateTimeout ||
  14981. (function e() {
  14982. t.media().endList ||
  14983. (t.mediaUpdateTimeout = window.setTimeout(function () {
  14984. t.trigger('mediaupdatetimeout'), e()
  14985. }, mu(t.media(), Boolean(n))))
  14986. })(),
  14987. this.trigger('loadedplaylist')
  14988. }),
  14989. e
  14990. )
  14991. })(ar),
  14992. El = {
  14993. GOAL_BUFFER_LENGTH: 30,
  14994. MAX_GOAL_BUFFER_LENGTH: 60,
  14995. BACK_BUFFER_LENGTH: 30,
  14996. GOAL_BUFFER_LENGTH_RATE: 1,
  14997. INITIAL_BANDWIDTH: 4194304,
  14998. BANDWIDTH_VARIANCE: 1.2,
  14999. BUFFER_LOW_WATER_LINE: 0,
  15000. MAX_BUFFER_LOW_WATER_LINE: 30,
  15001. EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE: 16,
  15002. BUFFER_LOW_WATER_LINE_RATE: 1,
  15003. BUFFER_HIGH_WATER_LINE: 30,
  15004. },
  15005. x = function (n) {
  15006. return function () {
  15007. var e = (function (t) {
  15008. try {
  15009. return URL.createObjectURL(new Blob([t], { type: 'application/javascript' }))
  15010. } catch (e) {
  15011. var i = new BlobBuilder()
  15012. return i.append(t), URL.createObjectURL(i.getBlob())
  15013. }
  15014. })(n),
  15015. t = Lu(new Worker(e))
  15016. t.objURL = e
  15017. var i = t.terminate
  15018. return (
  15019. (t.on = t.addEventListener),
  15020. (t.off = t.removeEventListener),
  15021. (t.terminate = function () {
  15022. return URL.revokeObjectURL(e), i.call(this)
  15023. }),
  15024. t
  15025. )
  15026. }
  15027. },
  15028. U = function (e) {
  15029. return 'var browserWorkerPolyFill = ' + Lu.toString() + ';\nbrowserWorkerPolyFill(self);\n' + e
  15030. },
  15031. W = function (e) {
  15032. return e
  15033. .toString()
  15034. .replace(/^function.+?{/, '')
  15035. .slice(0, -1)
  15036. },
  15037. kl = x(
  15038. U(
  15039. W(function () {
  15040. var e = function () {
  15041. this.init = function () {
  15042. var a = {}
  15043. ;(this.on = function (e, t) {
  15044. a[e] || (a[e] = []), (a[e] = a[e].concat(t))
  15045. }),
  15046. (this.off = function (e, t) {
  15047. return !!a[e] && ((t = a[e].indexOf(t)), (a[e] = a[e].slice()), a[e].splice(t, 1), -1 < t)
  15048. }),
  15049. (this.trigger = function (e) {
  15050. var t,
  15051. i,
  15052. n,
  15053. r = a[e]
  15054. if (r)
  15055. if (2 === arguments.length) for (i = r.length, t = 0; t < i; ++t) r[t].call(this, arguments[1])
  15056. else {
  15057. for (n = [], t = arguments.length, t = 1; t < arguments.length; ++t) n.push(arguments[t])
  15058. for (i = r.length, t = 0; t < i; ++t) r[t].apply(this, n)
  15059. }
  15060. }),
  15061. (this.dispose = function () {
  15062. a = {}
  15063. })
  15064. }
  15065. }
  15066. ;(e.prototype.pipe = function (t) {
  15067. return (
  15068. this.on('data', function (e) {
  15069. t.push(e)
  15070. }),
  15071. this.on('done', function (e) {
  15072. t.flush(e)
  15073. }),
  15074. this.on('partialdone', function (e) {
  15075. t.partialFlush(e)
  15076. }),
  15077. this.on('endedtimeline', function (e) {
  15078. t.endTimeline(e)
  15079. }),
  15080. this.on('reset', function (e) {
  15081. t.reset(e)
  15082. }),
  15083. t
  15084. )
  15085. }),
  15086. (e.prototype.push = function (e) {
  15087. this.trigger('data', e)
  15088. }),
  15089. (e.prototype.flush = function (e) {
  15090. this.trigger('done', e)
  15091. }),
  15092. (e.prototype.partialFlush = function (e) {
  15093. this.trigger('partialdone', e)
  15094. }),
  15095. (e.prototype.endTimeline = function (e) {
  15096. this.trigger('endedtimeline', e)
  15097. }),
  15098. (e.prototype.reset = function (e) {
  15099. this.trigger('reset', e)
  15100. })
  15101. var u,
  15102. t,
  15103. i,
  15104. n,
  15105. r,
  15106. a,
  15107. s,
  15108. o,
  15109. l,
  15110. c,
  15111. d,
  15112. h,
  15113. p,
  15114. f,
  15115. m,
  15116. g,
  15117. y,
  15118. v,
  15119. _,
  15120. b,
  15121. T,
  15122. S,
  15123. w,
  15124. E,
  15125. k,
  15126. C,
  15127. I,
  15128. x,
  15129. A,
  15130. P,
  15131. L,
  15132. D,
  15133. O,
  15134. M,
  15135. R,
  15136. N,
  15137. U,
  15138. B,
  15139. F,
  15140. j = e,
  15141. H = Math.pow(2, 32),
  15142. q = {
  15143. getUint64: function (e) {
  15144. var t = new DataView(e.buffer, e.byteOffset, e.byteLength)
  15145. return t.getBigUint64 ? ((e = t.getBigUint64(0)) < Number.MAX_SAFE_INTEGER ? Number(e) : e) : t.getUint32(0) * H + t.getUint32(4)
  15146. },
  15147. MAX_UINT32: H,
  15148. },
  15149. V = q.MAX_UINT32
  15150. !(function () {
  15151. if (
  15152. ((T = {
  15153. avc1: [],
  15154. avcC: [],
  15155. btrt: [],
  15156. dinf: [],
  15157. dref: [],
  15158. esds: [],
  15159. ftyp: [],
  15160. hdlr: [],
  15161. mdat: [],
  15162. mdhd: [],
  15163. mdia: [],
  15164. mfhd: [],
  15165. minf: [],
  15166. moof: [],
  15167. moov: [],
  15168. mp4a: [],
  15169. mvex: [],
  15170. mvhd: [],
  15171. pasp: [],
  15172. sdtp: [],
  15173. smhd: [],
  15174. stbl: [],
  15175. stco: [],
  15176. stsc: [],
  15177. stsd: [],
  15178. stsz: [],
  15179. stts: [],
  15180. styp: [],
  15181. tfdt: [],
  15182. tfhd: [],
  15183. traf: [],
  15184. trak: [],
  15185. trun: [],
  15186. trex: [],
  15187. tkhd: [],
  15188. vmhd: [],
  15189. }),
  15190. 'undefined' != typeof Uint8Array)
  15191. ) {
  15192. for (var e in T) T.hasOwnProperty(e) && (T[e] = [e.charCodeAt(0), e.charCodeAt(1), e.charCodeAt(2), e.charCodeAt(3)])
  15193. ;(S = new Uint8Array(['i'.charCodeAt(0), 's'.charCodeAt(0), 'o'.charCodeAt(0), 'm'.charCodeAt(0)])),
  15194. (E = new Uint8Array(['a'.charCodeAt(0), 'v'.charCodeAt(0), 'c'.charCodeAt(0), '1'.charCodeAt(0)])),
  15195. (w = new Uint8Array([0, 0, 0, 1])),
  15196. (k = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 118, 105, 100, 101, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 86, 105, 100, 101, 111, 72, 97, 110, 100, 108, 101, 114, 0])),
  15197. (C = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 115, 111, 117, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 83, 111, 117, 110, 100, 72, 97, 110, 100, 108, 101, 114, 0])),
  15198. (I = { video: k, audio: C }),
  15199. (P = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 12, 117, 114, 108, 32, 0, 0, 0, 1])),
  15200. (A = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  15201. (L = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0])),
  15202. (D = L),
  15203. (O = new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
  15204. (M = L),
  15205. (x = new Uint8Array([0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0]))
  15206. }
  15207. })(),
  15208. (u = function (e) {
  15209. for (var t, i = [], n = 0, r = 1; r < arguments.length; r++) i.push(arguments[r])
  15210. for (r = i.length; r--; ) n += i[r].byteLength
  15211. for (t = new Uint8Array(n + 8), new DataView(t.buffer, t.byteOffset, t.byteLength).setUint32(0, t.byteLength), t.set(e, 4), r = 0, n = 8; r < i.length; r++)
  15212. t.set(i[r], n), (n += i[r].byteLength)
  15213. return t
  15214. }),
  15215. (t = function () {
  15216. return u(T.dinf, u(T.dref, P))
  15217. }),
  15218. (i = function (e) {
  15219. return u(
  15220. T.esds,
  15221. new Uint8Array([
  15222. 0,
  15223. 0,
  15224. 0,
  15225. 0,
  15226. 3,
  15227. 25,
  15228. 0,
  15229. 0,
  15230. 0,
  15231. 4,
  15232. 17,
  15233. 64,
  15234. 21,
  15235. 0,
  15236. 6,
  15237. 0,
  15238. 0,
  15239. 0,
  15240. 218,
  15241. 192,
  15242. 0,
  15243. 0,
  15244. 218,
  15245. 192,
  15246. 5,
  15247. 2,
  15248. (e.audioobjecttype << 3) | (e.samplingfrequencyindex >>> 1),
  15249. (e.samplingfrequencyindex << 7) | (e.channelcount << 3),
  15250. 6,
  15251. 1,
  15252. 2,
  15253. ])
  15254. )
  15255. }),
  15256. (f = function (e) {
  15257. return u(T.hdlr, I[e])
  15258. }),
  15259. (p = function (e) {
  15260. var t = new Uint8Array([
  15261. 0,
  15262. 0,
  15263. 0,
  15264. 0,
  15265. 0,
  15266. 0,
  15267. 0,
  15268. 2,
  15269. 0,
  15270. 0,
  15271. 0,
  15272. 3,
  15273. 0,
  15274. 1,
  15275. 95,
  15276. 144,
  15277. (e.duration >>> 24) & 255,
  15278. (e.duration >>> 16) & 255,
  15279. (e.duration >>> 8) & 255,
  15280. 255 & e.duration,
  15281. 85,
  15282. 196,
  15283. 0,
  15284. 0,
  15285. ])
  15286. return (
  15287. e.samplerate && ((t[12] = (e.samplerate >>> 24) & 255), (t[13] = (e.samplerate >>> 16) & 255), (t[14] = (e.samplerate >>> 8) & 255), (t[15] = 255 & e.samplerate)),
  15288. u(T.mdhd, t)
  15289. )
  15290. }),
  15291. (h = function (e) {
  15292. return u(T.mdia, p(e), f(e.type), a(e))
  15293. }),
  15294. (r = function (e) {
  15295. return u(T.mfhd, new Uint8Array([0, 0, 0, 0, (4278190080 & e) >> 24, (16711680 & e) >> 16, (65280 & e) >> 8, 255 & e]))
  15296. }),
  15297. (a = function (e) {
  15298. return u(T.minf, 'video' === e.type ? u(T.vmhd, x) : u(T.smhd, A), t(), g(e))
  15299. }),
  15300. (We = function (e, t) {
  15301. for (var i = [], n = t.length; n--; ) i[n] = v(t[n])
  15302. return u.apply(null, [T.moof, r(e)].concat(i))
  15303. }),
  15304. (s = function (e) {
  15305. for (var t = e.length, i = []; t--; ) i[t] = c(e[t])
  15306. return u.apply(null, [T.moov, l(4294967295)].concat(i).concat(o(e)))
  15307. }),
  15308. (o = function (e) {
  15309. for (var t = e.length, i = []; t--; ) i[t] = _(e[t])
  15310. return u.apply(null, [T.mvex].concat(i))
  15311. }),
  15312. (l = function (e) {
  15313. e = new Uint8Array([
  15314. 0,
  15315. 0,
  15316. 0,
  15317. 0,
  15318. 0,
  15319. 0,
  15320. 0,
  15321. 1,
  15322. 0,
  15323. 0,
  15324. 0,
  15325. 2,
  15326. 0,
  15327. 1,
  15328. 95,
  15329. 144,
  15330. (4278190080 & e) >> 24,
  15331. (16711680 & e) >> 16,
  15332. (65280 & e) >> 8,
  15333. 255 & e,
  15334. 0,
  15335. 1,
  15336. 0,
  15337. 0,
  15338. 1,
  15339. 0,
  15340. 0,
  15341. 0,
  15342. 0,
  15343. 0,
  15344. 0,
  15345. 0,
  15346. 0,
  15347. 0,
  15348. 0,
  15349. 0,
  15350. 0,
  15351. 1,
  15352. 0,
  15353. 0,
  15354. 0,
  15355. 0,
  15356. 0,
  15357. 0,
  15358. 0,
  15359. 0,
  15360. 0,
  15361. 0,
  15362. 0,
  15363. 0,
  15364. 0,
  15365. 0,
  15366. 0,
  15367. 1,
  15368. 0,
  15369. 0,
  15370. 0,
  15371. 0,
  15372. 0,
  15373. 0,
  15374. 0,
  15375. 0,
  15376. 0,
  15377. 0,
  15378. 0,
  15379. 0,
  15380. 0,
  15381. 0,
  15382. 64,
  15383. 0,
  15384. 0,
  15385. 0,
  15386. 0,
  15387. 0,
  15388. 0,
  15389. 0,
  15390. 0,
  15391. 0,
  15392. 0,
  15393. 0,
  15394. 0,
  15395. 0,
  15396. 0,
  15397. 0,
  15398. 0,
  15399. 0,
  15400. 0,
  15401. 0,
  15402. 0,
  15403. 0,
  15404. 0,
  15405. 0,
  15406. 0,
  15407. 0,
  15408. 0,
  15409. 0,
  15410. 255,
  15411. 255,
  15412. 255,
  15413. 255,
  15414. ])
  15415. return u(T.mvhd, e)
  15416. }),
  15417. (m = function (e) {
  15418. for (var t, i = e.samples || [], n = new Uint8Array(4 + i.length), r = 0; r < i.length; r++)
  15419. (t = i[r].flags), (n[r + 4] = (t.dependsOn << 4) | (t.isDependedOn << 2) | t.hasRedundancy)
  15420. return u(T.sdtp, n)
  15421. }),
  15422. (g = function (e) {
  15423. return u(T.stbl, y(e), u(T.stts, M), u(T.stsc, D), u(T.stsz, O), u(T.stco, L))
  15424. }),
  15425. (y = function (e) {
  15426. return u(T.stsd, new Uint8Array([0, 0, 0, 0, 0, 0, 0, 1]), ('video' === e.type ? R : N)(e))
  15427. }),
  15428. (R = function (e) {
  15429. for (var t, i, n = e.sps || [], r = e.pps || [], a = [], s = [], o = 0; o < n.length; o++)
  15430. a.push((65280 & n[o].byteLength) >>> 8), a.push(255 & n[o].byteLength), (a = a.concat(Array.prototype.slice.call(n[o])))
  15431. for (o = 0; o < r.length; o++) s.push((65280 & r[o].byteLength) >>> 8), s.push(255 & r[o].byteLength), (s = s.concat(Array.prototype.slice.call(r[o])))
  15432. return (
  15433. (t = [
  15434. T.avc1,
  15435. new Uint8Array([
  15436. 0,
  15437. 0,
  15438. 0,
  15439. 0,
  15440. 0,
  15441. 0,
  15442. 0,
  15443. 1,
  15444. 0,
  15445. 0,
  15446. 0,
  15447. 0,
  15448. 0,
  15449. 0,
  15450. 0,
  15451. 0,
  15452. 0,
  15453. 0,
  15454. 0,
  15455. 0,
  15456. 0,
  15457. 0,
  15458. 0,
  15459. 0,
  15460. (65280 & e.width) >> 8,
  15461. 255 & e.width,
  15462. (65280 & e.height) >> 8,
  15463. 255 & e.height,
  15464. 0,
  15465. 72,
  15466. 0,
  15467. 0,
  15468. 0,
  15469. 72,
  15470. 0,
  15471. 0,
  15472. 0,
  15473. 0,
  15474. 0,
  15475. 0,
  15476. 0,
  15477. 1,
  15478. 19,
  15479. 118,
  15480. 105,
  15481. 100,
  15482. 101,
  15483. 111,
  15484. 106,
  15485. 115,
  15486. 45,
  15487. 99,
  15488. 111,
  15489. 110,
  15490. 116,
  15491. 114,
  15492. 105,
  15493. 98,
  15494. 45,
  15495. 104,
  15496. 108,
  15497. 115,
  15498. 0,
  15499. 0,
  15500. 0,
  15501. 0,
  15502. 0,
  15503. 0,
  15504. 0,
  15505. 0,
  15506. 0,
  15507. 0,
  15508. 0,
  15509. 0,
  15510. 0,
  15511. 24,
  15512. 17,
  15513. 17,
  15514. ]),
  15515. u(T.avcC, new Uint8Array([1, e.profileIdc, e.profileCompatibility, e.levelIdc, 255].concat([n.length], a, [r.length], s))),
  15516. u(T.btrt, new Uint8Array([0, 28, 156, 128, 0, 45, 198, 192, 0, 45, 198, 192])),
  15517. ]),
  15518. e.sarRatio &&
  15519. ((i = e.sarRatio[0]),
  15520. (e = e.sarRatio[1]),
  15521. t.push(
  15522. u(
  15523. T.pasp,
  15524. new Uint8Array([
  15525. (4278190080 & i) >> 24,
  15526. (16711680 & i) >> 16,
  15527. (65280 & i) >> 8,
  15528. 255 & i,
  15529. (4278190080 & e) >> 24,
  15530. (16711680 & e) >> 16,
  15531. (65280 & e) >> 8,
  15532. 255 & e,
  15533. ])
  15534. )
  15535. )),
  15536. u.apply(null, t)
  15537. )
  15538. }),
  15539. (N = function (e) {
  15540. return u(
  15541. T.mp4a,
  15542. new Uint8Array([
  15543. 0,
  15544. 0,
  15545. 0,
  15546. 0,
  15547. 0,
  15548. 0,
  15549. 0,
  15550. 1,
  15551. 0,
  15552. 0,
  15553. 0,
  15554. 0,
  15555. 0,
  15556. 0,
  15557. 0,
  15558. 0,
  15559. (65280 & e.channelcount) >> 8,
  15560. 255 & e.channelcount,
  15561. (65280 & e.samplesize) >> 8,
  15562. 255 & e.samplesize,
  15563. 0,
  15564. 0,
  15565. 0,
  15566. 0,
  15567. (65280 & e.samplerate) >> 8,
  15568. 255 & e.samplerate,
  15569. 0,
  15570. 0,
  15571. ]),
  15572. i(e)
  15573. )
  15574. }),
  15575. (d = function (e) {
  15576. e = new Uint8Array([
  15577. 0,
  15578. 0,
  15579. 0,
  15580. 7,
  15581. 0,
  15582. 0,
  15583. 0,
  15584. 0,
  15585. 0,
  15586. 0,
  15587. 0,
  15588. 0,
  15589. (4278190080 & e.id) >> 24,
  15590. (16711680 & e.id) >> 16,
  15591. (65280 & e.id) >> 8,
  15592. 255 & e.id,
  15593. 0,
  15594. 0,
  15595. 0,
  15596. 0,
  15597. (4278190080 & e.duration) >> 24,
  15598. (16711680 & e.duration) >> 16,
  15599. (65280 & e.duration) >> 8,
  15600. 255 & e.duration,
  15601. 0,
  15602. 0,
  15603. 0,
  15604. 0,
  15605. 0,
  15606. 0,
  15607. 0,
  15608. 0,
  15609. 0,
  15610. 0,
  15611. 0,
  15612. 0,
  15613. 1,
  15614. 0,
  15615. 0,
  15616. 0,
  15617. 0,
  15618. 1,
  15619. 0,
  15620. 0,
  15621. 0,
  15622. 0,
  15623. 0,
  15624. 0,
  15625. 0,
  15626. 0,
  15627. 0,
  15628. 0,
  15629. 0,
  15630. 0,
  15631. 0,
  15632. 0,
  15633. 0,
  15634. 1,
  15635. 0,
  15636. 0,
  15637. 0,
  15638. 0,
  15639. 0,
  15640. 0,
  15641. 0,
  15642. 0,
  15643. 0,
  15644. 0,
  15645. 0,
  15646. 0,
  15647. 0,
  15648. 0,
  15649. 64,
  15650. 0,
  15651. 0,
  15652. 0,
  15653. (65280 & e.width) >> 8,
  15654. 255 & e.width,
  15655. 0,
  15656. 0,
  15657. (65280 & e.height) >> 8,
  15658. 255 & e.height,
  15659. 0,
  15660. 0,
  15661. ])
  15662. return u(T.tkhd, e)
  15663. }),
  15664. (v = function (e) {
  15665. var t,
  15666. i = u(
  15667. T.tfhd,
  15668. new Uint8Array([0, 0, 0, 58, (4278190080 & e.id) >> 24, (16711680 & e.id) >> 16, (65280 & e.id) >> 8, 255 & e.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])
  15669. ),
  15670. n = Math.floor(e.baseMediaDecodeTime / V),
  15671. r = Math.floor(e.baseMediaDecodeTime % V),
  15672. n = u(T.tfdt, new Uint8Array([1, 0, 0, 0, (n >>> 24) & 255, (n >>> 16) & 255, (n >>> 8) & 255, 255 & n, (r >>> 24) & 255, (r >>> 16) & 255, (r >>> 8) & 255, 255 & r]))
  15673. return 'audio' === e.type ? ((t = b(e, 92)), u(T.traf, i, n, t)) : ((r = m(e)), (t = b(e, r.length + 92)), u(T.traf, i, n, t, r))
  15674. }),
  15675. (c = function (e) {
  15676. return (e.duration = e.duration || 4294967295), u(T.trak, d(e), h(e))
  15677. }),
  15678. (_ = function (e) {
  15679. var t = new Uint8Array([0, 0, 0, 0, (4278190080 & e.id) >> 24, (16711680 & e.id) >> 16, (65280 & e.id) >> 8, 255 & e.id, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1])
  15680. return 'video' !== e.type && (t[t.length - 1] = 0), u(T.trex, t)
  15681. }),
  15682. (U = function (e, t) {
  15683. var i = 0,
  15684. n = 0,
  15685. r = 0,
  15686. a = 0
  15687. return (
  15688. e.length && (void 0 !== e[0].duration && (i = 1), void 0 !== e[0].size && (n = 2), void 0 !== e[0].flags && (r = 4), void 0 !== e[0].compositionTimeOffset && (a = 8)),
  15689. [
  15690. 0,
  15691. 0,
  15692. i | n | r | a,
  15693. 1,
  15694. (4278190080 & e.length) >>> 24,
  15695. (16711680 & e.length) >>> 16,
  15696. (65280 & e.length) >>> 8,
  15697. 255 & e.length,
  15698. (4278190080 & t) >>> 24,
  15699. (16711680 & t) >>> 16,
  15700. (65280 & t) >>> 8,
  15701. 255 & t,
  15702. ]
  15703. )
  15704. }),
  15705. (B = function (e, t) {
  15706. var i,
  15707. n,
  15708. r,
  15709. a,
  15710. s = e.samples || []
  15711. for (t += 20 + 16 * s.length, t = U(s, t), (n = new Uint8Array(t.length + 16 * s.length)).set(t), i = t.length, a = 0; a < s.length; a++)
  15712. (r = s[a]),
  15713. (n[i++] = (4278190080 & r.duration) >>> 24),
  15714. (n[i++] = (16711680 & r.duration) >>> 16),
  15715. (n[i++] = (65280 & r.duration) >>> 8),
  15716. (n[i++] = 255 & r.duration),
  15717. (n[i++] = (4278190080 & r.size) >>> 24),
  15718. (n[i++] = (16711680 & r.size) >>> 16),
  15719. (n[i++] = (65280 & r.size) >>> 8),
  15720. (n[i++] = 255 & r.size),
  15721. (n[i++] = (r.flags.isLeading << 2) | r.flags.dependsOn),
  15722. (n[i++] = (r.flags.isDependedOn << 6) | (r.flags.hasRedundancy << 4) | (r.flags.paddingValue << 1) | r.flags.isNonSyncSample),
  15723. (n[i++] = 61440 & r.flags.degradationPriority),
  15724. (n[i++] = 15 & r.flags.degradationPriority),
  15725. (n[i++] = (4278190080 & r.compositionTimeOffset) >>> 24),
  15726. (n[i++] = (16711680 & r.compositionTimeOffset) >>> 16),
  15727. (n[i++] = (65280 & r.compositionTimeOffset) >>> 8),
  15728. (n[i++] = 255 & r.compositionTimeOffset)
  15729. return u(T.trun, n)
  15730. }),
  15731. (F = function (e, t) {
  15732. var i,
  15733. n,
  15734. r,
  15735. a,
  15736. s = e.samples || []
  15737. for (t += 20 + 8 * s.length, t = U(s, t), (i = new Uint8Array(t.length + 8 * s.length)).set(t), n = t.length, a = 0; a < s.length; a++)
  15738. (r = s[a]),
  15739. (i[n++] = (4278190080 & r.duration) >>> 24),
  15740. (i[n++] = (16711680 & r.duration) >>> 16),
  15741. (i[n++] = (65280 & r.duration) >>> 8),
  15742. (i[n++] = 255 & r.duration),
  15743. (i[n++] = (4278190080 & r.size) >>> 24),
  15744. (i[n++] = (16711680 & r.size) >>> 16),
  15745. (i[n++] = (65280 & r.size) >>> 8),
  15746. (i[n++] = 255 & r.size)
  15747. return u(T.trun, i)
  15748. }),
  15749. (b = function (e, t) {
  15750. return ('audio' === e.type ? F : B)(e, t)
  15751. })
  15752. n = function () {
  15753. return u(T.ftyp, S, w, S, E)
  15754. }
  15755. function W(e, t) {
  15756. var i = { size: 0, flags: { isLeading: 0, dependsOn: 1, isDependedOn: 0, hasRedundancy: 0, degradationPriority: 0, isNonSyncSample: 1 } }
  15757. return (
  15758. (i.dataOffset = t),
  15759. (i.compositionTimeOffset = e.pts - e.dts),
  15760. (i.duration = e.duration),
  15761. (i.size = 4 * e.length),
  15762. (i.size += e.byteLength),
  15763. e.keyFrame && ((i.flags.dependsOn = 2), (i.flags.isNonSyncSample = 0)),
  15764. i
  15765. )
  15766. }
  15767. function G(e) {
  15768. for (var t = []; e--; ) t.push(0)
  15769. return t
  15770. }
  15771. function z() {
  15772. var e, i
  15773. return (
  15774. X ||
  15775. ((e = {
  15776. 96e3: [ie, [227, 64], G(154), [56]],
  15777. 88200: [ie, [231], G(170), [56]],
  15778. 64e3: [ie, [248, 192], G(240), [56]],
  15779. 48e3: [ie, [255, 192], G(268), [55, 148, 128], G(54), [112]],
  15780. 44100: [ie, [255, 192], G(268), [55, 163, 128], G(84), [112]],
  15781. 32e3: [ie, [255, 192], G(268), [55, 234], G(226), [112]],
  15782. 24e3: [ie, [255, 192], G(268), [55, 255, 128], G(268), [111, 112], G(126), [224]],
  15783. 16e3: [ie, [255, 192], G(268), [55, 255, 128], G(268), [111, 255], G(269), [223, 108], G(195), [1, 192]],
  15784. 12e3: [ne, G(268), [3, 127, 248], G(268), [6, 255, 240], G(268), [13, 255, 224], G(268), [27, 253, 128], G(259), [56]],
  15785. 11025: [ne, G(268), [3, 127, 248], G(268), [6, 255, 240], G(268), [13, 255, 224], G(268), [27, 255, 192], G(268), [55, 175, 128], G(108), [112]],
  15786. 8e3: [ne, G(268), [3, 121, 16], G(47), [7]],
  15787. }),
  15788. (i = e),
  15789. (X = Object.keys(i).reduce(function (e, t) {
  15790. return (
  15791. (e[t] = new Uint8Array(
  15792. i[t].reduce(function (e, t) {
  15793. return e.concat(t)
  15794. }, [])
  15795. )),
  15796. e
  15797. )
  15798. }, {}))),
  15799. X
  15800. )
  15801. }
  15802. var X,
  15803. K = function (e) {
  15804. return u(T.mdat, e)
  15805. },
  15806. Y = We,
  15807. Q = function (e) {
  15808. var t = n(),
  15809. i = s(e),
  15810. e = new Uint8Array(t.byteLength + i.byteLength)
  15811. return e.set(t), e.set(i, t.byteLength), e
  15812. },
  15813. $ = function (e) {
  15814. var t,
  15815. i,
  15816. n = [],
  15817. r = []
  15818. for (r.byteLength = 0, r.nalCount = 0, r.duration = 0, t = n.byteLength = 0; t < e.length; t++)
  15819. 'access_unit_delimiter_rbsp' === (i = e[t]).nalUnitType
  15820. ? (n.length && ((n.duration = i.dts - n.dts), (r.byteLength += n.byteLength), (r.nalCount += n.length), (r.duration += n.duration), r.push(n)),
  15821. ((n = [i]).byteLength = i.data.byteLength),
  15822. (n.pts = i.pts),
  15823. (n.dts = i.dts))
  15824. : ('slice_layer_without_partitioning_rbsp_idr' === i.nalUnitType && (n.keyFrame = !0), (n.duration = i.dts - n.dts), (n.byteLength += i.data.byteLength), n.push(i))
  15825. return (
  15826. r.length && (!n.duration || n.duration <= 0) && (n.duration = r[r.length - 1].duration),
  15827. (r.byteLength += n.byteLength),
  15828. (r.nalCount += n.length),
  15829. (r.duration += n.duration),
  15830. r.push(n),
  15831. r
  15832. )
  15833. },
  15834. J = function (e) {
  15835. var t,
  15836. i,
  15837. n = [],
  15838. r = []
  15839. for (
  15840. n.byteLength = 0,
  15841. n.nalCount = 0,
  15842. n.duration = 0,
  15843. n.pts = e[0].pts,
  15844. n.dts = e[0].dts,
  15845. r.byteLength = 0,
  15846. r.nalCount = 0,
  15847. r.duration = 0,
  15848. r.pts = e[0].pts,
  15849. r.dts = e[0].dts,
  15850. t = 0;
  15851. t < e.length;
  15852. t++
  15853. )
  15854. (i = e[t]).keyFrame
  15855. ? (n.length && (r.push(n), (r.byteLength += n.byteLength), (r.nalCount += n.nalCount), (r.duration += n.duration)),
  15856. ((n = [i]).nalCount = i.length),
  15857. (n.byteLength = i.byteLength),
  15858. (n.pts = i.pts),
  15859. (n.dts = i.dts),
  15860. (n.duration = i.duration))
  15861. : ((n.duration += i.duration), (n.nalCount += i.length), (n.byteLength += i.byteLength), n.push(i))
  15862. return (
  15863. r.length && n.duration <= 0 && (n.duration = r[r.length - 1].duration),
  15864. (r.byteLength += n.byteLength),
  15865. (r.nalCount += n.nalCount),
  15866. (r.duration += n.duration),
  15867. r.push(n),
  15868. r
  15869. )
  15870. },
  15871. Z = function (e) {
  15872. var t
  15873. return (
  15874. !e[0][0].keyFrame &&
  15875. 1 < e.length &&
  15876. ((t = e.shift()), (e.byteLength -= t.byteLength), (e.nalCount -= t.nalCount), (e[0][0].dts = t.dts), (e[0][0].pts = t.pts), (e[0][0].duration += t.duration)),
  15877. e
  15878. )
  15879. },
  15880. ee = function (e, t) {
  15881. for (var i, n, r, a = t || 0, s = [], o = 0; o < e.length; o++) for (n = e[o], i = 0; i < n.length; i++) (r = n[i]), (a += (r = W(r, a)).size), s.push(r)
  15882. return s
  15883. },
  15884. te = function (e) {
  15885. for (var t, i, n, r, a, s = 0, o = e.byteLength, u = e.nalCount, l = new Uint8Array(o + 4 * u), c = new DataView(l.buffer), d = 0; d < e.length; d++)
  15886. for (n = e[d], t = 0; t < n.length; t++)
  15887. for (r = n[t], i = 0; i < r.length; i++) (a = r[i]), c.setUint32(s, a.data.byteLength), l.set(a.data, (s += 4)), (s += a.data.byteLength)
  15888. return l
  15889. },
  15890. ie = [33, 16, 5, 32, 164, 27],
  15891. ne = [33, 65, 108, 84, 1, 2, 4, 8, 168, 2, 4, 8, 17, 191, 252],
  15892. re = function (e) {
  15893. return 9e4 * e
  15894. },
  15895. ae = function (e, t) {
  15896. return e * t
  15897. },
  15898. se = function (e) {
  15899. return e / 9e4
  15900. },
  15901. oe = function (e, t) {
  15902. return e / t
  15903. },
  15904. ue = 9e4,
  15905. le = re,
  15906. ce = se,
  15907. de = function (e, t) {
  15908. return re(oe(e, t))
  15909. },
  15910. he = function (e, t) {
  15911. return ae(se(e), t)
  15912. },
  15913. pe = function (e, t, i) {
  15914. return se(i ? e : e - t)
  15915. },
  15916. fe = function (e, t, i, n) {
  15917. var r,
  15918. a,
  15919. s,
  15920. o,
  15921. u,
  15922. l,
  15923. c = 0,
  15924. d = 0
  15925. if (
  15926. t.length &&
  15927. ((r = de(e.baseMediaDecodeTime, e.samplerate)),
  15928. (a = Math.ceil(ue / (e.samplerate / 1024))),
  15929. i && n && ((s = r - Math.max(i, n)), (d = (c = Math.floor(s / a)) * a)),
  15930. !(c < 1 || ue / 2 < d))
  15931. ) {
  15932. for (o = (o = z()[e.samplerate]) || t[0].data, u = 0; u < c; u++) (l = t[0]), t.splice(0, 0, { data: o, dts: l.dts - a, pts: l.pts - a })
  15933. return (e.baseMediaDecodeTime -= Math.floor(he(d, e.samplerate))), d
  15934. }
  15935. },
  15936. me = function (e, t, i) {
  15937. return t.minSegmentDts >= i
  15938. ? e
  15939. : ((t.minSegmentDts = 1 / 0),
  15940. e.filter(function (e) {
  15941. return e.dts >= i && ((t.minSegmentDts = Math.min(t.minSegmentDts, e.dts)), (t.minSegmentPts = t.minSegmentDts), !0)
  15942. }))
  15943. },
  15944. ge = function (e) {
  15945. for (var t, i = [], n = 0; n < e.length; n++) (t = e[n]), i.push({ size: t.data.byteLength, duration: 1024 })
  15946. return i
  15947. },
  15948. ye = function (e) {
  15949. for (
  15950. var t,
  15951. i = 0,
  15952. n = new Uint8Array(
  15953. (function (e) {
  15954. for (var t = 0, i = 0; i < e.length; i++) t += e[i].data.byteLength
  15955. return t
  15956. })(e)
  15957. ),
  15958. r = 0;
  15959. r < e.length;
  15960. r++
  15961. )
  15962. (t = e[r]), n.set(t.data, i), (i += t.data.byteLength)
  15963. return n
  15964. },
  15965. ve = ue,
  15966. _e = function (e) {
  15967. delete e.minSegmentDts, delete e.maxSegmentDts, delete e.minSegmentPts, delete e.maxSegmentPts
  15968. },
  15969. be = function (e, t) {
  15970. var i = e.minSegmentDts
  15971. return (
  15972. t || (i -= e.timelineStartInfo.dts),
  15973. (t = e.timelineStartInfo.baseMediaDecodeTime),
  15974. (t += i),
  15975. (t = Math.max(0, t)),
  15976. 'audio' === e.type && ((t *= e.samplerate / ve), (t = Math.floor(t))),
  15977. t
  15978. )
  15979. },
  15980. Te = function (e, t) {
  15981. 'number' == typeof t.pts &&
  15982. (void 0 === e.timelineStartInfo.pts && (e.timelineStartInfo.pts = t.pts),
  15983. void 0 === e.minSegmentPts ? (e.minSegmentPts = t.pts) : (e.minSegmentPts = Math.min(e.minSegmentPts, t.pts)),
  15984. void 0 === e.maxSegmentPts ? (e.maxSegmentPts = t.pts) : (e.maxSegmentPts = Math.max(e.maxSegmentPts, t.pts))),
  15985. 'number' == typeof t.dts &&
  15986. (void 0 === e.timelineStartInfo.dts && (e.timelineStartInfo.dts = t.dts),
  15987. void 0 === e.minSegmentDts ? (e.minSegmentDts = t.dts) : (e.minSegmentDts = Math.min(e.minSegmentDts, t.dts)),
  15988. void 0 === e.maxSegmentDts ? (e.maxSegmentDts = t.dts) : (e.maxSegmentDts = Math.max(e.maxSegmentDts, t.dts)))
  15989. },
  15990. Se = function (e) {
  15991. for (var t = 0, i = { payloadType: -1, payloadSize: 0 }, n = 0, r = 0; t < e.byteLength && 128 !== e[t]; ) {
  15992. for (; 255 === e[t]; ) (n += 255), t++
  15993. for (n += e[t++]; 255 === e[t]; ) (r += 255), t++
  15994. if (((r += e[t++]), !i.payload && 4 === n)) {
  15995. if ('GA94' === String.fromCharCode(e[t + 3], e[t + 4], e[t + 5], e[t + 6])) {
  15996. ;(i.payloadType = n), (i.payloadSize = r), (i.payload = e.subarray(t, t + r))
  15997. break
  15998. }
  15999. i.payload = void 0
  16000. }
  16001. ;(t += r), (r = n = 0)
  16002. }
  16003. return i
  16004. },
  16005. we = function (e) {
  16006. return 181 !== e.payload[0] ||
  16007. 49 != ((e.payload[1] << 8) | e.payload[2]) ||
  16008. 'GA94' !== String.fromCharCode(e.payload[3], e.payload[4], e.payload[5], e.payload[6]) ||
  16009. 3 !== e.payload[7]
  16010. ? null
  16011. : e.payload.subarray(8, e.payload.length - 1)
  16012. },
  16013. Ee = function (e, t) {
  16014. var i,
  16015. n,
  16016. r,
  16017. a,
  16018. s = []
  16019. if (!(64 & t[0])) return s
  16020. for (n = 31 & t[0], i = 0; i < n; i++) (a = { type: 3 & t[2 + (r = 3 * i)], pts: e }), 4 & t[2 + r] && ((a.ccData = (t[3 + r] << 8) | t[4 + r]), s.push(a))
  16021. return s
  16022. },
  16023. ke = function (e) {
  16024. for (var t = e.byteLength, i = [], n = 1; n < t - 2; ) 0 === e[n] && 0 === e[n + 1] && 3 === e[n + 2] ? (i.push(n + 2), (n += 2)) : n++
  16025. if (0 === i.length) return e
  16026. for (var r = t - i.length, a = new Uint8Array(r), s = 0, n = 0; n < r; s++, n++) s === i[0] && (s++, i.shift()), (a[n] = e[s])
  16027. return a
  16028. },
  16029. Ce = 4,
  16030. Ie = function e(t) {
  16031. ;(t = t || {}),
  16032. e.prototype.init.call(this),
  16033. (this.parse708captions_ = 'boolean' != typeof t.parse708captions || t.parse708captions),
  16034. (this.captionPackets_ = []),
  16035. (this.ccStreams_ = [new Ue(0, 0), new Ue(0, 1), new Ue(1, 0), new Ue(1, 1)]),
  16036. this.parse708captions_ && (this.cc708Stream_ = new De({ captionServices: t.captionServices })),
  16037. this.reset(),
  16038. this.ccStreams_.forEach(function (e) {
  16039. e.on('data', this.trigger.bind(this, 'data')), e.on('partialdone', this.trigger.bind(this, 'partialdone')), e.on('done', this.trigger.bind(this, 'done'))
  16040. }, this),
  16041. this.parse708captions_ &&
  16042. (this.cc708Stream_.on('data', this.trigger.bind(this, 'data')),
  16043. this.cc708Stream_.on('partialdone', this.trigger.bind(this, 'partialdone')),
  16044. this.cc708Stream_.on('done', this.trigger.bind(this, 'done')))
  16045. }
  16046. ;((Ie.prototype = new j()).push = function (e) {
  16047. var t, i
  16048. if ('sei_rbsp' === e.nalUnitType && (t = Se(e.escapedRBSP)).payload && t.payloadType === Ce && (i = we(t)))
  16049. if (e.dts < this.latestDts_) this.ignoreNextEqualDts_ = !0
  16050. else {
  16051. if (e.dts === this.latestDts_ && this.ignoreNextEqualDts_) return this.numSameDts_--, void (this.numSameDts_ || (this.ignoreNextEqualDts_ = !1))
  16052. ;(i = Ee(e.pts, i)),
  16053. (this.captionPackets_ = this.captionPackets_.concat(i)),
  16054. this.latestDts_ !== e.dts && (this.numSameDts_ = 0),
  16055. this.numSameDts_++,
  16056. (this.latestDts_ = e.dts)
  16057. }
  16058. }),
  16059. (Ie.prototype.flushCCStreams = function (t) {
  16060. this.ccStreams_.forEach(function (e) {
  16061. return 'flush' === t ? e.flush() : e.partialFlush()
  16062. }, this)
  16063. }),
  16064. (Ie.prototype.flushStream = function (e) {
  16065. this.captionPackets_.length &&
  16066. (this.captionPackets_.forEach(function (e, t) {
  16067. e.presortIndex = t
  16068. }),
  16069. this.captionPackets_.sort(function (e, t) {
  16070. return e.pts === t.pts ? e.presortIndex - t.presortIndex : e.pts - t.pts
  16071. }),
  16072. this.captionPackets_.forEach(function (e) {
  16073. e.type < 2 ? this.dispatchCea608Packet(e) : this.dispatchCea708Packet(e)
  16074. }, this),
  16075. (this.captionPackets_.length = 0)),
  16076. this.flushCCStreams(e)
  16077. }),
  16078. (Ie.prototype.flush = function () {
  16079. return this.flushStream('flush')
  16080. }),
  16081. (Ie.prototype.partialFlush = function () {
  16082. return this.flushStream('partialFlush')
  16083. }),
  16084. (Ie.prototype.reset = function () {
  16085. ;(this.latestDts_ = null),
  16086. (this.ignoreNextEqualDts_ = !1),
  16087. (this.numSameDts_ = 0),
  16088. (this.activeCea608Channel_ = [null, null]),
  16089. this.ccStreams_.forEach(function (e) {
  16090. e.reset()
  16091. })
  16092. }),
  16093. (Ie.prototype.dispatchCea608Packet = function (e) {
  16094. this.setsTextOrXDSActive(e)
  16095. ? (this.activeCea608Channel_[e.type] = null)
  16096. : this.setsChannel1Active(e)
  16097. ? (this.activeCea608Channel_[e.type] = 0)
  16098. : this.setsChannel2Active(e) && (this.activeCea608Channel_[e.type] = 1),
  16099. null !== this.activeCea608Channel_[e.type] && this.ccStreams_[(e.type << 1) + this.activeCea608Channel_[e.type]].push(e)
  16100. }),
  16101. (Ie.prototype.setsChannel1Active = function (e) {
  16102. return 4096 == (30720 & e.ccData)
  16103. }),
  16104. (Ie.prototype.setsChannel2Active = function (e) {
  16105. return 6144 == (30720 & e.ccData)
  16106. }),
  16107. (Ie.prototype.setsTextOrXDSActive = function (e) {
  16108. return 256 == (28928 & e.ccData) || 4138 == (30974 & e.ccData) || 6186 == (30974 & e.ccData)
  16109. }),
  16110. (Ie.prototype.dispatchCea708Packet = function (e) {
  16111. this.parse708captions_ && this.cc708Stream_.push(e)
  16112. })
  16113. function xe(e) {
  16114. return (32 <= e && e <= 127) || (160 <= e && e <= 255)
  16115. }
  16116. function Ae(e) {
  16117. ;(this.windowNum = e), this.reset()
  16118. }
  16119. var Pe = {
  16120. 127: 9834,
  16121. 4128: 32,
  16122. 4129: 160,
  16123. 4133: 8230,
  16124. 4138: 352,
  16125. 4140: 338,
  16126. 4144: 9608,
  16127. 4145: 8216,
  16128. 4146: 8217,
  16129. 4147: 8220,
  16130. 4148: 8221,
  16131. 4149: 8226,
  16132. 4153: 8482,
  16133. 4154: 353,
  16134. 4156: 339,
  16135. 4157: 8480,
  16136. 4159: 376,
  16137. 4214: 8539,
  16138. 4215: 8540,
  16139. 4216: 8541,
  16140. 4217: 8542,
  16141. 4218: 9168,
  16142. 4219: 9124,
  16143. 4220: 9123,
  16144. 4221: 9135,
  16145. 4222: 9126,
  16146. 4223: 9121,
  16147. 4256: 12600,
  16148. }
  16149. ;(Ae.prototype.reset = function () {
  16150. this.clearText(),
  16151. (this.pendingNewLine = !1),
  16152. (this.winAttr = {}),
  16153. (this.penAttr = {}),
  16154. (this.penLoc = {}),
  16155. (this.penColor = {}),
  16156. (this.visible = 0),
  16157. (this.rowLock = 0),
  16158. (this.columnLock = 0),
  16159. (this.priority = 0),
  16160. (this.relativePositioning = 0),
  16161. (this.anchorVertical = 0),
  16162. (this.anchorHorizontal = 0),
  16163. (this.anchorPoint = 0),
  16164. (this.rowCount = 1),
  16165. (this.virtualRowCount = this.rowCount + 1),
  16166. (this.columnCount = 41),
  16167. (this.windowStyle = 0),
  16168. (this.penStyle = 0)
  16169. }),
  16170. (Ae.prototype.getText = function () {
  16171. return this.rows.join('\n')
  16172. }),
  16173. (Ae.prototype.clearText = function () {
  16174. ;(this.rows = ['']), (this.rowIdx = 0)
  16175. }),
  16176. (Ae.prototype.newLine = function (e) {
  16177. for (
  16178. this.rows.length >= this.virtualRowCount && 'function' == typeof this.beforeRowOverflow && this.beforeRowOverflow(e),
  16179. 0 < this.rows.length && (this.rows.push(''), this.rowIdx++);
  16180. this.rows.length > this.virtualRowCount;
  16181. )
  16182. this.rows.shift(), this.rowIdx--
  16183. }),
  16184. (Ae.prototype.isEmpty = function () {
  16185. return 0 === this.rows.length || (1 === this.rows.length && '' === this.rows[0])
  16186. }),
  16187. (Ae.prototype.addText = function (e) {
  16188. this.rows[this.rowIdx] += e
  16189. }),
  16190. (Ae.prototype.backspace = function () {
  16191. var e
  16192. this.isEmpty() || ((e = this.rows[this.rowIdx]), (this.rows[this.rowIdx] = e.substr(0, e.length - 1)))
  16193. })
  16194. function Le(e, t, i) {
  16195. ;(this.serviceNum = e), (this.text = ''), (this.currentWindow = new Ae(-1)), (this.windows = []), (this.stream = i), 'string' == typeof t && this.createTextDecoder(t)
  16196. }
  16197. ;(Le.prototype.init = function (e, t) {
  16198. this.startPts = e
  16199. for (var i = 0; i < 8; i++) (this.windows[i] = new Ae(i)), 'function' == typeof t && (this.windows[i].beforeRowOverflow = t)
  16200. }),
  16201. (Le.prototype.setCurrentWindow = function (e) {
  16202. this.currentWindow = this.windows[e]
  16203. }),
  16204. (Le.prototype.createTextDecoder = function (t) {
  16205. if ('undefined' == typeof TextDecoder) this.stream.trigger('log', { level: 'warn', message: 'The `encoding` option is unsupported without TextDecoder support' })
  16206. else
  16207. try {
  16208. this.textDecoder_ = new TextDecoder(t)
  16209. } catch (e) {
  16210. this.stream.trigger('log', { level: 'warn', message: 'TextDecoder could not be created with ' + t + ' encoding. ' + e })
  16211. }
  16212. })
  16213. var De = function e(t) {
  16214. ;(t = t || {}), e.prototype.init.call(this)
  16215. var i,
  16216. n = this,
  16217. r = t.captionServices || {},
  16218. a = {}
  16219. Object.keys(r).forEach(function (e) {
  16220. ;(i = r[e]), /^SERVICE/.test(e) && (a[e] = i.encoding)
  16221. }),
  16222. (this.serviceEncodings = a),
  16223. (this.current708Packet = null),
  16224. (this.services = {}),
  16225. (this.push = function (e) {
  16226. ;(3 === e.type || null === n.current708Packet) && n.new708Packet(), n.add708Bytes(e)
  16227. })
  16228. }
  16229. ;(De.prototype = new j()),
  16230. (De.prototype.new708Packet = function () {
  16231. null !== this.current708Packet && this.push708Packet(), (this.current708Packet = { data: [], ptsVals: [] })
  16232. }),
  16233. (De.prototype.add708Bytes = function (e) {
  16234. var t = e.ccData,
  16235. i = t >>> 8,
  16236. t = 255 & t
  16237. this.current708Packet.ptsVals.push(e.pts), this.current708Packet.data.push(i), this.current708Packet.data.push(t)
  16238. }),
  16239. (De.prototype.push708Packet = function () {
  16240. var e,
  16241. t = this.current708Packet,
  16242. i = t.data,
  16243. n = null,
  16244. r = 0,
  16245. a = i[r++]
  16246. for (t.seq = a >> 6, t.sizeCode = 63 & a; r < i.length; r++)
  16247. (e = 31 & (a = i[r++])), 7 === (n = a >> 5) && 0 < e && (n = i[r++]), this.pushServiceBlock(n, r, e), 0 < e && (r += e - 1)
  16248. }),
  16249. (De.prototype.pushServiceBlock = function (e, t, i) {
  16250. for (var n, r = t, a = this.current708Packet.data, s = (s = this.services[e]) || this.initService(e, r); r < t + i && r < a.length; r++)
  16251. (n = a[r]),
  16252. xe(n)
  16253. ? (r = this.handleText(r, s))
  16254. : 24 === n
  16255. ? (r = this.multiByteCharacter(r, s))
  16256. : 16 === n
  16257. ? (r = this.extendedCommands(r, s))
  16258. : 128 <= n && n <= 135
  16259. ? (r = this.setCurrentWindow(r, s))
  16260. : 152 <= n && n <= 159
  16261. ? (r = this.defineWindow(r, s))
  16262. : 136 === n
  16263. ? (r = this.clearWindows(r, s))
  16264. : 140 === n
  16265. ? (r = this.deleteWindows(r, s))
  16266. : 137 === n
  16267. ? (r = this.displayWindows(r, s))
  16268. : 138 === n
  16269. ? (r = this.hideWindows(r, s))
  16270. : 139 === n
  16271. ? (r = this.toggleWindows(r, s))
  16272. : 151 === n
  16273. ? (r = this.setWindowAttributes(r, s))
  16274. : 144 === n
  16275. ? (r = this.setPenAttributes(r, s))
  16276. : 145 === n
  16277. ? (r = this.setPenColor(r, s))
  16278. : 146 === n
  16279. ? (r = this.setPenLocation(r, s))
  16280. : 143 === n
  16281. ? (s = this.reset(r, s))
  16282. : 8 === n
  16283. ? s.currentWindow.backspace()
  16284. : 12 === n
  16285. ? s.currentWindow.clearText()
  16286. : 13 === n
  16287. ? (s.currentWindow.pendingNewLine = !0)
  16288. : 14 === n
  16289. ? s.currentWindow.clearText()
  16290. : 141 === n && r++
  16291. }),
  16292. (De.prototype.extendedCommands = function (e, t) {
  16293. var i = this.current708Packet.data[++e]
  16294. return (e = xe(i) ? this.handleText(e, t, { isExtended: !0 }) : e)
  16295. }),
  16296. (De.prototype.getPts = function (e) {
  16297. return this.current708Packet.ptsVals[Math.floor(e / 2)]
  16298. }),
  16299. (De.prototype.initService = function (t, e) {
  16300. var i,
  16301. n = 'SERVICE' + t,
  16302. r = this
  16303. return (
  16304. n in this.serviceEncodings && (i = this.serviceEncodings[n]),
  16305. (this.services[t] = new Le(t, i, r)),
  16306. this.services[t].init(this.getPts(e), function (e) {
  16307. r.flushDisplayed(e, r.services[t])
  16308. }),
  16309. this.services[t]
  16310. )
  16311. }),
  16312. (De.prototype.handleText = function (e, t, i) {
  16313. var n,
  16314. r = i && i.isExtended,
  16315. a = i && i.isMultiByte,
  16316. s = this.current708Packet.data,
  16317. o = r ? 4096 : 0,
  16318. u = s[e],
  16319. i = s[e + 1],
  16320. s = t.currentWindow,
  16321. l =
  16322. t.textDecoder_ && !r
  16323. ? (a ? ((n = [u, i]), e++) : (n = [u]), t.textDecoder_.decode(new Uint8Array(n)))
  16324. : ((l = Pe[(u = o | u)] || u), 4096 & u && u === l ? '' : String.fromCharCode(l))
  16325. return s.pendingNewLine && !s.isEmpty() && s.newLine(this.getPts(e)), (s.pendingNewLine = !1), s.addText(l), e
  16326. }),
  16327. (De.prototype.multiByteCharacter = function (e, t) {
  16328. var i = this.current708Packet.data,
  16329. n = i[e + 1],
  16330. i = i[e + 2]
  16331. return (e = xe(n) && xe(i) ? this.handleText(++e, t, { isMultiByte: !0 }) : e)
  16332. }),
  16333. (De.prototype.setCurrentWindow = function (e, t) {
  16334. var i = this.current708Packet.data[e]
  16335. return t.setCurrentWindow(7 & i), e
  16336. }),
  16337. (De.prototype.defineWindow = function (e, t) {
  16338. var i = this.current708Packet.data,
  16339. n = i[e]
  16340. t.setCurrentWindow(7 & n)
  16341. ;(t = t.currentWindow), (n = i[++e])
  16342. return (
  16343. (t.visible = (32 & n) >> 5),
  16344. (t.rowLock = (16 & n) >> 4),
  16345. (t.columnLock = (8 & n) >> 3),
  16346. (t.priority = 7 & n),
  16347. (n = i[++e]),
  16348. (t.relativePositioning = (128 & n) >> 7),
  16349. (t.anchorVertical = 127 & n),
  16350. (n = i[++e]),
  16351. (t.anchorHorizontal = n),
  16352. (n = i[++e]),
  16353. (t.anchorPoint = (240 & n) >> 4),
  16354. (t.rowCount = 15 & n),
  16355. (n = i[++e]),
  16356. (t.columnCount = 63 & n),
  16357. (n = i[++e]),
  16358. (t.windowStyle = (56 & n) >> 3),
  16359. (t.penStyle = 7 & n),
  16360. (t.virtualRowCount = t.rowCount + 1),
  16361. e
  16362. )
  16363. }),
  16364. (De.prototype.setWindowAttributes = function (e, t) {
  16365. var i = this.current708Packet.data,
  16366. n = i[e],
  16367. t = t.currentWindow.winAttr,
  16368. n = i[++e]
  16369. return (
  16370. (t.fillOpacity = (192 & n) >> 6),
  16371. (t.fillRed = (48 & n) >> 4),
  16372. (t.fillGreen = (12 & n) >> 2),
  16373. (t.fillBlue = 3 & n),
  16374. (n = i[++e]),
  16375. (t.borderType = (192 & n) >> 6),
  16376. (t.borderRed = (48 & n) >> 4),
  16377. (t.borderGreen = (12 & n) >> 2),
  16378. (t.borderBlue = 3 & n),
  16379. (n = i[++e]),
  16380. (t.borderType += (128 & n) >> 5),
  16381. (t.wordWrap = (64 & n) >> 6),
  16382. (t.printDirection = (48 & n) >> 4),
  16383. (t.scrollDirection = (12 & n) >> 2),
  16384. (t.justify = 3 & n),
  16385. (n = i[++e]),
  16386. (t.effectSpeed = (240 & n) >> 4),
  16387. (t.effectDirection = (12 & n) >> 2),
  16388. (t.displayEffect = 3 & n),
  16389. e
  16390. )
  16391. }),
  16392. (De.prototype.flushDisplayed = function (e, t) {
  16393. for (var i = [], n = 0; n < 8; n++) t.windows[n].visible && !t.windows[n].isEmpty() && i.push(t.windows[n].getText())
  16394. ;(t.endPts = e), (t.text = i.join('\n\n')), this.pushCaption(t), (t.startPts = e)
  16395. }),
  16396. (De.prototype.pushCaption = function (e) {
  16397. '' !== e.text && (this.trigger('data', { startPts: e.startPts, endPts: e.endPts, text: e.text, stream: 'cc708_' + e.serviceNum }), (e.text = ''), (e.startPts = e.endPts))
  16398. }),
  16399. (De.prototype.displayWindows = function (e, t) {
  16400. var i = this.current708Packet.data[++e],
  16401. n = this.getPts(e)
  16402. this.flushDisplayed(n, t)
  16403. for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible = 1)
  16404. return e
  16405. }),
  16406. (De.prototype.hideWindows = function (e, t) {
  16407. var i = this.current708Packet.data[++e],
  16408. n = this.getPts(e)
  16409. this.flushDisplayed(n, t)
  16410. for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible = 0)
  16411. return e
  16412. }),
  16413. (De.prototype.toggleWindows = function (e, t) {
  16414. var i = this.current708Packet.data[++e],
  16415. n = this.getPts(e)
  16416. this.flushDisplayed(n, t)
  16417. for (var r = 0; r < 8; r++) i & (1 << r) && (t.windows[r].visible ^= 1)
  16418. return e
  16419. }),
  16420. (De.prototype.clearWindows = function (e, t) {
  16421. var i = this.current708Packet.data[++e],
  16422. n = this.getPts(e)
  16423. this.flushDisplayed(n, t)
  16424. for (var r = 0; r < 8; r++) i & (1 << r) && t.windows[r].clearText()
  16425. return e
  16426. }),
  16427. (De.prototype.deleteWindows = function (e, t) {
  16428. var i = this.current708Packet.data[++e],
  16429. n = this.getPts(e)
  16430. this.flushDisplayed(n, t)
  16431. for (var r = 0; r < 8; r++) i & (1 << r) && t.windows[r].reset()
  16432. return e
  16433. }),
  16434. (De.prototype.setPenAttributes = function (e, t) {
  16435. var i = this.current708Packet.data,
  16436. n = i[e],
  16437. t = t.currentWindow.penAttr,
  16438. n = i[++e]
  16439. return (
  16440. (t.textTag = (240 & n) >> 4),
  16441. (t.offset = (12 & n) >> 2),
  16442. (t.penSize = 3 & n),
  16443. (n = i[++e]),
  16444. (t.italics = (128 & n) >> 7),
  16445. (t.underline = (64 & n) >> 6),
  16446. (t.edgeType = (56 & n) >> 3),
  16447. (t.fontStyle = 7 & n),
  16448. e
  16449. )
  16450. }),
  16451. (De.prototype.setPenColor = function (e, t) {
  16452. var i = this.current708Packet.data,
  16453. n = i[e],
  16454. t = t.currentWindow.penColor,
  16455. n = i[++e]
  16456. return (
  16457. (t.fgOpacity = (192 & n) >> 6),
  16458. (t.fgRed = (48 & n) >> 4),
  16459. (t.fgGreen = (12 & n) >> 2),
  16460. (t.fgBlue = 3 & n),
  16461. (n = i[++e]),
  16462. (t.bgOpacity = (192 & n) >> 6),
  16463. (t.bgRed = (48 & n) >> 4),
  16464. (t.bgGreen = (12 & n) >> 2),
  16465. (t.bgBlue = 3 & n),
  16466. (n = i[++e]),
  16467. (t.edgeRed = (48 & n) >> 4),
  16468. (t.edgeGreen = (12 & n) >> 2),
  16469. (t.edgeBlue = 3 & n),
  16470. e
  16471. )
  16472. }),
  16473. (De.prototype.setPenLocation = function (e, t) {
  16474. var i = this.current708Packet.data,
  16475. n = i[e],
  16476. r = t.currentWindow.penLoc
  16477. return (t.currentWindow.pendingNewLine = !0), (n = i[++e]), (r.row = 15 & n), (n = i[++e]), (r.column = 63 & n), e
  16478. }),
  16479. (De.prototype.reset = function (e, t) {
  16480. var i = this.getPts(e)
  16481. return this.flushDisplayed(i, t), this.initService(t.serviceNum, e)
  16482. })
  16483. function Oe(e) {
  16484. return null === e ? '' : ((e = Re[e] || e), String.fromCharCode(e))
  16485. }
  16486. function Me() {
  16487. for (var e = [], t = 15; t--; ) e.push('')
  16488. return e
  16489. }
  16490. var Re = {
  16491. 42: 225,
  16492. 92: 233,
  16493. 94: 237,
  16494. 95: 243,
  16495. 96: 250,
  16496. 123: 231,
  16497. 124: 247,
  16498. 125: 209,
  16499. 126: 241,
  16500. 127: 9608,
  16501. 304: 174,
  16502. 305: 176,
  16503. 306: 189,
  16504. 307: 191,
  16505. 308: 8482,
  16506. 309: 162,
  16507. 310: 163,
  16508. 311: 9834,
  16509. 312: 224,
  16510. 313: 160,
  16511. 314: 232,
  16512. 315: 226,
  16513. 316: 234,
  16514. 317: 238,
  16515. 318: 244,
  16516. 319: 251,
  16517. 544: 193,
  16518. 545: 201,
  16519. 546: 211,
  16520. 547: 218,
  16521. 548: 220,
  16522. 549: 252,
  16523. 550: 8216,
  16524. 551: 161,
  16525. 552: 42,
  16526. 553: 39,
  16527. 554: 8212,
  16528. 555: 169,
  16529. 556: 8480,
  16530. 557: 8226,
  16531. 558: 8220,
  16532. 559: 8221,
  16533. 560: 192,
  16534. 561: 194,
  16535. 562: 199,
  16536. 563: 200,
  16537. 564: 202,
  16538. 565: 203,
  16539. 566: 235,
  16540. 567: 206,
  16541. 568: 207,
  16542. 569: 239,
  16543. 570: 212,
  16544. 571: 217,
  16545. 572: 249,
  16546. 573: 219,
  16547. 574: 171,
  16548. 575: 187,
  16549. 800: 195,
  16550. 801: 227,
  16551. 802: 205,
  16552. 803: 204,
  16553. 804: 236,
  16554. 805: 210,
  16555. 806: 242,
  16556. 807: 213,
  16557. 808: 245,
  16558. 809: 123,
  16559. 810: 125,
  16560. 811: 92,
  16561. 812: 94,
  16562. 813: 95,
  16563. 814: 124,
  16564. 815: 126,
  16565. 816: 196,
  16566. 817: 228,
  16567. 818: 214,
  16568. 819: 246,
  16569. 820: 223,
  16570. 821: 165,
  16571. 822: 164,
  16572. 823: 9474,
  16573. 824: 197,
  16574. 825: 229,
  16575. 826: 216,
  16576. 827: 248,
  16577. 828: 9484,
  16578. 829: 9488,
  16579. 830: 9492,
  16580. 831: 9496,
  16581. },
  16582. Ne = [4352, 4384, 4608, 4640, 5376, 5408, 5632, 5664, 5888, 5920, 4096, 4864, 4896, 5120, 5152],
  16583. Ue = function e(t, i) {
  16584. e.prototype.init.call(this),
  16585. (this.field_ = t || 0),
  16586. (this.dataChannel_ = i || 0),
  16587. (this.name_ = 'CC' + (1 + ((this.field_ << 1) | this.dataChannel_))),
  16588. this.setConstants(),
  16589. this.reset(),
  16590. (this.push = function (e) {
  16591. var t,
  16592. i,
  16593. n,
  16594. r,
  16595. a = 32639 & e.ccData
  16596. a !== this.lastControlCode_
  16597. ? (4096 == (61440 & a) ? (this.lastControlCode_ = a) : a !== this.PADDING_ && (this.lastControlCode_ = null),
  16598. (t = a >>> 8),
  16599. (i = 255 & a),
  16600. a === this.PADDING_ ||
  16601. (a === this.RESUME_CAPTION_LOADING_
  16602. ? (this.mode_ = 'popOn')
  16603. : a === this.END_OF_CAPTION_
  16604. ? ((this.mode_ = 'popOn'),
  16605. this.clearFormatting(e.pts),
  16606. this.flushDisplayed(e.pts),
  16607. (r = this.displayed_),
  16608. (this.displayed_ = this.nonDisplayed_),
  16609. (this.nonDisplayed_ = r),
  16610. (this.startPts_ = e.pts))
  16611. : a === this.ROLL_UP_2_ROWS_
  16612. ? ((this.rollUpRows_ = 2), this.setRollUp(e.pts))
  16613. : a === this.ROLL_UP_3_ROWS_
  16614. ? ((this.rollUpRows_ = 3), this.setRollUp(e.pts))
  16615. : a === this.ROLL_UP_4_ROWS_
  16616. ? ((this.rollUpRows_ = 4), this.setRollUp(e.pts))
  16617. : a === this.CARRIAGE_RETURN_
  16618. ? (this.clearFormatting(e.pts), this.flushDisplayed(e.pts), this.shiftRowsUp_(), (this.startPts_ = e.pts))
  16619. : a === this.BACKSPACE_
  16620. ? 'popOn' === this.mode_
  16621. ? (this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1))
  16622. : (this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1))
  16623. : a === this.ERASE_DISPLAYED_MEMORY_
  16624. ? (this.flushDisplayed(e.pts), (this.displayed_ = Me()))
  16625. : a === this.ERASE_NON_DISPLAYED_MEMORY_
  16626. ? (this.nonDisplayed_ = Me())
  16627. : a === this.RESUME_DIRECT_CAPTIONING_
  16628. ? ('paintOn' !== this.mode_ && (this.flushDisplayed(e.pts), (this.displayed_ = Me())), (this.mode_ = 'paintOn'), (this.startPts_ = e.pts))
  16629. : this.isSpecialCharacter(t, i)
  16630. ? ((n = Oe((t = (3 & t) << 8) | i)), this[this.mode_](e.pts, n), this.column_++)
  16631. : this.isExtCharacter(t, i)
  16632. ? ('popOn' === this.mode_
  16633. ? (this.nonDisplayed_[this.row_] = this.nonDisplayed_[this.row_].slice(0, -1))
  16634. : (this.displayed_[this.row_] = this.displayed_[this.row_].slice(0, -1)),
  16635. (n = Oe((t = (3 & t) << 8) | i)),
  16636. this[this.mode_](e.pts, n),
  16637. this.column_++)
  16638. : this.isMidRowCode(t, i)
  16639. ? (this.clearFormatting(e.pts),
  16640. this[this.mode_](e.pts, ' '),
  16641. this.column_++,
  16642. 14 == (14 & i) && this.addFormatting(e.pts, ['i']),
  16643. 1 == (1 & i) && this.addFormatting(e.pts, ['u']))
  16644. : this.isOffsetControlCode(t, i)
  16645. ? (this.column_ += 3 & i)
  16646. : this.isPAC(t, i)
  16647. ? ((r = Ne.indexOf(7968 & a)),
  16648. 'rollUp' === this.mode_ && (r - this.rollUpRows_ + 1 < 0 && (r = this.rollUpRows_ - 1), this.setRollUp(e.pts, r)),
  16649. r !== this.row_ && (this.clearFormatting(e.pts), (this.row_ = r)),
  16650. 1 & i && -1 === this.formatting_.indexOf('u') && this.addFormatting(e.pts, ['u']),
  16651. 16 == (16 & a) && (this.column_ = 4 * ((14 & a) >> 1)),
  16652. this.isColorPAC(i) && 14 == (14 & i) && this.addFormatting(e.pts, ['i']))
  16653. : this.isNormalChar(t) && (0 === i && (i = null), (n = Oe(t)), (n += Oe(i)), this[this.mode_](e.pts, n), (this.column_ += n.length))))
  16654. : (this.lastControlCode_ = null)
  16655. })
  16656. }
  16657. ;(Ue.prototype = new j()),
  16658. (Ue.prototype.flushDisplayed = function (e) {
  16659. var t = this.displayed_
  16660. .map(function (e, t) {
  16661. try {
  16662. return e.trim()
  16663. } catch (e) {
  16664. return this.trigger('log', { level: 'warn', message: 'Skipping a malformed 608 caption at index ' + t + '.' }), ''
  16665. }
  16666. }, this)
  16667. .join('\n')
  16668. .replace(/^\n+|\n+$/g, '')
  16669. t.length && this.trigger('data', { startPts: this.startPts_, endPts: e, text: t, stream: this.name_ })
  16670. }),
  16671. (Ue.prototype.reset = function () {
  16672. ;(this.mode_ = 'popOn'),
  16673. (this.topRow_ = 0),
  16674. (this.startPts_ = 0),
  16675. (this.displayed_ = Me()),
  16676. (this.nonDisplayed_ = Me()),
  16677. (this.lastControlCode_ = null),
  16678. (this.column_ = 0),
  16679. (this.row_ = 14),
  16680. (this.rollUpRows_ = 2),
  16681. (this.formatting_ = [])
  16682. }),
  16683. (Ue.prototype.setConstants = function () {
  16684. 0 === this.dataChannel_
  16685. ? ((this.BASE_ = 16), (this.EXT_ = 17), (this.CONTROL_ = (20 | this.field_) << 8), (this.OFFSET_ = 23))
  16686. : 1 === this.dataChannel_ && ((this.BASE_ = 24), (this.EXT_ = 25), (this.CONTROL_ = (28 | this.field_) << 8), (this.OFFSET_ = 31)),
  16687. (this.PADDING_ = 0),
  16688. (this.RESUME_CAPTION_LOADING_ = 32 | this.CONTROL_),
  16689. (this.END_OF_CAPTION_ = 47 | this.CONTROL_),
  16690. (this.ROLL_UP_2_ROWS_ = 37 | this.CONTROL_),
  16691. (this.ROLL_UP_3_ROWS_ = 38 | this.CONTROL_),
  16692. (this.ROLL_UP_4_ROWS_ = 39 | this.CONTROL_),
  16693. (this.CARRIAGE_RETURN_ = 45 | this.CONTROL_),
  16694. (this.RESUME_DIRECT_CAPTIONING_ = 41 | this.CONTROL_),
  16695. (this.BACKSPACE_ = 33 | this.CONTROL_),
  16696. (this.ERASE_DISPLAYED_MEMORY_ = 44 | this.CONTROL_),
  16697. (this.ERASE_NON_DISPLAYED_MEMORY_ = 46 | this.CONTROL_)
  16698. }),
  16699. (Ue.prototype.isSpecialCharacter = function (e, t) {
  16700. return e === this.EXT_ && 48 <= t && t <= 63
  16701. }),
  16702. (Ue.prototype.isExtCharacter = function (e, t) {
  16703. return (e === this.EXT_ + 1 || e === this.EXT_ + 2) && 32 <= t && t <= 63
  16704. }),
  16705. (Ue.prototype.isMidRowCode = function (e, t) {
  16706. return e === this.EXT_ && 32 <= t && t <= 47
  16707. }),
  16708. (Ue.prototype.isOffsetControlCode = function (e, t) {
  16709. return e === this.OFFSET_ && 33 <= t && t <= 35
  16710. }),
  16711. (Ue.prototype.isPAC = function (e, t) {
  16712. return e >= this.BASE_ && e < this.BASE_ + 8 && 64 <= t && t <= 127
  16713. }),
  16714. (Ue.prototype.isColorPAC = function (e) {
  16715. return (64 <= e && e <= 79) || (96 <= e && e <= 127)
  16716. }),
  16717. (Ue.prototype.isNormalChar = function (e) {
  16718. return 32 <= e && e <= 127
  16719. }),
  16720. (Ue.prototype.setRollUp = function (e, t) {
  16721. if (
  16722. ('rollUp' !== this.mode_ && ((this.row_ = 14), (this.mode_ = 'rollUp'), this.flushDisplayed(e), (this.nonDisplayed_ = Me()), (this.displayed_ = Me())),
  16723. void 0 !== t && t !== this.row_)
  16724. )
  16725. for (var i = 0; i < this.rollUpRows_; i++) (this.displayed_[t - i] = this.displayed_[this.row_ - i]), (this.displayed_[this.row_ - i] = '')
  16726. void 0 === t && (t = this.row_), (this.topRow_ = t - this.rollUpRows_ + 1)
  16727. }),
  16728. (Ue.prototype.addFormatting = function (e, t) {
  16729. this.formatting_ = this.formatting_.concat(t)
  16730. t = t.reduce(function (e, t) {
  16731. return e + '<' + t + '>'
  16732. }, '')
  16733. this[this.mode_](e, t)
  16734. }),
  16735. (Ue.prototype.clearFormatting = function (e) {
  16736. var t
  16737. this.formatting_.length &&
  16738. ((t = this.formatting_.reverse().reduce(function (e, t) {
  16739. return e + '</' + t + '>'
  16740. }, '')),
  16741. (this.formatting_ = []),
  16742. this[this.mode_](e, t))
  16743. }),
  16744. (Ue.prototype.popOn = function (e, t) {
  16745. var i = this.nonDisplayed_[this.row_]
  16746. this.nonDisplayed_[this.row_] = i += t
  16747. }),
  16748. (Ue.prototype.rollUp = function (e, t) {
  16749. var i = this.displayed_[this.row_]
  16750. this.displayed_[this.row_] = i += t
  16751. }),
  16752. (Ue.prototype.shiftRowsUp_ = function () {
  16753. for (var e = 0; e < this.topRow_; e++) this.displayed_[e] = ''
  16754. for (e = this.row_ + 1; e < 15; e++) this.displayed_[e] = ''
  16755. for (e = this.topRow_; e < this.row_; e++) this.displayed_[e] = this.displayed_[e + 1]
  16756. this.displayed_[this.row_] = ''
  16757. }),
  16758. (Ue.prototype.paintOn = function (e, t) {
  16759. var i = this.displayed_[this.row_]
  16760. this.displayed_[this.row_] = i += t
  16761. })
  16762. function Be(e, t) {
  16763. var i = 1
  16764. for (t < e && (i = -1); 4294967296 < Math.abs(t - e); ) e += 8589934592 * i
  16765. return e
  16766. }
  16767. var Fe = { CaptionStream: Ie, Cea608Stream: Ue, Cea708Stream: De },
  16768. je = { H264_STREAM_TYPE: 27, ADTS_STREAM_TYPE: 15, METADATA_STREAM_TYPE: 21 },
  16769. e = function e(t) {
  16770. var i, n
  16771. e.prototype.init.call(this),
  16772. (this.type_ = t || 'shared'),
  16773. (this.push = function (e) {
  16774. ;('shared' !== this.type_ && e.type !== this.type_) ||
  16775. (void 0 === n && (n = e.dts), (e.dts = Be(e.dts, n)), (e.pts = Be(e.pts, n)), (i = e.dts), this.trigger('data', e))
  16776. }),
  16777. (this.flush = function () {
  16778. ;(n = i), this.trigger('done')
  16779. }),
  16780. (this.endTimeline = function () {
  16781. this.flush(), this.trigger('endedtimeline')
  16782. }),
  16783. (this.discontinuity = function () {
  16784. i = n = void 0
  16785. }),
  16786. (this.reset = function () {
  16787. this.discontinuity(), this.trigger('reset')
  16788. })
  16789. }
  16790. e.prototype = new j()
  16791. function He(e, t, i) {
  16792. for (var n = '', r = t; r < i; r++) n += '%' + ('00' + e[r].toString(16)).slice(-2)
  16793. return n
  16794. }
  16795. function qe(e, t, i) {
  16796. return decodeURIComponent(He(e, t, i))
  16797. }
  16798. function Ve(e) {
  16799. return (e[0] << 21) | (e[1] << 14) | (e[2] << 7) | e[3]
  16800. }
  16801. var We = e,
  16802. Ie = Be,
  16803. Ge = {
  16804. TXXX: function (e) {
  16805. var t
  16806. if (3 === e.data[0]) {
  16807. for (t = 1; t < e.data.length; t++)
  16808. if (0 === e.data[t]) {
  16809. ;(e.description = qe(e.data, 1, t)), (e.value = qe(e.data, t + 1, e.data.length).replace(/\0*$/, ''))
  16810. break
  16811. }
  16812. e.data = e.value
  16813. }
  16814. },
  16815. WXXX: function (e) {
  16816. var t
  16817. if (3 === e.data[0])
  16818. for (t = 1; t < e.data.length; t++)
  16819. if (0 === e.data[t]) {
  16820. ;(e.description = qe(e.data, 1, t)), (e.url = qe(e.data, t + 1, e.data.length))
  16821. break
  16822. }
  16823. },
  16824. PRIV: function (e) {
  16825. for (var t, i = 0; i < e.data.length; i++)
  16826. if (0 === e.data[i]) {
  16827. e.owner = ((t = e.data), unescape(He(t, 0, i)))
  16828. break
  16829. }
  16830. ;(e.privateData = e.data.subarray(i + 1)), (e.data = e.privateData)
  16831. },
  16832. },
  16833. ze = function (e) {
  16834. var t,
  16835. i = { descriptor: e && e.descriptor },
  16836. u = 0,
  16837. l = [],
  16838. c = 0
  16839. if ((ze.prototype.init.call(this), (this.dispatchType = je.METADATA_STREAM_TYPE.toString(16)), i.descriptor))
  16840. for (t = 0; t < i.descriptor.length; t++) this.dispatchType += ('00' + i.descriptor[t].toString(16)).slice(-2)
  16841. this.push = function (e) {
  16842. var t, i, n, r, a, s, o
  16843. if ('timed-metadata' === e.type)
  16844. if (
  16845. (e.dataAlignmentIndicator && ((c = 0), (l.length = 0)),
  16846. 0 === l.length && (e.data.length < 10 || e.data[0] !== 'I'.charCodeAt(0) || e.data[1] !== 'D'.charCodeAt(0) || e.data[2] !== '3'.charCodeAt(0)))
  16847. )
  16848. this.trigger('log', { level: 'warn', message: 'Skipping unrecognized metadata packet' })
  16849. else if ((l.push(e), (c += e.data.byteLength), 1 === l.length && ((u = Ve(e.data.subarray(6, 10))), (u += 10)), !(c < u))) {
  16850. for (t = { data: new Uint8Array(u), frames: [], pts: l[0].pts, dts: l[0].dts }, r = 0; r < u; )
  16851. t.data.set(l[0].data.subarray(0, u - r), r), (r += l[0].data.byteLength), (c -= l[0].data.byteLength), l.shift()
  16852. ;(i = 10), 64 & t.data[5] && ((i += 4), (i += Ve(t.data.subarray(10, 14))), (u -= Ve(t.data.subarray(16, 20))))
  16853. do {
  16854. if ((n = Ve(t.data.subarray(i + 4, i + 8))) < 1)
  16855. return void this.trigger('log', { level: 'warn', message: 'Malformed ID3 frame encountered. Skipping metadata parsing.' })
  16856. } while (
  16857. (((o = { id: String.fromCharCode(t.data[i], t.data[i + 1], t.data[i + 2], t.data[i + 3]), data: t.data.subarray(i + 10, i + n + 10) }).key = o.id),
  16858. Ge[o.id] &&
  16859. (Ge[o.id](o),
  16860. 'com.apple.streaming.transportStreamTimestamp' === o.owner &&
  16861. ((s = ((1 & (a = o.data)[3]) << 30) | (a[4] << 22) | (a[5] << 14) | (a[6] << 6) | (a[7] >>> 2)),
  16862. (s *= 4),
  16863. (s += 3 & a[7]),
  16864. (o.timeStamp = s),
  16865. void 0 === t.pts && void 0 === t.dts && ((t.pts = o.timeStamp), (t.dts = o.timeStamp)),
  16866. this.trigger('timestamp', o))),
  16867. t.frames.push(o),
  16868. (i += 10),
  16869. (i += n) < u)
  16870. )
  16871. this.trigger('data', t)
  16872. }
  16873. }
  16874. }
  16875. ze.prototype = new j()
  16876. var Xe,
  16877. Ke,
  16878. e = ze,
  16879. We = We,
  16880. Ye = function () {
  16881. var r = new Uint8Array(188),
  16882. a = 0
  16883. Ye.prototype.init.call(this),
  16884. (this.push = function (e) {
  16885. var t,
  16886. i = 0,
  16887. n = 188
  16888. for (a ? ((t = new Uint8Array(e.byteLength + a)).set(r.subarray(0, a)), t.set(e, a), (a = 0)) : (t = e); n < t.byteLength; )
  16889. 71 !== t[i] || 71 !== t[n] ? (i++, n++) : (this.trigger('data', t.subarray(i, n)), (i += 188), (n += 188))
  16890. i < t.byteLength && (r.set(t.subarray(i), 0), (a = t.byteLength - i))
  16891. }),
  16892. (this.flush = function () {
  16893. 188 === a && 71 === r[0] && (this.trigger('data', r), (a = 0)), this.trigger('done')
  16894. }),
  16895. (this.endTimeline = function () {
  16896. this.flush(), this.trigger('endedtimeline')
  16897. }),
  16898. (this.reset = function () {
  16899. ;(a = 0), this.trigger('reset')
  16900. })
  16901. }
  16902. ;(Ye.prototype = new j()),
  16903. ((Xe = function () {
  16904. var n, r, a, s
  16905. Xe.prototype.init.call(this),
  16906. ((s = this).packetsWaitingForPmt = []),
  16907. (this.programMapTable = void 0),
  16908. (n = function (e, t) {
  16909. var i = 0
  16910. t.payloadUnitStartIndicator && (i += e[i] + 1), ('pat' === t.type ? r : a)(e.subarray(i), t)
  16911. }),
  16912. (r = function (e, t) {
  16913. ;(t.section_number = e[7]), (t.last_section_number = e[8]), (s.pmtPid = ((31 & e[10]) << 8) | e[11]), (t.pmtPid = s.pmtPid)
  16914. }),
  16915. (a = function (e, t) {
  16916. var i, n
  16917. if (1 & e[5]) {
  16918. for (
  16919. s.programMapTable = { video: null, audio: null, 'timed-metadata': {} }, i = 3 + (((15 & e[1]) << 8) | e[2]) - 4, n = 12 + (((15 & e[10]) << 8) | e[11]);
  16920. n < i;
  16921. ) {
  16922. var r = e[n],
  16923. a = ((31 & e[n + 1]) << 8) | e[n + 2]
  16924. r === je.H264_STREAM_TYPE && null === s.programMapTable.video
  16925. ? (s.programMapTable.video = a)
  16926. : r === je.ADTS_STREAM_TYPE && null === s.programMapTable.audio
  16927. ? (s.programMapTable.audio = a)
  16928. : r === je.METADATA_STREAM_TYPE && (s.programMapTable['timed-metadata'][a] = r),
  16929. (n += 5 + (((15 & e[n + 3]) << 8) | e[n + 4]))
  16930. }
  16931. t.programMapTable = s.programMapTable
  16932. }
  16933. }),
  16934. (this.push = function (e) {
  16935. var t = {},
  16936. i = 4
  16937. if (((t.payloadUnitStartIndicator = !!(64 & e[1])), (t.pid = 31 & e[1]), (t.pid <<= 8), (t.pid |= e[2]), 1 < (48 & e[3]) >>> 4 && (i += e[i] + 1), 0 === t.pid))
  16938. (t.type = 'pat'), n(e.subarray(i), t), this.trigger('data', t)
  16939. else if (t.pid === this.pmtPid)
  16940. for (t.type = 'pmt', n(e.subarray(i), t), this.trigger('data', t); this.packetsWaitingForPmt.length; )
  16941. this.processPes_.apply(this, this.packetsWaitingForPmt.shift())
  16942. else void 0 === this.programMapTable ? this.packetsWaitingForPmt.push([e, i, t]) : this.processPes_(e, i, t)
  16943. }),
  16944. (this.processPes_ = function (e, t, i) {
  16945. i.pid === this.programMapTable.video
  16946. ? (i.streamType = je.H264_STREAM_TYPE)
  16947. : i.pid === this.programMapTable.audio
  16948. ? (i.streamType = je.ADTS_STREAM_TYPE)
  16949. : (i.streamType = this.programMapTable['timed-metadata'][i.pid]),
  16950. (i.type = 'pes'),
  16951. (i.data = e.subarray(t)),
  16952. this.trigger('data', i)
  16953. })
  16954. }).prototype = new j()),
  16955. (Xe.STREAM_TYPES = { h264: 27, adts: 15 }),
  16956. ((Ke = function () {
  16957. function n(e, t, i) {
  16958. var n,
  16959. r,
  16960. a,
  16961. s,
  16962. o = new Uint8Array(e.size),
  16963. u = { type: t },
  16964. l = 0,
  16965. c = 0
  16966. if (e.data.length && !(e.size < 9)) {
  16967. for (u.trackId = e.data[0].pid, l = 0; l < e.data.length; l++) (n = e.data[l]), o.set(n.data, c), (c += n.data.byteLength)
  16968. ;(a = u),
  16969. (s = ((r = o)[0] << 16) | (r[1] << 8) | r[2]),
  16970. (a.data = new Uint8Array()),
  16971. 1 == s &&
  16972. ((a.packetLength = 6 + ((r[4] << 8) | r[5])),
  16973. (a.dataAlignmentIndicator = 0 != (4 & r[6])),
  16974. 192 & (s = r[7]) &&
  16975. ((a.pts = ((14 & r[9]) << 27) | ((255 & r[10]) << 20) | ((254 & r[11]) << 12) | ((255 & r[12]) << 5) | ((254 & r[13]) >>> 3)),
  16976. (a.pts *= 4),
  16977. (a.pts += (6 & r[13]) >>> 1),
  16978. (a.dts = a.pts),
  16979. 64 & s &&
  16980. ((a.dts = ((14 & r[14]) << 27) | ((255 & r[15]) << 20) | ((254 & r[16]) << 12) | ((255 & r[17]) << 5) | ((254 & r[18]) >>> 3)),
  16981. (a.dts *= 4),
  16982. (a.dts += (6 & r[18]) >>> 1))),
  16983. (a.data = r.subarray(9 + r[8]))),
  16984. (t = 'video' === t || u.packetLength <= e.size),
  16985. (i || t) && ((e.size = 0), (e.data.length = 0)),
  16986. t && d.trigger('data', u)
  16987. }
  16988. }
  16989. var t,
  16990. d = this,
  16991. r = !1,
  16992. a = { data: [], size: 0 },
  16993. s = { data: [], size: 0 },
  16994. o = { data: [], size: 0 }
  16995. Ke.prototype.init.call(this),
  16996. (this.push = function (i) {
  16997. ;({
  16998. pat: function () {},
  16999. pes: function () {
  17000. var e, t
  17001. switch (i.streamType) {
  17002. case je.H264_STREAM_TYPE:
  17003. ;(e = a), (t = 'video')
  17004. break
  17005. case je.ADTS_STREAM_TYPE:
  17006. ;(e = s), (t = 'audio')
  17007. break
  17008. case je.METADATA_STREAM_TYPE:
  17009. ;(e = o), (t = 'timed-metadata')
  17010. break
  17011. default:
  17012. return
  17013. }
  17014. i.payloadUnitStartIndicator && n(e, t, !0), e.data.push(i), (e.size += i.data.byteLength)
  17015. },
  17016. pmt: function () {
  17017. var e = { type: 'metadata', tracks: [] }
  17018. null !== (t = i.programMapTable).video && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.video, codec: 'avc', type: 'video' }),
  17019. null !== t.audio && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.audio, codec: 'adts', type: 'audio' }),
  17020. (r = !0),
  17021. d.trigger('data', e)
  17022. },
  17023. }[i.type]())
  17024. }),
  17025. (this.reset = function () {
  17026. ;(a.size = 0), (a.data.length = 0), (s.size = 0), (s.data.length = 0), this.trigger('reset')
  17027. }),
  17028. (this.flushStreams_ = function () {
  17029. n(a, 'video'), n(s, 'audio'), n(o, 'timed-metadata')
  17030. }),
  17031. (this.flush = function () {
  17032. var e
  17033. !r &&
  17034. t &&
  17035. ((e = { type: 'metadata', tracks: [] }),
  17036. null !== t.video && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.video, codec: 'avc', type: 'video' }),
  17037. null !== t.audio && e.tracks.push({ timelineStartInfo: { baseMediaDecodeTime: 0 }, id: +t.audio, codec: 'adts', type: 'audio' }),
  17038. d.trigger('data', e)),
  17039. (r = !1),
  17040. this.flushStreams_(),
  17041. this.trigger('done')
  17042. })
  17043. }).prototype = new j())
  17044. var Qe,
  17045. $e = {
  17046. PAT_PID: 0,
  17047. MP2T_PACKET_LENGTH: 188,
  17048. TransportPacketStream: Ye,
  17049. TransportParseStream: Xe,
  17050. ElementaryStream: Ke,
  17051. TimestampRolloverStream: We,
  17052. CaptionStream: Fe.CaptionStream,
  17053. Cea608Stream: Fe.Cea608Stream,
  17054. Cea708Stream: Fe.Cea708Stream,
  17055. MetadataStream: e,
  17056. }
  17057. for (Qe in je) je.hasOwnProperty(Qe) && ($e[Qe] = je[Qe])
  17058. var Je = $e,
  17059. Ze = ue,
  17060. et = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350],
  17061. tt = function (u) {
  17062. var l,
  17063. c = 0
  17064. tt.prototype.init.call(this),
  17065. (this.skipWarn_ = function (e, t) {
  17066. this.trigger('log', { level: 'warn', message: 'adts skiping bytes ' + e + ' to ' + t + ' in frame ' + c + ' outside syncword' })
  17067. }),
  17068. (this.push = function (e) {
  17069. var t,
  17070. i,
  17071. n,
  17072. r,
  17073. a,
  17074. s,
  17075. o = 0
  17076. if ((u || (c = 0), 'audio' === e.type)) {
  17077. for (l && l.length ? ((n = l), (l = new Uint8Array(n.byteLength + e.data.byteLength)).set(n), l.set(e.data, n.byteLength)) : (l = e.data); o + 7 < l.length; )
  17078. if (255 === l[o] && 240 == (246 & l[o + 1])) {
  17079. if (
  17080. ('number' == typeof s && (this.skipWarn_(s, o), (s = null)),
  17081. (i = 2 * (1 & ~l[o + 1])),
  17082. (t = ((3 & l[o + 3]) << 11) | (l[o + 4] << 3) | ((224 & l[o + 5]) >> 5)),
  17083. (a = ((r = 1024 * (1 + (3 & l[o + 6]))) * Ze) / et[(60 & l[o + 2]) >>> 2]),
  17084. l.byteLength - o < t)
  17085. )
  17086. break
  17087. this.trigger('data', {
  17088. pts: e.pts + c * a,
  17089. dts: e.dts + c * a,
  17090. sampleCount: r,
  17091. audioobjecttype: 1 + ((l[o + 2] >>> 6) & 3),
  17092. channelcount: ((1 & l[o + 2]) << 2) | ((192 & l[o + 3]) >>> 6),
  17093. samplerate: et[(60 & l[o + 2]) >>> 2],
  17094. samplingfrequencyindex: (60 & l[o + 2]) >>> 2,
  17095. samplesize: 16,
  17096. data: l.subarray(o + 7 + i, o + t),
  17097. }),
  17098. c++,
  17099. (o += t)
  17100. } else 'number' != typeof s && (s = o), o++
  17101. 'number' == typeof s && (this.skipWarn_(s, o), (s = null)), (l = l.subarray(o))
  17102. }
  17103. }),
  17104. (this.flush = function () {
  17105. ;(c = 0), this.trigger('done')
  17106. }),
  17107. (this.reset = function () {
  17108. ;(l = void 0), this.trigger('reset')
  17109. }),
  17110. (this.endTimeline = function () {
  17111. ;(l = void 0), this.trigger('endedtimeline')
  17112. })
  17113. }
  17114. tt.prototype = new j()
  17115. var it,
  17116. nt,
  17117. rt = tt,
  17118. at = function (n) {
  17119. var r = n.byteLength,
  17120. a = 0,
  17121. s = 0
  17122. ;(this.length = function () {
  17123. return 8 * r
  17124. }),
  17125. (this.bitsAvailable = function () {
  17126. return 8 * r + s
  17127. }),
  17128. (this.loadWord = function () {
  17129. var e = n.byteLength - r,
  17130. t = new Uint8Array(4),
  17131. i = Math.min(4, r)
  17132. if (0 === i) throw new Error('no bytes available')
  17133. t.set(n.subarray(e, e + i)), (a = new DataView(t.buffer).getUint32(0)), (s = 8 * i), (r -= i)
  17134. }),
  17135. (this.skipBits = function (e) {
  17136. var t
  17137. e < s || ((e -= s), (e -= 8 * (t = Math.floor(e / 8))), (r -= t), this.loadWord()), (a <<= e), (s -= e)
  17138. }),
  17139. (this.readBits = function (e) {
  17140. var t = Math.min(s, e),
  17141. i = a >>> (32 - t)
  17142. return 0 < (s -= t) ? (a <<= t) : 0 < r && this.loadWord(), 0 < (t = e - t) ? (i << t) | this.readBits(t) : i
  17143. }),
  17144. (this.skipLeadingZeros = function () {
  17145. for (var e = 0; e < s; ++e) if (0 != (a & (2147483648 >>> e))) return (a <<= e), (s -= e), e
  17146. return this.loadWord(), e + this.skipLeadingZeros()
  17147. }),
  17148. (this.skipUnsignedExpGolomb = function () {
  17149. this.skipBits(1 + this.skipLeadingZeros())
  17150. }),
  17151. (this.skipExpGolomb = function () {
  17152. this.skipBits(1 + this.skipLeadingZeros())
  17153. }),
  17154. (this.readUnsignedExpGolomb = function () {
  17155. var e = this.skipLeadingZeros()
  17156. return this.readBits(e + 1) - 1
  17157. }),
  17158. (this.readExpGolomb = function () {
  17159. var e = this.readUnsignedExpGolomb()
  17160. return 1 & e ? (1 + e) >>> 1 : -1 * (e >>> 1)
  17161. }),
  17162. (this.readBoolean = function () {
  17163. return 1 === this.readBits(1)
  17164. }),
  17165. (this.readUnsignedByte = function () {
  17166. return this.readBits(8)
  17167. }),
  17168. this.loadWord()
  17169. },
  17170. st = function () {
  17171. var n,
  17172. r,
  17173. a = 0
  17174. st.prototype.init.call(this),
  17175. (this.push = function (e) {
  17176. for (var t, i = (r = r ? ((t = new Uint8Array(r.byteLength + e.data.byteLength)).set(r), t.set(e.data, r.byteLength), t) : e.data).byteLength; a < i - 3; a++)
  17177. if (1 === r[a + 2]) {
  17178. n = a + 5
  17179. break
  17180. }
  17181. for (; n < i; )
  17182. switch (r[n]) {
  17183. case 0:
  17184. if (0 !== r[n - 1]) {
  17185. n += 2
  17186. break
  17187. }
  17188. if (0 !== r[n - 2]) {
  17189. n++
  17190. break
  17191. }
  17192. for (a + 3 !== n - 2 && this.trigger('data', r.subarray(a + 3, n - 2)); 1 !== r[++n] && n < i; );
  17193. ;(a = n - 2), (n += 3)
  17194. break
  17195. case 1:
  17196. if (0 !== r[n - 1] || 0 !== r[n - 2]) {
  17197. n += 3
  17198. break
  17199. }
  17200. this.trigger('data', r.subarray(a + 3, n - 2)), (a = n - 2), (n += 3)
  17201. break
  17202. default:
  17203. n += 3
  17204. }
  17205. ;(r = r.subarray(a)), (n -= a), (a = 0)
  17206. }),
  17207. (this.reset = function () {
  17208. ;(r = null), (a = 0), this.trigger('reset')
  17209. }),
  17210. (this.flush = function () {
  17211. r && 3 < r.byteLength && this.trigger('data', r.subarray(a + 3)), (r = null), (a = 0), this.trigger('done')
  17212. }),
  17213. (this.endTimeline = function () {
  17214. this.flush(), this.trigger('endedtimeline')
  17215. })
  17216. }
  17217. ;(st.prototype = new j()),
  17218. (nt = { 100: !0, 110: !0, 122: !0, 244: !0, 44: !0, 83: !0, 86: !0, 118: !0, 128: !0, 138: !0, 139: !0, 134: !0 }),
  17219. ((it = function () {
  17220. var i,
  17221. n,
  17222. r,
  17223. a,
  17224. s,
  17225. o,
  17226. m,
  17227. t = new st()
  17228. it.prototype.init.call(this),
  17229. ((i = this).push = function (e) {
  17230. 'video' === e.type && ((n = e.trackId), (r = e.pts), (a = e.dts), t.push(e))
  17231. }),
  17232. t.on('data', function (e) {
  17233. var t = { trackId: n, pts: r, dts: a, data: e, nalUnitTypeCode: 31 & e[0] }
  17234. switch (t.nalUnitTypeCode) {
  17235. case 5:
  17236. t.nalUnitType = 'slice_layer_without_partitioning_rbsp_idr'
  17237. break
  17238. case 6:
  17239. ;(t.nalUnitType = 'sei_rbsp'), (t.escapedRBSP = s(e.subarray(1)))
  17240. break
  17241. case 7:
  17242. ;(t.nalUnitType = 'seq_parameter_set_rbsp'), (t.escapedRBSP = s(e.subarray(1))), (t.config = o(t.escapedRBSP))
  17243. break
  17244. case 8:
  17245. t.nalUnitType = 'pic_parameter_set_rbsp'
  17246. break
  17247. case 9:
  17248. t.nalUnitType = 'access_unit_delimiter_rbsp'
  17249. }
  17250. i.trigger('data', t)
  17251. }),
  17252. t.on('done', function () {
  17253. i.trigger('done')
  17254. }),
  17255. t.on('partialdone', function () {
  17256. i.trigger('partialdone')
  17257. }),
  17258. t.on('reset', function () {
  17259. i.trigger('reset')
  17260. }),
  17261. t.on('endedtimeline', function () {
  17262. i.trigger('endedtimeline')
  17263. }),
  17264. (this.flush = function () {
  17265. t.flush()
  17266. }),
  17267. (this.partialFlush = function () {
  17268. t.partialFlush()
  17269. }),
  17270. (this.reset = function () {
  17271. t.reset()
  17272. }),
  17273. (this.endTimeline = function () {
  17274. t.endTimeline()
  17275. }),
  17276. (m = function (e, t) {
  17277. for (var i = 8, n = 8, r = 0; r < e; r++) i = 0 === (n = 0 !== n ? (i + t.readExpGolomb() + 256) % 256 : n) ? i : n
  17278. }),
  17279. (s = function (e) {
  17280. for (var t = e.byteLength, i = [], n = 1; n < t - 2; ) 0 === e[n] && 0 === e[n + 1] && 3 === e[n + 2] ? (i.push(n + 2), (n += 2)) : n++
  17281. if (0 === i.length) return e
  17282. for (var r = t - i.length, a = new Uint8Array(r), s = 0, n = 0; n < r; s++, n++) s === i[0] && (s++, i.shift()), (a[n] = e[s])
  17283. return a
  17284. }),
  17285. (o = function (e) {
  17286. var t,
  17287. i,
  17288. n,
  17289. r,
  17290. a,
  17291. s = 0,
  17292. o = 0,
  17293. u = 0,
  17294. l = 0,
  17295. c = [1, 1],
  17296. d = new at(e),
  17297. h = d.readUnsignedByte(),
  17298. p = d.readUnsignedByte(),
  17299. f = d.readUnsignedByte()
  17300. if (
  17301. (d.skipUnsignedExpGolomb(),
  17302. nt[h] && (3 === (i = d.readUnsignedExpGolomb()) && d.skipBits(1), d.skipUnsignedExpGolomb(), d.skipUnsignedExpGolomb(), d.skipBits(1), d.readBoolean()))
  17303. )
  17304. for (r = 3 !== i ? 8 : 12, a = 0; a < r; a++) d.readBoolean() && m(a < 6 ? 16 : 64, d)
  17305. if ((d.skipUnsignedExpGolomb(), 0 === (n = d.readUnsignedExpGolomb()))) d.readUnsignedExpGolomb()
  17306. else if (1 === n) for (d.skipBits(1), d.skipExpGolomb(), d.skipExpGolomb(), t = d.readUnsignedExpGolomb(), a = 0; a < t; a++) d.skipExpGolomb()
  17307. if (
  17308. (d.skipUnsignedExpGolomb(),
  17309. d.skipBits(1),
  17310. (e = d.readUnsignedExpGolomb()),
  17311. (i = d.readUnsignedExpGolomb()),
  17312. 0 === (n = d.readBits(1)) && d.skipBits(1),
  17313. d.skipBits(1),
  17314. d.readBoolean() && ((s = d.readUnsignedExpGolomb()), (o = d.readUnsignedExpGolomb()), (u = d.readUnsignedExpGolomb()), (l = d.readUnsignedExpGolomb())),
  17315. d.readBoolean() && d.readBoolean())
  17316. ) {
  17317. switch (d.readUnsignedByte()) {
  17318. case 1:
  17319. c = [1, 1]
  17320. break
  17321. case 2:
  17322. c = [12, 11]
  17323. break
  17324. case 3:
  17325. c = [10, 11]
  17326. break
  17327. case 4:
  17328. c = [16, 11]
  17329. break
  17330. case 5:
  17331. c = [40, 33]
  17332. break
  17333. case 6:
  17334. c = [24, 11]
  17335. break
  17336. case 7:
  17337. c = [20, 11]
  17338. break
  17339. case 8:
  17340. c = [32, 11]
  17341. break
  17342. case 9:
  17343. c = [80, 33]
  17344. break
  17345. case 10:
  17346. c = [18, 11]
  17347. break
  17348. case 11:
  17349. c = [15, 11]
  17350. break
  17351. case 12:
  17352. c = [64, 33]
  17353. break
  17354. case 13:
  17355. c = [160, 99]
  17356. break
  17357. case 14:
  17358. c = [4, 3]
  17359. break
  17360. case 15:
  17361. c = [3, 2]
  17362. break
  17363. case 16:
  17364. c = [2, 1]
  17365. break
  17366. case 255:
  17367. c = [(d.readUnsignedByte() << 8) | d.readUnsignedByte(), (d.readUnsignedByte() << 8) | d.readUnsignedByte()]
  17368. }
  17369. c && (c[0], c[1])
  17370. }
  17371. return { profileIdc: h, levelIdc: f, profileCompatibility: p, width: 16 * (e + 1) - 2 * s - 2 * o, height: (2 - n) * (i + 1) * 16 - 2 * u - 2 * l, sarRatio: c }
  17372. })
  17373. }).prototype = new j())
  17374. function ot(e, t) {
  17375. var i = 0 <= (i = (e[t + 6] << 21) | (e[t + 7] << 14) | (e[t + 8] << 7) | e[t + 9]) ? i : 0
  17376. return (16 & e[t + 5]) >> 4 ? i + 20 : i + 10
  17377. }
  17378. function ut(e, t) {
  17379. return e.length - t < 10 || e[t] !== 'I'.charCodeAt(0) || e[t + 1] !== 'D'.charCodeAt(0) || e[t + 2] !== '3'.charCodeAt(0) ? t : ut(e, (t += ot(e, t)))
  17380. }
  17381. function lt(e) {
  17382. return (e[0] << 21) | (e[1] << 14) | (e[2] << 7) | e[3]
  17383. }
  17384. var e = { H264Stream: it, NalByteStream: st },
  17385. ct = [96e3, 88200, 64e3, 48e3, 44100, 32e3, 24e3, 22050, 16e3, 12e3, 11025, 8e3, 7350],
  17386. dt = {
  17387. isLikelyAacData: function (e) {
  17388. var t = ut(e, 0)
  17389. return e.length >= t + 2 && 255 == (255 & e[t]) && 240 == (240 & e[t + 1]) && 16 == (22 & e[t + 1])
  17390. },
  17391. parseId3TagSize: ot,
  17392. parseAdtsSize: function (e, t) {
  17393. var i = (224 & e[t + 5]) >> 5,
  17394. n = e[t + 4] << 3
  17395. return (6144 & e[t + 3]) | n | i
  17396. },
  17397. parseType: function (e, t) {
  17398. return e[t] === 'I'.charCodeAt(0) && e[t + 1] === 'D'.charCodeAt(0) && e[t + 2] === '3'.charCodeAt(0)
  17399. ? 'timed-metadata'
  17400. : !0 & e[t] && 240 == (240 & e[t + 1])
  17401. ? 'audio'
  17402. : null
  17403. },
  17404. parseSampleRate: function (e) {
  17405. for (var t = 0; t + 5 < e.length; ) {
  17406. if (255 === e[t] && 240 == (246 & e[t + 1])) return ct[(60 & e[t + 2]) >>> 2]
  17407. t++
  17408. }
  17409. return null
  17410. },
  17411. parseAacTimestamp: function (e) {
  17412. var t,
  17413. i = 10
  17414. 64 & e[5] && ((i += 4), (i += lt(e.subarray(10, 14))))
  17415. do {
  17416. if ((t = lt(e.subarray(i + 4, i + 8))) < 1) return null
  17417. if ('PRIV' === String.fromCharCode(e[i], e[i + 1], e[i + 2], e[i + 3]))
  17418. for (var n = e.subarray(i + 10, i + t + 10), r = 0; r < n.byteLength; r++)
  17419. if (0 === n[r]) {
  17420. if (
  17421. 'com.apple.streaming.transportStreamTimestamp' !==
  17422. unescape(
  17423. (function (e, t, i) {
  17424. for (var n = '', r = t; r < i; r++) n += '%' + ('00' + e[r].toString(16)).slice(-2)
  17425. return n
  17426. })(n, 0, r)
  17427. )
  17428. )
  17429. break
  17430. var a = n.subarray(r + 1),
  17431. s = ((1 & a[3]) << 30) | (a[4] << 22) | (a[5] << 14) | (a[6] << 6) | (a[7] >>> 2)
  17432. return (s *= 4), (s += 3 & a[7])
  17433. }
  17434. } while (((i += 10), (i += t) < e.byteLength))
  17435. return null
  17436. },
  17437. },
  17438. ht = function () {
  17439. var a = new Uint8Array(),
  17440. s = 0
  17441. ht.prototype.init.call(this),
  17442. (this.setTimestamp = function (e) {
  17443. s = e
  17444. }),
  17445. (this.push = function (e) {
  17446. var t,
  17447. i,
  17448. n = 0,
  17449. r = 0
  17450. for (a.length ? ((i = a.length), (a = new Uint8Array(e.byteLength + i)).set(a.subarray(0, i)), a.set(e, i)) : (a = e); 3 <= a.length - r; )
  17451. if (a[r] !== 'I'.charCodeAt(0) || a[r + 1] !== 'D'.charCodeAt(0) || a[r + 2] !== '3'.charCodeAt(0))
  17452. if (255 != (255 & a[r]) || 240 != (240 & a[r + 1])) r++
  17453. else {
  17454. if (a.length - r < 7) break
  17455. if (r + (n = dt.parseAdtsSize(a, r)) > a.length) break
  17456. ;(t = { type: 'audio', data: a.subarray(r, r + n), pts: s, dts: s }), this.trigger('data', t), (r += n)
  17457. }
  17458. else {
  17459. if (a.length - r < 10) break
  17460. if (r + (n = dt.parseId3TagSize(a, r)) > a.length) break
  17461. ;(t = { type: 'timed-metadata', data: a.subarray(r, r + n) }), this.trigger('data', t), (r += n)
  17462. }
  17463. ;(e = a.length - r), (a = 0 < e ? a.subarray(r) : new Uint8Array())
  17464. }),
  17465. (this.reset = function () {
  17466. ;(a = new Uint8Array()), this.trigger('reset')
  17467. }),
  17468. (this.endTimeline = function () {
  17469. ;(a = new Uint8Array()), this.trigger('endedtimeline')
  17470. })
  17471. }
  17472. ht.prototype = new j()
  17473. function pt(e, t) {
  17474. ;(t.stream = e), this.trigger('log', t)
  17475. }
  17476. function ft(e, t) {
  17477. for (var i = Object.keys(t), n = 0; n < i.length; n++) {
  17478. var r = i[n]
  17479. 'headOfPipeline' !== r && t[r].on && t[r].on('log', pt.bind(e, r))
  17480. }
  17481. }
  17482. function mt(e, t) {
  17483. var i
  17484. if (e.length === t.length) {
  17485. for (i = 0; i < e.length; i++) if (e[i] !== t[i]) return
  17486. return 1
  17487. }
  17488. }
  17489. function gt(e, t, i, n, r, a) {
  17490. return { start: { dts: e, pts: e + (i - t) }, end: { dts: e + (n - t), pts: e + (r - i) }, prependedContentDuration: a, baseMediaDecodeTime: e }
  17491. }
  17492. var yt,
  17493. vt,
  17494. _t,
  17495. bt = ht,
  17496. Tt = ['audioobjecttype', 'channelcount', 'samplerate', 'samplingfrequencyindex', 'samplesize'],
  17497. St = ['width', 'height', 'profileIdc', 'levelIdc', 'profileCompatibility', 'sarRatio'],
  17498. wt = e.H264Stream,
  17499. Et = dt.isLikelyAacData,
  17500. kt = ue,
  17501. Ct = function (a, s) {
  17502. var o = [],
  17503. u = 0,
  17504. l = 0,
  17505. c = 1 / 0,
  17506. d = (s = s || {}).firstSequenceNumber || 0
  17507. Ct.prototype.init.call(this),
  17508. (this.push = function (t) {
  17509. Te(a, t),
  17510. a &&
  17511. Tt.forEach(function (e) {
  17512. a[e] = t[e]
  17513. }),
  17514. o.push(t)
  17515. }),
  17516. (this.setEarliestDts = function (e) {
  17517. u = e
  17518. }),
  17519. (this.setVideoBaseMediaDecodeTime = function (e) {
  17520. c = e
  17521. }),
  17522. (this.setAudioAppendStart = function (e) {
  17523. l = e
  17524. }),
  17525. (this.flush = function () {
  17526. var e, t, i, n, r
  17527. 0 !== o.length &&
  17528. ((e = me(o, a, u)),
  17529. (a.baseMediaDecodeTime = be(a, s.keepOriginalTimestamps)),
  17530. (r = fe(a, e, l, c)),
  17531. (a.samples = ge(e)),
  17532. (t = K(ye(e))),
  17533. (o = []),
  17534. (n = Y(d, [a])),
  17535. (i = new Uint8Array(n.byteLength + t.byteLength)),
  17536. d++,
  17537. i.set(n),
  17538. i.set(t, n.byteLength),
  17539. _e(a),
  17540. (n = Math.ceil((1024 * kt) / a.samplerate)),
  17541. e.length &&
  17542. ((n = e.length * n),
  17543. this.trigger('segmentTimingInfo', gt(de(a.baseMediaDecodeTime, a.samplerate), e[0].dts, e[0].pts, e[0].dts + n, e[0].pts + n, r || 0)),
  17544. this.trigger('timingInfo', { start: e[0].pts, end: e[0].pts + n })),
  17545. this.trigger('data', { track: a, boxes: i })),
  17546. this.trigger('done', 'AudioSegmentStream')
  17547. }),
  17548. (this.reset = function () {
  17549. _e(a), (o = []), this.trigger('reset')
  17550. })
  17551. }
  17552. ;(Ct.prototype = new j()),
  17553. ((yt = function (s, a) {
  17554. var t,
  17555. i,
  17556. o = [],
  17557. l = [],
  17558. u = (a = a || {}).firstSequenceNumber || 0
  17559. yt.prototype.init.call(this),
  17560. delete s.minPTS,
  17561. (this.gopCache_ = []),
  17562. (this.push = function (e) {
  17563. Te(s, e),
  17564. 'seq_parameter_set_rbsp' !== e.nalUnitType ||
  17565. t ||
  17566. ((t = e.config),
  17567. (s.sps = [e.data]),
  17568. St.forEach(function (e) {
  17569. s[e] = t[e]
  17570. }, this)),
  17571. 'pic_parameter_set_rbsp' !== e.nalUnitType || i || ((i = e.data), (s.pps = [e.data])),
  17572. o.push(e)
  17573. }),
  17574. (this.flush = function () {
  17575. for (var e, t, i, n = 0; o.length && 'access_unit_delimiter_rbsp' !== o[0].nalUnitType; ) o.shift()
  17576. if (0 === o.length) return this.resetStream_(), void this.trigger('done', 'VideoSegmentStream')
  17577. if (
  17578. ((e = $(o)),
  17579. (t = J(e))[0][0].keyFrame ||
  17580. ((i = this.getGopForFusion_(o[0], s))
  17581. ? ((n = i.duration),
  17582. t.unshift(i),
  17583. (t.byteLength += i.byteLength),
  17584. (t.nalCount += i.nalCount),
  17585. (t.pts = i.pts),
  17586. (t.dts = i.dts),
  17587. (t.duration += i.duration))
  17588. : (t = Z(t))),
  17589. l.length)
  17590. ) {
  17591. var r = a.alignGopsAtEnd ? this.alignGopsAtEnd_(t) : this.alignGopsAtStart_(t)
  17592. if (!r)
  17593. return (
  17594. this.gopCache_.unshift({ gop: t.pop(), pps: s.pps, sps: s.sps }),
  17595. (this.gopCache_.length = Math.min(6, this.gopCache_.length)),
  17596. (o = []),
  17597. this.resetStream_(),
  17598. void this.trigger('done', 'VideoSegmentStream')
  17599. )
  17600. _e(s), (t = r)
  17601. }
  17602. Te(s, t),
  17603. (s.samples = ee(t)),
  17604. (e = K(te(t))),
  17605. (s.baseMediaDecodeTime = be(s, a.keepOriginalTimestamps)),
  17606. this.trigger(
  17607. 'processedGopsInfo',
  17608. t.map(function (e) {
  17609. return { pts: e.pts, dts: e.dts, byteLength: e.byteLength }
  17610. })
  17611. ),
  17612. (i = t[0]),
  17613. (r = t[t.length - 1]),
  17614. this.trigger('segmentTimingInfo', gt(s.baseMediaDecodeTime, i.dts, i.pts, r.dts + r.duration, r.pts + r.duration, n)),
  17615. this.trigger('timingInfo', { start: t[0].pts, end: t[t.length - 1].pts + t[t.length - 1].duration }),
  17616. this.gopCache_.unshift({ gop: t.pop(), pps: s.pps, sps: s.sps }),
  17617. (this.gopCache_.length = Math.min(6, this.gopCache_.length)),
  17618. (o = []),
  17619. this.trigger('baseMediaDecodeTime', s.baseMediaDecodeTime),
  17620. this.trigger('timelineStartInfo', s.timelineStartInfo),
  17621. (n = Y(u, [s])),
  17622. (t = new Uint8Array(n.byteLength + e.byteLength)),
  17623. u++,
  17624. t.set(n),
  17625. t.set(e, n.byteLength),
  17626. this.trigger('data', { track: s, boxes: t }),
  17627. this.resetStream_(),
  17628. this.trigger('done', 'VideoSegmentStream')
  17629. }),
  17630. (this.reset = function () {
  17631. this.resetStream_(), (o = []), (this.gopCache_.length = 0), (l.length = 0), this.trigger('reset')
  17632. }),
  17633. (this.resetStream_ = function () {
  17634. _e(s), (i = t = void 0)
  17635. }),
  17636. (this.getGopForFusion_ = function (e) {
  17637. for (var t, i, n, r = 1 / 0, a = 0; a < this.gopCache_.length; a++)
  17638. (i = (n = this.gopCache_[a]).gop),
  17639. s.pps &&
  17640. mt(s.pps[0], n.pps[0]) &&
  17641. s.sps &&
  17642. mt(s.sps[0], n.sps[0]) &&
  17643. (i.dts < s.timelineStartInfo.dts || (-1e4 <= (i = e.dts - i.dts - i.duration) && i <= 45e3 && (!t || i < r) && ((t = n), (r = i))))
  17644. return t ? t.gop : null
  17645. }),
  17646. (this.alignGopsAtStart_ = function (e) {
  17647. for (var t, i, n, r, a = e.byteLength, s = e.nalCount, o = e.duration, u = (t = 0); u < l.length && t < e.length && ((i = l[u]), (n = e[t]), i.pts !== n.pts); )
  17648. n.pts > i.pts ? u++ : (t++, (a -= n.byteLength), (s -= n.nalCount), (o -= n.duration))
  17649. return 0 === t ? e : t === e.length ? null : (((r = e.slice(t)).byteLength = a), (r.duration = o), (r.nalCount = s), (r.pts = r[0].pts), (r.dts = r[0].dts), r)
  17650. }),
  17651. (this.alignGopsAtEnd_ = function (e) {
  17652. for (var t, i, n = l.length - 1, r = e.length - 1, a = null, s = !1; 0 <= n && 0 <= r; ) {
  17653. if (((t = l[n]), (i = e[r]), t.pts === i.pts)) {
  17654. s = !0
  17655. break
  17656. }
  17657. t.pts > i.pts ? n-- : (n === l.length - 1 && (a = r), r--)
  17658. }
  17659. if (!s && null === a) return null
  17660. if (0 === (u = s ? r : a)) return e
  17661. var o = e.slice(u),
  17662. u = o.reduce(
  17663. function (e, t) {
  17664. return (e.byteLength += t.byteLength), (e.duration += t.duration), (e.nalCount += t.nalCount), e
  17665. },
  17666. { byteLength: 0, duration: 0, nalCount: 0 }
  17667. )
  17668. return (o.byteLength = u.byteLength), (o.duration = u.duration), (o.nalCount = u.nalCount), (o.pts = o[0].pts), (o.dts = o[0].dts), o
  17669. }),
  17670. (this.alignGopsWith = function (e) {
  17671. l = e
  17672. })
  17673. }).prototype = new j()),
  17674. ((_t = function (e, t) {
  17675. ;(this.numberOfTracks = 0),
  17676. (this.metadataStream = t),
  17677. 'undefined' != typeof (e = e || {}).remux ? (this.remuxTracks = !!e.remux) : (this.remuxTracks = !0),
  17678. 'boolean' == typeof e.keepOriginalTimestamps ? (this.keepOriginalTimestamps = e.keepOriginalTimestamps) : (this.keepOriginalTimestamps = !1),
  17679. (this.pendingTracks = []),
  17680. (this.videoTrack = null),
  17681. (this.pendingBoxes = []),
  17682. (this.pendingCaptions = []),
  17683. (this.pendingMetadata = []),
  17684. (this.pendingBytes = 0),
  17685. (this.emittedTracks = 0),
  17686. _t.prototype.init.call(this),
  17687. (this.push = function (e) {
  17688. return e.text
  17689. ? this.pendingCaptions.push(e)
  17690. : e.frames
  17691. ? this.pendingMetadata.push(e)
  17692. : (this.pendingTracks.push(e.track),
  17693. (this.pendingBytes += e.boxes.byteLength),
  17694. 'video' === e.track.type && ((this.videoTrack = e.track), this.pendingBoxes.push(e.boxes)),
  17695. void ('audio' === e.track.type && ((this.audioTrack = e.track), this.pendingBoxes.unshift(e.boxes))))
  17696. })
  17697. }).prototype = new j()),
  17698. (_t.prototype.flush = function (e) {
  17699. var t,
  17700. i,
  17701. n,
  17702. r = 0,
  17703. a = { captions: [], captionStreams: {}, metadata: [], info: {} },
  17704. s = 0
  17705. if (this.pendingTracks.length < this.numberOfTracks) {
  17706. if ('VideoSegmentStream' !== e && 'AudioSegmentStream' !== e) return
  17707. if (this.remuxTracks) return
  17708. if (0 === this.pendingTracks.length) return this.emittedTracks++, void (this.emittedTracks >= this.numberOfTracks && (this.trigger('done'), (this.emittedTracks = 0)))
  17709. }
  17710. if (
  17711. (this.videoTrack
  17712. ? ((s = this.videoTrack.timelineStartInfo.pts),
  17713. St.forEach(function (e) {
  17714. a.info[e] = this.videoTrack[e]
  17715. }, this))
  17716. : this.audioTrack &&
  17717. ((s = this.audioTrack.timelineStartInfo.pts),
  17718. Tt.forEach(function (e) {
  17719. a.info[e] = this.audioTrack[e]
  17720. }, this)),
  17721. this.videoTrack || this.audioTrack)
  17722. ) {
  17723. for (
  17724. 1 === this.pendingTracks.length ? (a.type = this.pendingTracks[0].type) : (a.type = 'combined'),
  17725. this.emittedTracks += this.pendingTracks.length,
  17726. e = Q(this.pendingTracks),
  17727. a.initSegment = new Uint8Array(e.byteLength),
  17728. a.initSegment.set(e),
  17729. a.data = new Uint8Array(this.pendingBytes),
  17730. n = 0;
  17731. n < this.pendingBoxes.length;
  17732. n++
  17733. )
  17734. a.data.set(this.pendingBoxes[n], r), (r += this.pendingBoxes[n].byteLength)
  17735. for (n = 0; n < this.pendingCaptions.length; n++)
  17736. ((t = this.pendingCaptions[n]).startTime = pe(t.startPts, s, this.keepOriginalTimestamps)),
  17737. (t.endTime = pe(t.endPts, s, this.keepOriginalTimestamps)),
  17738. (a.captionStreams[t.stream] = !0),
  17739. a.captions.push(t)
  17740. for (n = 0; n < this.pendingMetadata.length; n++) ((i = this.pendingMetadata[n]).cueTime = pe(i.pts, s, this.keepOriginalTimestamps)), a.metadata.push(i)
  17741. for (
  17742. a.metadata.dispatchType = this.metadataStream.dispatchType,
  17743. this.pendingTracks.length = 0,
  17744. this.videoTrack = null,
  17745. this.pendingBoxes.length = 0,
  17746. this.pendingCaptions.length = 0,
  17747. this.pendingBytes = 0,
  17748. this.pendingMetadata.length = 0,
  17749. this.trigger('data', a),
  17750. n = 0;
  17751. n < a.captions.length;
  17752. n++
  17753. )
  17754. (t = a.captions[n]), this.trigger('caption', t)
  17755. for (n = 0; n < a.metadata.length; n++) (i = a.metadata[n]), this.trigger('id3Frame', i)
  17756. }
  17757. this.emittedTracks >= this.numberOfTracks && (this.trigger('done'), (this.emittedTracks = 0))
  17758. }),
  17759. (_t.prototype.setRemux = function (e) {
  17760. this.remuxTracks = e
  17761. }),
  17762. ((vt = function (n) {
  17763. var r,
  17764. a,
  17765. s = this,
  17766. i = !0
  17767. vt.prototype.init.call(this),
  17768. (this.baseMediaDecodeTime = (n = n || {}).baseMediaDecodeTime || 0),
  17769. (this.transmuxPipeline_ = {}),
  17770. (this.setupAacPipeline = function () {
  17771. var t = {}
  17772. ;((this.transmuxPipeline_ = t).type = 'aac'),
  17773. (t.metadataStream = new Je.MetadataStream()),
  17774. (t.aacStream = new bt()),
  17775. (t.audioTimestampRolloverStream = new Je.TimestampRolloverStream('audio')),
  17776. (t.timedMetadataTimestampRolloverStream = new Je.TimestampRolloverStream('timed-metadata')),
  17777. (t.adtsStream = new rt()),
  17778. (t.coalesceStream = new _t(n, t.metadataStream)),
  17779. (t.headOfPipeline = t.aacStream),
  17780. t.aacStream.pipe(t.audioTimestampRolloverStream).pipe(t.adtsStream),
  17781. t.aacStream.pipe(t.timedMetadataTimestampRolloverStream).pipe(t.metadataStream).pipe(t.coalesceStream),
  17782. t.metadataStream.on('timestamp', function (e) {
  17783. t.aacStream.setTimestamp(e.timeStamp)
  17784. }),
  17785. t.aacStream.on('data', function (e) {
  17786. ;('timed-metadata' !== e.type && 'audio' !== e.type) ||
  17787. t.audioSegmentStream ||
  17788. ((a = a || { timelineStartInfo: { baseMediaDecodeTime: s.baseMediaDecodeTime }, codec: 'adts', type: 'audio' }),
  17789. t.coalesceStream.numberOfTracks++,
  17790. (t.audioSegmentStream = new Ct(a, n)),
  17791. t.audioSegmentStream.on('log', s.getLogTrigger_('audioSegmentStream')),
  17792. t.audioSegmentStream.on('timingInfo', s.trigger.bind(s, 'audioTimingInfo')),
  17793. t.adtsStream.pipe(t.audioSegmentStream).pipe(t.coalesceStream),
  17794. s.trigger('trackinfo', { hasAudio: !!a, hasVideo: !!r }))
  17795. }),
  17796. t.coalesceStream.on('data', this.trigger.bind(this, 'data')),
  17797. t.coalesceStream.on('done', this.trigger.bind(this, 'done')),
  17798. ft(this, t)
  17799. }),
  17800. (this.setupTsPipeline = function () {
  17801. var i = {}
  17802. ;((this.transmuxPipeline_ = i).type = 'ts'),
  17803. (i.metadataStream = new Je.MetadataStream()),
  17804. (i.packetStream = new Je.TransportPacketStream()),
  17805. (i.parseStream = new Je.TransportParseStream()),
  17806. (i.elementaryStream = new Je.ElementaryStream()),
  17807. (i.timestampRolloverStream = new Je.TimestampRolloverStream()),
  17808. (i.adtsStream = new rt()),
  17809. (i.h264Stream = new wt()),
  17810. (i.captionStream = new Je.CaptionStream(n)),
  17811. (i.coalesceStream = new _t(n, i.metadataStream)),
  17812. (i.headOfPipeline = i.packetStream),
  17813. i.packetStream.pipe(i.parseStream).pipe(i.elementaryStream).pipe(i.timestampRolloverStream),
  17814. i.timestampRolloverStream.pipe(i.h264Stream),
  17815. i.timestampRolloverStream.pipe(i.adtsStream),
  17816. i.timestampRolloverStream.pipe(i.metadataStream).pipe(i.coalesceStream),
  17817. i.h264Stream.pipe(i.captionStream).pipe(i.coalesceStream),
  17818. i.elementaryStream.on('data', function (e) {
  17819. var t
  17820. if ('metadata' === e.type) {
  17821. for (t = e.tracks.length; t--; )
  17822. r || 'video' !== e.tracks[t].type
  17823. ? a || 'audio' !== e.tracks[t].type || ((a = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = s.baseMediaDecodeTime)
  17824. : ((r = e.tracks[t]).timelineStartInfo.baseMediaDecodeTime = s.baseMediaDecodeTime)
  17825. r &&
  17826. !i.videoSegmentStream &&
  17827. (i.coalesceStream.numberOfTracks++,
  17828. (i.videoSegmentStream = new yt(r, n)),
  17829. i.videoSegmentStream.on('log', s.getLogTrigger_('videoSegmentStream')),
  17830. i.videoSegmentStream.on('timelineStartInfo', function (e) {
  17831. a && !n.keepOriginalTimestamps && ((a.timelineStartInfo = e), i.audioSegmentStream.setEarliestDts(e.dts - s.baseMediaDecodeTime))
  17832. }),
  17833. i.videoSegmentStream.on('processedGopsInfo', s.trigger.bind(s, 'gopInfo')),
  17834. i.videoSegmentStream.on('segmentTimingInfo', s.trigger.bind(s, 'videoSegmentTimingInfo')),
  17835. i.videoSegmentStream.on('baseMediaDecodeTime', function (e) {
  17836. a && i.audioSegmentStream.setVideoBaseMediaDecodeTime(e)
  17837. }),
  17838. i.videoSegmentStream.on('timingInfo', s.trigger.bind(s, 'videoTimingInfo')),
  17839. i.h264Stream.pipe(i.videoSegmentStream).pipe(i.coalesceStream)),
  17840. a &&
  17841. !i.audioSegmentStream &&
  17842. (i.coalesceStream.numberOfTracks++,
  17843. (i.audioSegmentStream = new Ct(a, n)),
  17844. i.audioSegmentStream.on('log', s.getLogTrigger_('audioSegmentStream')),
  17845. i.audioSegmentStream.on('timingInfo', s.trigger.bind(s, 'audioTimingInfo')),
  17846. i.audioSegmentStream.on('segmentTimingInfo', s.trigger.bind(s, 'audioSegmentTimingInfo')),
  17847. i.adtsStream.pipe(i.audioSegmentStream).pipe(i.coalesceStream)),
  17848. s.trigger('trackinfo', { hasAudio: !!a, hasVideo: !!r })
  17849. }
  17850. }),
  17851. i.coalesceStream.on('data', this.trigger.bind(this, 'data')),
  17852. i.coalesceStream.on('id3Frame', function (e) {
  17853. ;(e.dispatchType = i.metadataStream.dispatchType), s.trigger('id3Frame', e)
  17854. }),
  17855. i.coalesceStream.on('caption', this.trigger.bind(this, 'caption')),
  17856. i.coalesceStream.on('done', this.trigger.bind(this, 'done')),
  17857. ft(this, i)
  17858. }),
  17859. (this.setBaseMediaDecodeTime = function (e) {
  17860. var t = this.transmuxPipeline_
  17861. n.keepOriginalTimestamps || (this.baseMediaDecodeTime = e),
  17862. a &&
  17863. ((a.timelineStartInfo.dts = void 0),
  17864. (a.timelineStartInfo.pts = void 0),
  17865. _e(a),
  17866. t.audioTimestampRolloverStream && t.audioTimestampRolloverStream.discontinuity()),
  17867. r &&
  17868. (t.videoSegmentStream && (t.videoSegmentStream.gopCache_ = []),
  17869. (r.timelineStartInfo.dts = void 0),
  17870. (r.timelineStartInfo.pts = void 0),
  17871. _e(r),
  17872. t.captionStream.reset()),
  17873. t.timestampRolloverStream && t.timestampRolloverStream.discontinuity()
  17874. }),
  17875. (this.setAudioAppendStart = function (e) {
  17876. a && this.transmuxPipeline_.audioSegmentStream.setAudioAppendStart(e)
  17877. }),
  17878. (this.setRemux = function (e) {
  17879. var t = this.transmuxPipeline_
  17880. ;(n.remux = e), t && t.coalesceStream && t.coalesceStream.setRemux(e)
  17881. }),
  17882. (this.alignGopsWith = function (e) {
  17883. r && this.transmuxPipeline_.videoSegmentStream && this.transmuxPipeline_.videoSegmentStream.alignGopsWith(e)
  17884. }),
  17885. (this.getLogTrigger_ = function (t) {
  17886. var i = this
  17887. return function (e) {
  17888. ;(e.stream = t), i.trigger('log', e)
  17889. }
  17890. }),
  17891. (this.push = function (e) {
  17892. var t
  17893. i &&
  17894. ((t = Et(e)) && 'aac' !== this.transmuxPipeline_.type ? this.setupAacPipeline() : t || 'ts' === this.transmuxPipeline_.type || this.setupTsPipeline(),
  17895. (i = !1)),
  17896. this.transmuxPipeline_.headOfPipeline.push(e)
  17897. }),
  17898. (this.flush = function () {
  17899. ;(i = !0), this.transmuxPipeline_.headOfPipeline.flush()
  17900. }),
  17901. (this.endTimeline = function () {
  17902. this.transmuxPipeline_.headOfPipeline.endTimeline()
  17903. }),
  17904. (this.reset = function () {
  17905. this.transmuxPipeline_.headOfPipeline && this.transmuxPipeline_.headOfPipeline.reset()
  17906. }),
  17907. (this.resetCaptions = function () {
  17908. this.transmuxPipeline_.captionStream && this.transmuxPipeline_.captionStream.reset()
  17909. })
  17910. }).prototype = new j())
  17911. function It(e, c) {
  17912. var i = Rt(e, ['moof', 'traf']),
  17913. e = Rt(e, ['mdat']),
  17914. d = {},
  17915. n = []
  17916. return (
  17917. e.forEach(function (e, t) {
  17918. t = i[t]
  17919. n.push({ mdat: e, traf: t })
  17920. }),
  17921. n.forEach(function (e) {
  17922. var t,
  17923. i,
  17924. n,
  17925. r,
  17926. a,
  17927. s = e.mdat,
  17928. o = e.traf,
  17929. u = Rt(o, ['tfhd']),
  17930. l = Ht(u[0]),
  17931. e = l.trackId,
  17932. u = Rt(o, ['tfdt']),
  17933. u = 0 < u.length ? Bt(u[0]).baseMediaDecodeTime : 0,
  17934. o = Rt(o, ['trun'])
  17935. c === e &&
  17936. 0 < o.length &&
  17937. ((o = o),
  17938. (t = u),
  17939. (i = (l = l).defaultSampleDuration || 0),
  17940. (n = l.defaultSampleSize || 0),
  17941. (r = l.trackId),
  17942. (a = []),
  17943. o.forEach(function (e) {
  17944. e = jt(e).samples
  17945. e.forEach(function (e) {
  17946. void 0 === e.duration && (e.duration = i),
  17947. void 0 === e.size && (e.size = n),
  17948. (e.trackId = r),
  17949. (e.dts = t),
  17950. void 0 === e.compositionTimeOffset && (e.compositionTimeOffset = 0),
  17951. 'bigint' == typeof t
  17952. ? ((e.pts = t + qt.BigInt(e.compositionTimeOffset)), (t += qt.BigInt(e.duration)))
  17953. : ((e.pts = t + e.compositionTimeOffset), (t += e.duration))
  17954. }),
  17955. (a = a.concat(e))
  17956. }),
  17957. (s = (function (e, t, i) {
  17958. for (var n, r, a = new DataView(e.buffer, e.byteOffset, e.byteLength), s = { logs: [], seiNals: [] }, o = 0; o + 4 < e.length; o += n)
  17959. if (((n = a.getUint32(o)), (o += 4), !(n <= 0)))
  17960. switch (31 & e[o]) {
  17961. case 6:
  17962. var u = e.subarray(o + 1, o + 1 + n),
  17963. l = (function (e, t) {
  17964. for (var i = e, n = 0; n < t.length; n++) {
  17965. var r = t[n]
  17966. if (i < r.size) return r
  17967. i -= r.size
  17968. }
  17969. return null
  17970. })(o, t),
  17971. u = { nalUnitType: 'sei_rbsp', size: n, data: u, escapedRBSP: Vt(u), trackId: i }
  17972. if (l) (u.pts = l.pts), (u.dts = l.dts), (r = l)
  17973. else {
  17974. if (!r) {
  17975. s.logs.push({ level: 'warn', message: "We've encountered a nal unit without data at " + o + ' for trackId ' + i + '. See mux.js#223.' })
  17976. break
  17977. }
  17978. ;(u.pts = r.pts), (u.dts = r.dts)
  17979. }
  17980. s.seiNals.push(u)
  17981. }
  17982. return s
  17983. })(s, a, e)),
  17984. d[e] || (d[e] = { seiNals: [], logs: [] }),
  17985. (d[e].seiNals = d[e].seiNals.concat(s.seiNals)),
  17986. (d[e].logs = d[e].logs.concat(s.logs)))
  17987. }),
  17988. d
  17989. )
  17990. }
  17991. function xt(e) {
  17992. var t = 31 & e[1]
  17993. return (t <<= 8), (t |= e[2])
  17994. }
  17995. function At(e) {
  17996. return !!(64 & e[1])
  17997. }
  17998. function Pt(e) {
  17999. var t = 0
  18000. return 1 < (48 & e[3]) >>> 4 && (t += e[4] + 1), t
  18001. }
  18002. function Lt(e) {
  18003. switch (e) {
  18004. case 5:
  18005. return 'slice_layer_without_partitioning_rbsp_idr'
  18006. case 6:
  18007. return 'sei_rbsp'
  18008. case 7:
  18009. return 'seq_parameter_set_rbsp'
  18010. case 8:
  18011. return 'pic_parameter_set_rbsp'
  18012. case 9:
  18013. return 'access_unit_delimiter_rbsp'
  18014. default:
  18015. return null
  18016. }
  18017. }
  18018. var Dt = { Transmuxer: vt, VideoSegmentStream: yt, AudioSegmentStream: Ct, AUDIO_PROPERTIES: Tt, VIDEO_PROPERTIES: St, generateSegmentTimingInfo: gt },
  18019. e = function (e) {
  18020. return e >>> 0
  18021. },
  18022. Ot = function (e) {
  18023. var t = ''
  18024. return (t += String.fromCharCode(e[0])), (t += String.fromCharCode(e[1])), (t += String.fromCharCode(e[2])), (t += String.fromCharCode(e[3]))
  18025. },
  18026. Mt = e,
  18027. Rt = function e(t, i) {
  18028. var n,
  18029. r,
  18030. a,
  18031. s = []
  18032. if (!i.length) return null
  18033. for (n = 0; n < t.byteLength; )
  18034. (r = Mt((t[n] << 24) | (t[n + 1] << 16) | (t[n + 2] << 8) | t[n + 3])),
  18035. (a = Ot(t.subarray(n + 4, n + 8))),
  18036. (r = 1 < r ? n + r : t.byteLength),
  18037. a === i[0] && (1 === i.length ? s.push(t.subarray(n + 8, r)) : (a = e(t.subarray(n + 8, r), i.slice(1))).length && (s = s.concat(a))),
  18038. (n = r)
  18039. return s
  18040. },
  18041. Nt = e,
  18042. Ut = q.getUint64,
  18043. Bt = function (e) {
  18044. var t = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)) }
  18045. return 1 === t.version ? (t.baseMediaDecodeTime = Ut(e.subarray(4))) : (t.baseMediaDecodeTime = Nt((e[4] << 24) | (e[5] << 16) | (e[6] << 8) | e[7])), t
  18046. },
  18047. Ft = function (e) {
  18048. return {
  18049. isLeading: (12 & e[0]) >>> 2,
  18050. dependsOn: 3 & e[0],
  18051. isDependedOn: (192 & e[1]) >>> 6,
  18052. hasRedundancy: (48 & e[1]) >>> 4,
  18053. paddingValue: (14 & e[1]) >>> 1,
  18054. isNonSyncSample: 1 & e[1],
  18055. degradationPriority: (e[2] << 8) | e[3],
  18056. }
  18057. },
  18058. jt = function (e) {
  18059. var t,
  18060. i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), samples: [] },
  18061. n = new DataView(e.buffer, e.byteOffset, e.byteLength),
  18062. r = 1 & i.flags[2],
  18063. a = 4 & i.flags[2],
  18064. s = 1 & i.flags[1],
  18065. o = 2 & i.flags[1],
  18066. u = 4 & i.flags[1],
  18067. l = 8 & i.flags[1],
  18068. c = n.getUint32(4),
  18069. d = 8
  18070. for (
  18071. r && ((i.dataOffset = n.getInt32(d)), (d += 4)),
  18072. a &&
  18073. c &&
  18074. ((t = { flags: Ft(e.subarray(d, d + 4)) }),
  18075. (d += 4),
  18076. s && ((t.duration = n.getUint32(d)), (d += 4)),
  18077. o && ((t.size = n.getUint32(d)), (d += 4)),
  18078. l && (1 === i.version ? (t.compositionTimeOffset = n.getInt32(d)) : (t.compositionTimeOffset = n.getUint32(d)), (d += 4)),
  18079. i.samples.push(t),
  18080. c--);
  18081. c--;
  18082. )
  18083. (t = {}),
  18084. s && ((t.duration = n.getUint32(d)), (d += 4)),
  18085. o && ((t.size = n.getUint32(d)), (d += 4)),
  18086. u && ((t.flags = Ft(e.subarray(d, d + 4))), (d += 4)),
  18087. l && (1 === i.version ? (t.compositionTimeOffset = n.getInt32(d)) : (t.compositionTimeOffset = n.getUint32(d)), (d += 4)),
  18088. i.samples.push(t)
  18089. return i
  18090. },
  18091. Ht = function (e) {
  18092. var t = new DataView(e.buffer, e.byteOffset, e.byteLength),
  18093. i = { version: e[0], flags: new Uint8Array(e.subarray(1, 4)), trackId: t.getUint32(4) },
  18094. n = 1 & i.flags[2],
  18095. r = 2 & i.flags[2],
  18096. a = 8 & i.flags[2],
  18097. s = 16 & i.flags[2],
  18098. o = 32 & i.flags[2],
  18099. u = 65536 & i.flags[0],
  18100. l = 131072 & i.flags[0],
  18101. e = 8
  18102. return (
  18103. n && ((e += 4), (i.baseDataOffset = t.getUint32(12)), (e += 4)),
  18104. r && ((i.sampleDescriptionIndex = t.getUint32(e)), (e += 4)),
  18105. a && ((i.defaultSampleDuration = t.getUint32(e)), (e += 4)),
  18106. s && ((i.defaultSampleSize = t.getUint32(e)), (e += 4)),
  18107. o && (i.defaultSampleFlags = t.getUint32(e)),
  18108. u && (i.durationIsEmpty = !0),
  18109. !n && l && (i.baseDataOffsetIsMoof = !0),
  18110. i
  18111. )
  18112. },
  18113. j = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : {},
  18114. j = 'undefined' != typeof window ? window : 'undefined' != typeof j ? j : 'undefined' != typeof self ? self : {},
  18115. qt = j,
  18116. Vt = ke,
  18117. Wt = Fe.CaptionStream,
  18118. Gt = function () {
  18119. var t,
  18120. r,
  18121. a,
  18122. s,
  18123. o,
  18124. i,
  18125. n = !1
  18126. ;(this.isInitialized = function () {
  18127. return n
  18128. }),
  18129. (this.init = function (e) {
  18130. ;(t = new Wt()),
  18131. (n = !0),
  18132. (i = !!e && e.isPartial),
  18133. t.on('data', function (e) {
  18134. ;(e.startTime = e.startPts / s), (e.endTime = e.endPts / s), o.captions.push(e), (o.captionStreams[e.stream] = !0)
  18135. }),
  18136. t.on('log', function (e) {
  18137. o.logs.push(e)
  18138. })
  18139. }),
  18140. (this.isNewInit = function (e, t) {
  18141. return !((e && 0 === e.length) || (t && 'object' == typeof t && 0 === Object.keys(t).length)) && (a !== e[0] || s !== t[a])
  18142. }),
  18143. (this.parse = function (e, t, i) {
  18144. if (!this.isInitialized()) return null
  18145. if (!t || !i) return null
  18146. if (this.isNewInit(t, i)) (a = t[0]), (s = i[a])
  18147. else if (null === a || !s) return r.push(e), null
  18148. for (; 0 < r.length; ) {
  18149. var n = r.shift()
  18150. this.parse(n, t, i)
  18151. }
  18152. return (
  18153. (e = (function (e, t, i) {
  18154. if (null === t) return null
  18155. t = It(e, t)[t] || {}
  18156. return { seiNals: t.seiNals, logs: t.logs, timescale: i }
  18157. })(e, a, s)) &&
  18158. e.logs &&
  18159. (o.logs = o.logs.concat(e.logs)),
  18160. null !== e && e.seiNals ? (this.pushNals(e.seiNals), this.flushStream(), o) : o.logs.length ? { logs: o.logs, captions: [], captionStreams: [] } : null
  18161. )
  18162. }),
  18163. (this.pushNals = function (e) {
  18164. if (!this.isInitialized() || !e || 0 === e.length) return null
  18165. e.forEach(function (e) {
  18166. t.push(e)
  18167. })
  18168. }),
  18169. (this.flushStream = function () {
  18170. if (!this.isInitialized()) return null
  18171. i ? t.partialFlush() : t.flush()
  18172. }),
  18173. (this.clearParsedCaptions = function () {
  18174. ;(o.captions = []), (o.captionStreams = {}), (o.logs = [])
  18175. }),
  18176. (this.resetCaptionStream = function () {
  18177. if (!this.isInitialized()) return null
  18178. t.reset()
  18179. }),
  18180. (this.clearAllCaptions = function () {
  18181. this.clearParsedCaptions(), this.resetCaptionStream()
  18182. }),
  18183. (this.reset = function () {
  18184. ;(r = []), (s = a = null), o ? this.clearParsedCaptions() : (o = { captions: [], captionStreams: {}, logs: [] }), this.resetCaptionStream()
  18185. }),
  18186. this.reset()
  18187. },
  18188. zt = e,
  18189. Xt = function (e) {
  18190. return ('00' + e.toString(16)).slice(-2)
  18191. },
  18192. Kt = q.getUint64,
  18193. j = function (e) {
  18194. return Rt(e, ['moov', 'trak']).reduce(function (e, t) {
  18195. var i,
  18196. n,
  18197. r = Rt(t, ['tkhd'])[0]
  18198. return r
  18199. ? ((i = r[0]),
  18200. (r = zt((r[(n = 0 === i ? 12 : 20)] << 24) | (r[1 + n] << 16) | (r[2 + n] << 8) | r[3 + n])),
  18201. (t = Rt(t, ['mdia', 'mdhd'])[0]) ? ((i = t[0]), (e[r] = zt((t[(n = 0 === i ? 12 : 20)] << 24) | (t[1 + n] << 16) | (t[2 + n] << 8) | t[3 + n])), e) : null)
  18202. : null
  18203. }, {})
  18204. },
  18205. ke = function (a, e) {
  18206. e = Rt(e, ['moof', 'traf']).reduce(function (e, t) {
  18207. var i,
  18208. n = Rt(t, ['tfhd'])[0],
  18209. r = zt((n[4] << 24) | (n[5] << 16) | (n[6] << 8) | n[7]),
  18210. n = a[r] || 9e4,
  18211. r = Rt(t, ['tfdt'])[0],
  18212. t = new DataView(r.buffer, r.byteOffset, r.byteLength),
  18213. t = 1 === r[0] ? Kt(r.subarray(4, 12)) : t.getUint32(4)
  18214. return (
  18215. 'bigint' == typeof t ? (i = t / qt.BigInt(n)) : 'number' != typeof t || isNaN(t) || (i = t / n), (e = (i = i < Number.MAX_SAFE_INTEGER ? Number(i) : i) < e ? i : e)
  18216. )
  18217. }, 1 / 0)
  18218. return 'bigint' == typeof e || isFinite(e) ? e : 0
  18219. },
  18220. e = function (e) {
  18221. var e = Rt(e, ['moov', 'trak']),
  18222. n = []
  18223. return (
  18224. e.forEach(function (e) {
  18225. var t = Rt(e, ['mdia', 'hdlr']),
  18226. i = Rt(e, ['tkhd'])
  18227. t.forEach(function (e, t) {
  18228. ;(e = Ot(e.subarray(8, 12))), (t = i[t])
  18229. 'vide' === e && ((t = 0 === (t = new DataView(t.buffer, t.byteOffset, t.byteLength)).getUint8(0) ? t.getUint32(12) : t.getUint32(20)), n.push(t))
  18230. })
  18231. }),
  18232. n
  18233. )
  18234. },
  18235. Yt = function (e) {
  18236. var t = 0 === e[0] ? 12 : 20
  18237. return zt((e[t] << 24) | (e[1 + t] << 16) | (e[2 + t] << 8) | e[3 + t])
  18238. },
  18239. q = function (e) {
  18240. var e = Rt(e, ['moov', 'trak']),
  18241. s = []
  18242. return (
  18243. e.forEach(function (e) {
  18244. var t = {},
  18245. i = Rt(e, ['tkhd'])[0]
  18246. i && ((i = (n = new DataView(i.buffer, i.byteOffset, i.byteLength)).getUint8(0)), (t.id = 0 === i ? n.getUint32(12) : n.getUint32(20)))
  18247. var n = Rt(e, ['mdia', 'hdlr'])[0]
  18248. n && ((a = Ot(n.subarray(8, 12))), (t.type = 'vide' === a ? 'video' : 'soun' === a ? 'audio' : a))
  18249. var r,
  18250. a = Rt(e, ['mdia', 'minf', 'stbl', 'stsd'])[0]
  18251. a &&
  18252. ((a = a.subarray(8)),
  18253. (t.codec = Ot(a.subarray(4, 8))),
  18254. (a = Rt(a, [t.codec])[0]) &&
  18255. (/^[asm]vc[1-9]$/i.test(t.codec)
  18256. ? ((r = a.subarray(78)),
  18257. 'avcC' === Ot(r.subarray(4, 8)) && 11 < r.length
  18258. ? ((t.codec += '.'), (t.codec += Xt(r[9])), (t.codec += Xt(r[10])), (t.codec += Xt(r[11])))
  18259. : (t.codec = 'avc1.4d400d'))
  18260. : /^mp4[a,v]$/i.test(t.codec)
  18261. ? ((r = a.subarray(28)),
  18262. 'esds' === Ot(r.subarray(4, 8)) && 20 < r.length && 0 !== r[19]
  18263. ? ((t.codec += '.' + Xt(r[19])), (t.codec += '.' + Xt((r[20] >>> 2) & 63).replace(/^0/, '')))
  18264. : (t.codec = 'mp4a.40.2'))
  18265. : (t.codec = t.codec.toLowerCase())))
  18266. e = Rt(e, ['mdia', 'mdhd'])[0]
  18267. e && (t.timescale = Yt(e)), s.push(t)
  18268. }),
  18269. s
  18270. )
  18271. },
  18272. Qt = ke,
  18273. $t = q,
  18274. Jt = Ie,
  18275. Zt = {}
  18276. ;(Zt.ts = {
  18277. parseType: function (e, t) {
  18278. e = xt(e)
  18279. return 0 === e ? 'pat' : e === t ? 'pmt' : t ? 'pes' : null
  18280. },
  18281. parsePat: function (e) {
  18282. var t = At(e),
  18283. i = 4 + Pt(e)
  18284. return t && (i += e[i] + 1), ((31 & e[i + 10]) << 8) | e[i + 11]
  18285. },
  18286. parsePmt: function (e) {
  18287. var t = {},
  18288. i = At(e),
  18289. n = 4 + Pt(e)
  18290. if ((i && (n += e[n] + 1), 1 & e[n + 5])) {
  18291. for (var r = 3 + (((15 & e[n + 1]) << 8) | e[n + 2]) - 4, a = 12 + (((15 & e[n + 10]) << 8) | e[n + 11]); a < r; ) {
  18292. var s = n + a
  18293. ;(t[((31 & e[s + 1]) << 8) | e[s + 2]] = e[s]), (a += 5 + (((15 & e[s + 3]) << 8) | e[s + 4]))
  18294. }
  18295. return t
  18296. }
  18297. },
  18298. parsePayloadUnitStartIndicator: At,
  18299. parsePesType: function (e, t) {
  18300. switch (t[xt(e)]) {
  18301. case je.H264_STREAM_TYPE:
  18302. return 'video'
  18303. case je.ADTS_STREAM_TYPE:
  18304. return 'audio'
  18305. case je.METADATA_STREAM_TYPE:
  18306. return 'timed-metadata'
  18307. default:
  18308. return null
  18309. }
  18310. },
  18311. parsePesTime: function (e) {
  18312. if (!At(e)) return null
  18313. var t = 4 + Pt(e)
  18314. if (t >= e.byteLength) return null
  18315. var i = null,
  18316. n = e[t + 7]
  18317. return (
  18318. 192 & n &&
  18319. (((i = {}).pts = ((14 & e[t + 9]) << 27) | ((255 & e[t + 10]) << 20) | ((254 & e[t + 11]) << 12) | ((255 & e[t + 12]) << 5) | ((254 & e[t + 13]) >>> 3)),
  18320. (i.pts *= 4),
  18321. (i.pts += (6 & e[t + 13]) >>> 1),
  18322. (i.dts = i.pts),
  18323. 64 & n &&
  18324. ((i.dts = ((14 & e[t + 14]) << 27) | ((255 & e[t + 15]) << 20) | ((254 & e[t + 16]) << 12) | ((255 & e[t + 17]) << 5) | ((254 & e[t + 18]) >>> 3)),
  18325. (i.dts *= 4),
  18326. (i.dts += (6 & e[t + 18]) >>> 1))),
  18327. i
  18328. )
  18329. },
  18330. videoPacketContainsKeyFrame: function (e) {
  18331. for (var t = 4 + Pt(e), i = e.subarray(t), n = 0, r = 0, a = !1; r < i.byteLength - 3; r++)
  18332. if (1 === i[r + 2]) {
  18333. n = r + 5
  18334. break
  18335. }
  18336. for (; n < i.byteLength; )
  18337. switch (i[n]) {
  18338. case 0:
  18339. if (0 !== i[n - 1]) {
  18340. n += 2
  18341. break
  18342. }
  18343. if (0 !== i[n - 2]) {
  18344. n++
  18345. break
  18346. }
  18347. for (r + 3 !== n - 2 && 'slice_layer_without_partitioning_rbsp_idr' === Lt(31 & i[r + 3]) && (a = !0); 1 !== i[++n] && n < i.length; );
  18348. ;(r = n - 2), (n += 3)
  18349. break
  18350. case 1:
  18351. if (0 !== i[n - 1] || 0 !== i[n - 2]) {
  18352. n += 3
  18353. break
  18354. }
  18355. 'slice_layer_without_partitioning_rbsp_idr' === Lt(31 & i[r + 3]) && (a = !0), (r = n - 2), (n += 3)
  18356. break
  18357. default:
  18358. n += 3
  18359. }
  18360. return (i = i.subarray(r)), (n -= r), (r = 0), (a = i && 3 < i.byteLength && 'slice_layer_without_partitioning_rbsp_idr' === Lt(31 & i[r + 3]) ? !0 : a)
  18361. },
  18362. }),
  18363. (Zt.aac = dt)
  18364. function ei(e, t, i) {
  18365. for (var n, r, a, s, o = 0, u = 188, l = !1; u <= e.byteLength; )
  18366. if (71 !== e[o] || (71 !== e[u] && u !== e.byteLength)) o++, u++
  18367. else {
  18368. if (
  18369. ((n = e.subarray(o, u)),
  18370. 'pes' === Zt.ts.parseType(n, t.pid) &&
  18371. ((r = Zt.ts.parsePesType(n, t.table)),
  18372. (a = Zt.ts.parsePayloadUnitStartIndicator(n)),
  18373. 'audio' === r && a && (s = Zt.ts.parsePesTime(n)) && ((s.type = 'audio'), i.audio.push(s), (l = !0))),
  18374. l)
  18375. )
  18376. break
  18377. ;(o += 188), (u += 188)
  18378. }
  18379. for (o = (u = e.byteLength) - 188, l = !1; 0 <= o; )
  18380. if (71 !== e[o] || (71 !== e[u] && u !== e.byteLength)) o--, u--
  18381. else {
  18382. if (
  18383. ((n = e.subarray(o, u)),
  18384. 'pes' === Zt.ts.parseType(n, t.pid) &&
  18385. ((r = Zt.ts.parsePesType(n, t.table)),
  18386. (a = Zt.ts.parsePayloadUnitStartIndicator(n)),
  18387. 'audio' === r && a && (s = Zt.ts.parsePesTime(n)) && ((s.type = 'audio'), i.audio.push(s), (l = !0))),
  18388. l)
  18389. )
  18390. break
  18391. ;(o -= 188), (u -= 188)
  18392. }
  18393. }
  18394. function ti(e) {
  18395. var t,
  18396. i = { pid: null, table: null },
  18397. n = {}
  18398. for (t in (!(function (e, t) {
  18399. for (var i, n = 0, r = 188; r < e.byteLength; )
  18400. if (71 !== e[n] || 71 !== e[r]) n++, r++
  18401. else {
  18402. switch (((i = e.subarray(n, r)), Zt.ts.parseType(i, t.pid))) {
  18403. case 'pat':
  18404. t.pid = Zt.ts.parsePat(i)
  18405. break
  18406. case 'pmt':
  18407. var a = Zt.ts.parsePmt(i)
  18408. ;(t.table = t.table || {}),
  18409. Object.keys(a).forEach(function (e) {
  18410. t.table[e] = a[e]
  18411. })
  18412. }
  18413. ;(n += 188), (r += 188)
  18414. }
  18415. })(e, i),
  18416. i.table))
  18417. if (i.table.hasOwnProperty(t))
  18418. switch (i.table[t]) {
  18419. case je.H264_STREAM_TYPE:
  18420. ;(n.video = []),
  18421. (function (e, t, i) {
  18422. for (var n, r, a, s, o, u, l, c, d = 0, h = 188, p = !1, f = { data: [], size: 0 }; h < e.byteLength; )
  18423. if (71 !== e[d] || 71 !== e[h]) d++, h++
  18424. else {
  18425. if (((n = e.subarray(d, h)), 'pes' === Zt.ts.parseType(n, t.pid)))
  18426. if (
  18427. ((r = Zt.ts.parsePesType(n, t.table)),
  18428. (a = Zt.ts.parsePayloadUnitStartIndicator(n)),
  18429. 'video' === r && (a && !p && (s = Zt.ts.parsePesTime(n)) && ((s.type = 'video'), i.video.push(s), (p = !0)), !i.firstKeyFrame))
  18430. ) {
  18431. if (a && 0 !== f.size) {
  18432. for (o = new Uint8Array(f.size), u = 0; f.data.length; ) (l = f.data.shift()), o.set(l, u), (u += l.byteLength)
  18433. !Zt.ts.videoPacketContainsKeyFrame(o) || ((c = Zt.ts.parsePesTime(o)) && ((i.firstKeyFrame = c), (i.firstKeyFrame.type = 'video'))),
  18434. (f.size = 0)
  18435. }
  18436. f.data.push(n), (f.size += n.byteLength)
  18437. }
  18438. if (p && i.firstKeyFrame) break
  18439. ;(d += 188), (h += 188)
  18440. }
  18441. for (d = (h = e.byteLength) - 188, p = !1; 0 <= d; )
  18442. if (71 !== e[d] || 71 !== e[h]) d--, h--
  18443. else {
  18444. if (
  18445. ((n = e.subarray(d, h)),
  18446. 'pes' === Zt.ts.parseType(n, t.pid) &&
  18447. ((r = Zt.ts.parsePesType(n, t.table)),
  18448. (a = Zt.ts.parsePayloadUnitStartIndicator(n)),
  18449. 'video' === r && a && (s = Zt.ts.parsePesTime(n)) && ((s.type = 'video'), i.video.push(s), (p = !0))),
  18450. p)
  18451. )
  18452. break
  18453. ;(d -= 188), (h -= 188)
  18454. }
  18455. })(e, i, n),
  18456. 0 === n.video.length && delete n.video
  18457. break
  18458. case je.ADTS_STREAM_TYPE:
  18459. ;(n.audio = []), ei(e, i, n), 0 === n.audio.length && delete n.audio
  18460. }
  18461. return n
  18462. }
  18463. var ii = ue,
  18464. ni = function (e, t) {
  18465. var i,
  18466. n,
  18467. r = (
  18468. Zt.aac.isLikelyAacData(e)
  18469. ? function (e) {
  18470. for (var t, i = !1, n = 0, r = null, a = null, s = 0, o = 0; 3 <= e.length - o; ) {
  18471. switch (Zt.aac.parseType(e, o)) {
  18472. case 'timed-metadata':
  18473. if (e.length - o < 10) {
  18474. i = !0
  18475. break
  18476. }
  18477. if ((s = Zt.aac.parseId3TagSize(e, o)) > e.length) {
  18478. i = !0
  18479. break
  18480. }
  18481. null === a && ((t = e.subarray(o, o + s)), (a = Zt.aac.parseAacTimestamp(t))), (o += s)
  18482. break
  18483. case 'audio':
  18484. if (e.length - o < 7) {
  18485. i = !0
  18486. break
  18487. }
  18488. if ((s = Zt.aac.parseAdtsSize(e, o)) > e.length) {
  18489. i = !0
  18490. break
  18491. }
  18492. null === r && ((t = e.subarray(o, o + s)), (r = Zt.aac.parseSampleRate(t))), n++, (o += s)
  18493. break
  18494. default:
  18495. o++
  18496. }
  18497. if (i) return null
  18498. }
  18499. if (null === r || null === a) return null
  18500. var u = ii / r
  18501. return {
  18502. audio: [
  18503. { type: 'audio', dts: a, pts: a },
  18504. { type: 'audio', dts: a + 1024 * n * u, pts: a + 1024 * n * u },
  18505. ],
  18506. }
  18507. }
  18508. : ti
  18509. )(e)
  18510. return r && (r.audio || r.video)
  18511. ? ((e = t),
  18512. (t = r).audio &&
  18513. t.audio.length &&
  18514. (('undefined' != typeof (i = e) && !isNaN(i)) || (i = t.audio[0].dts),
  18515. t.audio.forEach(function (e) {
  18516. ;(e.dts = Jt(e.dts, i)), (e.pts = Jt(e.pts, i)), (e.dtsTime = e.dts / ii), (e.ptsTime = e.pts / ii)
  18517. })),
  18518. t.video &&
  18519. t.video.length &&
  18520. (('undefined' != typeof (n = e) && !isNaN(n)) || (n = t.video[0].dts),
  18521. t.video.forEach(function (e) {
  18522. ;(e.dts = Jt(e.dts, n)), (e.pts = Jt(e.pts, n)), (e.dtsTime = e.dts / ii), (e.ptsTime = e.pts / ii)
  18523. }),
  18524. t.firstKeyFrame && (((t = t.firstKeyFrame).dts = Jt(t.dts, n)), (t.pts = Jt(t.pts, n)), (t.dtsTime = t.dts / ii), (t.ptsTime = t.pts / ii))),
  18525. r)
  18526. : null
  18527. },
  18528. ri = (function () {
  18529. function e(e, t) {
  18530. ;(this.options = t || {}), (this.self = e), this.init()
  18531. }
  18532. var t = e.prototype
  18533. return (
  18534. (t.init = function () {
  18535. var i, e
  18536. this.transmuxer && this.transmuxer.dispose(),
  18537. (this.transmuxer = new Dt.Transmuxer(this.options)),
  18538. (i = this.self),
  18539. (e = this.transmuxer).on('data', function (e) {
  18540. var t = e.initSegment
  18541. e.initSegment = { data: t.buffer, byteOffset: t.byteOffset, byteLength: t.byteLength }
  18542. t = e.data
  18543. ;(e.data = t.buffer), i.postMessage({ action: 'data', segment: e, byteOffset: t.byteOffset, byteLength: t.byteLength }, [e.data])
  18544. }),
  18545. e.on('done', function (e) {
  18546. i.postMessage({ action: 'done' })
  18547. }),
  18548. e.on('gopInfo', function (e) {
  18549. i.postMessage({ action: 'gopInfo', gopInfo: e })
  18550. }),
  18551. e.on('videoSegmentTimingInfo', function (e) {
  18552. var t = {
  18553. start: { decode: ce(e.start.dts), presentation: ce(e.start.pts) },
  18554. end: { decode: ce(e.end.dts), presentation: ce(e.end.pts) },
  18555. baseMediaDecodeTime: ce(e.baseMediaDecodeTime),
  18556. }
  18557. e.prependedContentDuration && (t.prependedContentDuration = ce(e.prependedContentDuration)),
  18558. i.postMessage({ action: 'videoSegmentTimingInfo', videoSegmentTimingInfo: t })
  18559. }),
  18560. e.on('audioSegmentTimingInfo', function (e) {
  18561. var t = {
  18562. start: { decode: ce(e.start.dts), presentation: ce(e.start.pts) },
  18563. end: { decode: ce(e.end.dts), presentation: ce(e.end.pts) },
  18564. baseMediaDecodeTime: ce(e.baseMediaDecodeTime),
  18565. }
  18566. e.prependedContentDuration && (t.prependedContentDuration = ce(e.prependedContentDuration)),
  18567. i.postMessage({ action: 'audioSegmentTimingInfo', audioSegmentTimingInfo: t })
  18568. }),
  18569. e.on('id3Frame', function (e) {
  18570. i.postMessage({ action: 'id3Frame', id3Frame: e })
  18571. }),
  18572. e.on('caption', function (e) {
  18573. i.postMessage({ action: 'caption', caption: e })
  18574. }),
  18575. e.on('trackinfo', function (e) {
  18576. i.postMessage({ action: 'trackinfo', trackInfo: e })
  18577. }),
  18578. e.on('audioTimingInfo', function (e) {
  18579. i.postMessage({ action: 'audioTimingInfo', audioTimingInfo: { start: ce(e.start), end: ce(e.end) } })
  18580. }),
  18581. e.on('videoTimingInfo', function (e) {
  18582. i.postMessage({ action: 'videoTimingInfo', videoTimingInfo: { start: ce(e.start), end: ce(e.end) } })
  18583. }),
  18584. e.on('log', function (e) {
  18585. i.postMessage({ action: 'log', log: e })
  18586. })
  18587. }),
  18588. (t.pushMp4Captions = function (e) {
  18589. this.captionParser || ((this.captionParser = new Gt()), this.captionParser.init())
  18590. var t = new Uint8Array(e.data, e.byteOffset, e.byteLength),
  18591. e = this.captionParser.parse(t, e.trackIds, e.timescales)
  18592. this.self.postMessage({ action: 'mp4Captions', captions: (e && e.captions) || [], logs: (e && e.logs) || [], data: t.buffer }, [t.buffer])
  18593. }),
  18594. (t.probeMp4StartTime = function (e) {
  18595. var t = e.timescales,
  18596. e = e.data,
  18597. t = Qt(t, e)
  18598. this.self.postMessage({ action: 'probeMp4StartTime', startTime: t, data: e }, [e.buffer])
  18599. }),
  18600. (t.probeMp4Tracks = function (e) {
  18601. var t = e.data,
  18602. e = $t(t)
  18603. this.self.postMessage({ action: 'probeMp4Tracks', tracks: e, data: t }, [t.buffer])
  18604. }),
  18605. (t.probeTs = function (e) {
  18606. var t = e.data,
  18607. i = e.baseStartTime,
  18608. e = 'number' != typeof i || isNaN(i) ? void 0 : i * ue,
  18609. i = ni(t, e),
  18610. e = null
  18611. i &&
  18612. ((e = { hasVideo: (i.video && 2 === i.video.length) || !1, hasAudio: (i.audio && 2 === i.audio.length) || !1 }).hasVideo && (e.videoStart = i.video[0].ptsTime),
  18613. e.hasAudio && (e.audioStart = i.audio[0].ptsTime)),
  18614. this.self.postMessage({ action: 'probeTs', result: e, data: t }, [t.buffer])
  18615. }),
  18616. (t.clearAllMp4Captions = function () {
  18617. this.captionParser && this.captionParser.clearAllCaptions()
  18618. }),
  18619. (t.clearParsedMp4Captions = function () {
  18620. this.captionParser && this.captionParser.clearParsedCaptions()
  18621. }),
  18622. (t.push = function (e) {
  18623. e = new Uint8Array(e.data, e.byteOffset, e.byteLength)
  18624. this.transmuxer.push(e)
  18625. }),
  18626. (t.reset = function () {
  18627. this.transmuxer.reset()
  18628. }),
  18629. (t.setTimestampOffset = function (e) {
  18630. e = e.timestampOffset || 0
  18631. this.transmuxer.setBaseMediaDecodeTime(Math.round(le(e)))
  18632. }),
  18633. (t.setAudioAppendStart = function (e) {
  18634. this.transmuxer.setAudioAppendStart(Math.ceil(le(e.appendStart)))
  18635. }),
  18636. (t.setRemux = function (e) {
  18637. this.transmuxer.setRemux(e.remux)
  18638. }),
  18639. (t.flush = function (e) {
  18640. this.transmuxer.flush(), self.postMessage({ action: 'done', type: 'transmuxed' })
  18641. }),
  18642. (t.endTimeline = function () {
  18643. this.transmuxer.endTimeline(), self.postMessage({ action: 'endedtimeline', type: 'transmuxed' })
  18644. }),
  18645. (t.alignGopsWith = function (e) {
  18646. this.transmuxer.alignGopsWith(e.gopsToAlignWith.slice())
  18647. }),
  18648. e
  18649. )
  18650. })()
  18651. self.onmessage = function (e) {
  18652. 'init' === e.data.action && e.data.options
  18653. ? (this.messageHandlers = new ri(self, e.data.options))
  18654. : (this.messageHandlers || (this.messageHandlers = new ri(self)),
  18655. e.data && e.data.action && 'init' !== e.data.action && this.messageHandlers[e.data.action] && this.messageHandlers[e.data.action](e.data))
  18656. }
  18657. })
  18658. )
  18659. ),
  18660. Cl = function (e) {
  18661. ;(e.currentTransmux = null), e.transmuxQueue.length && ((e.currentTransmux = e.transmuxQueue.shift()), 'function' == typeof e.currentTransmux ? e.currentTransmux() : Du(e.currentTransmux))
  18662. },
  18663. Il = function (e) {
  18664. Mu('reset', e)
  18665. },
  18666. xl = function (e) {
  18667. var t = new kl()
  18668. ;(t.currentTransmux = null), (t.transmuxQueue = [])
  18669. var i = t.terminate
  18670. return (
  18671. (t.terminate = function () {
  18672. return (t.currentTransmux = null), (t.transmuxQueue.length = 0), i.call(t)
  18673. }),
  18674. t.postMessage({ action: 'init', options: e }),
  18675. t
  18676. )
  18677. },
  18678. Al = 2,
  18679. Pl = -101,
  18680. Ll = -102,
  18681. Dl = Ro('CodecUtils'),
  18682. Ol = Ro('PlaylistSelector'),
  18683. ar = function () {
  18684. var e = (this.useDevicePixelRatio && window.devicePixelRatio) || 1
  18685. return il(
  18686. this.playlists.master,
  18687. this.systemBandwidth,
  18688. parseInt(Zu(this.tech_.el(), 'width'), 10) * e,
  18689. parseInt(Zu(this.tech_.el(), 'height'), 10) * e,
  18690. this.limitRenditionByPlayerDimensions,
  18691. this.masterPlaylistController_
  18692. )
  18693. },
  18694. Ml = (function (n) {
  18695. function e(e, t) {
  18696. var i = n.call(this) || this
  18697. if (!e) throw new TypeError('Initialization settings are required')
  18698. if ('function' != typeof e.currentTime) throw new TypeError('No currentTime getter specified')
  18699. if (!e.mediaSource) throw new TypeError('No MediaSource specified')
  18700. return (
  18701. (i.bandwidth = e.bandwidth),
  18702. (i.throughput = { rate: 0, count: 0 }),
  18703. (i.roundTrip = NaN),
  18704. i.resetStats_(),
  18705. (i.mediaIndex = null),
  18706. (i.partIndex = null),
  18707. (i.hasPlayed_ = e.hasPlayed),
  18708. (i.currentTime_ = e.currentTime),
  18709. (i.seekable_ = e.seekable),
  18710. (i.seeking_ = e.seeking),
  18711. (i.duration_ = e.duration),
  18712. (i.mediaSource_ = e.mediaSource),
  18713. (i.vhs_ = e.vhs),
  18714. (i.loaderType_ = e.loaderType),
  18715. (i.currentMediaInfo_ = void 0),
  18716. (i.startingMediaInfo_ = void 0),
  18717. (i.segmentMetadataTrack_ = e.segmentMetadataTrack),
  18718. (i.goalBufferLength_ = e.goalBufferLength),
  18719. (i.sourceType_ = e.sourceType),
  18720. (i.sourceUpdater_ = e.sourceUpdater),
  18721. (i.inbandTextTracks_ = e.inbandTextTracks),
  18722. (i.state_ = 'INIT'),
  18723. (i.timelineChangeController_ = e.timelineChangeController),
  18724. (i.shouldSaveSegmentTimingInfo_ = !0),
  18725. (i.parse708captions_ = e.parse708captions),
  18726. (i.useDtsForTimestampOffset_ = e.useDtsForTimestampOffset),
  18727. (i.captionServices_ = e.captionServices),
  18728. (i.experimentalExactManifestTimings = e.experimentalExactManifestTimings),
  18729. (i.checkBufferTimeout_ = null),
  18730. (i.error_ = void 0),
  18731. (i.currentTimeline_ = -1),
  18732. (i.pendingSegment_ = null),
  18733. (i.xhrOptions_ = null),
  18734. (i.pendingSegments_ = []),
  18735. (i.audioDisabled_ = !1),
  18736. (i.isPendingTimestampOffset_ = !1),
  18737. (i.gopBuffer_ = []),
  18738. (i.timeMapping_ = 0),
  18739. (i.safeAppend_ = 11 <= tr.browser.IE_VERSION),
  18740. (i.appendInitSegment_ = { audio: !0, video: !0 }),
  18741. (i.playlistOfLastInitSegment_ = { audio: null, video: null }),
  18742. (i.callQueue_ = []),
  18743. (i.loadQueue_ = []),
  18744. (i.metadataQueue_ = { id3: [], caption: [] }),
  18745. (i.waitingOnRemove_ = !1),
  18746. (i.quotaExceededErrorRetryTimeout_ = null),
  18747. (i.activeInitSegmentId_ = null),
  18748. (i.initSegments_ = {}),
  18749. (i.cacheEncryptionKeys_ = e.cacheEncryptionKeys),
  18750. (i.keyCache_ = {}),
  18751. (i.decrypter_ = e.decrypter),
  18752. (i.syncController_ = e.syncController),
  18753. (i.syncPoint_ = { segmentIndex: 0, time: 0 }),
  18754. (i.transmuxer_ = i.createTransmuxer_()),
  18755. (i.triggerSyncInfoUpdate_ = function () {
  18756. return i.trigger('syncinfoupdate')
  18757. }),
  18758. i.syncController_.on('syncinfoupdate', i.triggerSyncInfoUpdate_),
  18759. i.mediaSource_.addEventListener('sourceopen', function () {
  18760. i.isEndOfStream_() || (i.ended_ = !1)
  18761. }),
  18762. (i.fetchAtBuffer_ = !1),
  18763. (i.logger_ = Ro('SegmentLoader[' + i.loaderType_ + ']')),
  18764. Object.defineProperty(ft(i), 'state', {
  18765. get: function () {
  18766. return this.state_
  18767. },
  18768. set: function (e) {
  18769. e !== this.state_ && (this.logger_(this.state_ + ' -> ' + e), (this.state_ = e), this.trigger('statechange'))
  18770. },
  18771. }),
  18772. i.sourceUpdater_.on('ready', function () {
  18773. i.hasEnoughInfoToAppend_() && i.processCallQueue_()
  18774. }),
  18775. 'main' === i.loaderType_ &&
  18776. i.timelineChangeController_.on('pendingtimelinechange', function () {
  18777. i.hasEnoughInfoToAppend_() && i.processCallQueue_()
  18778. }),
  18779. 'audio' === i.loaderType_ &&
  18780. i.timelineChangeController_.on('timelinechange', function () {
  18781. i.hasEnoughInfoToLoad_() && i.processLoadQueue_(), i.hasEnoughInfoToAppend_() && i.processCallQueue_()
  18782. }),
  18783. i
  18784. )
  18785. }
  18786. mt(e, n)
  18787. var t = e.prototype
  18788. return (
  18789. (t.createTransmuxer_ = function () {
  18790. return xl({ remux: !1, alignGopsAtEnd: this.safeAppend_, keepOriginalTimestamps: !0, parse708captions: this.parse708captions_, captionServices: this.captionServices_ })
  18791. }),
  18792. (t.resetStats_ = function () {
  18793. ;(this.mediaBytesTransferred = 0),
  18794. (this.mediaRequests = 0),
  18795. (this.mediaRequestsAborted = 0),
  18796. (this.mediaRequestsTimedout = 0),
  18797. (this.mediaRequestsErrored = 0),
  18798. (this.mediaTransferDuration = 0),
  18799. (this.mediaSecondsLoaded = 0),
  18800. (this.mediaAppends = 0)
  18801. }),
  18802. (t.dispose = function () {
  18803. this.trigger('dispose'),
  18804. (this.state = 'DISPOSED'),
  18805. this.pause(),
  18806. this.abort_(),
  18807. this.transmuxer_ && this.transmuxer_.terminate(),
  18808. this.resetStats_(),
  18809. this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_),
  18810. this.syncController_ && this.triggerSyncInfoUpdate_ && this.syncController_.off('syncinfoupdate', this.triggerSyncInfoUpdate_),
  18811. this.off()
  18812. }),
  18813. (t.setAudio = function (e) {
  18814. ;(this.audioDisabled_ = !e), e ? (this.appendInitSegment_.audio = !0) : this.sourceUpdater_.removeAudio(0, this.duration_())
  18815. }),
  18816. (t.abort = function () {
  18817. 'WAITING' === this.state ? (this.abort_(), (this.state = 'READY'), this.paused() || this.monitorBuffer_()) : this.pendingSegment_ && (this.pendingSegment_ = null)
  18818. }),
  18819. (t.abort_ = function () {
  18820. this.pendingSegment_ && this.pendingSegment_.abortRequests && this.pendingSegment_.abortRequests(),
  18821. (this.pendingSegment_ = null),
  18822. (this.callQueue_ = []),
  18823. (this.loadQueue_ = []),
  18824. (this.metadataQueue_.id3 = []),
  18825. (this.metadataQueue_.caption = []),
  18826. this.timelineChangeController_.clearPendingTimelineChange(this.loaderType_),
  18827. (this.waitingOnRemove_ = !1),
  18828. window.clearTimeout(this.quotaExceededErrorRetryTimeout_),
  18829. (this.quotaExceededErrorRetryTimeout_ = null)
  18830. }),
  18831. (t.checkForAbort_ = function (e) {
  18832. return 'APPENDING' !== this.state || this.pendingSegment_ ? !this.pendingSegment_ || this.pendingSegment_.requestId !== e : ((this.state = 'READY'), !0)
  18833. }),
  18834. (t.error = function (e) {
  18835. return 'undefined' != typeof e && (this.logger_('error occurred:', e), (this.error_ = e)), (this.pendingSegment_ = null), this.error_
  18836. }),
  18837. (t.endOfStream = function () {
  18838. ;(this.ended_ = !0), this.transmuxer_ && Il(this.transmuxer_), (this.gopBuffer_.length = 0), this.pause(), this.trigger('ended')
  18839. }),
  18840. (t.buffered_ = function () {
  18841. var e = this.getMediaInfo_()
  18842. if (!this.sourceUpdater_ || !e) return tr.createTimeRanges()
  18843. if ('main' === this.loaderType_) {
  18844. var t = e.hasAudio,
  18845. i = e.hasVideo,
  18846. e = e.isMuxed
  18847. if (i && t && !this.audioDisabled_ && !e) return this.sourceUpdater_.buffered()
  18848. if (i) return this.sourceUpdater_.videoBuffered()
  18849. }
  18850. return this.sourceUpdater_.audioBuffered()
  18851. }),
  18852. (t.initSegmentForMap = function (e, t) {
  18853. if ((void 0 === t && (t = !1), !e)) return null
  18854. var i = Su(e),
  18855. n = this.initSegments_[i]
  18856. return (
  18857. t && !n && e.bytes && (this.initSegments_[i] = n = { resolvedUri: e.resolvedUri, byterange: e.byterange, bytes: e.bytes, tracks: e.tracks, timescales: e.timescales }), n || e
  18858. )
  18859. }),
  18860. (t.segmentKey = function (e, t) {
  18861. if ((void 0 === t && (t = !1), !e)) return null
  18862. var i = wu(e),
  18863. n = this.keyCache_[i]
  18864. this.cacheEncryptionKeys_ && t && !n && e.bytes && (this.keyCache_[i] = n = { resolvedUri: e.resolvedUri, bytes: e.bytes })
  18865. e = { resolvedUri: (n || e).resolvedUri }
  18866. return n && (e.bytes = n.bytes), e
  18867. }),
  18868. (t.couldBeginLoading_ = function () {
  18869. return this.playlist_ && !this.paused()
  18870. }),
  18871. (t.load = function () {
  18872. if ((this.monitorBuffer_(), this.playlist_))
  18873. return 'INIT' === this.state && this.couldBeginLoading_()
  18874. ? this.init_()
  18875. : void (!this.couldBeginLoading_() || ('READY' !== this.state && 'INIT' !== this.state) || (this.state = 'READY'))
  18876. }),
  18877. (t.init_ = function () {
  18878. return (this.state = 'READY'), this.resetEverything(), this.monitorBuffer_()
  18879. }),
  18880. (t.playlist = function (e, t) {
  18881. if ((void 0 === t && (t = {}), e)) {
  18882. var i = this.playlist_,
  18883. n = this.pendingSegment_
  18884. ;(this.playlist_ = e),
  18885. (this.xhrOptions_ = t),
  18886. 'INIT' === this.state && ((e.syncInfo = { mediaSequence: e.mediaSequence, time: 0 }), 'main' === this.loaderType_ && this.syncController_.setDateTimeMappingForStart(e))
  18887. var r = null
  18888. if (
  18889. (i && (i.id ? (r = i.id) : i.uri && (r = i.uri)),
  18890. this.logger_('playlist update [' + r + ' => ' + (e.id || e.uri) + ']'),
  18891. this.trigger('syncinfoupdate'),
  18892. 'INIT' === this.state && this.couldBeginLoading_())
  18893. )
  18894. return this.init_()
  18895. if (!i || i.uri !== e.uri)
  18896. return null !== this.mediaIndex && (e.endList ? this.resyncLoader() : this.resetLoader()), (this.currentMediaInfo_ = void 0), void this.trigger('playlistupdate')
  18897. t = e.mediaSequence - i.mediaSequence
  18898. this.logger_('live window shift [' + t + ']'),
  18899. null !== this.mediaIndex &&
  18900. ((this.mediaIndex -= t),
  18901. this.mediaIndex < 0
  18902. ? ((this.mediaIndex = null), (this.partIndex = null))
  18903. : ((r = this.playlist_.segments[this.mediaIndex]),
  18904. !this.partIndex ||
  18905. (r.parts && r.parts.length && r.parts[this.partIndex]) ||
  18906. ((r = this.mediaIndex),
  18907. this.logger_('currently processing part (index ' + this.partIndex + ') no longer exists.'),
  18908. this.resetLoader(),
  18909. (this.mediaIndex = r)))),
  18910. n &&
  18911. ((n.mediaIndex -= t),
  18912. n.mediaIndex < 0
  18913. ? ((n.mediaIndex = null), (n.partIndex = null))
  18914. : (0 <= n.mediaIndex && (n.segment = e.segments[n.mediaIndex]), 0 <= n.partIndex && n.segment.parts && (n.part = n.segment.parts[n.partIndex]))),
  18915. this.syncController_.saveExpiredSegmentInfo(i, e)
  18916. }
  18917. }),
  18918. (t.pause = function () {
  18919. this.checkBufferTimeout_ && (window.clearTimeout(this.checkBufferTimeout_), (this.checkBufferTimeout_ = null))
  18920. }),
  18921. (t.paused = function () {
  18922. return null === this.checkBufferTimeout_
  18923. }),
  18924. (t.resetEverything = function (e) {
  18925. ;(this.ended_ = !1),
  18926. (this.appendInitSegment_ = { audio: !0, video: !0 }),
  18927. this.resetLoader(),
  18928. this.remove(0, 1 / 0, e),
  18929. this.transmuxer_ && (this.transmuxer_.postMessage({ action: 'clearAllMp4Captions' }), this.transmuxer_.postMessage({ action: 'reset' }))
  18930. }),
  18931. (t.resetLoader = function () {
  18932. ;(this.fetchAtBuffer_ = !1), this.resyncLoader()
  18933. }),
  18934. (t.resyncLoader = function () {
  18935. this.transmuxer_ && Il(this.transmuxer_),
  18936. (this.mediaIndex = null),
  18937. (this.partIndex = null),
  18938. (this.syncPoint_ = null),
  18939. (this.isPendingTimestampOffset_ = !1),
  18940. (this.callQueue_ = []),
  18941. (this.loadQueue_ = []),
  18942. (this.metadataQueue_.id3 = []),
  18943. (this.metadataQueue_.caption = []),
  18944. this.abort(),
  18945. this.transmuxer_ && this.transmuxer_.postMessage({ action: 'clearParsedMp4Captions' })
  18946. }),
  18947. (t.remove = function (e, t, i, n) {
  18948. if ((void 0 === i && (i = function () {}), void 0 === n && (n = !1), (t = t === 1 / 0 ? this.duration_() : t) <= e))
  18949. this.logger_('skipping remove because end ${end} is <= start ${start}')
  18950. else if (this.sourceUpdater_ && this.getMediaInfo_()) {
  18951. var r,
  18952. a = 1,
  18953. s = function () {
  18954. 0 === --a && i()
  18955. }
  18956. for (r in ((!n && this.audioDisabled_) || (a++, this.sourceUpdater_.removeAudio(e, t, s)),
  18957. (!n && 'main' !== this.loaderType_) ||
  18958. ((this.gopBuffer_ = (function (e, t, i, n) {
  18959. for (var r = Math.ceil((t - n) * hl), a = Math.ceil((i - n) * hl), n = e.slice(), s = e.length; s-- && !(e[s].pts <= a); );
  18960. if (-1 === s) return n
  18961. for (var o = s + 1; o-- && !(e[o].pts <= r); );
  18962. return (o = Math.max(o, 0)), n.splice(o, s - o + 1), n
  18963. })(this.gopBuffer_, e, t, this.timeMapping_)),
  18964. a++,
  18965. this.sourceUpdater_.removeVideo(e, t, s)),
  18966. this.inbandTextTracks_))
  18967. rl(e, t, this.inbandTextTracks_[r])
  18968. rl(e, t, this.segmentMetadataTrack_), s()
  18969. } else this.logger_('skipping remove because no source updater or starting media info')
  18970. }),
  18971. (t.monitorBuffer_ = function () {
  18972. this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_), (this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this), 1))
  18973. }),
  18974. (t.monitorBufferTick_ = function () {
  18975. 'READY' === this.state && this.fillBuffer_(),
  18976. this.checkBufferTimeout_ && window.clearTimeout(this.checkBufferTimeout_),
  18977. (this.checkBufferTimeout_ = window.setTimeout(this.monitorBufferTick_.bind(this), 500))
  18978. }),
  18979. (t.fillBuffer_ = function () {
  18980. var e
  18981. this.sourceUpdater_.updating() ||
  18982. ((e = this.chooseNextRequest_()) &&
  18983. ('number' == typeof e.timestampOffset &&
  18984. ((this.isPendingTimestampOffset_ = !1), this.timelineChangeController_.pendingTimelineChange({ type: this.loaderType_, from: this.currentTimeline_, to: e.timeline })),
  18985. this.loadSegment_(e)))
  18986. }),
  18987. (t.isEndOfStream_ = function (e, t, i) {
  18988. if ((void 0 === e && (e = this.mediaIndex), void 0 === t && (t = this.playlist_), void 0 === i && (i = this.partIndex), !t || !this.mediaSource_)) return !1
  18989. var n = 'number' == typeof e && t.segments[e],
  18990. e = e + 1 === t.segments.length,
  18991. n = !n || !n.parts || i + 1 === n.parts.length
  18992. return t.endList && 'open' === this.mediaSource_.readyState && e && n
  18993. }),
  18994. (t.chooseNextRequest_ = function () {
  18995. var e = this.buffered_(),
  18996. t = Ho(e) || 0,
  18997. i = qo(e, this.currentTime_()),
  18998. n = !this.hasPlayed_() && 1 <= i,
  18999. r = i >= this.goalBufferLength_(),
  19000. e = this.playlist_.segments
  19001. if (!e.length || n || r) return null
  19002. this.syncPoint_ = this.syncPoint_ || this.syncController_.getSyncPoint(this.playlist_, this.duration_(), this.currentTimeline_, this.currentTime_())
  19003. var a,
  19004. n = { partIndex: null, mediaIndex: null, startOfSegment: null, playlist: this.playlist_, isSyncRequest: Boolean(!this.syncPoint_) }
  19005. n.isSyncRequest
  19006. ? (n.mediaIndex = (function (e, t, i) {
  19007. t = t || []
  19008. for (var n = [], r = 0, a = 0; a < t.length; a++) {
  19009. var s = t[a]
  19010. if (e === s.timeline && (n.push(a), i < (r += s.duration))) return a
  19011. }
  19012. return 0 === n.length ? 0 : n[n.length - 1]
  19013. })(this.currentTimeline_, e, t))
  19014. : null !== this.mediaIndex
  19015. ? ((r = e[this.mediaIndex]),
  19016. (a = 'number' == typeof this.partIndex ? this.partIndex : -1),
  19017. (n.startOfSegment = r.end || t),
  19018. r.parts && r.parts[a + 1] ? ((n.mediaIndex = this.mediaIndex), (n.partIndex = a + 1)) : (n.mediaIndex = this.mediaIndex + 1))
  19019. : ((a = (o = gl.getMediaInfoForTime({
  19020. experimentalExactManifestTimings: this.experimentalExactManifestTimings,
  19021. playlist: this.playlist_,
  19022. currentTime: this.fetchAtBuffer_ ? t : this.currentTime_(),
  19023. startingPartIndex: this.syncPoint_.partIndex,
  19024. startingSegmentIndex: this.syncPoint_.segmentIndex,
  19025. startTime: this.syncPoint_.time,
  19026. })).segmentIndex),
  19027. (s = o.startTime),
  19028. (o = o.partIndex),
  19029. (n.getMediaInfoForTime = this.fetchAtBuffer_ ? 'bufferedEnd ' + t : 'currentTime ' + this.currentTime_()),
  19030. (n.mediaIndex = a),
  19031. (n.startOfSegment = s),
  19032. (n.partIndex = o))
  19033. var s = e[n.mediaIndex],
  19034. o = s && 'number' == typeof n.partIndex && s.parts && s.parts[n.partIndex]
  19035. if (!s || ('number' == typeof n.partIndex && !o)) return null
  19036. 'number' != typeof n.partIndex && s.parts && ((n.partIndex = 0), (o = s.parts[0])),
  19037. i ||
  19038. !o ||
  19039. o.independent ||
  19040. (0 === n.partIndex
  19041. ? (o = (i = e[n.mediaIndex - 1]).parts && i.parts.length && i.parts[i.parts.length - 1]) &&
  19042. o.independent &&
  19043. (--n.mediaIndex, (n.partIndex = i.parts.length - 1), (n.independent = 'previous segment'))
  19044. : s.parts[n.partIndex - 1].independent && (--n.partIndex, (n.independent = 'previous part')))
  19045. s = this.mediaSource_ && 'ended' === this.mediaSource_.readyState
  19046. return n.mediaIndex >= e.length - 1 && s && !this.seeking_() ? null : this.generateSegmentInfo_(n)
  19047. }),
  19048. (t.generateSegmentInfo_ = function (e) {
  19049. var t = e.independent,
  19050. i = e.playlist,
  19051. n = e.mediaIndex,
  19052. r = e.startOfSegment,
  19053. a = e.isSyncRequest,
  19054. s = e.partIndex,
  19055. o = e.forceTimestampOffset,
  19056. u = e.getMediaInfoForTime,
  19057. l = i.segments[n],
  19058. e = 'number' == typeof s && l.parts[s],
  19059. t = {
  19060. requestId: 'segment-loader-' + Math.random(),
  19061. uri: (e && e.resolvedUri) || l.resolvedUri,
  19062. mediaIndex: n,
  19063. partIndex: e ? s : null,
  19064. isSyncRequest: a,
  19065. startOfSegment: r,
  19066. playlist: i,
  19067. bytes: null,
  19068. encryptedBytes: null,
  19069. timestampOffset: null,
  19070. timeline: l.timeline,
  19071. duration: (e && e.duration) || l.duration,
  19072. segment: l,
  19073. part: e,
  19074. byteLength: 0,
  19075. transmuxer: this.transmuxer_,
  19076. getMediaInfoForTime: u,
  19077. independent: t,
  19078. },
  19079. o = 'undefined' != typeof o ? o : this.isPendingTimestampOffset_
  19080. t.timestampOffset = this.timestampOffsetForSegment_({
  19081. segmentTimeline: l.timeline,
  19082. currentTimeline: this.currentTimeline_,
  19083. startOfSegment: r,
  19084. buffered: this.buffered_(),
  19085. overrideCheck: o,
  19086. })
  19087. o = Ho(this.sourceUpdater_.audioBuffered())
  19088. return (
  19089. 'number' == typeof o && (t.audioAppendStart = o - this.sourceUpdater_.audioTimestampOffset()),
  19090. this.sourceUpdater_.videoBuffered().length &&
  19091. (t.gopsToAlignWith = (function (e, t, i) {
  19092. if ('undefined' == typeof t || null === t || !e.length) return []
  19093. for (var n = Math.ceil((t - i + 3) * hl), r = 0; r < e.length && !(e[r].pts > n); r++);
  19094. return e.slice(r)
  19095. })(this.gopBuffer_, this.currentTime_() - this.sourceUpdater_.videoTimestampOffset(), this.timeMapping_)),
  19096. t
  19097. )
  19098. }),
  19099. (t.timestampOffsetForSegment_ = function (e) {
  19100. return (
  19101. (i = (t = e).segmentTimeline),
  19102. (n = t.currentTimeline),
  19103. (r = t.startOfSegment),
  19104. (e = t.buffered),
  19105. t.overrideCheck || i !== n ? (!(i < n) && e.length ? e.end(e.length - 1) : r) : null
  19106. )
  19107. var t, i, n, r
  19108. }),
  19109. (t.earlyAbortWhenNeeded_ = function (e) {
  19110. var t, i, n, r, a, s, o, u, l, c, d, h, p
  19111. !this.vhs_.tech_.paused() &&
  19112. this.xhrOptions_.timeout &&
  19113. this.playlist_.attributes.BANDWIDTH &&
  19114. (Date.now() - (e.firstBytesReceivedAt || Date.now()) < 1e3 ||
  19115. ((t = this.currentTime_()),
  19116. (r = e.bandwidth),
  19117. (a = this.pendingSegment_.duration),
  19118. (p = gl.estimateSegmentRequestTime(a, r, this.playlist_, e.bytesReceived)),
  19119. (i = this.buffered_()),
  19120. (n = t),
  19121. void 0 === (e = this.vhs_.tech_.playbackRate()) && (e = 1),
  19122. p <= (e = ((i.length ? i.end(i.length - 1) : 0) - n) / e - 1) ||
  19123. ((r = {
  19124. master: this.vhs_.playlists.master,
  19125. currentTime: t,
  19126. bandwidth: r,
  19127. duration: this.duration_(),
  19128. segmentDuration: a,
  19129. timeUntilRebuffer: e,
  19130. currentTimeline: this.currentTimeline_,
  19131. syncController: this.syncController_,
  19132. }),
  19133. (a = r.master),
  19134. (s = r.currentTime),
  19135. (o = r.bandwidth),
  19136. (u = r.duration),
  19137. (l = r.segmentDuration),
  19138. (c = r.timeUntilRebuffer),
  19139. (d = r.currentTimeline),
  19140. (h = r.syncController),
  19141. (a = (r = (a = !(a = (r = a.playlists.filter(function (e) {
  19142. return !gl.isIncompatible(e)
  19143. })).filter(gl.isEnabled)).length
  19144. ? r.filter(function (e) {
  19145. return !gl.isDisabled(e)
  19146. })
  19147. : a)
  19148. .filter(gl.hasAttribute.bind(null, 'BANDWIDTH'))
  19149. .map(function (e) {
  19150. var t = h.getSyncPoint(e, u, d, s) ? 1 : 2
  19151. return { playlist: e, rebufferingImpact: gl.estimateSegmentRequestTime(l, o, e) * t - c }
  19152. })).filter(function (e) {
  19153. return e.rebufferingImpact <= 0
  19154. })),
  19155. el(a, function (e, t) {
  19156. return tl(t.playlist, e.playlist)
  19157. }),
  19158. (r = a.length
  19159. ? a[0]
  19160. : (el(r, function (e, t) {
  19161. return e.rebufferingImpact - t.rebufferingImpact
  19162. }),
  19163. r[0] || null)) &&
  19164. ((p = p - e - r.rebufferingImpact),
  19165. !r.playlist ||
  19166. r.playlist.uri === this.playlist_.uri ||
  19167. p < (e <= fl ? 1 : 0.5) ||
  19168. ((this.bandwidth = r.playlist.attributes.BANDWIDTH * El.BANDWIDTH_VARIANCE + 1), this.trigger('earlyabort'))))))
  19169. }),
  19170. (t.handleAbort_ = function (e) {
  19171. this.logger_('Aborting ' + sl(e)), (this.mediaRequestsAborted += 1)
  19172. }),
  19173. (t.handleProgress_ = function (e, t) {
  19174. this.earlyAbortWhenNeeded_(t.stats), this.checkForAbort_(t.requestId) || this.trigger('progress')
  19175. }),
  19176. (t.handleTrackInfo_ = function (e, t) {
  19177. this.earlyAbortWhenNeeded_(e.stats),
  19178. this.checkForAbort_(e.requestId) ||
  19179. this.checkForIllegalMediaSwitch(t) ||
  19180. ((function (e, t) {
  19181. if ((!e && !t) || (!e && t) || (e && !t)) return !1
  19182. if (e === t) return !0
  19183. var i = Object.keys(e).sort(),
  19184. n = Object.keys(t).sort()
  19185. if (i.length !== n.length) return !1
  19186. for (var r = 0; r < i.length; r++) {
  19187. var a = i[r]
  19188. if (a !== n[r]) return !1
  19189. if (e[a] !== t[a]) return !1
  19190. }
  19191. return !0
  19192. })(this.currentMediaInfo_, (t = t || {})) ||
  19193. ((this.appendInitSegment_ = { audio: !0, video: !0 }),
  19194. (this.startingMediaInfo_ = t),
  19195. (this.currentMediaInfo_ = t),
  19196. this.logger_('trackinfo update', t),
  19197. this.trigger('trackinfo')),
  19198. this.checkForAbort_(e.requestId) || ((this.pendingSegment_.trackInfo = t), this.hasEnoughInfoToAppend_() && this.processCallQueue_()))
  19199. }),
  19200. (t.handleTimingInfo_ = function (e, t, i, n) {
  19201. var r
  19202. this.earlyAbortWhenNeeded_(e.stats),
  19203. this.checkForAbort_(e.requestId) ||
  19204. (((r = this.pendingSegment_)[(e = ol(t))] = r[e] || {}),
  19205. (r[e][i] = n),
  19206. this.logger_('timinginfo: ' + t + ' - ' + i + ' - ' + n),
  19207. this.hasEnoughInfoToAppend_() && this.processCallQueue_())
  19208. }),
  19209. (t.handleCaptions_ = function (e, t) {
  19210. var g,
  19211. y,
  19212. v = this
  19213. this.earlyAbortWhenNeeded_(e.stats),
  19214. this.checkForAbort_(e.requestId) ||
  19215. (0 !== t.length
  19216. ? this.pendingSegment_.hasAppendedData_
  19217. ? ((g = null === this.sourceUpdater_.videoTimestampOffset() ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset()),
  19218. (y = {}),
  19219. t.forEach(function (e) {
  19220. y[e.stream] = y[e.stream] || { startTime: 1 / 0, captions: [], endTime: 0 }
  19221. var t = y[e.stream]
  19222. ;(t.startTime = Math.min(t.startTime, e.startTime + g)), (t.endTime = Math.max(t.endTime, e.endTime + g)), t.captions.push(e)
  19223. }),
  19224. Object.keys(y).forEach(function (e) {
  19225. var t,
  19226. i,
  19227. n,
  19228. r,
  19229. a,
  19230. s,
  19231. o,
  19232. u,
  19233. l,
  19234. c,
  19235. d = y[e],
  19236. h = d.startTime,
  19237. p = d.endTime,
  19238. f = d.captions,
  19239. m = v.inbandTextTracks_
  19240. v.logger_('adding cues from ' + h + ' -> ' + p + ' for ' + e),
  19241. (t = m),
  19242. (i = v.vhs_.tech_),
  19243. t[(n = e)] ||
  19244. (i.trigger({ type: 'usage', name: 'vhs-608' }),
  19245. i.trigger({ type: 'usage', name: 'hls-608' }),
  19246. /^cc708_/.test((r = n)) && (r = 'SERVICE' + n.split('_')[1]),
  19247. (o = i.textTracks().getTrackById(r))
  19248. ? (t[n] = o)
  19249. : ((s = a = n),
  19250. (d = !1),
  19251. (o = ((i.options_.vhs && i.options_.vhs.captionServices) || {})[r]) && ((a = o.label), (s = o.language), (d = o.default)),
  19252. (t[n] = i.addRemoteTextTrack({ kind: 'captions', id: r, default: d, label: a, language: s }, !1).track))),
  19253. rl(h, p, m[e]),
  19254. (l = (f = { captionArray: f, inbandTextTracks: m, timestampOffset: g }).inbandTextTracks),
  19255. (m = f.captionArray),
  19256. (c = f.timestampOffset),
  19257. m &&
  19258. ((u = window.WebKitDataCue || window.VTTCue),
  19259. m.forEach(function (e) {
  19260. var t = e.stream
  19261. l[t].addCue(new u(e.startTime + c, e.endTime + c, e.text))
  19262. }))
  19263. }),
  19264. this.transmuxer_ && this.transmuxer_.postMessage({ action: 'clearParsedMp4Captions' }))
  19265. : this.metadataQueue_.caption.push(this.handleCaptions_.bind(this, e, t))
  19266. : this.logger_('SegmentLoader received no captions from a caption event'))
  19267. }),
  19268. (t.handleId3_ = function (e, t, i) {
  19269. var n, r, a, s
  19270. this.earlyAbortWhenNeeded_(e.stats),
  19271. this.checkForAbort_(e.requestId) ||
  19272. (this.pendingSegment_.hasAppendedData_
  19273. ? ((n = null === this.sourceUpdater_.videoTimestampOffset() ? this.sourceUpdater_.audioTimestampOffset() : this.sourceUpdater_.videoTimestampOffset()),
  19274. (r = this.inbandTextTracks_),
  19275. (a = i),
  19276. (s = this.vhs_.tech_),
  19277. r.metadataTrack_ ||
  19278. ((r.metadataTrack_ = s.addRemoteTextTrack({ kind: 'metadata', label: 'Timed Metadata' }, !1).track), (r.metadataTrack_.inBandMetadataTrackDispatchType = a)),
  19279. nl({ inbandTextTracks: this.inbandTextTracks_, metadataArray: t, timestampOffset: n, videoDuration: this.duration_() }))
  19280. : this.metadataQueue_.id3.push(this.handleId3_.bind(this, e, t, i)))
  19281. }),
  19282. (t.processMetadataQueue_ = function () {
  19283. this.metadataQueue_.id3.forEach(function (e) {
  19284. return e()
  19285. }),
  19286. this.metadataQueue_.caption.forEach(function (e) {
  19287. return e()
  19288. }),
  19289. (this.metadataQueue_.id3 = []),
  19290. (this.metadataQueue_.caption = [])
  19291. }),
  19292. (t.processCallQueue_ = function () {
  19293. var e = this.callQueue_
  19294. ;(this.callQueue_ = []),
  19295. e.forEach(function (e) {
  19296. return e()
  19297. })
  19298. }),
  19299. (t.processLoadQueue_ = function () {
  19300. var e = this.loadQueue_
  19301. ;(this.loadQueue_ = []),
  19302. e.forEach(function (e) {
  19303. return e()
  19304. })
  19305. }),
  19306. (t.hasEnoughInfoToLoad_ = function () {
  19307. if ('audio' !== this.loaderType_) return !0
  19308. var e = this.pendingSegment_
  19309. return (
  19310. !!e &&
  19311. (!this.getCurrentMediaInfo_() ||
  19312. !ul({
  19313. timelineChangeController: this.timelineChangeController_,
  19314. currentTimeline: this.currentTimeline_,
  19315. segmentTimeline: e.timeline,
  19316. loaderType: this.loaderType_,
  19317. audioDisabled: this.audioDisabled_,
  19318. }))
  19319. )
  19320. }),
  19321. (t.getCurrentMediaInfo_ = function (e) {
  19322. return ((e = void 0 === e ? this.pendingSegment_ : e) && e.trackInfo) || this.currentMediaInfo_
  19323. }),
  19324. (t.getMediaInfo_ = function (e) {
  19325. return void 0 === e && (e = this.pendingSegment_), this.getCurrentMediaInfo_(e) || this.startingMediaInfo_
  19326. }),
  19327. (t.hasEnoughInfoToAppend_ = function () {
  19328. if (!this.sourceUpdater_.ready()) return !1
  19329. if (this.waitingOnRemove_ || this.quotaExceededErrorRetryTimeout_) return !1
  19330. var e = this.pendingSegment_,
  19331. t = this.getCurrentMediaInfo_()
  19332. if (!e || !t) return !1
  19333. var i = t.hasAudio,
  19334. n = t.hasVideo,
  19335. t = t.isMuxed
  19336. return (
  19337. !(n && !e.videoTimingInfo) &&
  19338. !(i && !this.audioDisabled_ && !t && !e.audioTimingInfo) &&
  19339. !ul({
  19340. timelineChangeController: this.timelineChangeController_,
  19341. currentTimeline: this.currentTimeline_,
  19342. segmentTimeline: e.timeline,
  19343. loaderType: this.loaderType_,
  19344. audioDisabled: this.audioDisabled_,
  19345. })
  19346. )
  19347. }),
  19348. (t.handleData_ = function (e, t) {
  19349. if ((this.earlyAbortWhenNeeded_(e.stats), !this.checkForAbort_(e.requestId)))
  19350. if (!this.callQueue_.length && this.hasEnoughInfoToAppend_()) {
  19351. var i,
  19352. n = this.pendingSegment_
  19353. if ((this.setTimeMapping_(n.timeline), this.updateMediaSecondsLoaded_(n.part || n.segment), 'closed' !== this.mediaSource_.readyState)) {
  19354. if (
  19355. (e.map && ((e.map = this.initSegmentForMap(e.map, !0)), (n.segment.map = e.map)),
  19356. e.key && this.segmentKey(e.key, !0),
  19357. (n.isFmp4 = e.isFmp4),
  19358. (n.timingInfo = n.timingInfo || {}),
  19359. n.isFmp4
  19360. ? (this.trigger('fmp4'), (n.timingInfo.start = n[ol(t.type)].start))
  19361. : ((i = this.getCurrentMediaInfo_()),
  19362. (i = 'main' === this.loaderType_ && i && i.hasVideo) && (r = n.videoTimingInfo.start),
  19363. (n.timingInfo.start = this.trueSegmentStart_({
  19364. currentStart: n.timingInfo.start,
  19365. playlist: n.playlist,
  19366. mediaIndex: n.mediaIndex,
  19367. currentVideoTimestampOffset: this.sourceUpdater_.videoTimestampOffset(),
  19368. useVideoTimingInfo: i,
  19369. firstVideoFrameTimeForData: r,
  19370. videoTimingInfo: n.videoTimingInfo,
  19371. audioTimingInfo: n.audioTimingInfo,
  19372. }))),
  19373. this.updateAppendInitSegmentStatus(n, t.type),
  19374. this.updateSourceBufferTimestampOffset_(n),
  19375. n.isSyncRequest)
  19376. ) {
  19377. this.updateTimingInfoEnd_(n), this.syncController_.saveSegmentTimingInfo({ segmentInfo: n, shouldSaveTimelineMapping: 'main' === this.loaderType_ })
  19378. var r = this.chooseNextRequest_()
  19379. if (r.mediaIndex !== n.mediaIndex || r.partIndex !== n.partIndex) return void this.logger_('sync segment was incorrect, not appending')
  19380. this.logger_('sync segment was correct, appending')
  19381. }
  19382. ;(n.hasAppendedData_ = !0), this.processMetadataQueue_(), this.appendData_(n, t)
  19383. }
  19384. } else this.callQueue_.push(this.handleData_.bind(this, e, t))
  19385. }),
  19386. (t.updateAppendInitSegmentStatus = function (e, t) {
  19387. 'main' !== this.loaderType_ || 'number' != typeof e.timestampOffset || e.changedTimestampOffset || (this.appendInitSegment_ = { audio: !0, video: !0 }),
  19388. this.playlistOfLastInitSegment_[t] !== e.playlist && (this.appendInitSegment_[t] = !0)
  19389. }),
  19390. (t.getInitSegmentAndUpdateState_ = function (e) {
  19391. var t = e.type,
  19392. i = e.initSegment,
  19393. n = e.map,
  19394. r = e.playlist
  19395. if (n) {
  19396. e = Su(n)
  19397. if (this.activeInitSegmentId_ === e) return null
  19398. ;(i = this.initSegmentForMap(n, !0).bytes), (this.activeInitSegmentId_ = e)
  19399. }
  19400. return i && this.appendInitSegment_[t] ? ((this.playlistOfLastInitSegment_[t] = r), (this.appendInitSegment_[t] = !1), (this.activeInitSegmentId_ = null), i) : null
  19401. }),
  19402. (t.handleQuotaExceededError_ = function (e, t) {
  19403. var i = this,
  19404. n = e.segmentInfo,
  19405. r = e.type,
  19406. a = e.bytes,
  19407. s = this.sourceUpdater_.audioBuffered(),
  19408. o = this.sourceUpdater_.videoBuffered()
  19409. 1 < s.length && this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the audio buffer: ' + jo(s).join(', ')),
  19410. 1 < o.length && this.logger_('On QUOTA_EXCEEDED_ERR, found gaps in the video buffer: ' + jo(o).join(', '))
  19411. var u = s.length ? s.start(0) : 0,
  19412. l = s.length ? s.end(s.length - 1) : 0,
  19413. c = o.length ? o.start(0) : 0,
  19414. e = o.length ? o.end(o.length - 1) : 0
  19415. if (l - u <= 1 && e - c <= 1)
  19416. return (
  19417. this.logger_(
  19418. 'On QUOTA_EXCEEDED_ERR, single segment too large to append to buffer, triggering an error. Appended byte length: ' +
  19419. a.byteLength +
  19420. ', audio buffer: ' +
  19421. jo(s).join(', ') +
  19422. ', video buffer: ' +
  19423. jo(o).join(', ') +
  19424. ', '
  19425. ),
  19426. this.error({ message: 'Quota exceeded error with append of a single segment of content', excludeUntil: 1 / 0 }),
  19427. void this.trigger('error')
  19428. )
  19429. ;(this.waitingOnRemove_ = !0), this.callQueue_.push(this.appendToSourceBuffer_.bind(this, { segmentInfo: n, type: r, bytes: a }))
  19430. a = this.currentTime_() - 1
  19431. this.logger_('On QUOTA_EXCEEDED_ERR, removing audio/video from 0 to ' + a),
  19432. this.remove(
  19433. 0,
  19434. a,
  19435. function () {
  19436. i.logger_('On QUOTA_EXCEEDED_ERR, retrying append in 1s'),
  19437. (i.waitingOnRemove_ = !1),
  19438. (i.quotaExceededErrorRetryTimeout_ = window.setTimeout(function () {
  19439. i.logger_('On QUOTA_EXCEEDED_ERR, re-processing call queue'), (i.quotaExceededErrorRetryTimeout_ = null), i.processCallQueue_()
  19440. }, 1e3))
  19441. },
  19442. !0
  19443. )
  19444. }),
  19445. (t.handleAppendError_ = function (e, t) {
  19446. var i = e.segmentInfo,
  19447. n = e.type,
  19448. e = e.bytes
  19449. t &&
  19450. (22 !== t.code
  19451. ? (this.logger_('Received non QUOTA_EXCEEDED_ERR on append', t),
  19452. this.error(n + ' append of ' + e.length + 'b failed for segment #' + i.mediaIndex + ' in playlist ' + i.playlist.id),
  19453. this.trigger('appenderror'))
  19454. : this.handleQuotaExceededError_({ segmentInfo: i, type: n, bytes: e }))
  19455. }),
  19456. (t.appendToSourceBuffer_ = function (e) {
  19457. var t,
  19458. i,
  19459. n = e.segmentInfo,
  19460. r = e.type,
  19461. a = e.initSegment,
  19462. s = e.data,
  19463. o = e.bytes
  19464. o ||
  19465. ((e = [s]),
  19466. (s = s.byteLength),
  19467. a && (e.unshift(a), (s += a.byteLength)),
  19468. (i = 0),
  19469. (e = { bytes: s, segments: e }).bytes &&
  19470. ((t = new Uint8Array(e.bytes)),
  19471. e.segments.forEach(function (e) {
  19472. t.set(e, i), (i += e.byteLength)
  19473. })),
  19474. (o = t)),
  19475. this.sourceUpdater_.appendBuffer({ segmentInfo: n, type: r, bytes: o }, this.handleAppendError_.bind(this, { segmentInfo: n, type: r, bytes: o }))
  19476. }),
  19477. (t.handleSegmentTimingInfo_ = function (e, t, i) {
  19478. this.pendingSegment_ &&
  19479. t === this.pendingSegment_.requestId &&
  19480. ((t = this.pendingSegment_.segment)[(e = e + 'TimingInfo')] || (t[e] = {}),
  19481. (t[e].transmuxerPrependedSeconds = i.prependedContentDuration || 0),
  19482. (t[e].transmuxedPresentationStart = i.start.presentation),
  19483. (t[e].transmuxedDecodeStart = i.start.decode),
  19484. (t[e].transmuxedPresentationEnd = i.end.presentation),
  19485. (t[e].transmuxedDecodeEnd = i.end.decode),
  19486. (t[e].baseMediaDecodeTime = i.baseMediaDecodeTime))
  19487. }),
  19488. (t.appendData_ = function (e, t) {
  19489. var i = t.type,
  19490. n = t.data
  19491. n &&
  19492. n.byteLength &&
  19493. (('audio' === i && this.audioDisabled_) ||
  19494. ((t = this.getInitSegmentAndUpdateState_({ type: i, initSegment: t.initSegment, playlist: e.playlist, map: e.isFmp4 ? e.segment.map : null })),
  19495. this.appendToSourceBuffer_({ segmentInfo: e, type: i, initSegment: t, data: n })))
  19496. }),
  19497. (t.loadSegment_ = function (t) {
  19498. var i = this
  19499. ;(this.state = 'WAITING'),
  19500. (this.pendingSegment_ = t),
  19501. this.trimBackBuffer_(t),
  19502. 'number' == typeof t.timestampOffset && this.transmuxer_ && this.transmuxer_.postMessage({ action: 'clearAllMp4Captions' }),
  19503. this.hasEnoughInfoToLoad_()
  19504. ? this.updateTransmuxerAndRequestSegment_(t)
  19505. : this.loadQueue_.push(function () {
  19506. var e = g({}, t, { forceTimestampOffset: !0 })
  19507. g(t, i.generateSegmentInfo_(e)), (i.isPendingTimestampOffset_ = !1), i.updateTransmuxerAndRequestSegment_(t)
  19508. })
  19509. }),
  19510. (t.updateTransmuxerAndRequestSegment_ = function (n) {
  19511. var r = this
  19512. this.shouldUpdateTransmuxerTimestampOffset_(n.timestampOffset) &&
  19513. ((this.gopBuffer_.length = 0),
  19514. (n.gopsToAlignWith = []),
  19515. (this.timeMapping_ = 0),
  19516. this.transmuxer_.postMessage({ action: 'reset' }),
  19517. this.transmuxer_.postMessage({ action: 'setTimestampOffset', timestampOffset: n.timestampOffset }))
  19518. var e = this.createSimplifiedSegmentObj_(n),
  19519. t = this.isEndOfStream_(n.mediaIndex, n.playlist, n.partIndex),
  19520. i = null !== this.mediaIndex,
  19521. a = n.timeline !== this.currentTimeline_ && 0 < n.timeline,
  19522. a = t || (i && a)
  19523. this.logger_('Requesting ' + sl(n)),
  19524. e.map && !e.map.bytes && (this.logger_('going to request init segment.'), (this.appendInitSegment_ = { video: !0, audio: !0 })),
  19525. (n.abortRequests = Xu({
  19526. xhr: this.vhs_.xhr,
  19527. xhrOptions: this.xhrOptions_,
  19528. decryptionWorker: this.decrypter_,
  19529. segment: e,
  19530. abortFn: this.handleAbort_.bind(this, n),
  19531. progressFn: this.handleProgress_.bind(this),
  19532. trackInfoFn: this.handleTrackInfo_.bind(this),
  19533. timingInfoFn: this.handleTimingInfo_.bind(this),
  19534. videoSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'video', n.requestId),
  19535. audioSegmentTimingInfoFn: this.handleSegmentTimingInfo_.bind(this, 'audio', n.requestId),
  19536. captionsFn: this.handleCaptions_.bind(this),
  19537. isEndOfTimeline: a,
  19538. endedTimelineFn: function () {
  19539. r.logger_('received endedtimeline callback')
  19540. },
  19541. id3Fn: this.handleId3_.bind(this),
  19542. dataFn: this.handleData_.bind(this),
  19543. doneFn: this.segmentRequestFinished_.bind(this),
  19544. onTransmuxerLog: function (e) {
  19545. var t = e.message,
  19546. i = e.level,
  19547. e = e.stream
  19548. r.logger_(sl(n) + ' logged from transmuxer stream ' + e + ' as a ' + i + ': ' + t)
  19549. },
  19550. }))
  19551. }),
  19552. (t.trimBackBuffer_ = function (e) {
  19553. var t,
  19554. i,
  19555. n,
  19556. r,
  19557. r =
  19558. ((t = this.seekable_()),
  19559. (i = this.currentTime_()),
  19560. (n = this.playlist_.targetDuration || 10),
  19561. (r = i - El.BACK_BUFFER_LENGTH),
  19562. t.length && (r = Math.max(r, t.start(0))),
  19563. Math.min(i - n, r))
  19564. 0 < r && this.remove(0, r)
  19565. }),
  19566. (t.createSimplifiedSegmentObj_ = function (e) {
  19567. var t = e.segment,
  19568. i = e.part,
  19569. n = {
  19570. resolvedUri: (i || t).resolvedUri,
  19571. byterange: (i || t).byterange,
  19572. requestId: e.requestId,
  19573. transmuxer: e.transmuxer,
  19574. audioAppendStart: e.audioAppendStart,
  19575. gopsToAlignWith: e.gopsToAlignWith,
  19576. part: e.part,
  19577. },
  19578. i = e.playlist.segments[e.mediaIndex - 1]
  19579. return (
  19580. i &&
  19581. i.timeline === t.timeline &&
  19582. (i.videoTimingInfo ? (n.baseStartTime = i.videoTimingInfo.transmuxedDecodeEnd) : i.audioTimingInfo && (n.baseStartTime = i.audioTimingInfo.transmuxedDecodeEnd)),
  19583. t.key && ((e = t.key.iv || new Uint32Array([0, 0, 0, e.mediaIndex + e.playlist.mediaSequence])), (n.key = this.segmentKey(t.key)), (n.key.iv = e)),
  19584. t.map && (n.map = this.initSegmentForMap(t.map)),
  19585. n
  19586. )
  19587. }),
  19588. (t.saveTransferStats_ = function (e) {
  19589. ;(this.mediaRequests += 1), e && ((this.mediaBytesTransferred += e.bytesReceived), (this.mediaTransferDuration += e.roundTripTime))
  19590. }),
  19591. (t.saveBandwidthRelatedStats_ = function (e, t) {
  19592. ;(this.pendingSegment_.byteLength = t.bytesReceived),
  19593. e < 1 / 60
  19594. ? this.logger_("Ignoring segment's bandwidth because its duration of " + e + ' is less than the min to record ' + 1 / 60)
  19595. : ((this.bandwidth = t.bandwidth), (this.roundTrip = t.roundTripTime))
  19596. }),
  19597. (t.handleTimeout_ = function () {
  19598. ;(this.mediaRequestsTimedout += 1), (this.bandwidth = 1), (this.roundTrip = NaN), this.trigger('bandwidthupdate')
  19599. }),
  19600. (t.segmentRequestFinished_ = function (e, t, i) {
  19601. if (this.callQueue_.length) this.callQueue_.push(this.segmentRequestFinished_.bind(this, e, t, i))
  19602. else if ((this.saveTransferStats_(t.stats), this.pendingSegment_ && t.requestId === this.pendingSegment_.requestId)) {
  19603. if (e)
  19604. return (
  19605. (this.pendingSegment_ = null),
  19606. (this.state = 'READY'),
  19607. e.code === Ll ? void 0 : (this.pause(), e.code === Pl ? void this.handleTimeout_() : ((this.mediaRequestsErrored += 1), this.error(e), void this.trigger('error')))
  19608. )
  19609. e = this.pendingSegment_
  19610. this.saveBandwidthRelatedStats_(e.duration, t.stats),
  19611. (e.endOfAllRequests = t.endOfAllRequests),
  19612. i.gopInfo &&
  19613. (this.gopBuffer_ = (function (e, t, i) {
  19614. if (!t.length) return e
  19615. if (i) return t.slice()
  19616. for (var n = t[0].pts, r = 0; r < e.length && !(e[r].pts >= n); r++);
  19617. return e.slice(0, r).concat(t)
  19618. })(this.gopBuffer_, i.gopInfo, this.safeAppend_)),
  19619. (this.state = 'APPENDING'),
  19620. this.trigger('appending'),
  19621. this.waitForAppendsToComplete_(e)
  19622. }
  19623. }),
  19624. (t.setTimeMapping_ = function (e) {
  19625. e = this.syncController_.mappingForTimeline(e)
  19626. null !== e && (this.timeMapping_ = e)
  19627. }),
  19628. (t.updateMediaSecondsLoaded_ = function (e) {
  19629. 'number' == typeof e.start && 'number' == typeof e.end ? (this.mediaSecondsLoaded += e.end - e.start) : (this.mediaSecondsLoaded += e.duration)
  19630. }),
  19631. (t.shouldUpdateTransmuxerTimestampOffset_ = function (e) {
  19632. return (
  19633. null !== e && (('main' === this.loaderType_ && e !== this.sourceUpdater_.videoTimestampOffset()) || (!this.audioDisabled_ && e !== this.sourceUpdater_.audioTimestampOffset()))
  19634. )
  19635. }),
  19636. (t.trueSegmentStart_ = function (e) {
  19637. var t = e.currentStart,
  19638. i = e.playlist,
  19639. n = e.mediaIndex,
  19640. r = e.firstVideoFrameTimeForData,
  19641. a = e.currentVideoTimestampOffset,
  19642. s = e.useVideoTimingInfo,
  19643. o = e.videoTimingInfo,
  19644. e = e.audioTimingInfo
  19645. if ('undefined' != typeof t) return t
  19646. if (!s) return e.start
  19647. i = i.segments[n - 1]
  19648. return 0 !== n && i && 'undefined' != typeof i.start && i.end === r + a ? o.start : r
  19649. }),
  19650. (t.waitForAppendsToComplete_ = function (e) {
  19651. var t = this.getCurrentMediaInfo_(e)
  19652. if (!t) return this.error({ message: 'No starting media returned, likely due to an unsupported media format.', blacklistDuration: 1 / 0 }), void this.trigger('error')
  19653. var i = t.hasAudio,
  19654. n = t.hasVideo,
  19655. t = t.isMuxed,
  19656. n = 'main' === this.loaderType_ && n,
  19657. t = !this.audioDisabled_ && i && !t
  19658. if (((e.waitingOnAppends = 0), !e.hasAppendedData_))
  19659. return (
  19660. e.timingInfo || 'number' != typeof e.timestampOffset || (this.isPendingTimestampOffset_ = !0),
  19661. (e.timingInfo = { start: 0 }),
  19662. e.waitingOnAppends++,
  19663. this.isPendingTimestampOffset_ || (this.updateSourceBufferTimestampOffset_(e), this.processMetadataQueue_()),
  19664. void this.checkAppendsDone_(e)
  19665. )
  19666. n && e.waitingOnAppends++,
  19667. t && e.waitingOnAppends++,
  19668. n && this.sourceUpdater_.videoQueueCallback(this.checkAppendsDone_.bind(this, e)),
  19669. t && this.sourceUpdater_.audioQueueCallback(this.checkAppendsDone_.bind(this, e))
  19670. }),
  19671. (t.checkAppendsDone_ = function (e) {
  19672. this.checkForAbort_(e.requestId) || (e.waitingOnAppends--, 0 === e.waitingOnAppends && this.handleAppendsDone_())
  19673. }),
  19674. (t.checkForIllegalMediaSwitch = function (e) {
  19675. var t,
  19676. i,
  19677. e =
  19678. ((t = this.loaderType_),
  19679. (i = this.getCurrentMediaInfo_()),
  19680. (e = e),
  19681. 'main' === t && i && e
  19682. ? e.hasAudio || e.hasVideo
  19683. ? i.hasVideo && !e.hasVideo
  19684. ? "Only audio found in segment when we expected video. We can't switch to audio only from a stream that had video. To get rid of this message, please add codec information to the manifest."
  19685. : !i.hasVideo && e.hasVideo
  19686. ? "Video found in segment when we expected only audio. We can't switch to a stream with video from an audio only stream. To get rid of this message, please add codec information to the manifest."
  19687. : null
  19688. : 'Neither audio nor video found in segment.'
  19689. : null)
  19690. return !!e && (this.error({ message: e, blacklistDuration: 1 / 0 }), this.trigger('error'), !0)
  19691. }),
  19692. (t.updateSourceBufferTimestampOffset_ = function (e) {
  19693. var t
  19694. null === e.timestampOffset ||
  19695. 'number' != typeof e.timingInfo.start ||
  19696. e.changedTimestampOffset ||
  19697. 'main' !== this.loaderType_ ||
  19698. ((t = !1),
  19699. (e.timestampOffset -= this.getSegmentStartTimeForTimestampOffsetCalculation_({
  19700. videoTimingInfo: e.segment.videoTimingInfo,
  19701. audioTimingInfo: e.segment.audioTimingInfo,
  19702. timingInfo: e.timingInfo,
  19703. })),
  19704. (e.changedTimestampOffset = !0),
  19705. e.timestampOffset !== this.sourceUpdater_.videoTimestampOffset() && (this.sourceUpdater_.videoTimestampOffset(e.timestampOffset), (t = !0)),
  19706. e.timestampOffset !== this.sourceUpdater_.audioTimestampOffset() && (this.sourceUpdater_.audioTimestampOffset(e.timestampOffset), (t = !0)),
  19707. t && this.trigger('timestampoffset'))
  19708. }),
  19709. (t.getSegmentStartTimeForTimestampOffsetCalculation_ = function (e) {
  19710. var t = e.videoTimingInfo,
  19711. i = e.audioTimingInfo,
  19712. e = e.timingInfo
  19713. return this.useDtsForTimestampOffset_
  19714. ? t && 'number' == typeof t.transmuxedDecodeStart
  19715. ? t.transmuxedDecodeStart
  19716. : i && 'number' == typeof i.transmuxedDecodeStart
  19717. ? i.transmuxedDecodeStart
  19718. : e.start
  19719. : e.start
  19720. }),
  19721. (t.updateTimingInfoEnd_ = function (e) {
  19722. e.timingInfo = e.timingInfo || {}
  19723. var t = this.getMediaInfo_(),
  19724. t = 'main' === this.loaderType_ && t && t.hasVideo && e.videoTimingInfo ? e.videoTimingInfo : e.audioTimingInfo
  19725. t && (e.timingInfo.end = 'number' == typeof t.end ? t.end : t.start + e.duration)
  19726. }),
  19727. (t.handleAppendsDone_ = function () {
  19728. if ((this.pendingSegment_ && this.trigger('appendsdone'), !this.pendingSegment_)) return (this.state = 'READY'), void (this.paused() || this.monitorBuffer_())
  19729. var e = this.pendingSegment_
  19730. this.updateTimingInfoEnd_(e),
  19731. this.shouldSaveSegmentTimingInfo_ && this.syncController_.saveSegmentTimingInfo({ segmentInfo: e, shouldSaveTimelineMapping: 'main' === this.loaderType_ })
  19732. var t = cl(e, this.sourceType_)
  19733. if (
  19734. (t && ('warn' === t.severity ? tr.log.warn(t.message) : this.logger_(t.message)),
  19735. this.recordThroughput_(e),
  19736. (this.pendingSegment_ = null),
  19737. (this.state = 'READY'),
  19738. !e.isSyncRequest || (this.trigger('syncinfoupdate'), e.hasAppendedData_))
  19739. ) {
  19740. this.logger_('Appended ' + sl(e)),
  19741. this.addSegmentMetadataCue_(e),
  19742. (this.fetchAtBuffer_ = !0),
  19743. this.currentTimeline_ !== e.timeline &&
  19744. (this.timelineChangeController_.lastTimelineChange({ type: this.loaderType_, from: this.currentTimeline_, to: e.timeline }),
  19745. 'main' !== this.loaderType_ ||
  19746. this.audioDisabled_ ||
  19747. this.timelineChangeController_.lastTimelineChange({ type: 'audio', from: this.currentTimeline_, to: e.timeline })),
  19748. (this.currentTimeline_ = e.timeline),
  19749. this.trigger('syncinfoupdate')
  19750. var i = e.segment,
  19751. t = e.part,
  19752. i = i.end && this.currentTime_() - i.end > 3 * e.playlist.targetDuration,
  19753. t = t && t.end && this.currentTime_() - t.end > 3 * e.playlist.partTargetDuration
  19754. if (i || t) return this.logger_('bad ' + (i ? 'segment' : 'part') + ' ' + sl(e)), void this.resetEverything()
  19755. null !== this.mediaIndex && this.trigger('bandwidthupdate'),
  19756. this.trigger('progress'),
  19757. (this.mediaIndex = e.mediaIndex),
  19758. (this.partIndex = e.partIndex),
  19759. this.isEndOfStream_(e.mediaIndex, e.playlist, e.partIndex) && this.endOfStream(),
  19760. this.trigger('appended'),
  19761. e.hasAppendedData_ && this.mediaAppends++,
  19762. this.paused() || this.monitorBuffer_()
  19763. } else this.logger_('Throwing away un-appended sync request ' + sl(e))
  19764. }),
  19765. (t.recordThroughput_ = function (e) {
  19766. var t, i
  19767. e.duration < 1 / 60
  19768. ? this.logger_("Ignoring segment's throughput because its duration of " + e.duration + ' is less than the min to record ' + 1 / 60)
  19769. : ((t = this.throughput.rate),
  19770. (i = Date.now() - e.endOfAllRequests + 1),
  19771. (i = Math.floor((e.byteLength / i) * 8 * 1e3)),
  19772. (this.throughput.rate += (i - t) / ++this.throughput.count))
  19773. }),
  19774. (t.addSegmentMetadataCue_ = function (e) {
  19775. var t, i, n, r
  19776. this.segmentMetadataTrack_ &&
  19777. ((i = (t = e.segment).start),
  19778. (r = t.end),
  19779. al(i) &&
  19780. al(r) &&
  19781. (rl(i, r, this.segmentMetadataTrack_),
  19782. (n = window.WebKitDataCue || window.VTTCue),
  19783. (e = {
  19784. custom: t.custom,
  19785. dateTimeObject: t.dateTimeObject,
  19786. dateTimeString: t.dateTimeString,
  19787. bandwidth: e.playlist.attributes.BANDWIDTH,
  19788. resolution: e.playlist.attributes.RESOLUTION,
  19789. codecs: e.playlist.attributes.CODECS,
  19790. byteLength: e.byteLength,
  19791. uri: e.uri,
  19792. timeline: e.timeline,
  19793. playlist: e.playlist.id,
  19794. start: i,
  19795. end: r,
  19796. }),
  19797. ((r = new n(i, r, JSON.stringify(e))).value = e),
  19798. this.segmentMetadataTrack_.addCue(r)))
  19799. }),
  19800. e
  19801. )
  19802. })(tr.EventTarget)
  19803. function Rl() {}
  19804. function Nl(e) {
  19805. return 'string' != typeof e
  19806. ? e
  19807. : e.replace(/./, function (e) {
  19808. return e.toUpperCase()
  19809. })
  19810. }
  19811. function Ul(e, t) {
  19812. var i = t[e + 'Buffer']
  19813. return (i && i.updating) || t.queuePending[e]
  19814. }
  19815. function Bl(e, t) {
  19816. if (0 !== t.queue.length) {
  19817. var i = 0,
  19818. n = t.queue[i]
  19819. if ('mediaSource' !== n.type) {
  19820. if ('mediaSource' !== e && t.ready() && 'closed' !== t.mediaSource.readyState && !Ul(e, t)) {
  19821. if (n.type !== e) {
  19822. if (
  19823. null ===
  19824. (i = (function (e, t) {
  19825. for (var i = 0; i < t.length; i++) {
  19826. var n = t[i]
  19827. if ('mediaSource' === n.type) return null
  19828. if (n.type === e) return i
  19829. }
  19830. return null
  19831. })(e, t.queue))
  19832. )
  19833. return
  19834. n = t.queue[i]
  19835. }
  19836. t.queue.splice(i, 1), (t.queuePending[e] = n).action(e, t), n.doneFn || ((t.queuePending[e] = null), Bl(e, t))
  19837. }
  19838. } else t.updating() || 'closed' === t.mediaSource.readyState || (t.queue.shift(), n.action(t), n.doneFn && n.doneFn(), Bl('audio', t), Bl('video', t))
  19839. }
  19840. }
  19841. function Fl(e, t) {
  19842. var i = t[e + 'Buffer'],
  19843. n = Nl(e)
  19844. i && (i.removeEventListener('updateend', t['on' + n + 'UpdateEnd_']), i.removeEventListener('error', t['on' + n + 'Error_']), (t.codecs[e] = null), (t[e + 'Buffer'] = null))
  19845. }
  19846. function jl(e, t) {
  19847. return e && t && -1 !== Array.prototype.indexOf.call(e.sourceBuffers, t)
  19848. }
  19849. function Hl(e) {
  19850. var t = e.type,
  19851. i = e.sourceUpdater,
  19852. n = e.action,
  19853. r = e.doneFn,
  19854. e = e.name
  19855. i.queue.push({ type: t, action: n, doneFn: r, name: e }), Bl(t, i)
  19856. }
  19857. function ql(i, n) {
  19858. return function (e) {
  19859. var t
  19860. n.queuePending[i] && ((t = n.queuePending[i].doneFn), (n.queuePending[i] = null), t && t(n[i + 'Error_'])), Bl(i, n)
  19861. }
  19862. }
  19863. function Vl(e) {
  19864. return decodeURIComponent(escape(String.fromCharCode.apply(null, e)))
  19865. }
  19866. function Wl(e, t) {
  19867. e.abort(), e.pause(), t && t.activePlaylistLoader && (t.activePlaylistLoader.pause(), (t.activePlaylistLoader = null))
  19868. }
  19869. function Gl(e, t) {
  19870. ;(t.activePlaylistLoader = e).load()
  19871. }
  19872. function zl(e, t) {
  19873. for (var i = 0; i < e.length; i++) {
  19874. if (nu(t, e[i])) return !0
  19875. if (e[i].playlists && zl(e[i].playlists, t)) return !0
  19876. }
  19877. return !1
  19878. }
  19879. function Xl(a) {
  19880. ;['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (e) {
  19881. yc[e](e, a)
  19882. })
  19883. var e,
  19884. s = a.mediaTypes,
  19885. t = a.masterPlaylistLoader,
  19886. i = a.tech,
  19887. n = a.vhs,
  19888. r = a.segmentLoaders,
  19889. o = r.AUDIO,
  19890. u = r.main
  19891. function l() {
  19892. s.AUDIO.onTrackChanged(), i.trigger({ type: 'usage', name: 'vhs-audio-change' }), i.trigger({ type: 'usage', name: 'hls-audio-change' })
  19893. }
  19894. for (e in (['AUDIO', 'SUBTITLES'].forEach(function (e) {
  19895. var u, l, o, c, t, i, d, h, n, r
  19896. ;(s[e].activeGroup =
  19897. ((u = e),
  19898. (l = a),
  19899. function (t) {
  19900. var e = l.masterPlaylistLoader,
  19901. i = l.mediaTypes[u].groups,
  19902. n = e.media()
  19903. if (!n) return null
  19904. var r = null
  19905. n.attributes[u] && (r = i[n.attributes[u]])
  19906. var a = Object.keys(i)
  19907. if (!r)
  19908. if ('AUDIO' === u && 1 < a.length && au(l.master))
  19909. for (var s = 0; s < a.length; s++) {
  19910. var o = i[a[s]]
  19911. if (zl(o, n)) {
  19912. r = o
  19913. break
  19914. }
  19915. }
  19916. else i.main ? (r = i.main) : 1 === a.length && (r = i[a[0]])
  19917. return 'undefined' == typeof t
  19918. ? r
  19919. : (null !== t &&
  19920. r &&
  19921. r.filter(function (e) {
  19922. return e.id === t.id
  19923. })[0]) ||
  19924. null
  19925. })),
  19926. (s[e].activeTrack = vc[e](e, a)),
  19927. (s[e].onGroupChanged =
  19928. ((o = e),
  19929. (c = a),
  19930. function () {
  19931. var e = c.segmentLoaders,
  19932. t = e[o],
  19933. i = e.main,
  19934. n = c.mediaTypes[o],
  19935. r = n.activeTrack(),
  19936. a = n.getActiveGroup(),
  19937. s = n.activePlaylistLoader,
  19938. e = n.lastGroup_
  19939. ;(a && e && a.id === e.id) ||
  19940. ((n.lastGroup_ = a), (n.lastTrack_ = r), Wl(t, n), a && !a.isMasterPlaylist && (a.playlistLoader ? (t.resyncLoader(), Gl(a.playlistLoader, n)) : s && i.resetEverything()))
  19941. })),
  19942. (s[e].onGroupChanging =
  19943. ((t = e),
  19944. (i = a),
  19945. function () {
  19946. var e = i.segmentLoaders[t]
  19947. ;(i.mediaTypes[t].lastGroup_ = null), e.abort(), e.pause()
  19948. })),
  19949. (s[e].onTrackChanged =
  19950. ((d = e),
  19951. (h = a),
  19952. function () {
  19953. var e = h.masterPlaylistLoader,
  19954. t = h.segmentLoaders,
  19955. i = t[d],
  19956. n = t.main,
  19957. r = h.mediaTypes[d],
  19958. a = r.activeTrack(),
  19959. s = r.getActiveGroup(),
  19960. o = r.activePlaylistLoader,
  19961. u = r.lastTrack_
  19962. if ((!u || !a || u.id !== a.id) && ((r.lastGroup_ = s), (r.lastTrack_ = a), Wl(i, r), s)) {
  19963. if (s.isMasterPlaylist) {
  19964. if (!a || !u || a.id === u.id) return
  19965. var l = h.vhs.masterPlaylistController_,
  19966. t = l.selectPlaylist()
  19967. return l.media() === t
  19968. ? void 0
  19969. : (r.logger_('track change. Switching master audio from ' + u.id + ' to ' + a.id), e.pause(), n.resetEverything(), void l.fastQualityChange_(t))
  19970. }
  19971. if ('AUDIO' === d) {
  19972. if (!s.playlistLoader) return n.setAudio(!0), void n.resetEverything()
  19973. i.setAudio(!0), n.setAudio(!1)
  19974. }
  19975. o !== s.playlistLoader && (i.track && i.track(a), i.resetEverything()), Gl(s.playlistLoader, r)
  19976. }
  19977. })),
  19978. (s[e].getActiveGroup =
  19979. ((n = e),
  19980. (r = a.mediaTypes),
  19981. function () {
  19982. var e = r[n].activeTrack()
  19983. return e ? r[n].activeGroup(e) : null
  19984. }))
  19985. }),
  19986. (r = s.AUDIO.activeGroup()) &&
  19987. ((r = (
  19988. r.filter(function (e) {
  19989. return e.default
  19990. })[0] || r[0]
  19991. ).id),
  19992. (s.AUDIO.tracks[r].enabled = !0),
  19993. s.AUDIO.onGroupChanged(),
  19994. s.AUDIO.onTrackChanged(),
  19995. s.AUDIO.getActiveGroup().playlistLoader ? (u.setAudio(!1), o.setAudio(!0)) : u.setAudio(!0)),
  19996. t.on('mediachange', function () {
  19997. ;['AUDIO', 'SUBTITLES'].forEach(function (e) {
  19998. return s[e].onGroupChanged()
  19999. })
  20000. }),
  20001. t.on('mediachanging', function () {
  20002. ;['AUDIO', 'SUBTITLES'].forEach(function (e) {
  20003. return s[e].onGroupChanging()
  20004. })
  20005. }),
  20006. i.audioTracks().addEventListener('change', l),
  20007. i.remoteTextTracks().addEventListener('change', s.SUBTITLES.onTrackChanged),
  20008. n.on('dispose', function () {
  20009. i.audioTracks().removeEventListener('change', l), i.remoteTextTracks().removeEventListener('change', s.SUBTITLES.onTrackChanged)
  20010. }),
  20011. i.clearTracks('audio'),
  20012. s.AUDIO.tracks))
  20013. i.audioTracks().addTrack(s.AUDIO.tracks[e])
  20014. }
  20015. function Kl(e, t, i) {
  20016. var n,
  20017. r,
  20018. a,
  20019. s,
  20020. o = e.masterPlaylistController_,
  20021. u = o[(e.options_.smoothQualityChange ? 'smooth' : 'fast') + 'QualityChange_'].bind(o)
  20022. t.attributes && ((n = t.attributes.RESOLUTION), (this.width = n && n.width), (this.height = n && n.height), (this.bandwidth = t.attributes.BANDWIDTH)),
  20023. (this.codecs = $u(o.master(), t)),
  20024. (this.playlist = t),
  20025. (this.id = i),
  20026. (this.enabled =
  20027. ((r = e.playlists),
  20028. (a = t.id),
  20029. (s = u),
  20030. function (e) {
  20031. var t = r.master.playlists[a],
  20032. i = Zo(t),
  20033. n = eu(t)
  20034. return 'undefined' == typeof e ? n : (e ? delete t.disabled : (t.disabled = !0), e === n || i || (s(), e ? r.trigger('renditionenabled') : r.trigger('renditiondisabled')), e)
  20035. }))
  20036. }
  20037. function Yl(t, e) {
  20038. var i = 0,
  20039. n = 0,
  20040. r = tr.mergeOptions(wc, e)
  20041. function a() {
  20042. n && t.currentTime(n)
  20043. }
  20044. function s(e) {
  20045. null != e &&
  20046. ((n = (t.duration() !== 1 / 0 && t.currentTime()) || 0),
  20047. t.one('loadedmetadata', a),
  20048. t.src(e),
  20049. t.trigger({ type: 'usage', name: 'vhs-error-reload' }),
  20050. t.trigger({ type: 'usage', name: 'hls-error-reload' }),
  20051. t.play())
  20052. }
  20053. function o() {
  20054. return Date.now() - i < 1e3 * r.errorInterval
  20055. ? (t.trigger({ type: 'usage', name: 'vhs-error-reload-canceled' }), void t.trigger({ type: 'usage', name: 'hls-error-reload-canceled' }))
  20056. : r.getSource && 'function' == typeof r.getSource
  20057. ? ((i = Date.now()), r.getSource.call(t, s))
  20058. : void tr.log.error('ERROR: reloadSourceOnError - The option getSource must be a function!')
  20059. }
  20060. function u() {
  20061. t.off('loadedmetadata', a), t.off('error', o), t.off('dispose', u)
  20062. }
  20063. t.ready(function () {
  20064. t.trigger({ type: 'usage', name: 'vhs-error-reload-initialized' }), t.trigger({ type: 'usage', name: 'hls-error-reload-initialized' })
  20065. }),
  20066. t.on('error', o),
  20067. t.on('dispose', u),
  20068. (t.reloadSourceOnError = function (e) {
  20069. u(), Yl(t, e)
  20070. })
  20071. }
  20072. var Ql,
  20073. $l = ['video', 'audio'],
  20074. Jl = function (n, r, a) {
  20075. return function (t, i) {
  20076. var e = i[t + 'Buffer']
  20077. if (jl(i.mediaSource, e)) {
  20078. i.logger_('Appending segment ' + r.mediaIndex + "'s " + n.length + ' bytes to ' + t + 'Buffer')
  20079. try {
  20080. e.appendBuffer(n)
  20081. } catch (e) {
  20082. i.logger_('Error with code ' + e.code + ' ' + (22 === e.code ? '(QUOTA_EXCEEDED_ERR) ' : '') + 'when appending segment ' + r.mediaIndex + ' to ' + t + 'Buffer'),
  20083. (i.queuePending[t] = null),
  20084. a(e)
  20085. }
  20086. }
  20087. }
  20088. },
  20089. Zl = function (n, r) {
  20090. return function (t, i) {
  20091. var e = i[t + 'Buffer']
  20092. if (jl(i.mediaSource, e)) {
  20093. i.logger_('Removing ' + n + ' to ' + r + ' from ' + t + 'Buffer')
  20094. try {
  20095. e.remove(n, r)
  20096. } catch (e) {
  20097. i.logger_('Remove ' + n + ' to ' + r + ' from ' + t + 'Buffer failed')
  20098. }
  20099. }
  20100. }
  20101. },
  20102. ec = function (n) {
  20103. return function (e, t) {
  20104. var i = t[e + 'Buffer']
  20105. jl(t.mediaSource, i) && (t.logger_('Setting ' + e + 'timestampOffset to ' + n), (i.timestampOffset = n))
  20106. }
  20107. },
  20108. tc = function (i) {
  20109. return function (e, t) {
  20110. i()
  20111. }
  20112. },
  20113. ic = function (t) {
  20114. return function (e) {
  20115. if ('open' === e.mediaSource.readyState) {
  20116. e.logger_('Calling mediaSource endOfStream(' + (t || '') + ')')
  20117. try {
  20118. e.mediaSource.endOfStream(t)
  20119. } catch (e) {
  20120. tr.log.warn('Failed to call media source endOfStream', e)
  20121. }
  20122. }
  20123. }
  20124. },
  20125. nc = function (t) {
  20126. return function (e) {
  20127. e.logger_('Setting mediaSource duration to ' + t)
  20128. try {
  20129. e.mediaSource.duration = t
  20130. } catch (e) {
  20131. tr.log.warn('Failed to set media source duration', e)
  20132. }
  20133. }
  20134. },
  20135. rc = function () {
  20136. return function (t, e) {
  20137. if ('open' === e.mediaSource.readyState) {
  20138. var i = e[t + 'Buffer']
  20139. if (jl(e.mediaSource, i)) {
  20140. e.logger_('calling abort on ' + t + 'Buffer')
  20141. try {
  20142. i.abort()
  20143. } catch (e) {
  20144. tr.log.warn('Failed to abort on ' + t + 'Buffer', e)
  20145. }
  20146. }
  20147. }
  20148. }
  20149. },
  20150. ac = function (n, r) {
  20151. return function (e) {
  20152. var t = Nl(n),
  20153. i = mr(r)
  20154. e.logger_('Adding ' + n + 'Buffer with codec ' + r + ' to mediaSource')
  20155. i = e.mediaSource.addSourceBuffer(i)
  20156. i.addEventListener('updateend', e['on' + t + 'UpdateEnd_']), i.addEventListener('error', e['on' + t + 'Error_']), (e.codecs[n] = r), (e[n + 'Buffer'] = i)
  20157. }
  20158. },
  20159. sc = function (i) {
  20160. return function (e) {
  20161. var t = e[i + 'Buffer']
  20162. if ((Fl(i, e), jl(e.mediaSource, t))) {
  20163. e.logger_('Removing ' + i + 'Buffer with codec ' + e.codecs[i] + ' from mediaSource')
  20164. try {
  20165. e.mediaSource.removeSourceBuffer(t)
  20166. } catch (e) {
  20167. tr.log.warn('Failed to removeSourceBuffer ' + i + 'Buffer', e)
  20168. }
  20169. }
  20170. }
  20171. },
  20172. oc = function (r) {
  20173. return function (e, t) {
  20174. var i = t[e + 'Buffer'],
  20175. n = mr(r)
  20176. jl(t.mediaSource, i) && t.codecs[e] !== r && (t.logger_('changing ' + e + 'Buffer codec from ' + t.codecs[e] + ' to ' + r), i.changeType(n), (t.codecs[e] = r))
  20177. }
  20178. },
  20179. uc = (function (i) {
  20180. function e(e) {
  20181. var t = i.call(this) || this
  20182. return (
  20183. (t.mediaSource = e),
  20184. (t.sourceopenListener_ = function () {
  20185. return Bl('mediaSource', ft(t))
  20186. }),
  20187. t.mediaSource.addEventListener('sourceopen', t.sourceopenListener_),
  20188. (t.logger_ = Ro('SourceUpdater')),
  20189. (t.audioTimestampOffset_ = 0),
  20190. (t.videoTimestampOffset_ = 0),
  20191. (t.queue = []),
  20192. (t.queuePending = { audio: null, video: null }),
  20193. (t.delayedAudioAppendQueue_ = []),
  20194. (t.videoAppendQueued_ = !1),
  20195. (t.codecs = {}),
  20196. (t.onVideoUpdateEnd_ = ql('video', ft(t))),
  20197. (t.onAudioUpdateEnd_ = ql('audio', ft(t))),
  20198. (t.onVideoError_ = function (e) {
  20199. t.videoError_ = e
  20200. }),
  20201. (t.onAudioError_ = function (e) {
  20202. t.audioError_ = e
  20203. }),
  20204. (t.createdSourceBuffers_ = !1),
  20205. (t.initializedEme_ = !1),
  20206. (t.triggeredReady_ = !1),
  20207. t
  20208. )
  20209. }
  20210. mt(e, i)
  20211. var t = e.prototype
  20212. return (
  20213. (t.initializedEme = function () {
  20214. ;(this.initializedEme_ = !0), this.triggerReady()
  20215. }),
  20216. (t.hasCreatedSourceBuffers = function () {
  20217. return this.createdSourceBuffers_
  20218. }),
  20219. (t.hasInitializedAnyEme = function () {
  20220. return this.initializedEme_
  20221. }),
  20222. (t.ready = function () {
  20223. return this.hasCreatedSourceBuffers() && this.hasInitializedAnyEme()
  20224. }),
  20225. (t.createSourceBuffers = function (e) {
  20226. this.hasCreatedSourceBuffers() || (this.addOrChangeSourceBuffers(e), (this.createdSourceBuffers_ = !0), this.trigger('createdsourcebuffers'), this.triggerReady())
  20227. }),
  20228. (t.triggerReady = function () {
  20229. this.ready() && !this.triggeredReady_ && ((this.triggeredReady_ = !0), this.trigger('ready'))
  20230. }),
  20231. (t.addSourceBuffer = function (e, t) {
  20232. Hl({ type: 'mediaSource', sourceUpdater: this, action: ac(e, t), name: 'addSourceBuffer' })
  20233. }),
  20234. (t.abort = function (e) {
  20235. Hl({ type: e, sourceUpdater: this, action: rc(e), name: 'abort' })
  20236. }),
  20237. (t.removeSourceBuffer = function (e) {
  20238. this.canRemoveSourceBuffer() ? Hl({ type: 'mediaSource', sourceUpdater: this, action: sc(e), name: 'removeSourceBuffer' }) : tr.log.error('removeSourceBuffer is not supported!')
  20239. }),
  20240. (t.canRemoveSourceBuffer = function () {
  20241. return (
  20242. !tr.browser.IE_VERSION && !tr.browser.IS_FIREFOX && window.MediaSource && window.MediaSource.prototype && 'function' == typeof window.MediaSource.prototype.removeSourceBuffer
  20243. )
  20244. }),
  20245. (e.canChangeType = function () {
  20246. return window.SourceBuffer && window.SourceBuffer.prototype && 'function' == typeof window.SourceBuffer.prototype.changeType
  20247. }),
  20248. (t.canChangeType = function () {
  20249. return this.constructor.canChangeType()
  20250. }),
  20251. (t.changeType = function (e, t) {
  20252. this.canChangeType() ? Hl({ type: e, sourceUpdater: this, action: oc(t), name: 'changeType' }) : tr.log.error('changeType is not supported!')
  20253. }),
  20254. (t.addOrChangeSourceBuffers = function (i) {
  20255. var n = this
  20256. if (!i || 'object' != typeof i || 0 === Object.keys(i).length) throw new Error('Cannot addOrChangeSourceBuffers to undefined codecs')
  20257. Object.keys(i).forEach(function (e) {
  20258. var t = i[e]
  20259. if (!n.hasCreatedSourceBuffers()) return n.addSourceBuffer(e, t)
  20260. n.canChangeType() && n.changeType(e, t)
  20261. })
  20262. }),
  20263. (t.appendBuffer = function (e, t) {
  20264. var i = this,
  20265. n = e.segmentInfo,
  20266. r = e.type,
  20267. a = e.bytes
  20268. if (((this.processedAppend_ = !0), 'audio' === r && this.videoBuffer && !this.videoAppendQueued_))
  20269. return this.delayedAudioAppendQueue_.push([e, t]), void this.logger_('delayed audio append of ' + a.length + ' until video append')
  20270. Hl({ type: r, sourceUpdater: this, action: Jl(a, n || { mediaIndex: -1 }, t), doneFn: t, name: 'appendBuffer' }),
  20271. 'video' === r &&
  20272. ((this.videoAppendQueued_ = !0),
  20273. this.delayedAudioAppendQueue_.length &&
  20274. ((r = this.delayedAudioAppendQueue_.slice()),
  20275. this.logger_('queuing delayed audio ' + r.length + ' appendBuffers'),
  20276. (this.delayedAudioAppendQueue_.length = 0),
  20277. r.forEach(function (e) {
  20278. i.appendBuffer.apply(i, e)
  20279. })))
  20280. }),
  20281. (t.audioBuffered = function () {
  20282. return (jl(this.mediaSource, this.audioBuffer) && this.audioBuffer.buffered) || tr.createTimeRange()
  20283. }),
  20284. (t.videoBuffered = function () {
  20285. return (jl(this.mediaSource, this.videoBuffer) && this.videoBuffer.buffered) || tr.createTimeRange()
  20286. }),
  20287. (t.buffered = function () {
  20288. var e = jl(this.mediaSource, this.videoBuffer) ? this.videoBuffer : null,
  20289. t = jl(this.mediaSource, this.audioBuffer) ? this.audioBuffer : null
  20290. return t && !e
  20291. ? this.audioBuffered()
  20292. : e && !t
  20293. ? this.videoBuffered()
  20294. : (function (e, t) {
  20295. var i = null,
  20296. n = null,
  20297. r = 0,
  20298. a = [],
  20299. s = []
  20300. if (!(e && e.length && t && t.length)) return tr.createTimeRange()
  20301. for (var o = e.length; o--; ) a.push({ time: e.start(o), type: 'start' }), a.push({ time: e.end(o), type: 'end' })
  20302. for (o = t.length; o--; ) a.push({ time: t.start(o), type: 'start' }), a.push({ time: t.end(o), type: 'end' })
  20303. for (
  20304. a.sort(function (e, t) {
  20305. return e.time - t.time
  20306. }),
  20307. o = 0;
  20308. o < a.length;
  20309. o++
  20310. )
  20311. 'start' === a[o].type ? 2 === ++r && (i = a[o].time) : 'end' === a[o].type && 1 === --r && (n = a[o].time),
  20312. null !== i && null !== n && (s.push([i, n]), (n = i = null))
  20313. return tr.createTimeRanges(s)
  20314. })(this.audioBuffered(), this.videoBuffered())
  20315. }),
  20316. (t.setDuration = function (e, t) {
  20317. void 0 === t && (t = Rl), Hl({ type: 'mediaSource', sourceUpdater: this, action: nc(e), name: 'duration', doneFn: t })
  20318. }),
  20319. (t.endOfStream = function (e, t) {
  20320. void 0 === t && (t = Rl),
  20321. Hl({ type: 'mediaSource', sourceUpdater: this, action: ic((e = 'string' != typeof (e = void 0 === e ? null : e) ? void 0 : e)), name: 'endOfStream', doneFn: t })
  20322. }),
  20323. (t.removeAudio = function (e, t, i) {
  20324. void 0 === i && (i = Rl),
  20325. this.audioBuffered().length && 0 !== this.audioBuffered().end(0) ? Hl({ type: 'audio', sourceUpdater: this, action: Zl(e, t), doneFn: i, name: 'remove' }) : i()
  20326. }),
  20327. (t.removeVideo = function (e, t, i) {
  20328. void 0 === i && (i = Rl),
  20329. this.videoBuffered().length && 0 !== this.videoBuffered().end(0) ? Hl({ type: 'video', sourceUpdater: this, action: Zl(e, t), doneFn: i, name: 'remove' }) : i()
  20330. }),
  20331. (t.updating = function () {
  20332. return !(!Ul('audio', this) && !Ul('video', this))
  20333. }),
  20334. (t.audioTimestampOffset = function (e) {
  20335. return (
  20336. 'undefined' != typeof e &&
  20337. this.audioBuffer &&
  20338. this.audioTimestampOffset_ !== e &&
  20339. (Hl({ type: 'audio', sourceUpdater: this, action: ec(e), name: 'timestampOffset' }), (this.audioTimestampOffset_ = e)),
  20340. this.audioTimestampOffset_
  20341. )
  20342. }),
  20343. (t.videoTimestampOffset = function (e) {
  20344. return (
  20345. 'undefined' != typeof e &&
  20346. this.videoBuffer &&
  20347. this.videoTimestampOffset !== e &&
  20348. (Hl({ type: 'video', sourceUpdater: this, action: ec(e), name: 'timestampOffset' }), (this.videoTimestampOffset_ = e)),
  20349. this.videoTimestampOffset_
  20350. )
  20351. }),
  20352. (t.audioQueueCallback = function (e) {
  20353. this.audioBuffer && Hl({ type: 'audio', sourceUpdater: this, action: tc(e), name: 'callback' })
  20354. }),
  20355. (t.videoQueueCallback = function (e) {
  20356. this.videoBuffer && Hl({ type: 'video', sourceUpdater: this, action: tc(e), name: 'callback' })
  20357. }),
  20358. (t.dispose = function () {
  20359. var t = this
  20360. this.trigger('dispose'),
  20361. $l.forEach(function (e) {
  20362. t.abort(e),
  20363. t.canRemoveSourceBuffer()
  20364. ? t.removeSourceBuffer(e)
  20365. : t[e + 'QueueCallback'](function () {
  20366. return Fl(e, t)
  20367. })
  20368. }),
  20369. (this.videoAppendQueued_ = !1),
  20370. (this.delayedAudioAppendQueue_.length = 0),
  20371. this.sourceopenListener_ && this.mediaSource.removeEventListener('sourceopen', this.sourceopenListener_),
  20372. this.off()
  20373. }),
  20374. e
  20375. )
  20376. })(tr.EventTarget),
  20377. lc = new Uint8Array(
  20378. '\n\n'.split('').map(function (e) {
  20379. return e.charCodeAt(0)
  20380. })
  20381. ),
  20382. cc = (function (i) {
  20383. function e(e, t) {
  20384. return (
  20385. ((t = i.call(this, e, (t = void 0 === t ? {} : t)) || this).mediaSource_ = null),
  20386. (t.subtitlesTrack_ = null),
  20387. (t.loaderType_ = 'subtitle'),
  20388. (t.featuresNativeTextTracks_ = e.featuresNativeTextTracks),
  20389. (t.shouldSaveSegmentTimingInfo_ = !1),
  20390. t
  20391. )
  20392. }
  20393. mt(e, i)
  20394. var t = e.prototype
  20395. return (
  20396. (t.createTransmuxer_ = function () {
  20397. return null
  20398. }),
  20399. (t.buffered_ = function () {
  20400. if (!this.subtitlesTrack_ || !this.subtitlesTrack_.cues || !this.subtitlesTrack_.cues.length) return tr.createTimeRanges()
  20401. var e = this.subtitlesTrack_.cues,
  20402. t = e[0].startTime,
  20403. e = e[e.length - 1].startTime
  20404. return tr.createTimeRanges([[t, e]])
  20405. }),
  20406. (t.initSegmentForMap = function (e, t) {
  20407. if ((void 0 === t && (t = !1), !e)) return null
  20408. var i = Su(e),
  20409. n = this.initSegments_[i]
  20410. return (
  20411. t &&
  20412. !n &&
  20413. e.bytes &&
  20414. ((t = lc.byteLength + e.bytes.byteLength),
  20415. (t = new Uint8Array(t)).set(e.bytes),
  20416. t.set(lc, e.bytes.byteLength),
  20417. (this.initSegments_[i] = n = { resolvedUri: e.resolvedUri, byterange: e.byterange, bytes: t })),
  20418. n || e
  20419. )
  20420. }),
  20421. (t.couldBeginLoading_ = function () {
  20422. return this.playlist_ && this.subtitlesTrack_ && !this.paused()
  20423. }),
  20424. (t.init_ = function () {
  20425. return (this.state = 'READY'), this.resetEverything(), this.monitorBuffer_()
  20426. }),
  20427. (t.track = function (e) {
  20428. return 'undefined' == typeof e || ((this.subtitlesTrack_ = e), 'INIT' === this.state && this.couldBeginLoading_() && this.init_()), this.subtitlesTrack_
  20429. }),
  20430. (t.remove = function (e, t) {
  20431. rl(e, t, this.subtitlesTrack_)
  20432. }),
  20433. (t.fillBuffer_ = function () {
  20434. var e = this,
  20435. t = this.chooseNextRequest_()
  20436. if (t) {
  20437. if (null === this.syncController_.timestampOffsetForTimeline(t.timeline))
  20438. return (
  20439. this.syncController_.one('timestampoffset', function () {
  20440. ;(e.state = 'READY'), e.paused() || e.monitorBuffer_()
  20441. }),
  20442. void (this.state = 'WAITING_ON_TIMELINE')
  20443. )
  20444. this.loadSegment_(t)
  20445. }
  20446. }),
  20447. (t.timestampOffsetForSegment_ = function () {
  20448. return null
  20449. }),
  20450. (t.chooseNextRequest_ = function () {
  20451. return this.skipEmptySegments_(i.prototype.chooseNextRequest_.call(this))
  20452. }),
  20453. (t.skipEmptySegments_ = function (e) {
  20454. for (; e && e.segment.empty; ) {
  20455. if (e.mediaIndex + 1 >= e.playlist.segments.length) {
  20456. e = null
  20457. break
  20458. }
  20459. e = this.generateSegmentInfo_({ playlist: e.playlist, mediaIndex: e.mediaIndex + 1, startOfSegment: e.startOfSegment + e.duration, isSyncRequest: e.isSyncRequest })
  20460. }
  20461. return e
  20462. }),
  20463. (t.stopForError = function (e) {
  20464. this.error(e), (this.state = 'READY'), this.pause(), this.trigger('error')
  20465. }),
  20466. (t.segmentRequestFinished_ = function (e, t, i) {
  20467. var n = this
  20468. if (this.subtitlesTrack_) {
  20469. if ((this.saveTransferStats_(t.stats), !this.pendingSegment_)) return (this.state = 'READY'), void (this.mediaRequestsAborted += 1)
  20470. if (e) return e.code === Pl && this.handleTimeout_(), e.code === Ll ? (this.mediaRequestsAborted += 1) : (this.mediaRequestsErrored += 1), void this.stopForError(e)
  20471. var r = this.pendingSegment_
  20472. this.saveBandwidthRelatedStats_(r.duration, t.stats), (this.state = 'APPENDING'), this.trigger('appending')
  20473. var a = r.segment
  20474. if ((a.map && (a.map.bytes = t.map.bytes), (r.bytes = t.bytes), 'function' != typeof window.WebVTT && this.subtitlesTrack_ && this.subtitlesTrack_.tech_)) {
  20475. var s = function () {
  20476. n.subtitlesTrack_.tech_.off('vttjsloaded', o), n.stopForError({ message: 'Error loading vtt.js' })
  20477. },
  20478. o = function () {
  20479. n.subtitlesTrack_.tech_.off('vttjserror', s), n.segmentRequestFinished_(e, t, i)
  20480. }
  20481. return (this.state = 'WAITING_ON_VTTJS'), this.subtitlesTrack_.tech_.one('vttjsloaded', o), void this.subtitlesTrack_.tech_.one('vttjserror', s)
  20482. }
  20483. a.requested = !0
  20484. try {
  20485. this.parseVTTCues_(r)
  20486. } catch (e) {
  20487. return void this.stopForError({ message: e.message })
  20488. }
  20489. if (
  20490. (this.updateTimeMapping_(r, this.syncController_.timelines[r.timeline], this.playlist_),
  20491. r.cues.length
  20492. ? (r.timingInfo = { start: r.cues[0].startTime, end: r.cues[r.cues.length - 1].endTime })
  20493. : (r.timingInfo = { start: r.startOfSegment, end: r.startOfSegment + r.duration }),
  20494. r.isSyncRequest)
  20495. )
  20496. return this.trigger('syncinfoupdate'), (this.pendingSegment_ = null), void (this.state = 'READY')
  20497. ;(r.byteLength = r.bytes.byteLength),
  20498. (this.mediaSecondsLoaded += a.duration),
  20499. r.cues.forEach(function (e) {
  20500. n.subtitlesTrack_.addCue(n.featuresNativeTextTracks_ ? new window.VTTCue(e.startTime, e.endTime, e.text) : e)
  20501. }),
  20502. (function (t) {
  20503. var e = t.cues
  20504. if (e)
  20505. for (var i = 0; i < e.length; i++) {
  20506. for (var n = [], r = 0, a = 0; a < e.length; a++)
  20507. e[i].startTime === e[a].startTime && e[i].endTime === e[a].endTime && e[i].text === e[a].text && 1 < ++r && n.push(e[a])
  20508. n.length &&
  20509. n.forEach(function (e) {
  20510. return t.removeCue(e)
  20511. })
  20512. }
  20513. })(this.subtitlesTrack_),
  20514. this.handleAppendsDone_()
  20515. } else this.state = 'READY'
  20516. }),
  20517. (t.handleData_ = function () {}),
  20518. (t.updateTimingInfoEnd_ = function () {}),
  20519. (t.parseVTTCues_ = function (t) {
  20520. var e = !1
  20521. 'function' == typeof window.TextDecoder ? (i = new window.TextDecoder('utf8')) : ((i = window.WebVTT.StringDecoder()), (e = !0))
  20522. var i = new window.WebVTT.Parser(window, window.vttjs, i)
  20523. ;(t.cues = []),
  20524. (t.timestampmap = { MPEGTS: 0, LOCAL: 0 }),
  20525. (i.oncue = t.cues.push.bind(t.cues)),
  20526. (i.ontimestampmap = function (e) {
  20527. t.timestampmap = e
  20528. }),
  20529. (i.onparsingerror = function (e) {
  20530. tr.log.warn('Error encountered when parsing cues: ' + e.message)
  20531. }),
  20532. t.segment.map && ((n = t.segment.map.bytes), e && (n = Vl(n)), i.parse(n))
  20533. var n = t.bytes
  20534. e && (n = Vl(n)), i.parse(n), i.flush()
  20535. }),
  20536. (t.updateTimeMapping_ = function (e, t, i) {
  20537. var n,
  20538. r,
  20539. a = e.segment
  20540. t &&
  20541. (e.cues.length
  20542. ? ((r = e.timestampmap),
  20543. (n = r.MPEGTS / hl - r.LOCAL + t.mapping),
  20544. e.cues.forEach(function (e) {
  20545. ;(e.startTime += n), (e.endTime += n)
  20546. }),
  20547. i.syncInfo ||
  20548. ((r = e.cues[0].startTime),
  20549. (t = e.cues[e.cues.length - 1].startTime),
  20550. (i.syncInfo = { mediaSequence: i.mediaSequence + e.mediaIndex, time: Math.min(r, t - a.duration) })))
  20551. : (a.empty = !0))
  20552. }),
  20553. e
  20554. )
  20555. })(Ml),
  20556. dc = [
  20557. {
  20558. name: 'VOD',
  20559. run: function (e, t, i, n, r) {
  20560. if (i === 1 / 0) return null
  20561. return { time: 0, segmentIndex: 0, partIndex: null }
  20562. },
  20563. },
  20564. {
  20565. name: 'ProgramDateTime',
  20566. run: function (e, t, i, n, r) {
  20567. if (!Object.keys(e.timelineToDatetimeMappings).length) return null
  20568. var a = null,
  20569. s = null,
  20570. o = Wo(t)
  20571. r = r || 0
  20572. for (var u = 0; u < o.length; u++) {
  20573. var l = o[t.endList || 0 === r ? u : o.length - (u + 1)],
  20574. c = l.segment,
  20575. d = e.timelineToDatetimeMappings[c.timeline]
  20576. if (d && c.dateTimeObject) {
  20577. var h = c.dateTimeObject.getTime() / 1e3 + d
  20578. if (c.parts && 'number' == typeof l.partIndex) for (var p = 0; p < l.partIndex; p++) h += c.parts[p].duration
  20579. d = Math.abs(r - h)
  20580. if (null !== s && (0 === d || s < d)) break
  20581. ;(s = d), (a = { time: h, segmentIndex: l.segmentIndex, partIndex: l.partIndex })
  20582. }
  20583. }
  20584. return a
  20585. },
  20586. },
  20587. {
  20588. name: 'Segment',
  20589. run: function (e, t, i, n, r) {
  20590. var a = null,
  20591. s = null
  20592. r = r || 0
  20593. for (var o = Wo(t), u = 0; u < o.length; u++) {
  20594. var l = o[t.endList || 0 === r ? u : o.length - (u + 1)],
  20595. c = l.segment,
  20596. d = (l.part && l.part.start) || (c && c.start)
  20597. if (c.timeline === n && 'undefined' != typeof d) {
  20598. c = Math.abs(r - d)
  20599. if (null !== s && s < c) break
  20600. ;(!a || null === s || c <= s) && ((s = c), (a = { time: d, segmentIndex: l.segmentIndex, partIndex: l.partIndex }))
  20601. }
  20602. }
  20603. return a
  20604. },
  20605. },
  20606. {
  20607. name: 'Discontinuity',
  20608. run: function (e, t, i, n, r) {
  20609. var a = null
  20610. if (((r = r || 0), t.discontinuityStarts && t.discontinuityStarts.length))
  20611. for (var s = null, o = 0; o < t.discontinuityStarts.length; o++) {
  20612. var u = t.discontinuityStarts[o],
  20613. l = t.discontinuitySequence + o + 1,
  20614. c = e.discontinuities[l]
  20615. if (c) {
  20616. l = Math.abs(r - c.time)
  20617. if (null !== s && s < l) break
  20618. ;(!a || null === s || l <= s) && ((s = l), (a = { time: c.time, segmentIndex: u, partIndex: null }))
  20619. }
  20620. }
  20621. return a
  20622. },
  20623. },
  20624. {
  20625. name: 'Playlist',
  20626. run: function (e, t, i, n, r) {
  20627. return t.syncInfo ? { time: t.syncInfo.time, segmentIndex: t.syncInfo.mediaSequence - t.mediaSequence, partIndex: null } : null
  20628. },
  20629. },
  20630. ],
  20631. hc = (function (i) {
  20632. function e(e) {
  20633. var t = i.call(this) || this
  20634. return (t.timelines = []), (t.discontinuities = []), (t.timelineToDatetimeMappings = {}), (t.logger_ = Ro('SyncController')), t
  20635. }
  20636. mt(e, i)
  20637. var t = e.prototype
  20638. return (
  20639. (t.getSyncPoint = function (e, t, i, n) {
  20640. i = this.runStrategies_(e, t, i, n)
  20641. return i.length ? this.selectSyncPoint_(i, { key: 'time', value: n }) : null
  20642. }),
  20643. (t.getExpiredTime = function (e, t) {
  20644. if (!e || !e.segments) return null
  20645. t = this.runStrategies_(e, t, e.discontinuitySequence, 0)
  20646. if (!t.length) return null
  20647. t = this.selectSyncPoint_(t, { key: 'segmentIndex', value: 0 })
  20648. return 0 < t.segmentIndex && (t.time *= -1), Math.abs(t.time + Qo({ defaultDuration: e.targetDuration, durationList: e.segments, startIndex: t.segmentIndex, endIndex: 0 }))
  20649. }),
  20650. (t.runStrategies_ = function (e, t, i, n) {
  20651. for (var r = [], a = 0; a < dc.length; a++) {
  20652. var s = dc[a],
  20653. o = s.run(this, e, t, i, n)
  20654. o && ((o.strategy = s.name), r.push({ strategy: s.name, syncPoint: o }))
  20655. }
  20656. return r
  20657. }),
  20658. (t.selectSyncPoint_ = function (e, t) {
  20659. for (var i = e[0].syncPoint, n = Math.abs(e[0].syncPoint[t.key] - t.value), r = e[0].strategy, a = 1; a < e.length; a++) {
  20660. var s = Math.abs(e[a].syncPoint[t.key] - t.value)
  20661. s < n && ((n = s), (i = e[a].syncPoint), (r = e[a].strategy))
  20662. }
  20663. return (
  20664. this.logger_(
  20665. 'syncPoint for [' +
  20666. t.key +
  20667. ': ' +
  20668. t.value +
  20669. '] chosen with strategy [' +
  20670. r +
  20671. ']: [time:' +
  20672. i.time +
  20673. ', segmentIndex:' +
  20674. i.segmentIndex +
  20675. ('number' == typeof i.partIndex ? ',partIndex:' + i.partIndex : '') +
  20676. ']'
  20677. ),
  20678. i
  20679. )
  20680. }),
  20681. (t.saveExpiredSegmentInfo = function (e, t) {
  20682. var i = t.mediaSequence - e.mediaSequence
  20683. if (86400 < i) tr.log.warn('Not saving expired segment info. Media sequence gap ' + i + ' is too large.')
  20684. else
  20685. for (var n = i - 1; 0 <= n; n--) {
  20686. var r = e.segments[n]
  20687. if (r && 'undefined' != typeof r.start) {
  20688. ;(t.syncInfo = { mediaSequence: e.mediaSequence + n, time: r.start }),
  20689. this.logger_('playlist refresh sync: [time:' + t.syncInfo.time + ', mediaSequence: ' + t.syncInfo.mediaSequence + ']'),
  20690. this.trigger('syncinfoupdate')
  20691. break
  20692. }
  20693. }
  20694. }),
  20695. (t.setDateTimeMappingForStart = function (e) {
  20696. var t
  20697. ;(this.timelineToDatetimeMappings = {}),
  20698. e.segments &&
  20699. e.segments.length &&
  20700. e.segments[0].dateTimeObject &&
  20701. ((e = (t = e.segments[0]).dateTimeObject.getTime() / 1e3), (this.timelineToDatetimeMappings[t.timeline] = -e))
  20702. }),
  20703. (t.saveSegmentTimingInfo = function (e) {
  20704. var t = e.segmentInfo,
  20705. i = e.shouldSaveTimelineMapping,
  20706. n = this.calculateSegmentTimeMapping_(t, t.timingInfo, i),
  20707. e = t.segment
  20708. n && (this.saveDiscontinuitySyncInfo_(t), t.playlist.syncInfo || (t.playlist.syncInfo = { mediaSequence: t.playlist.mediaSequence + t.mediaIndex, time: e.start }))
  20709. t = e.dateTimeObject
  20710. e.discontinuity && i && t && (this.timelineToDatetimeMappings[e.timeline] = -t.getTime() / 1e3)
  20711. }),
  20712. (t.timestampOffsetForTimeline = function (e) {
  20713. return 'undefined' == typeof this.timelines[e] ? null : this.timelines[e].time
  20714. }),
  20715. (t.mappingForTimeline = function (e) {
  20716. return 'undefined' == typeof this.timelines[e] ? null : this.timelines[e].mapping
  20717. }),
  20718. (t.calculateSegmentTimeMapping_ = function (e, t, i) {
  20719. var n,
  20720. r,
  20721. a = e.segment,
  20722. s = e.part,
  20723. o = this.timelines[e.timeline]
  20724. if ('number' == typeof e.timestampOffset)
  20725. (o = { time: e.startOfSegment, mapping: e.startOfSegment - t.start }),
  20726. i &&
  20727. ((this.timelines[e.timeline] = o),
  20728. this.trigger('timestampoffset'),
  20729. this.logger_('time mapping for timeline ' + e.timeline + ': [time: ' + o.time + '] [mapping: ' + o.mapping + ']')),
  20730. (n = e.startOfSegment),
  20731. (r = t.end + o.mapping)
  20732. else {
  20733. if (!o) return !1
  20734. ;(n = t.start + o.mapping), (r = t.end + o.mapping)
  20735. }
  20736. return s && ((s.start = n), (s.end = r)), (!a.start || n < a.start) && (a.start = n), (a.end = r), !0
  20737. }),
  20738. (t.saveDiscontinuitySyncInfo_ = function (e) {
  20739. var t = e.playlist,
  20740. i = e.segment
  20741. if (i.discontinuity) this.discontinuities[i.timeline] = { time: i.start, accuracy: 0 }
  20742. else if (t.discontinuityStarts && t.discontinuityStarts.length)
  20743. for (var n = 0; n < t.discontinuityStarts.length; n++) {
  20744. var r,
  20745. a = t.discontinuityStarts[n],
  20746. s = t.discontinuitySequence + n + 1,
  20747. o = a - e.mediaIndex,
  20748. u = Math.abs(o)
  20749. ;(!this.discontinuities[s] || this.discontinuities[s].accuracy > u) &&
  20750. ((r = void 0),
  20751. (r =
  20752. o < 0
  20753. ? i.start - Qo({ defaultDuration: t.targetDuration, durationList: t.segments, startIndex: e.mediaIndex, endIndex: a })
  20754. : i.end + Qo({ defaultDuration: t.targetDuration, durationList: t.segments, startIndex: e.mediaIndex + 1, endIndex: a })),
  20755. (this.discontinuities[s] = { time: r, accuracy: u }))
  20756. }
  20757. }),
  20758. (t.dispose = function () {
  20759. this.trigger('dispose'), this.off()
  20760. }),
  20761. e
  20762. )
  20763. })(tr.EventTarget),
  20764. pc = (function (t) {
  20765. function e() {
  20766. var e = t.call(this) || this
  20767. return (e.pendingTimelineChanges_ = {}), (e.lastTimelineChanges_ = {}), e
  20768. }
  20769. mt(e, t)
  20770. var i = e.prototype
  20771. return (
  20772. (i.clearPendingTimelineChange = function (e) {
  20773. ;(this.pendingTimelineChanges_[e] = null), this.trigger('pendingtimelinechange')
  20774. }),
  20775. (i.pendingTimelineChange = function (e) {
  20776. var t = e.type,
  20777. i = e.from,
  20778. e = e.to
  20779. return (
  20780. 'number' == typeof i && 'number' == typeof e && ((this.pendingTimelineChanges_[t] = { type: t, from: i, to: e }), this.trigger('pendingtimelinechange')),
  20781. this.pendingTimelineChanges_[t]
  20782. )
  20783. }),
  20784. (i.lastTimelineChange = function (e) {
  20785. var t = e.type,
  20786. i = e.from,
  20787. e = e.to
  20788. return (
  20789. 'number' == typeof i &&
  20790. 'number' == typeof e &&
  20791. ((this.lastTimelineChanges_[t] = { type: t, from: i, to: e }), delete this.pendingTimelineChanges_[t], this.trigger('timelinechange')),
  20792. this.lastTimelineChanges_[t]
  20793. )
  20794. }),
  20795. (i.dispose = function () {
  20796. this.trigger('dispose'), (this.pendingTimelineChanges_ = {}), (this.lastTimelineChanges_ = {}), this.off()
  20797. }),
  20798. e
  20799. )
  20800. })(tr.EventTarget),
  20801. fc = x(
  20802. U(
  20803. W(function () {
  20804. var e = 'undefined' != typeof globalThis ? globalThis : 'undefined' != typeof window ? window : 'undefined' != typeof global ? global : 'undefined' != typeof self ? self : {}
  20805. function t(e, t, i) {
  20806. return (
  20807. e(
  20808. (i = {
  20809. path: t,
  20810. exports: {},
  20811. require: function (e, t) {
  20812. return (function () {
  20813. throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs')
  20814. })(null == t && i.path)
  20815. },
  20816. }),
  20817. i.exports
  20818. ),
  20819. i.exports
  20820. )
  20821. }
  20822. var i = t(function (e) {
  20823. function n(e, t) {
  20824. for (var i = 0; i < t.length; i++) {
  20825. var n = t[i]
  20826. ;(n.enumerable = n.enumerable || !1), (n.configurable = !0), 'value' in n && (n.writable = !0), Object.defineProperty(e, n.key, n)
  20827. }
  20828. }
  20829. ;(e.exports = function (e, t, i) {
  20830. return t && n(e.prototype, t), i && n(e, i), e
  20831. }),
  20832. (e.exports.default = e.exports),
  20833. (e.exports.__esModule = !0)
  20834. }),
  20835. n = t(function (i) {
  20836. function n(e, t) {
  20837. return (
  20838. (i.exports = n =
  20839. Object.setPrototypeOf ||
  20840. function (e, t) {
  20841. return (e.__proto__ = t), e
  20842. }),
  20843. (i.exports.default = i.exports),
  20844. (i.exports.__esModule = !0),
  20845. n(e, t)
  20846. )
  20847. }
  20848. ;(i.exports = n), (i.exports.default = i.exports), (i.exports.__esModule = !0)
  20849. }),
  20850. r = t(function (e) {
  20851. ;(e.exports = function (e, t) {
  20852. ;(e.prototype = Object.create(t.prototype)), (e.prototype.constructor = e), n(e, t)
  20853. }),
  20854. (e.exports.default = e.exports),
  20855. (e.exports.__esModule = !0)
  20856. }),
  20857. a = (function () {
  20858. function e() {
  20859. this.listeners = {}
  20860. }
  20861. var t = e.prototype
  20862. return (
  20863. (t.on = function (e, t) {
  20864. this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(t)
  20865. }),
  20866. (t.off = function (e, t) {
  20867. if (!this.listeners[e]) return !1
  20868. t = this.listeners[e].indexOf(t)
  20869. return (this.listeners[e] = this.listeners[e].slice(0)), this.listeners[e].splice(t, 1), -1 < t
  20870. }),
  20871. (t.trigger = function (e) {
  20872. var t = this.listeners[e]
  20873. if (t)
  20874. if (2 === arguments.length) for (var i = t.length, n = 0; n < i; ++n) t[n].call(this, arguments[1])
  20875. else for (var r = Array.prototype.slice.call(arguments, 1), a = t.length, s = 0; s < a; ++s) t[s].apply(this, r)
  20876. }),
  20877. (t.dispose = function () {
  20878. this.listeners = {}
  20879. }),
  20880. (t.pipe = function (t) {
  20881. this.on('data', function (e) {
  20882. t.push(e)
  20883. })
  20884. }),
  20885. e
  20886. )
  20887. })()
  20888. /*! @name aes-decrypter @version 3.1.3 @license Apache-2.0 */
  20889. var c = null,
  20890. m = (function () {
  20891. function e(e) {
  20892. var t, i, n
  20893. ;(c =
  20894. c ||
  20895. (function () {
  20896. for (
  20897. var e,
  20898. t,
  20899. i,
  20900. n,
  20901. r,
  20902. a,
  20903. s,
  20904. o = [
  20905. [[], [], [], [], []],
  20906. [[], [], [], [], []],
  20907. ],
  20908. u = o[0],
  20909. l = o[1],
  20910. c = u[4],
  20911. d = l[4],
  20912. h = [],
  20913. p = [],
  20914. f = 0;
  20915. f < 256;
  20916. f++
  20917. )
  20918. p[(h[f] = (f << 1) ^ (283 * (f >> 7))) ^ f] = f
  20919. for (e = t = 0; !c[e]; e ^= i || 1, t = p[t] || 1)
  20920. for (
  20921. s =
  20922. (16843009 * h[(n = h[(i = h[(d[(c[e] = r = ((r = t ^ (t << 1) ^ (t << 2) ^ (t << 3) ^ (t << 4)) >> 8) ^ (255 & r) ^ 99)] = e)])])]) ^
  20923. (65537 * n) ^
  20924. (257 * i) ^
  20925. (16843008 * e),
  20926. a = (257 * h[r]) ^ (16843008 * r),
  20927. f = 0;
  20928. f < 4;
  20929. f++
  20930. )
  20931. (u[f][e] = a = (a << 24) ^ (a >>> 8)), (l[f][r] = s = (s << 24) ^ (s >>> 8))
  20932. for (f = 0; f < 5; f++) (u[f] = u[f].slice(0)), (l[f] = l[f].slice(0))
  20933. return o
  20934. })()),
  20935. (this._tables = [
  20936. [c[0][0].slice(), c[0][1].slice(), c[0][2].slice(), c[0][3].slice(), c[0][4].slice()],
  20937. [c[1][0].slice(), c[1][1].slice(), c[1][2].slice(), c[1][3].slice(), c[1][4].slice()],
  20938. ])
  20939. var r = this._tables[0][4],
  20940. a = this._tables[1],
  20941. s = e.length,
  20942. o = 1
  20943. if (4 !== s && 6 !== s && 8 !== s) throw new Error('Invalid aes key size')
  20944. var u = e.slice(0),
  20945. l = []
  20946. for (this._key = [u, l], t = s; t < 4 * s + 28; t++)
  20947. (n = u[t - 1]),
  20948. (t % s == 0 || (8 === s && t % s == 4)) &&
  20949. ((n = (r[n >>> 24] << 24) ^ (r[(n >> 16) & 255] << 16) ^ (r[(n >> 8) & 255] << 8) ^ r[255 & n]),
  20950. t % s == 0 && ((n = (n << 8) ^ (n >>> 24) ^ (o << 24)), (o = (o << 1) ^ (283 * (o >> 7))))),
  20951. (u[t] = u[t - s] ^ n)
  20952. for (i = 0; t; i++, t--)
  20953. (n = u[3 & i ? t : t - 4]), (l[i] = t <= 4 || i < 4 ? n : a[0][r[n >>> 24]] ^ a[1][r[(n >> 16) & 255]] ^ a[2][r[(n >> 8) & 255]] ^ a[3][r[255 & n]])
  20954. }
  20955. return (
  20956. (e.prototype.decrypt = function (e, t, i, n, r, a) {
  20957. for (
  20958. var s,
  20959. o,
  20960. u,
  20961. l = this._key[1],
  20962. c = e ^ l[0],
  20963. d = n ^ l[1],
  20964. h = i ^ l[2],
  20965. p = t ^ l[3],
  20966. f = l.length / 4 - 2,
  20967. m = 4,
  20968. t = this._tables[1],
  20969. g = t[0],
  20970. y = t[1],
  20971. v = t[2],
  20972. _ = t[3],
  20973. b = t[4],
  20974. T = 0;
  20975. T < f;
  20976. T++
  20977. )
  20978. (s = g[c >>> 24] ^ y[(d >> 16) & 255] ^ v[(h >> 8) & 255] ^ _[255 & p] ^ l[m]),
  20979. (o = g[d >>> 24] ^ y[(h >> 16) & 255] ^ v[(p >> 8) & 255] ^ _[255 & c] ^ l[m + 1]),
  20980. (u = g[h >>> 24] ^ y[(p >> 16) & 255] ^ v[(c >> 8) & 255] ^ _[255 & d] ^ l[m + 2]),
  20981. (p = g[p >>> 24] ^ y[(c >> 16) & 255] ^ v[(d >> 8) & 255] ^ _[255 & h] ^ l[m + 3]),
  20982. (m += 4),
  20983. (c = s),
  20984. (d = o),
  20985. (h = u)
  20986. for (T = 0; T < 4; T++)
  20987. (r[(3 & -T) + a] = (b[c >>> 24] << 24) ^ (b[(d >> 16) & 255] << 16) ^ (b[(h >> 8) & 255] << 8) ^ b[255 & p] ^ l[m++]),
  20988. (s = c),
  20989. (c = d),
  20990. (d = h),
  20991. (h = p),
  20992. (p = s)
  20993. }),
  20994. e
  20995. )
  20996. })(),
  20997. l = (function (t) {
  20998. function e() {
  20999. var e = t.call(this, a) || this
  21000. return (e.jobs = []), (e.delay = 1), (e.timeout_ = null), e
  21001. }
  21002. r(e, t)
  21003. var i = e.prototype
  21004. return (
  21005. (i.processJob_ = function () {
  21006. this.jobs.shift()(), this.jobs.length ? (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay)) : (this.timeout_ = null)
  21007. }),
  21008. (i.push = function (e) {
  21009. this.jobs.push(e), this.timeout_ || (this.timeout_ = setTimeout(this.processJob_.bind(this), this.delay))
  21010. }),
  21011. e
  21012. )
  21013. })(a),
  21014. g = function (e) {
  21015. return (e << 24) | ((65280 & e) << 8) | ((16711680 & e) >> 8) | (e >>> 24)
  21016. },
  21017. s = (function () {
  21018. function u(e, t, i, n) {
  21019. var r = u.STEP,
  21020. a = new Int32Array(e.buffer),
  21021. s = new Uint8Array(e.byteLength),
  21022. o = 0
  21023. for (this.asyncStream_ = new l(), this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s)), o = r; o < a.length; o += r)
  21024. (i = new Uint32Array([g(a[o - 4]), g(a[o - 3]), g(a[o - 2]), g(a[o - 1])])), this.asyncStream_.push(this.decryptChunk_(a.subarray(o, o + r), t, i, s))
  21025. this.asyncStream_.push(function () {
  21026. /*! @name pkcs7 @version 1.0.4 @license Apache-2.0 */
  21027. var e
  21028. n(null, (e = s).subarray(0, e.byteLength - e[e.byteLength - 1]))
  21029. })
  21030. }
  21031. return (
  21032. (u.prototype.decryptChunk_ = function (t, i, n, r) {
  21033. return function () {
  21034. var e = (function (e, t, i) {
  21035. for (
  21036. var n,
  21037. r,
  21038. a,
  21039. s,
  21040. o = new Int32Array(e.buffer, e.byteOffset, e.byteLength >> 2),
  21041. u = new m(Array.prototype.slice.call(t)),
  21042. e = new Uint8Array(e.byteLength),
  21043. l = new Int32Array(e.buffer),
  21044. c = i[0],
  21045. d = i[1],
  21046. h = i[2],
  21047. p = i[3],
  21048. f = 0;
  21049. f < o.length;
  21050. f += 4
  21051. )
  21052. (n = g(o[f])),
  21053. (r = g(o[f + 1])),
  21054. (a = g(o[f + 2])),
  21055. (s = g(o[f + 3])),
  21056. u.decrypt(n, r, a, s, l, f),
  21057. (l[f] = g(l[f] ^ c)),
  21058. (l[f + 1] = g(l[f + 1] ^ d)),
  21059. (l[f + 2] = g(l[f + 2] ^ h)),
  21060. (l[f + 3] = g(l[f + 3] ^ p)),
  21061. (c = n),
  21062. (d = r),
  21063. (h = a),
  21064. (p = s)
  21065. return e
  21066. })(t, i, n)
  21067. r.set(e, t.byteOffset)
  21068. }
  21069. }),
  21070. i(u, null, [
  21071. {
  21072. key: 'STEP',
  21073. get: function () {
  21074. return 32e3
  21075. },
  21076. },
  21077. ]),
  21078. u
  21079. )
  21080. })(),
  21081. e = 'undefined' != typeof window ? window : 'undefined' != typeof e ? e : 'undefined' != typeof self ? self : {},
  21082. e = e.BigInt || Number
  21083. e('0x1'), e('0x100'), e('0x10000'), e('0x1000000'), e('0x100000000'), e('0x10000000000'), e('0x1000000000000'), e('0x100000000000000'), e('0x10000000000000000')
  21084. function o(n) {
  21085. var r = {}
  21086. return (
  21087. Object.keys(n).forEach(function (e) {
  21088. var t,
  21089. i = n[e]
  21090. ;(t = i),
  21091. ('function' === ArrayBuffer.isView ? ArrayBuffer.isView(t) : t && t.buffer instanceof ArrayBuffer)
  21092. ? (r[e] = { bytes: i.buffer, byteOffset: i.byteOffset, byteLength: i.byteLength })
  21093. : (r[e] = i)
  21094. }),
  21095. r
  21096. )
  21097. }
  21098. self.onmessage = function (e) {
  21099. var i = e.data,
  21100. t = new Uint8Array(i.encrypted.bytes, i.encrypted.byteOffset, i.encrypted.byteLength),
  21101. n = new Uint32Array(i.key.bytes, i.key.byteOffset, i.key.byteLength / 4),
  21102. e = new Uint32Array(i.iv.bytes, i.iv.byteOffset, i.iv.byteLength / 4)
  21103. new s(t, n, e, function (e, t) {
  21104. self.postMessage(o({ source: i.source, decrypted: t }), [t.buffer])
  21105. })
  21106. }
  21107. })
  21108. )
  21109. ),
  21110. mc = {
  21111. AUDIO: function (s, o) {
  21112. return function () {
  21113. var e = o.segmentLoaders[s],
  21114. t = o.mediaTypes[s],
  21115. i = o.blacklistCurrentPlaylist
  21116. Wl(e, t)
  21117. var n = t.activeTrack(),
  21118. e = t.activeGroup(),
  21119. e = (
  21120. e.filter(function (e) {
  21121. return e.default
  21122. })[0] || e[0]
  21123. ).id,
  21124. r = t.tracks[e]
  21125. if (n !== r) {
  21126. for (var a in (tr.log.warn('Problem encountered loading the alternate audio track.Switching back to default.'), t.tracks)) t.tracks[a].enabled = t.tracks[a] === r
  21127. t.onTrackChanged()
  21128. } else i({ message: 'Problem encountered loading the default audio track.' })
  21129. }
  21130. },
  21131. SUBTITLES: function (i, n) {
  21132. return function () {
  21133. var e = n.segmentLoaders[i],
  21134. t = n.mediaTypes[i]
  21135. tr.log.warn('Problem encountered loading the subtitle track.Disabling subtitle track.'), Wl(e, t)
  21136. e = t.activeTrack()
  21137. e && (e.mode = 'disabled'), t.onTrackChanged()
  21138. }
  21139. },
  21140. },
  21141. gc = {
  21142. AUDIO: function (e, t, i) {
  21143. var n, r, a
  21144. t &&
  21145. ((n = i.tech),
  21146. (r = i.requestOptions),
  21147. (a = i.segmentLoaders[e]),
  21148. t.on('loadedmetadata', function () {
  21149. var e = t.media()
  21150. a.playlist(e, r), (!n.paused() || (e.endList && 'none' !== n.preload())) && a.load()
  21151. }),
  21152. t.on('loadedplaylist', function () {
  21153. a.playlist(t.media(), r), n.paused() || a.load()
  21154. }),
  21155. t.on('error', mc[e](e, i)))
  21156. },
  21157. SUBTITLES: function (e, t, i) {
  21158. var n = i.tech,
  21159. r = i.requestOptions,
  21160. a = i.segmentLoaders[e],
  21161. s = i.mediaTypes[e]
  21162. t.on('loadedmetadata', function () {
  21163. var e = t.media()
  21164. a.playlist(e, r), a.track(s.activeTrack()), (!n.paused() || (e.endList && 'none' !== n.preload())) && a.load()
  21165. }),
  21166. t.on('loadedplaylist', function () {
  21167. a.playlist(t.media(), r), n.paused() || a.load()
  21168. }),
  21169. t.on('error', mc[e](e, i))
  21170. },
  21171. },
  21172. yc = {
  21173. AUDIO: function (e, t) {
  21174. var i,
  21175. n,
  21176. r = t.vhs,
  21177. a = t.sourceType,
  21178. s = t.segmentLoaders[e],
  21179. o = t.requestOptions,
  21180. u = t.master.mediaGroups,
  21181. l = t.mediaTypes[e],
  21182. c = l.groups,
  21183. d = l.tracks,
  21184. h = l.logger_,
  21185. p = t.masterPlaylistLoader,
  21186. f = au(p.master)
  21187. for (i in ((u[e] && 0 !== Object.keys(u[e]).length) || ((u[e] = { main: { default: { default: !0 } } }), f && (u[e].main.default.playlists = p.master.playlists)), u[e]))
  21188. for (var m in (c[i] || (c[i] = []), u[e][i])) {
  21189. var g = u[e][i][m],
  21190. y = void 0,
  21191. y = f
  21192. ? (h("AUDIO group '" + i + "' label '" + m + "' is a master playlist"), (g.isMasterPlaylist = !0), null)
  21193. : 'vhs-json' === a && g.playlists
  21194. ? new _l(g.playlists[0], r, o)
  21195. : g.resolvedUri
  21196. ? new _l(g.resolvedUri, r, o)
  21197. : g.playlists && 'dash' === a
  21198. ? new wl(g.playlists[0], r, o, p)
  21199. : null,
  21200. g = tr.mergeOptions({ id: m, playlistLoader: y }, g)
  21201. gc[e](e, g.playlistLoader, t),
  21202. c[i].push(g),
  21203. 'undefined' == typeof d[m] &&
  21204. ((g = new tr.AudioTrack({
  21205. id: m,
  21206. kind:
  21207. ((n = void 0),
  21208. (n = (y = g).default ? 'main' : 'alternative'),
  21209. (n = y.characteristics && 0 <= y.characteristics.indexOf('public.accessibility.describes-video') ? 'main-desc' : n)),
  21210. enabled: !1,
  21211. language: g.language,
  21212. default: g.default,
  21213. label: m,
  21214. })),
  21215. (d[m] = g))
  21216. }
  21217. s.on('error', mc[e](e, t))
  21218. },
  21219. SUBTITLES: function (e, t) {
  21220. var i,
  21221. n = t.tech,
  21222. r = t.vhs,
  21223. a = t.sourceType,
  21224. s = t.segmentLoaders[e],
  21225. o = t.requestOptions,
  21226. u = t.master.mediaGroups,
  21227. l = t.mediaTypes[e],
  21228. c = l.groups,
  21229. d = l.tracks,
  21230. h = t.masterPlaylistLoader
  21231. for (i in u[e])
  21232. for (var p in (c[i] || (c[i] = []), u[e][i]))
  21233. if (!u[e][i][p].forced) {
  21234. var f = u[e][i][p],
  21235. m = void 0
  21236. if ('hls' === a) m = new _l(f.resolvedUri, r, o)
  21237. else if ('dash' === a) {
  21238. if (
  21239. !f.playlists.filter(function (e) {
  21240. return e.excludeUntil !== 1 / 0
  21241. }).length
  21242. )
  21243. return
  21244. m = new wl(f.playlists[0], r, o, h)
  21245. } else 'vhs-json' === a && (m = new _l(f.playlists ? f.playlists[0] : f.resolvedUri, r, o))
  21246. ;(f = tr.mergeOptions({ id: p, playlistLoader: m }, f)),
  21247. gc[e](e, f.playlistLoader, t),
  21248. c[i].push(f),
  21249. 'undefined' == typeof d[p] &&
  21250. ((f = n.addRemoteTextTrack({ id: p, kind: 'subtitles', default: f.default && f.autoselect, language: f.language, label: p }, !1).track), (d[p] = f))
  21251. }
  21252. s.on('error', mc[e](e, t))
  21253. },
  21254. 'CLOSED-CAPTIONS': function (e, t) {
  21255. var i,
  21256. n = t.tech,
  21257. r = t.master.mediaGroups,
  21258. t = t.mediaTypes[e],
  21259. a = t.groups,
  21260. s = t.tracks
  21261. for (i in r[e])
  21262. for (var o in (a[i] || (a[i] = []), r[e][i])) {
  21263. var u,
  21264. l,
  21265. c = r[e][i][o]
  21266. ;/^(?:CC|SERVICE)/.test(c.instreamId) &&
  21267. (void 0 ===
  21268. (l = (u = (n.options_.vhs && n.options_.vhs.captionServices) || {})[
  21269. (l = { label: o, language: c.language, instreamId: c.instreamId, default: c.default && c.autoselect }).instreamId
  21270. ]
  21271. ? tr.mergeOptions(l, u[l.instreamId])
  21272. : l).default && delete l.default,
  21273. a[i].push(tr.mergeOptions({ id: o }, c)),
  21274. 'undefined' == typeof s[o] &&
  21275. ((l = n.addRemoteTextTrack({ id: l.instreamId, kind: 'captions', default: l.default, language: l.language, label: l.label }, !1).track), (s[o] = l)))
  21276. }
  21277. },
  21278. },
  21279. vc = {
  21280. AUDIO: function (i, n) {
  21281. return function () {
  21282. var e,
  21283. t = n.mediaTypes[i].tracks
  21284. for (e in t) if (t[e].enabled) return t[e]
  21285. return null
  21286. }
  21287. },
  21288. SUBTITLES: function (i, n) {
  21289. return function () {
  21290. var e,
  21291. t = n.mediaTypes[i].tracks
  21292. for (e in t) if ('showing' === t[e].mode || 'hidden' === t[e].mode) return t[e]
  21293. return null
  21294. }
  21295. },
  21296. },
  21297. _c = ['mediaRequests', 'mediaRequestsAborted', 'mediaRequestsTimedout', 'mediaRequestsErrored', 'mediaTransferDuration', 'mediaBytesTransferred', 'mediaAppends'],
  21298. bc = (function (v) {
  21299. function e(e) {
  21300. var t = v.call(this) || this,
  21301. i = e.src,
  21302. n = e.handleManifestRedirects,
  21303. r = e.withCredentials,
  21304. a = e.tech,
  21305. s = e.bandwidth,
  21306. o = e.externVhs,
  21307. u = e.useCueTags,
  21308. l = e.blacklistDuration,
  21309. c = e.enableLowInitialPlaylist,
  21310. d = e.sourceType,
  21311. h = e.cacheEncryptionKeys,
  21312. p = e.experimentalBufferBasedABR,
  21313. f = e.experimentalLeastPixelDiffSelector,
  21314. m = e.captionServices
  21315. if (!i) throw new Error('A non-empty playlist URL or JSON manifest string is required')
  21316. var g,
  21317. y = e.maxPlaylistRetries
  21318. ;(null !== y && 'undefined' != typeof y) || (y = 1 / 0),
  21319. (Ql = o),
  21320. (t.experimentalBufferBasedABR = Boolean(p)),
  21321. (t.experimentalLeastPixelDiffSelector = Boolean(f)),
  21322. (t.withCredentials = r),
  21323. (t.tech_ = a),
  21324. (t.vhs_ = a.vhs),
  21325. (t.sourceType_ = d),
  21326. (t.useCueTags_ = u),
  21327. (t.blacklistDuration = l),
  21328. (t.maxPlaylistRetries = y),
  21329. (t.enableLowInitialPlaylist = c),
  21330. t.useCueTags_ && ((t.cueTagsTrack_ = t.tech_.addTextTrack('metadata', 'ad-cues')), (t.cueTagsTrack_.inBandMetadataTrackDispatchType = '')),
  21331. (t.requestOptions_ = { withCredentials: r, handleManifestRedirects: n, maxPlaylistRetries: y, timeout: null }),
  21332. t.on('error', t.pauseLoading),
  21333. (t.mediaTypes_ =
  21334. ((g = {}),
  21335. ['AUDIO', 'SUBTITLES', 'CLOSED-CAPTIONS'].forEach(function (e) {
  21336. g[e] = {
  21337. groups: {},
  21338. tracks: {},
  21339. activePlaylistLoader: null,
  21340. activeGroup: Rl,
  21341. activeTrack: Rl,
  21342. getActiveGroup: Rl,
  21343. onGroupChanged: Rl,
  21344. onTrackChanged: Rl,
  21345. lastTrack_: null,
  21346. logger_: Ro('MediaGroups[' + e + ']'),
  21347. }
  21348. }),
  21349. g)),
  21350. (t.mediaSource = new window.MediaSource()),
  21351. (t.handleDurationChange_ = t.handleDurationChange_.bind(ft(t))),
  21352. (t.handleSourceOpen_ = t.handleSourceOpen_.bind(ft(t))),
  21353. (t.handleSourceEnded_ = t.handleSourceEnded_.bind(ft(t))),
  21354. t.mediaSource.addEventListener('durationchange', t.handleDurationChange_),
  21355. t.mediaSource.addEventListener('sourceopen', t.handleSourceOpen_),
  21356. t.mediaSource.addEventListener('sourceended', t.handleSourceEnded_),
  21357. (t.seekable_ = tr.createTimeRanges()),
  21358. (t.hasPlayed_ = !1),
  21359. (t.syncController_ = new hc(e)),
  21360. (t.segmentMetadataTrack_ = a.addRemoteTextTrack({ kind: 'metadata', label: 'segment-metadata' }, !1).track),
  21361. (t.decrypter_ = new fc()),
  21362. (t.sourceUpdater_ = new uc(t.mediaSource)),
  21363. (t.inbandTextTracks_ = {}),
  21364. (t.timelineChangeController_ = new pc())
  21365. h = {
  21366. vhs: t.vhs_,
  21367. parse708captions: e.parse708captions,
  21368. useDtsForTimestampOffset: e.useDtsForTimestampOffset,
  21369. captionServices: m,
  21370. mediaSource: t.mediaSource,
  21371. currentTime: t.tech_.currentTime.bind(t.tech_),
  21372. seekable: function () {
  21373. return t.seekable()
  21374. },
  21375. seeking: function () {
  21376. return t.tech_.seeking()
  21377. },
  21378. duration: function () {
  21379. return t.duration()
  21380. },
  21381. hasPlayed: function () {
  21382. return t.hasPlayed_
  21383. },
  21384. goalBufferLength: function () {
  21385. return t.goalBufferLength()
  21386. },
  21387. bandwidth: s,
  21388. syncController: t.syncController_,
  21389. decrypter: t.decrypter_,
  21390. sourceType: t.sourceType_,
  21391. inbandTextTracks: t.inbandTextTracks_,
  21392. cacheEncryptionKeys: h,
  21393. sourceUpdater: t.sourceUpdater_,
  21394. timelineChangeController: t.timelineChangeController_,
  21395. experimentalExactManifestTimings: e.experimentalExactManifestTimings,
  21396. }
  21397. ;(t.masterPlaylistLoader_ = new ('dash' === t.sourceType_ ? wl : _l)(i, t.vhs_, t.requestOptions_)),
  21398. t.setupMasterPlaylistLoaderListeners_(),
  21399. (t.mainSegmentLoader_ = new Ml(tr.mergeOptions(h, { segmentMetadataTrack: t.segmentMetadataTrack_, loaderType: 'main' }), e)),
  21400. (t.audioSegmentLoader_ = new Ml(tr.mergeOptions(h, { loaderType: 'audio' }), e)),
  21401. (t.subtitleSegmentLoader_ = new cc(tr.mergeOptions(h, { loaderType: 'vtt', featuresNativeTextTracks: t.tech_.featuresNativeTextTracks }), e)),
  21402. t.setupSegmentLoaderListeners_(),
  21403. t.experimentalBufferBasedABR &&
  21404. (t.masterPlaylistLoader_.one('loadedplaylist', function () {
  21405. return t.startABRTimer_()
  21406. }),
  21407. t.tech_.on('pause', function () {
  21408. return t.stopABRTimer_()
  21409. }),
  21410. t.tech_.on('play', function () {
  21411. return t.startABRTimer_()
  21412. })),
  21413. _c.forEach(function (e) {
  21414. t[e + '_'] = function (e) {
  21415. return this.audioSegmentLoader_[e] + this.mainSegmentLoader_[e]
  21416. }.bind(ft(t), e)
  21417. }),
  21418. (t.logger_ = Ro('MPC')),
  21419. (t.triggeredFmp4Usage = !1),
  21420. 'none' === t.tech_.preload()
  21421. ? ((t.loadOnPlay_ = function () {
  21422. ;(t.loadOnPlay_ = null), t.masterPlaylistLoader_.load()
  21423. }),
  21424. t.tech_.one('play', t.loadOnPlay_))
  21425. : t.masterPlaylistLoader_.load(),
  21426. (t.timeToLoadedData__ = -1),
  21427. (t.mainAppendsToLoadedData__ = -1),
  21428. (t.audioAppendsToLoadedData__ = -1)
  21429. e = 'none' === t.tech_.preload() ? 'play' : 'loadstart'
  21430. return (
  21431. t.tech_.one(e, function () {
  21432. var e = Date.now()
  21433. t.tech_.one('loadeddata', function () {
  21434. ;(t.timeToLoadedData__ = Date.now() - e),
  21435. (t.mainAppendsToLoadedData__ = t.mainSegmentLoader_.mediaAppends),
  21436. (t.audioAppendsToLoadedData__ = t.audioSegmentLoader_.mediaAppends)
  21437. })
  21438. }),
  21439. t
  21440. )
  21441. }
  21442. mt(e, v)
  21443. var t = e.prototype
  21444. return (
  21445. (t.mainAppendsToLoadedData_ = function () {
  21446. return this.mainAppendsToLoadedData__
  21447. }),
  21448. (t.audioAppendsToLoadedData_ = function () {
  21449. return this.audioAppendsToLoadedData__
  21450. }),
  21451. (t.appendsToLoadedData_ = function () {
  21452. var e = this.mainAppendsToLoadedData_(),
  21453. t = this.audioAppendsToLoadedData_()
  21454. return -1 === e || -1 === t ? -1 : e + t
  21455. }),
  21456. (t.timeToLoadedData_ = function () {
  21457. return this.timeToLoadedData__
  21458. }),
  21459. (t.checkABR_ = function () {
  21460. var e = this.selectPlaylist()
  21461. e && this.shouldSwitchToMedia_(e) && this.switchMedia_(e, 'abr')
  21462. }),
  21463. (t.switchMedia_ = function (e, t, i) {
  21464. var n = this.media(),
  21465. r = n && (n.id || n.uri),
  21466. n = e.id || e.uri
  21467. r && r !== n && (this.logger_('switch media ' + r + ' -> ' + n + ' from ' + t), this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-change-' + t })),
  21468. this.masterPlaylistLoader_.media(e, i)
  21469. }),
  21470. (t.startABRTimer_ = function () {
  21471. var e = this
  21472. this.stopABRTimer_(),
  21473. (this.abrTimer_ = window.setInterval(function () {
  21474. return e.checkABR_()
  21475. }, 250))
  21476. }),
  21477. (t.stopABRTimer_ = function () {
  21478. ;(this.tech_.scrubbing && this.tech_.scrubbing()) || (window.clearInterval(this.abrTimer_), (this.abrTimer_ = null))
  21479. }),
  21480. (t.getAudioTrackPlaylists_ = function () {
  21481. var e = this.master(),
  21482. t = (e && e.playlists) || []
  21483. if (!e || !e.mediaGroups || !e.mediaGroups.AUDIO) return t
  21484. var i,
  21485. n = e.mediaGroups.AUDIO,
  21486. r = Object.keys(n)
  21487. if (Object.keys(this.mediaTypes_.AUDIO.groups).length) i = this.mediaTypes_.AUDIO.activeTrack()
  21488. else {
  21489. var a,
  21490. s = n.main || (r.length && n[r[0]])
  21491. for (a in s)
  21492. if (s[a].default) {
  21493. i = { label: a }
  21494. break
  21495. }
  21496. }
  21497. if (!i) return t
  21498. var o,
  21499. u = []
  21500. for (o in n)
  21501. if (n[o][i.label]) {
  21502. var l = n[o][i.label]
  21503. if (l.playlists && l.playlists.length) u.push.apply(u, l.playlists)
  21504. else if (l.uri) u.push(l)
  21505. else if (e.playlists.length)
  21506. for (var c = 0; c < e.playlists.length; c++) {
  21507. var d = e.playlists[c]
  21508. d.attributes && d.attributes.AUDIO && d.attributes.AUDIO === o && u.push(d)
  21509. }
  21510. }
  21511. return u.length ? u : t
  21512. }),
  21513. (t.setupMasterPlaylistLoaderListeners_ = function () {
  21514. var i = this
  21515. this.masterPlaylistLoader_.on('loadedmetadata', function () {
  21516. var e = i.masterPlaylistLoader_.media(),
  21517. t = 1.5 * e.targetDuration * 1e3
  21518. iu(i.masterPlaylistLoader_.master, i.masterPlaylistLoader_.media()) ? (i.requestOptions_.timeout = 0) : (i.requestOptions_.timeout = t),
  21519. e.endList && 'none' !== i.tech_.preload() && (i.mainSegmentLoader_.playlist(e, i.requestOptions_), i.mainSegmentLoader_.load()),
  21520. Xl({
  21521. sourceType: i.sourceType_,
  21522. segmentLoaders: { AUDIO: i.audioSegmentLoader_, SUBTITLES: i.subtitleSegmentLoader_, main: i.mainSegmentLoader_ },
  21523. tech: i.tech_,
  21524. requestOptions: i.requestOptions_,
  21525. masterPlaylistLoader: i.masterPlaylistLoader_,
  21526. vhs: i.vhs_,
  21527. master: i.master(),
  21528. mediaTypes: i.mediaTypes_,
  21529. blacklistCurrentPlaylist: i.blacklistCurrentPlaylist.bind(i),
  21530. }),
  21531. i.triggerPresenceUsage_(i.master(), e),
  21532. i.setupFirstPlay(),
  21533. !i.mediaTypes_.AUDIO.activePlaylistLoader || i.mediaTypes_.AUDIO.activePlaylistLoader.media()
  21534. ? i.trigger('selectedinitialmedia')
  21535. : i.mediaTypes_.AUDIO.activePlaylistLoader.one('loadedmetadata', function () {
  21536. i.trigger('selectedinitialmedia')
  21537. })
  21538. }),
  21539. this.masterPlaylistLoader_.on('loadedplaylist', function () {
  21540. i.loadOnPlay_ && i.tech_.off('play', i.loadOnPlay_)
  21541. var e,
  21542. t = i.masterPlaylistLoader_.media()
  21543. if (!t) {
  21544. if ((i.excludeUnsupportedVariants_(), !(e = (e = i.enableLowInitialPlaylist ? i.selectInitialPlaylist() : e) || i.selectPlaylist()) || !i.shouldSwitchToMedia_(e)))
  21545. return
  21546. if (((i.initialMedia_ = e), i.switchMedia_(i.initialMedia_, 'initial'), !('vhs-json' === i.sourceType_ && i.initialMedia_.segments))) return
  21547. t = i.initialMedia_
  21548. }
  21549. i.handleUpdatedMediaPlaylist(t)
  21550. }),
  21551. this.masterPlaylistLoader_.on('error', function () {
  21552. i.blacklistCurrentPlaylist(i.masterPlaylistLoader_.error)
  21553. }),
  21554. this.masterPlaylistLoader_.on('mediachanging', function () {
  21555. i.mainSegmentLoader_.abort(), i.mainSegmentLoader_.pause()
  21556. }),
  21557. this.masterPlaylistLoader_.on('mediachange', function () {
  21558. var e = i.masterPlaylistLoader_.media(),
  21559. t = 1.5 * e.targetDuration * 1e3
  21560. iu(i.masterPlaylistLoader_.master, i.masterPlaylistLoader_.media()) ? (i.requestOptions_.timeout = 0) : (i.requestOptions_.timeout = t),
  21561. i.mainSegmentLoader_.playlist(e, i.requestOptions_),
  21562. i.mainSegmentLoader_.load(),
  21563. i.tech_.trigger({ type: 'mediachange', bubbles: !0 })
  21564. }),
  21565. this.masterPlaylistLoader_.on('playlistunchanged', function () {
  21566. var e = i.masterPlaylistLoader_.media()
  21567. 'playlist-unchanged' !== e.lastExcludeReason_ &&
  21568. i.stuckAtPlaylistEnd_(e) &&
  21569. (i.blacklistCurrentPlaylist({ message: 'Playlist no longer updating.', reason: 'playlist-unchanged' }), i.tech_.trigger('playliststuck'))
  21570. }),
  21571. this.masterPlaylistLoader_.on('renditiondisabled', function () {
  21572. i.tech_.trigger({ type: 'usage', name: 'vhs-rendition-disabled' }), i.tech_.trigger({ type: 'usage', name: 'hls-rendition-disabled' })
  21573. }),
  21574. this.masterPlaylistLoader_.on('renditionenabled', function () {
  21575. i.tech_.trigger({ type: 'usage', name: 'vhs-rendition-enabled' }), i.tech_.trigger({ type: 'usage', name: 'hls-rendition-enabled' })
  21576. })
  21577. }),
  21578. (t.handleUpdatedMediaPlaylist = function (e) {
  21579. this.useCueTags_ && this.updateAdCues_(e),
  21580. this.mainSegmentLoader_.playlist(e, this.requestOptions_),
  21581. this.updateDuration(!e.endList),
  21582. this.tech_.paused() || (this.mainSegmentLoader_.load(), this.audioSegmentLoader_ && this.audioSegmentLoader_.load())
  21583. }),
  21584. (t.triggerPresenceUsage_ = function (e, t) {
  21585. var i,
  21586. n = e.mediaGroups || {},
  21587. r = !0,
  21588. e = Object.keys(n.AUDIO)
  21589. for (i in n.AUDIO) for (var a in n.AUDIO[i]) n.AUDIO[i][a].uri || (r = !1)
  21590. r && (this.tech_.trigger({ type: 'usage', name: 'vhs-demuxed' }), this.tech_.trigger({ type: 'usage', name: 'hls-demuxed' })),
  21591. Object.keys(n.SUBTITLES).length && (this.tech_.trigger({ type: 'usage', name: 'vhs-webvtt' }), this.tech_.trigger({ type: 'usage', name: 'hls-webvtt' })),
  21592. Ql.Playlist.isAes(t) && (this.tech_.trigger({ type: 'usage', name: 'vhs-aes' }), this.tech_.trigger({ type: 'usage', name: 'hls-aes' })),
  21593. e.length &&
  21594. 1 < Object.keys(n.AUDIO[e[0]]).length &&
  21595. (this.tech_.trigger({ type: 'usage', name: 'vhs-alternate-audio' }), this.tech_.trigger({ type: 'usage', name: 'hls-alternate-audio' })),
  21596. this.useCueTags_ && (this.tech_.trigger({ type: 'usage', name: 'vhs-playlist-cue-tags' }), this.tech_.trigger({ type: 'usage', name: 'hls-playlist-cue-tags' }))
  21597. }),
  21598. (t.shouldSwitchToMedia_ = function (e) {
  21599. var t = this.masterPlaylistLoader_.media() || this.masterPlaylistLoader_.pendingMedia_,
  21600. i = this.tech_.currentTime(),
  21601. n = this.bufferLowWaterLine(),
  21602. r = this.bufferHighWaterLine()
  21603. return (function (e) {
  21604. var t = e.currentPlaylist,
  21605. i = e.buffered,
  21606. n = e.currentTime,
  21607. r = e.nextPlaylist,
  21608. a = e.bufferLowWaterLine,
  21609. s = e.bufferHighWaterLine,
  21610. o = e.duration,
  21611. u = e.experimentalBufferBasedABR,
  21612. l = e.log
  21613. if (!r) return tr.log.warn('We received no playlist to switch to. Please check your stream.'), !1
  21614. var c = 'allowing switch ' + ((t && t.id) || 'null') + ' -> ' + r.id
  21615. if (!t) return l(c + ' as current playlist is not set'), !0
  21616. if (r.id === t.id) return !1
  21617. e = Boolean(Uo(i, n).length)
  21618. if (!t.endList)
  21619. return e || 'number' != typeof t.partTargetDuration
  21620. ? (l(c + ' as current playlist is live'), !0)
  21621. : (l('not ' + c + " as current playlist is live llhls, but currentTime isn't in buffered."), !1)
  21622. ;(i = qo(i, n)), (n = u ? El.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE : El.MAX_BUFFER_LOW_WATER_LINE)
  21623. if (o < n) return l(c + ' as duration < max low water line (' + o + ' < ' + n + ')'), !0
  21624. ;(n = r.attributes.BANDWIDTH), (r = t.attributes.BANDWIDTH)
  21625. if (n < r && (!u || i < s)) {
  21626. t = c + ' as next bandwidth < current bandwidth (' + n + ' < ' + r + ')'
  21627. return u && (t += ' and forwardBuffer < bufferHighWaterLine (' + i + ' < ' + s + ')'), l(t), !0
  21628. }
  21629. if ((!u || r < n) && a <= i) {
  21630. a = c + ' as forwardBuffer >= bufferLowWaterLine (' + i + ' >= ' + a + ')'
  21631. return u && (a += ' and next bandwidth > current bandwidth (' + n + ' > ' + r + ')'), l(a), !0
  21632. }
  21633. return l('not ' + c + ' as no switching criteria met'), !1
  21634. })({
  21635. buffered: this.tech_.buffered(),
  21636. currentTime: i,
  21637. currentPlaylist: t,
  21638. nextPlaylist: e,
  21639. bufferLowWaterLine: n,
  21640. bufferHighWaterLine: r,
  21641. duration: this.duration(),
  21642. experimentalBufferBasedABR: this.experimentalBufferBasedABR,
  21643. log: this.logger_,
  21644. })
  21645. }),
  21646. (t.setupSegmentLoaderListeners_ = function () {
  21647. var t = this
  21648. this.experimentalBufferBasedABR ||
  21649. (this.mainSegmentLoader_.on('bandwidthupdate', function () {
  21650. var e = t.selectPlaylist()
  21651. t.shouldSwitchToMedia_(e) && t.switchMedia_(e, 'bandwidthupdate'), t.tech_.trigger('bandwidthupdate')
  21652. }),
  21653. this.mainSegmentLoader_.on('progress', function () {
  21654. t.trigger('progress')
  21655. })),
  21656. this.mainSegmentLoader_.on('error', function () {
  21657. t.blacklistCurrentPlaylist(t.mainSegmentLoader_.error())
  21658. }),
  21659. this.mainSegmentLoader_.on('appenderror', function () {
  21660. ;(t.error = t.mainSegmentLoader_.error_), t.trigger('error')
  21661. }),
  21662. this.mainSegmentLoader_.on('syncinfoupdate', function () {
  21663. t.onSyncInfoUpdate_()
  21664. }),
  21665. this.mainSegmentLoader_.on('timestampoffset', function () {
  21666. t.tech_.trigger({ type: 'usage', name: 'vhs-timestamp-offset' }), t.tech_.trigger({ type: 'usage', name: 'hls-timestamp-offset' })
  21667. }),
  21668. this.audioSegmentLoader_.on('syncinfoupdate', function () {
  21669. t.onSyncInfoUpdate_()
  21670. }),
  21671. this.audioSegmentLoader_.on('appenderror', function () {
  21672. ;(t.error = t.audioSegmentLoader_.error_), t.trigger('error')
  21673. }),
  21674. this.mainSegmentLoader_.on('ended', function () {
  21675. t.logger_('main segment loader ended'), t.onEndOfStream()
  21676. }),
  21677. this.mainSegmentLoader_.on('earlyabort', function (e) {
  21678. t.experimentalBufferBasedABR ||
  21679. (t.delegateLoaders_('all', ['abort']),
  21680. t.blacklistCurrentPlaylist({ message: "Aborted early because there isn't enough bandwidth to complete the request without rebuffering." }, 120))
  21681. })
  21682. function e() {
  21683. if (!t.sourceUpdater_.hasCreatedSourceBuffers()) return t.tryToCreateSourceBuffers_()
  21684. var e = t.getCodecsOrExclude_()
  21685. e && t.sourceUpdater_.addOrChangeSourceBuffers(e)
  21686. }
  21687. this.mainSegmentLoader_.on('trackinfo', e),
  21688. this.audioSegmentLoader_.on('trackinfo', e),
  21689. this.mainSegmentLoader_.on('fmp4', function () {
  21690. t.triggeredFmp4Usage || (t.tech_.trigger({ type: 'usage', name: 'vhs-fmp4' }), t.tech_.trigger({ type: 'usage', name: 'hls-fmp4' }), (t.triggeredFmp4Usage = !0))
  21691. }),
  21692. this.audioSegmentLoader_.on('fmp4', function () {
  21693. t.triggeredFmp4Usage || (t.tech_.trigger({ type: 'usage', name: 'vhs-fmp4' }), t.tech_.trigger({ type: 'usage', name: 'hls-fmp4' }), (t.triggeredFmp4Usage = !0))
  21694. }),
  21695. this.audioSegmentLoader_.on('ended', function () {
  21696. t.logger_('audioSegmentLoader ended'), t.onEndOfStream()
  21697. })
  21698. }),
  21699. (t.mediaSecondsLoaded_ = function () {
  21700. return Math.max(this.audioSegmentLoader_.mediaSecondsLoaded + this.mainSegmentLoader_.mediaSecondsLoaded)
  21701. }),
  21702. (t.load = function () {
  21703. this.mainSegmentLoader_.load(),
  21704. this.mediaTypes_.AUDIO.activePlaylistLoader && this.audioSegmentLoader_.load(),
  21705. this.mediaTypes_.SUBTITLES.activePlaylistLoader && this.subtitleSegmentLoader_.load()
  21706. }),
  21707. (t.smoothQualityChange_ = function (e) {
  21708. void 0 === e && (e = this.selectPlaylist()), this.fastQualityChange_(e)
  21709. }),
  21710. (t.fastQualityChange_ = function (e) {
  21711. var t = this
  21712. ;(e = void 0 === e ? this.selectPlaylist() : e) !== this.masterPlaylistLoader_.media()
  21713. ? (this.switchMedia_(e, 'fast-quality'),
  21714. this.mainSegmentLoader_.resetEverything(function () {
  21715. tr.browser.IE_VERSION || tr.browser.IS_EDGE ? t.tech_.setCurrentTime(t.tech_.currentTime() + 0.04) : t.tech_.setCurrentTime(t.tech_.currentTime())
  21716. }))
  21717. : this.logger_('skipping fastQualityChange because new media is same as old')
  21718. }),
  21719. (t.play = function () {
  21720. if (!this.setupFirstPlay()) {
  21721. this.tech_.ended() && this.tech_.setCurrentTime(0), this.hasPlayed_ && this.load()
  21722. var e = this.tech_.seekable()
  21723. return this.tech_.duration() === 1 / 0 && this.tech_.currentTime() < e.start(0) ? this.tech_.setCurrentTime(e.end(e.length - 1)) : void 0
  21724. }
  21725. }),
  21726. (t.setupFirstPlay = function () {
  21727. var e = this,
  21728. t = this.masterPlaylistLoader_.media()
  21729. if (!t || this.tech_.paused() || this.hasPlayed_) return !1
  21730. if (!t.endList) {
  21731. var i = this.seekable()
  21732. if (!i.length) return !1
  21733. if (tr.browser.IE_VERSION && 0 === this.tech_.readyState())
  21734. return (
  21735. this.tech_.one('loadedmetadata', function () {
  21736. e.trigger('firstplay'), e.tech_.setCurrentTime(i.end(0)), (e.hasPlayed_ = !0)
  21737. }),
  21738. !1
  21739. )
  21740. this.trigger('firstplay'), this.tech_.setCurrentTime(i.end(0))
  21741. }
  21742. return (this.hasPlayed_ = !0), this.load(), !0
  21743. }),
  21744. (t.handleSourceOpen_ = function () {
  21745. var e
  21746. this.tryToCreateSourceBuffers_(),
  21747. !this.tech_.autoplay() || ('undefined' != typeof (e = this.tech_.play()) && 'function' == typeof e.then && e.then(null, function (e) {})),
  21748. this.trigger('sourceopen')
  21749. }),
  21750. (t.handleSourceEnded_ = function () {
  21751. var e, t
  21752. !this.inbandTextTracks_.metadataTrack_ ||
  21753. ((e = this.inbandTextTracks_.metadataTrack_.cues) && e.length && ((t = this.duration()), (e[e.length - 1].endTime = isNaN(t) || Math.abs(t) === 1 / 0 ? Number.MAX_VALUE : t)))
  21754. }),
  21755. (t.handleDurationChange_ = function () {
  21756. this.tech_.trigger('durationchange')
  21757. }),
  21758. (t.onEndOfStream = function () {
  21759. var e,
  21760. t = this.mainSegmentLoader_.ended_
  21761. ;(t = this.mediaTypes_.AUDIO.activePlaylistLoader ? (((e = this.mainSegmentLoader_.getCurrentMediaInfo_()) && !e.hasVideo) || t) && this.audioSegmentLoader_.ended_ : t) &&
  21762. (this.stopABRTimer_(), this.sourceUpdater_.endOfStream())
  21763. }),
  21764. (t.stuckAtPlaylistEnd_ = function (e) {
  21765. if (!this.seekable().length) return !1
  21766. var t = this.syncController_.getExpiredTime(e, this.duration())
  21767. if (null === t) return !1
  21768. var i = Ql.Playlist.playlistEnd(e, t),
  21769. e = this.tech_.currentTime(),
  21770. t = this.tech_.buffered()
  21771. if (!t.length) return i - e <= 0.1
  21772. t = t.end(t.length - 1)
  21773. return t - e <= 0.1 && i - t <= 0.1
  21774. }),
  21775. (t.blacklistCurrentPlaylist = function (e, t) {
  21776. var i = (e = void 0 === e ? {} : e).playlist || this.masterPlaylistLoader_.media()
  21777. if (((t = t || e.blacklistDuration || this.blacklistDuration), !i))
  21778. return (this.error = e), void ('open' !== this.mediaSource.readyState ? this.trigger('error') : this.sourceUpdater_.endOfStream('network'))
  21779. i.playlistErrors_++
  21780. var n,
  21781. r = this.masterPlaylistLoader_.master.playlists,
  21782. a = r.filter(eu),
  21783. s = 1 === a.length && a[0] === i
  21784. if (1 === r.length && t !== 1 / 0)
  21785. return (
  21786. tr.log.warn('Problem encountered with playlist ' + i.id + '. Trying again since it is the only playlist.'),
  21787. this.tech_.trigger('retryplaylist'),
  21788. this.masterPlaylistLoader_.load(s)
  21789. )
  21790. s &&
  21791. ((n = !1),
  21792. r.forEach(function (e) {
  21793. var t
  21794. e === i || ('undefined' != typeof (t = e.excludeUntil) && t !== 1 / 0 && ((n = !0), delete e.excludeUntil))
  21795. }),
  21796. n && (tr.log.warn('Removing other playlists from the exclusion list because the last rendition is about to be excluded.'), this.tech_.trigger('retryplaylist'))),
  21797. (a = i.playlistErrors_ > this.maxPlaylistRetries ? 1 / 0 : Date.now() + 1e3 * t),
  21798. (i.excludeUntil = a),
  21799. e.reason && (i.lastExcludeReason_ = e.reason),
  21800. this.tech_.trigger('blacklistplaylist'),
  21801. this.tech_.trigger({ type: 'usage', name: 'vhs-rendition-blacklisted' }),
  21802. this.tech_.trigger({ type: 'usage', name: 'hls-rendition-blacklisted' })
  21803. r = this.selectPlaylist()
  21804. if (!r) return (this.error = 'Playback cannot continue. No available working or supported playlists.'), void this.trigger('error')
  21805. ;(t = e.internal ? this.logger_ : tr.log.warn), (a = e.message ? ' ' + e.message : '')
  21806. t((e.internal ? 'Internal problem' : 'Problem') + ' encountered with playlist ' + i.id + '.' + a + ' Switching to playlist ' + r.id + '.'),
  21807. r.attributes.AUDIO !== i.attributes.AUDIO && this.delegateLoaders_('audio', ['abort', 'pause']),
  21808. r.attributes.SUBTITLES !== i.attributes.SUBTITLES && this.delegateLoaders_('subtitle', ['abort', 'pause']),
  21809. this.delegateLoaders_('main', ['abort', 'pause'])
  21810. ;(a = (r.targetDuration / 2) * 1e3 || 5e3), (a = 'number' == typeof r.lastRequest && Date.now() - r.lastRequest <= a)
  21811. return this.switchMedia_(r, 'exclude', s || a)
  21812. }),
  21813. (t.pauseLoading = function () {
  21814. this.delegateLoaders_('all', ['abort', 'pause']), this.stopABRTimer_()
  21815. }),
  21816. (t.delegateLoaders_ = function (i, e) {
  21817. var n = this,
  21818. r = [],
  21819. t = 'all' === i
  21820. ;(!t && 'main' !== i) || r.push(this.masterPlaylistLoader_)
  21821. var a = []
  21822. ;(!t && 'audio' !== i) || a.push('AUDIO'),
  21823. (!t && 'subtitle' !== i) || (a.push('CLOSED-CAPTIONS'), a.push('SUBTITLES')),
  21824. a.forEach(function (e) {
  21825. e = n.mediaTypes_[e] && n.mediaTypes_[e].activePlaylistLoader
  21826. e && r.push(e)
  21827. }),
  21828. ['main', 'audio', 'subtitle'].forEach(function (e) {
  21829. var t = n[e + 'SegmentLoader_']
  21830. !t || (i !== e && 'all' !== i) || r.push(t)
  21831. }),
  21832. r.forEach(function (t) {
  21833. return e.forEach(function (e) {
  21834. 'function' == typeof t[e] && t[e]()
  21835. })
  21836. })
  21837. }),
  21838. (t.setCurrentTime = function (e) {
  21839. var t = Uo(this.tech_.buffered(), e)
  21840. return this.masterPlaylistLoader_ && this.masterPlaylistLoader_.media() && this.masterPlaylistLoader_.media().segments
  21841. ? t && t.length
  21842. ? e
  21843. : (this.mainSegmentLoader_.resetEverything(),
  21844. this.mainSegmentLoader_.abort(),
  21845. this.mediaTypes_.AUDIO.activePlaylistLoader && (this.audioSegmentLoader_.resetEverything(), this.audioSegmentLoader_.abort()),
  21846. this.mediaTypes_.SUBTITLES.activePlaylistLoader && (this.subtitleSegmentLoader_.resetEverything(), this.subtitleSegmentLoader_.abort()),
  21847. void this.load())
  21848. : 0
  21849. }),
  21850. (t.duration = function () {
  21851. if (!this.masterPlaylistLoader_) return 0
  21852. var e = this.masterPlaylistLoader_.media()
  21853. return e ? (e.endList ? (this.mediaSource ? this.mediaSource.duration : Ql.Playlist.duration(e)) : 1 / 0) : 0
  21854. }),
  21855. (t.seekable = function () {
  21856. return this.seekable_
  21857. }),
  21858. (t.onSyncInfoUpdate_ = function () {
  21859. var e
  21860. if (this.masterPlaylistLoader_) {
  21861. var t = this.masterPlaylistLoader_.media()
  21862. if (t) {
  21863. var i = this.syncController_.getExpiredTime(t, this.duration())
  21864. if (null !== i) {
  21865. var n,
  21866. r,
  21867. a = this.masterPlaylistLoader_.master,
  21868. s = Ql.Playlist.seekable(t, i, Ql.Playlist.liveEdgeDelay(a, t))
  21869. if (0 !== s.length) {
  21870. if (this.mediaTypes_.AUDIO.activePlaylistLoader) {
  21871. if (((t = this.mediaTypes_.AUDIO.activePlaylistLoader.media()), null === (i = this.syncController_.getExpiredTime(t, this.duration())))) return
  21872. if (0 === (e = Ql.Playlist.seekable(t, i, Ql.Playlist.liveEdgeDelay(a, t))).length) return
  21873. }
  21874. this.seekable_ && this.seekable_.length && ((n = this.seekable_.end(0)), (r = this.seekable_.start(0))),
  21875. !e || e.start(0) > s.end(0) || s.start(0) > e.end(0)
  21876. ? (this.seekable_ = s)
  21877. : (this.seekable_ = tr.createTimeRanges([[(e.start(0) > s.start(0) ? e : s).start(0), (e.end(0) < s.end(0) ? e : s).end(0)]])),
  21878. (this.seekable_ && this.seekable_.length && this.seekable_.end(0) === n && this.seekable_.start(0) === r) ||
  21879. (this.logger_('seekable updated [' + Fo(this.seekable_) + ']'), this.tech_.trigger('seekablechanged'))
  21880. }
  21881. }
  21882. }
  21883. }
  21884. }),
  21885. (t.updateDuration = function (e) {
  21886. if ((this.updateDuration_ && (this.mediaSource.removeEventListener('sourceopen', this.updateDuration_), (this.updateDuration_ = null)), 'open' !== this.mediaSource.readyState))
  21887. return (this.updateDuration_ = this.updateDuration.bind(this, e)), void this.mediaSource.addEventListener('sourceopen', this.updateDuration_)
  21888. if (e) {
  21889. var t = this.seekable()
  21890. return t.length ? void ((isNaN(this.mediaSource.duration) || this.mediaSource.duration < t.end(t.length - 1)) && this.sourceUpdater_.setDuration(t.end(t.length - 1))) : void 0
  21891. }
  21892. ;(e = this.tech_.buffered()), (t = Ql.Playlist.duration(this.masterPlaylistLoader_.media()))
  21893. 0 < e.length && (t = Math.max(t, e.end(e.length - 1))), this.mediaSource.duration !== t && this.sourceUpdater_.setDuration(t)
  21894. }),
  21895. (t.dispose = function () {
  21896. var n = this
  21897. this.trigger('dispose'),
  21898. this.decrypter_.terminate(),
  21899. this.masterPlaylistLoader_.dispose(),
  21900. this.mainSegmentLoader_.dispose(),
  21901. this.loadOnPlay_ && this.tech_.off('play', this.loadOnPlay_),
  21902. ['AUDIO', 'SUBTITLES'].forEach(function (e) {
  21903. var t,
  21904. i = n.mediaTypes_[e].groups
  21905. for (t in i)
  21906. i[t].forEach(function (e) {
  21907. e.playlistLoader && e.playlistLoader.dispose()
  21908. })
  21909. }),
  21910. this.audioSegmentLoader_.dispose(),
  21911. this.subtitleSegmentLoader_.dispose(),
  21912. this.sourceUpdater_.dispose(),
  21913. this.timelineChangeController_.dispose(),
  21914. this.stopABRTimer_(),
  21915. this.updateDuration_ && this.mediaSource.removeEventListener('sourceopen', this.updateDuration_),
  21916. this.mediaSource.removeEventListener('durationchange', this.handleDurationChange_),
  21917. this.mediaSource.removeEventListener('sourceopen', this.handleSourceOpen_),
  21918. this.mediaSource.removeEventListener('sourceended', this.handleSourceEnded_),
  21919. this.off()
  21920. }),
  21921. (t.master = function () {
  21922. return this.masterPlaylistLoader_.master
  21923. }),
  21924. (t.media = function () {
  21925. return this.masterPlaylistLoader_.media() || this.initialMedia_
  21926. }),
  21927. (t.areMediaTypesKnown_ = function () {
  21928. var e = !!this.mediaTypes_.AUDIO.activePlaylistLoader,
  21929. t = !!this.mainSegmentLoader_.getCurrentMediaInfo_(),
  21930. e = !e || !!this.audioSegmentLoader_.getCurrentMediaInfo_()
  21931. return t && e
  21932. }),
  21933. (t.getCodecsOrExclude_ = function () {
  21934. var n = this,
  21935. r = { main: this.mainSegmentLoader_.getCurrentMediaInfo_() || {}, audio: this.audioSegmentLoader_.getCurrentMediaInfo_() || {} }
  21936. r.video = r.main
  21937. var e = $u(this.master(), this.media()),
  21938. a = {},
  21939. t = !!this.mediaTypes_.AUDIO.activePlaylistLoader
  21940. if (
  21941. (r.main.hasVideo && (a.video = e.video || r.main.videoCodec || 'avc1.4d400d'),
  21942. r.main.isMuxed && (a.video += ',' + (e.audio || r.main.audioCodec || Lr)),
  21943. ((r.main.hasAudio && !r.main.isMuxed) || r.audio.hasAudio || t) &&
  21944. ((a.audio = e.audio || r.main.audioCodec || r.audio.audioCodec || Lr), (r.audio.isFmp4 = (r.main.hasAudio && !r.main.isMuxed ? r.main : r.audio).isFmp4)),
  21945. a.audio || a.video)
  21946. ) {
  21947. var s,
  21948. i,
  21949. o = {}
  21950. if (
  21951. (['video', 'audio'].forEach(function (e) {
  21952. var t, i
  21953. a.hasOwnProperty(e) &&
  21954. ((t = r[e].isFmp4), (i = a[e]), !(t ? gr : yr)(i)) &&
  21955. ((i = r[e].isFmp4 ? 'browser' : 'muxer'), (o[i] = o[i] || []), o[i].push(a[e]), 'audio' === e && (s = i))
  21956. }),
  21957. t &&
  21958. s &&
  21959. this.media().attributes.AUDIO &&
  21960. ((i = this.media().attributes.AUDIO),
  21961. this.master().playlists.forEach(function (e) {
  21962. ;(e.attributes && e.attributes.AUDIO) === i && e !== n.media() && (e.excludeUntil = 1 / 0)
  21963. }),
  21964. this.logger_('excluding audio group ' + i + ' as ' + s + ' does not support codec(s): "' + a.audio + '"')),
  21965. !Object.keys(o).length)
  21966. ) {
  21967. if (this.sourceUpdater_.hasCreatedSourceBuffers() && !this.sourceUpdater_.canChangeType()) {
  21968. var u = []
  21969. if (
  21970. (['video', 'audio'].forEach(function (e) {
  21971. var t = (pr(n.sourceUpdater_.codecs[e] || '')[0] || {}).type,
  21972. i = (pr(a[e] || '')[0] || {}).type
  21973. t && i && t.toLowerCase() !== i.toLowerCase() && u.push('"' + n.sourceUpdater_.codecs[e] + '" -> "' + a[e] + '"')
  21974. }),
  21975. u.length)
  21976. )
  21977. return void this.blacklistCurrentPlaylist({
  21978. playlist: this.media(),
  21979. message: 'Codec switching not supported: ' + u.join(', ') + '.',
  21980. blacklistDuration: 1 / 0,
  21981. internal: !0,
  21982. })
  21983. }
  21984. return a
  21985. }
  21986. t =
  21987. Object.keys(o).reduce(function (e, t) {
  21988. return e && (e += ', '), (e += t + ' does not support codec(s): "' + o[t].join(',') + '"')
  21989. }, '') + '.'
  21990. this.blacklistCurrentPlaylist({ playlist: this.media(), internal: !0, message: t, blacklistDuration: 1 / 0 })
  21991. } else this.blacklistCurrentPlaylist({ playlist: this.media(), message: 'Could not determine codecs for playlist.', blacklistDuration: 1 / 0 })
  21992. }),
  21993. (t.tryToCreateSourceBuffers_ = function () {
  21994. var e
  21995. 'open' !== this.mediaSource.readyState ||
  21996. this.sourceUpdater_.hasCreatedSourceBuffers() ||
  21997. !this.areMediaTypesKnown_() ||
  21998. ((e = this.getCodecsOrExclude_()) && (this.sourceUpdater_.createSourceBuffers(e), (e = [e.video, e.audio].filter(Boolean).join(',')), this.excludeIncompatibleVariants_(e)))
  21999. }),
  22000. (t.excludeUnsupportedVariants_ = function () {
  22001. var n = this,
  22002. r = this.master().playlists,
  22003. a = []
  22004. Object.keys(r).forEach(function (e) {
  22005. var t,
  22006. i = r[e]
  22007. ;-1 === a.indexOf(i.id) &&
  22008. (a.push(i.id),
  22009. (t = []),
  22010. !(e = $u(n.master, i)).audio || yr(e.audio) || gr(e.audio) || t.push('audio codec ' + e.audio),
  22011. !e.video || yr(e.video) || gr(e.video) || t.push('video codec ' + e.video),
  22012. e.text && 'stpp.ttml.im1t' === e.text && t.push('text codec ' + e.text),
  22013. t.length && ((i.excludeUntil = 1 / 0), n.logger_('excluding ' + i.id + ' for unsupported: ' + t.join(', '))))
  22014. })
  22015. }),
  22016. (t.excludeIncompatibleVariants_ = function (e) {
  22017. var r = this,
  22018. a = [],
  22019. s = this.master().playlists,
  22020. e = Yu(pr(e)),
  22021. o = Qu(e),
  22022. u = (e.video && pr(e.video)[0]) || null,
  22023. l = (e.audio && pr(e.audio)[0]) || null
  22024. Object.keys(s).forEach(function (e) {
  22025. var t,
  22026. i,
  22027. n = s[e]
  22028. ;-1 === a.indexOf(n.id) &&
  22029. n.excludeUntil !== 1 / 0 &&
  22030. (a.push(n.id),
  22031. (t = []),
  22032. (i = $u(r.masterPlaylistLoader_.master, n)),
  22033. (e = Qu(i)),
  22034. (i.audio || i.video) &&
  22035. (e !== o && t.push('codec count "' + e + '" !== "' + o + '"'),
  22036. r.sourceUpdater_.canChangeType() ||
  22037. ((e = (i.video && pr(i.video)[0]) || null),
  22038. (i = (i.audio && pr(i.audio)[0]) || null),
  22039. e && u && e.type.toLowerCase() !== u.type.toLowerCase() && t.push('video codec "' + e.type + '" !== "' + u.type + '"'),
  22040. i && l && i.type.toLowerCase() !== l.type.toLowerCase() && t.push('audio codec "' + i.type + '" !== "' + l.type + '"')),
  22041. t.length && ((n.excludeUntil = 1 / 0), r.logger_('blacklisting ' + n.id + ': ' + t.join(' && ')))))
  22042. })
  22043. }),
  22044. (t.updateAdCues_ = function (e) {
  22045. var t = 0,
  22046. i = this.seekable()
  22047. i.length && (t = i.start(0)),
  22048. (function (e, t, i) {
  22049. if ((void 0 === i && (i = 0), e.segments))
  22050. for (var n = i, r = 0; r < e.segments.length; r++) {
  22051. var a,
  22052. s,
  22053. o,
  22054. u = e.segments[r]
  22055. if (
  22056. (o =
  22057. o ||
  22058. (function (e, t) {
  22059. for (var i = e.cues, n = 0; n < i.length; n++) {
  22060. var r = i[n]
  22061. if (t >= r.adStartTime && t <= r.adEndTime) return r
  22062. }
  22063. return null
  22064. })(t, n + u.duration / 2))
  22065. ) {
  22066. if ('cueIn' in u) {
  22067. ;(o.endTime = n), (o.adEndTime = n), (n += u.duration), (o = null)
  22068. continue
  22069. }
  22070. if (n < o.endTime) {
  22071. n += u.duration
  22072. continue
  22073. }
  22074. o.endTime += u.duration
  22075. } else
  22076. 'cueOut' in u && (((o = new window.VTTCue(n, n + u.duration, u.cueOut)).adStartTime = n), (o.adEndTime = n + parseFloat(u.cueOut)), t.addCue(o)),
  22077. 'cueOutCont' in u &&
  22078. ((a = (s = u.cueOutCont.split('/').map(parseFloat))[0]),
  22079. (s = s[1]),
  22080. ((o = new window.VTTCue(n, n + u.duration, '')).adStartTime = n - a),
  22081. (o.adEndTime = o.adStartTime + s),
  22082. t.addCue(o))
  22083. n += u.duration
  22084. }
  22085. })(e, this.cueTagsTrack_, t)
  22086. }),
  22087. (t.goalBufferLength = function () {
  22088. var e = this.tech_.currentTime(),
  22089. t = El.GOAL_BUFFER_LENGTH,
  22090. i = El.GOAL_BUFFER_LENGTH_RATE,
  22091. n = Math.max(t, El.MAX_GOAL_BUFFER_LENGTH)
  22092. return Math.min(t + e * i, n)
  22093. }),
  22094. (t.bufferLowWaterLine = function () {
  22095. var e = this.tech_.currentTime(),
  22096. t = El.BUFFER_LOW_WATER_LINE,
  22097. i = El.BUFFER_LOW_WATER_LINE_RATE,
  22098. n = Math.max(t, El.MAX_BUFFER_LOW_WATER_LINE),
  22099. r = Math.max(t, El.EXPERIMENTAL_MAX_BUFFER_LOW_WATER_LINE)
  22100. return Math.min(t + e * i, this.experimentalBufferBasedABR ? r : n)
  22101. }),
  22102. (t.bufferHighWaterLine = function () {
  22103. return El.BUFFER_HIGH_WATER_LINE
  22104. }),
  22105. e
  22106. )
  22107. })(tr.EventTarget),
  22108. Tc = ['seeking', 'seeked', 'pause', 'playing', 'error'],
  22109. Sc = (function () {
  22110. function e(e) {
  22111. var i = this
  22112. ;(this.masterPlaylistController_ = e.masterPlaylistController),
  22113. (this.tech_ = e.tech),
  22114. (this.seekable = e.seekable),
  22115. (this.allowSeeksWithinUnsafeLiveWindow = e.allowSeeksWithinUnsafeLiveWindow),
  22116. (this.liveRangeSafeTimeDelta = e.liveRangeSafeTimeDelta),
  22117. (this.media = e.media),
  22118. (this.consecutiveUpdates = 0),
  22119. (this.lastRecordedTime = null),
  22120. (this.timer_ = null),
  22121. (this.checkCurrentTimeTimeout_ = null),
  22122. (this.logger_ = Ro('PlaybackWatcher')),
  22123. this.logger_('initialize')
  22124. function t() {
  22125. return i.monitorCurrentTime_()
  22126. }
  22127. function n() {
  22128. return i.monitorCurrentTime_()
  22129. }
  22130. function r() {
  22131. return i.techWaiting_()
  22132. }
  22133. function a() {
  22134. return i.cancelTimer_()
  22135. }
  22136. var s = this.masterPlaylistController_,
  22137. o = ['main', 'subtitle', 'audio'],
  22138. u = {}
  22139. o.forEach(function (e) {
  22140. ;(u[e] = {
  22141. reset: function () {
  22142. return i.resetSegmentDownloads_(e)
  22143. },
  22144. updateend: function () {
  22145. return i.checkSegmentDownloads_(e)
  22146. },
  22147. }),
  22148. s[e + 'SegmentLoader_'].on('appendsdone', u[e].updateend),
  22149. s[e + 'SegmentLoader_'].on('playlistupdate', u[e].reset),
  22150. i.tech_.on(['seeked', 'seeking'], u[e].reset)
  22151. })
  22152. function l(t) {
  22153. ;['main', 'audio'].forEach(function (e) {
  22154. s[e + 'SegmentLoader_'][t]('appended', i.seekingAppendCheck_)
  22155. })
  22156. }
  22157. ;(this.seekingAppendCheck_ = function () {
  22158. i.fixesBadSeeks_() && ((i.consecutiveUpdates = 0), (i.lastRecordedTime = i.tech_.currentTime()), l('off'))
  22159. }),
  22160. (this.clearSeekingAppendCheck_ = function () {
  22161. return l('off')
  22162. }),
  22163. (this.watchForBadSeeking_ = function () {
  22164. i.clearSeekingAppendCheck_(), l('on')
  22165. }),
  22166. this.tech_.on('seeked', this.clearSeekingAppendCheck_),
  22167. this.tech_.on('seeking', this.watchForBadSeeking_),
  22168. this.tech_.on('waiting', r),
  22169. this.tech_.on(Tc, a),
  22170. this.tech_.on('canplay', n),
  22171. this.tech_.one('play', t),
  22172. (this.dispose = function () {
  22173. i.clearSeekingAppendCheck_(),
  22174. i.logger_('dispose'),
  22175. i.tech_.off('waiting', r),
  22176. i.tech_.off(Tc, a),
  22177. i.tech_.off('canplay', n),
  22178. i.tech_.off('play', t),
  22179. i.tech_.off('seeking', i.watchForBadSeeking_),
  22180. i.tech_.off('seeked', i.clearSeekingAppendCheck_),
  22181. o.forEach(function (e) {
  22182. s[e + 'SegmentLoader_'].off('appendsdone', u[e].updateend), s[e + 'SegmentLoader_'].off('playlistupdate', u[e].reset), i.tech_.off(['seeked', 'seeking'], u[e].reset)
  22183. }),
  22184. i.checkCurrentTimeTimeout_ && window.clearTimeout(i.checkCurrentTimeTimeout_),
  22185. i.cancelTimer_()
  22186. })
  22187. }
  22188. var t = e.prototype
  22189. return (
  22190. (t.monitorCurrentTime_ = function () {
  22191. this.checkCurrentTime_(),
  22192. this.checkCurrentTimeTimeout_ && window.clearTimeout(this.checkCurrentTimeTimeout_),
  22193. (this.checkCurrentTimeTimeout_ = window.setTimeout(this.monitorCurrentTime_.bind(this), 250))
  22194. }),
  22195. (t.resetSegmentDownloads_ = function (e) {
  22196. var t = this.masterPlaylistController_[e + 'SegmentLoader_']
  22197. 0 < this[e + 'StalledDownloads_'] && this.logger_('resetting possible stalled download count for ' + e + ' loader'),
  22198. (this[e + 'StalledDownloads_'] = 0),
  22199. (this[e + 'Buffered_'] = t.buffered_())
  22200. }),
  22201. (t.checkSegmentDownloads_ = function (e) {
  22202. var t = this.masterPlaylistController_,
  22203. i = t[e + 'SegmentLoader_'],
  22204. n = i.buffered_(),
  22205. r = (function (e, t) {
  22206. if (e === t) return !1
  22207. if ((!e && t) || (!t && e)) return !0
  22208. if (e.length !== t.length) return !0
  22209. for (var i = 0; i < e.length; i++) if (e.start(i) !== t.start(i) || e.end(i) !== t.end(i)) return !0
  22210. return !1
  22211. })(this[e + 'Buffered_'], n)
  22212. ;(this[e + 'Buffered_'] = n),
  22213. r
  22214. ? this.resetSegmentDownloads_(e)
  22215. : (this[e + 'StalledDownloads_']++,
  22216. this.logger_('found #' + this[e + 'StalledDownloads_'] + ' ' + e + ' appends that did not increase buffer (possible stalled download)', {
  22217. playlistId: i.playlist_ && i.playlist_.id,
  22218. buffered: jo(n),
  22219. }),
  22220. this[e + 'StalledDownloads_'] < 10 ||
  22221. (this.logger_(e + ' loader stalled download exclusion'),
  22222. this.resetSegmentDownloads_(e),
  22223. this.tech_.trigger({ type: 'usage', name: 'vhs-' + e + '-download-exclusion' }),
  22224. 'subtitle' !== e && t.blacklistCurrentPlaylist({ message: 'Excessive ' + e + ' segment downloading detected.' }, 1 / 0)))
  22225. }),
  22226. (t.checkCurrentTime_ = function () {
  22227. if (!this.tech_.paused() && !this.tech_.seeking()) {
  22228. var e = this.tech_.currentTime(),
  22229. t = this.tech_.buffered()
  22230. if (this.lastRecordedTime === e && (!t.length || e + 0.1 >= t.end(t.length - 1))) return this.techWaiting_()
  22231. 5 <= this.consecutiveUpdates && e === this.lastRecordedTime
  22232. ? (this.consecutiveUpdates++, this.waiting_())
  22233. : e === this.lastRecordedTime
  22234. ? this.consecutiveUpdates++
  22235. : ((this.consecutiveUpdates = 0), (this.lastRecordedTime = e))
  22236. }
  22237. }),
  22238. (t.cancelTimer_ = function () {
  22239. ;(this.consecutiveUpdates = 0), this.timer_ && (this.logger_('cancelTimer_'), clearTimeout(this.timer_)), (this.timer_ = null)
  22240. }),
  22241. (t.fixesBadSeeks_ = function () {
  22242. if (!this.tech_.seeking()) return !1
  22243. var e,
  22244. t = this.seekable(),
  22245. i = this.tech_.currentTime()
  22246. if (
  22247. (this.afterSeekableWindow_(t, i, this.media(), this.allowSeeksWithinUnsafeLiveWindow) && (e = t.end(t.length - 1)),
  22248. 'undefined' != typeof (e = this.beforeSeekableWindow_(t, i) ? (a = t.start(0)) + (a === t.end(0) ? 0 : 0.1) : e))
  22249. )
  22250. return this.logger_('Trying to seek outside of seekable at time ' + i + ' with seekable range ' + Fo(t) + '. Seeking to ' + e + '.'), this.tech_.setCurrentTime(e), !0
  22251. for (
  22252. var n = this.masterPlaylistController_.sourceUpdater_,
  22253. r = this.tech_.buffered(),
  22254. a = n.audioBuffer ? n.audioBuffered() : null,
  22255. t = n.videoBuffer ? n.videoBuffered() : null,
  22256. n = this.media(),
  22257. s = n.partTargetDuration || 2 * (n.targetDuration - fl),
  22258. o = [a, t],
  22259. u = 0;
  22260. u < o.length;
  22261. u++
  22262. )
  22263. if (o[u]) if (qo(o[u], i) < s) return !1
  22264. r = Bo(r, i)
  22265. return (
  22266. 0 !== r.length &&
  22267. ((e = r.start(0) + 0.1),
  22268. this.logger_('Buffered region starts (' + r.start(0) + ') just beyond seek point (' + i + '). Seeking to ' + e + '.'),
  22269. this.tech_.setCurrentTime(e),
  22270. !0)
  22271. )
  22272. }),
  22273. (t.waiting_ = function () {
  22274. var e, t
  22275. this.techWaiting_() ||
  22276. ((e = this.tech_.currentTime()),
  22277. (t = this.tech_.buffered()),
  22278. (t = Uo(t, e)).length &&
  22279. e + 3 <= t.end(0) &&
  22280. (this.cancelTimer_(),
  22281. this.tech_.setCurrentTime(e),
  22282. this.logger_('Stopped at ' + e + ' while inside a buffered region [' + t.start(0) + ' -> ' + t.end(0) + ']. Attempting to resume playback by seeking to the current time.'),
  22283. this.tech_.trigger({ type: 'usage', name: 'vhs-unknown-waiting' }),
  22284. this.tech_.trigger({ type: 'usage', name: 'hls-unknown-waiting' })))
  22285. }),
  22286. (t.techWaiting_ = function () {
  22287. var e = this.seekable(),
  22288. t = this.tech_.currentTime()
  22289. if (this.tech_.seeking() || null !== this.timer_) return !0
  22290. if (this.beforeSeekableWindow_(e, t)) {
  22291. var i = e.end(e.length - 1)
  22292. return (
  22293. this.logger_('Fell out of live window at time ' + t + '. Seeking to live point (seekable end) ' + i),
  22294. this.cancelTimer_(),
  22295. this.tech_.setCurrentTime(i),
  22296. this.tech_.trigger({ type: 'usage', name: 'vhs-live-resync' }),
  22297. this.tech_.trigger({ type: 'usage', name: 'hls-live-resync' }),
  22298. !0
  22299. )
  22300. }
  22301. ;(e = this.tech_.vhs.masterPlaylistController_.sourceUpdater_), (i = this.tech_.buffered())
  22302. if (this.videoUnderflow_({ audioBuffered: e.audioBuffered(), videoBuffered: e.videoBuffered(), currentTime: t }))
  22303. return (
  22304. this.cancelTimer_(),
  22305. this.tech_.setCurrentTime(t),
  22306. this.tech_.trigger({ type: 'usage', name: 'vhs-video-underflow' }),
  22307. this.tech_.trigger({ type: 'usage', name: 'hls-video-underflow' }),
  22308. !0
  22309. )
  22310. e = Bo(i, t)
  22311. if (0 < e.length) {
  22312. i = e.start(0) - t
  22313. return (
  22314. this.logger_('Stopped at ' + t + ', setting timer for ' + i + ', seeking to ' + e.start(0)),
  22315. this.cancelTimer_(),
  22316. (this.timer_ = setTimeout(this.skipTheGap_.bind(this), 1e3 * i, t)),
  22317. !0
  22318. )
  22319. }
  22320. return !1
  22321. }),
  22322. (t.afterSeekableWindow_ = function (e, t, i, n) {
  22323. if ((void 0 === n && (n = !1), !e.length)) return !1
  22324. var r = e.end(e.length - 1) + 0.1
  22325. return (r = !i.endList && n ? e.end(e.length - 1) + 3 * i.targetDuration : r) < t
  22326. }),
  22327. (t.beforeSeekableWindow_ = function (e, t) {
  22328. return !!(e.length && 0 < e.start(0) && t < e.start(0) - this.liveRangeSafeTimeDelta)
  22329. }),
  22330. (t.videoUnderflow_ = function (e) {
  22331. var t,
  22332. i,
  22333. n = e.videoBuffered,
  22334. r = e.audioBuffered,
  22335. a = e.currentTime
  22336. if (n)
  22337. return (
  22338. n.length && r.length
  22339. ? ((i = Uo(n, a - 3)), (e = Uo(n, a)), (r = Uo(r, a)).length && !e.length && i.length && (t = { start: i.end(0), end: r.end(0) }))
  22340. : Bo(n, a).length || (t = this.gapFromVideoUnderflow_(n, a)),
  22341. !!t && (this.logger_('Encountered a gap in video from ' + t.start + ' to ' + t.end + '. Seeking to current time ' + a), !0)
  22342. )
  22343. }),
  22344. (t.skipTheGap_ = function (e) {
  22345. var t = this.tech_.buffered(),
  22346. i = this.tech_.currentTime(),
  22347. t = Bo(t, i)
  22348. this.cancelTimer_(),
  22349. 0 !== t.length &&
  22350. i === e &&
  22351. (this.logger_('skipTheGap_:', 'currentTime:', i, 'scheduled currentTime:', e, 'nextRange start:', t.start(0)),
  22352. this.tech_.setCurrentTime(t.start(0) + fl),
  22353. this.tech_.trigger({ type: 'usage', name: 'vhs-gap-skip' }),
  22354. this.tech_.trigger({ type: 'usage', name: 'hls-gap-skip' }))
  22355. }),
  22356. (t.gapFromVideoUnderflow_ = function (e, t) {
  22357. for (
  22358. var i = (function (e) {
  22359. if (e.length < 2) return tr.createTimeRanges()
  22360. for (var t = [], i = 1; i < e.length; i++) {
  22361. var n = e.end(i - 1),
  22362. r = e.start(i)
  22363. t.push([n, r])
  22364. }
  22365. return tr.createTimeRanges(t)
  22366. })(e),
  22367. n = 0;
  22368. n < i.length;
  22369. n++
  22370. ) {
  22371. var r = i.start(n),
  22372. a = i.end(n)
  22373. if (t - r < 4 && 2 < t - r) return { start: r, end: a }
  22374. }
  22375. return null
  22376. }),
  22377. e
  22378. )
  22379. })(),
  22380. wc = {
  22381. errorInterval: 30,
  22382. getSource: function (e) {
  22383. return e(this.tech({ IWillNotUseThisInPlugins: !0 }).currentSource_ || this.currentSource())
  22384. },
  22385. },
  22386. Ec = {
  22387. PlaylistLoader: _l,
  22388. Playlist: gl,
  22389. utils: zt,
  22390. STANDARD_PLAYLIST_SELECTOR: ar,
  22391. INITIAL_PLAYLIST_SELECTOR: function () {
  22392. var t = this,
  22393. e = this.playlists.master.playlists.filter(gl.isEnabled)
  22394. return (
  22395. el(e, tl),
  22396. e.filter(function (e) {
  22397. return !!$u(t.playlists.master, e).video
  22398. })[0] || null
  22399. )
  22400. },
  22401. lastBandwidthSelector: ar,
  22402. movingAverageBandwidthSelector: function (t) {
  22403. var i = -1,
  22404. n = -1
  22405. if (t < 0 || 1 < t) throw new Error('Moving average bandwidth decay must be between 0 and 1.')
  22406. return function () {
  22407. var e = (this.useDevicePixelRatio && window.devicePixelRatio) || 1
  22408. return (
  22409. i < 0 && ((i = this.systemBandwidth), (n = this.systemBandwidth)),
  22410. 0 < this.systemBandwidth && this.systemBandwidth !== n && ((i = t * this.systemBandwidth + (1 - t) * i), (n = this.systemBandwidth)),
  22411. il(
  22412. this.playlists.master,
  22413. i,
  22414. parseInt(Zu(this.tech_.el(), 'width'), 10) * e,
  22415. parseInt(Zu(this.tech_.el(), 'height'), 10) * e,
  22416. this.limitRenditionByPlayerDimensions,
  22417. this.masterPlaylistController_
  22418. )
  22419. )
  22420. }
  22421. },
  22422. comparePlaylistBandwidth: tl,
  22423. comparePlaylistResolution: function (e, t) {
  22424. var i, n
  22425. return (i = (i = e.attributes.RESOLUTION && e.attributes.RESOLUTION.width ? e.attributes.RESOLUTION.width : i) || window.Number.MAX_VALUE) ===
  22426. (n = (n = t.attributes.RESOLUTION && t.attributes.RESOLUTION.width ? t.attributes.RESOLUTION.width : n) || window.Number.MAX_VALUE) &&
  22427. e.attributes.BANDWIDTH &&
  22428. t.attributes.BANDWIDTH
  22429. ? e.attributes.BANDWIDTH - t.attributes.BANDWIDTH
  22430. : i - n
  22431. },
  22432. xhr: yu(),
  22433. }
  22434. Object.keys(El).forEach(function (t) {
  22435. Object.defineProperty(Ec, t, {
  22436. get: function () {
  22437. return tr.log.warn('using Vhs.' + t + ' is UNSAFE be sure you know what you are doing'), El[t]
  22438. },
  22439. set: function (e) {
  22440. tr.log.warn('using Vhs.' + t + ' is UNSAFE be sure you know what you are doing'),
  22441. 'number' != typeof e || e < 0 ? tr.log.warn('value of Vhs.' + t + ' must be greater than or equal to 0') : (El[t] = e)
  22442. },
  22443. })
  22444. })
  22445. function kc(e, t) {
  22446. for (var i = t.media(), n = -1, r = 0; r < e.length; r++)
  22447. if (e[r].id === i.id) {
  22448. n = r
  22449. break
  22450. }
  22451. ;(e.selectedIndex_ = n), e.trigger({ selectedIndex: n, type: 'change' })
  22452. }
  22453. var Cc = 'videojs-vhs'
  22454. Ec.canPlaySource = function () {
  22455. return tr.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")
  22456. }
  22457. function Ic(e) {
  22458. var n = e.player,
  22459. t = e.sourceKeySystems,
  22460. i = e.audioMedia,
  22461. e = e.mainPlaylists
  22462. if (!n.eme.initializeMediaKeys) return Promise.resolve()
  22463. var r,
  22464. e =
  22465. ((e = e = i ? e.concat([i]) : e),
  22466. (r = Object.keys(t)),
  22467. e.reduce(function (e, n) {
  22468. if (!n.contentProtection) return e
  22469. var t = r.reduce(function (e, t) {
  22470. var i = n.contentProtection[t]
  22471. return i && i.pssh && (e[t] = { pssh: i.pssh }), e
  22472. }, {})
  22473. return Object.keys(t).length && e.push(t), e
  22474. }, [])),
  22475. a = [],
  22476. s = []
  22477. return (
  22478. e.forEach(function (e) {
  22479. s.push(
  22480. new Promise(function (e, t) {
  22481. n.tech_.one('keysessioncreated', e)
  22482. })
  22483. ),
  22484. a.push(
  22485. new Promise(function (t, i) {
  22486. n.eme.initializeMediaKeys({ keySystems: e }, function (e) {
  22487. e ? i(e) : t()
  22488. })
  22489. })
  22490. )
  22491. }),
  22492. Promise.race([Promise.all(a), Promise.race(s)])
  22493. )
  22494. }
  22495. function xc(e) {
  22496. var t = e.player
  22497. return (
  22498. !!(e = (function (e, t, i) {
  22499. if (!e) return e
  22500. var n = {}
  22501. t && t.attributes && t.attributes.CODECS && (n = Yu(pr(t.attributes.CODECS))), i && i.attributes && i.attributes.CODECS && (n.audio = i.attributes.CODECS)
  22502. var r,
  22503. a = mr(n.video),
  22504. s = mr(n.audio),
  22505. o = {}
  22506. for (r in e)
  22507. (o[r] = {}),
  22508. s && (o[r].audioContentType = s),
  22509. a && (o[r].videoContentType = a),
  22510. t.contentProtection && t.contentProtection[r] && t.contentProtection[r].pssh && (o[r].pssh = t.contentProtection[r].pssh),
  22511. 'string' == typeof e[r] && (o[r].url = e[r])
  22512. return tr.mergeOptions(e, o)
  22513. })(e.sourceKeySystems, e.media, e.audioMedia)) &&
  22514. (!((t.currentSource().keySystems = e) && !t.eme) || (tr.log.warn('DRM encrypted source cannot be decrypted without a DRM plugin'), !1))
  22515. )
  22516. }
  22517. function Ac() {
  22518. if (!window.localStorage) return null
  22519. var e = window.localStorage.getItem(Cc)
  22520. if (!e) return null
  22521. try {
  22522. return JSON.parse(e)
  22523. } catch (e) {
  22524. return null
  22525. }
  22526. }
  22527. ;(Ec.supportsNativeHls = (function () {
  22528. if (!document || !document.createElement) return !1
  22529. var t = document.createElement('video')
  22530. if (!tr.getTech('Html5').isSupported()) return !1
  22531. return ['application/vnd.apple.mpegurl', 'audio/mpegurl', 'audio/x-mpegurl', 'application/x-mpegurl', 'video/x-mpegurl', 'video/mpegurl', 'application/mpegurl'].some(function (e) {
  22532. return /maybe|probably/i.test(t.canPlayType(e))
  22533. })
  22534. })()),
  22535. (Ec.supportsNativeDash =
  22536. !!(document && document.createElement && tr.getTech('Html5').isSupported()) && /maybe|probably/i.test(document.createElement('video').canPlayType('application/dash+xml'))),
  22537. (Ec.supportsTypeNatively = function (e) {
  22538. return 'hls' === e ? Ec.supportsNativeHls : 'dash' === e && Ec.supportsNativeDash
  22539. }),
  22540. (Ec.isSupported = function () {
  22541. return tr.log.warn("HLS is no longer a tech. Please remove it from your player's techOrder.")
  22542. })
  22543. var Pc = (function (r) {
  22544. function e(e, t, i) {
  22545. var n = r.call(this, t, tr.mergeOptions(i.hls, i.vhs)) || this
  22546. if (
  22547. (i.hls && Object.keys(i.hls).length && tr.log.warn('Using hls options is deprecated. Please rename `hls` to `vhs` in your options object.'),
  22548. 'number' == typeof i.initialBandwidth && (n.options_.bandwidth = i.initialBandwidth),
  22549. (n.logger_ = Ro('VhsHandler')),
  22550. t.options_ &&
  22551. t.options_.playerId &&
  22552. ((i = tr(t.options_.playerId)).hasOwnProperty('hls') ||
  22553. Object.defineProperty(i, 'hls', {
  22554. get: function () {
  22555. return tr.log.warn('player.hls is deprecated. Use player.tech().vhs instead.'), t.trigger({ type: 'usage', name: 'hls-player-access' }), ft(n)
  22556. },
  22557. configurable: !0,
  22558. }),
  22559. i.hasOwnProperty('vhs') ||
  22560. Object.defineProperty(i, 'vhs', {
  22561. get: function () {
  22562. return tr.log.warn('player.vhs is deprecated. Use player.tech().vhs instead.'), t.trigger({ type: 'usage', name: 'vhs-player-access' }), ft(n)
  22563. },
  22564. configurable: !0,
  22565. }),
  22566. i.hasOwnProperty('dash') ||
  22567. Object.defineProperty(i, 'dash', {
  22568. get: function () {
  22569. return tr.log.warn('player.dash is deprecated. Use player.tech().vhs instead.'), ft(n)
  22570. },
  22571. configurable: !0,
  22572. }),
  22573. (n.player_ = i)),
  22574. (n.tech_ = t),
  22575. (n.source_ = e),
  22576. (n.stats = {}),
  22577. (n.ignoreNextSeekingEvent_ = !1),
  22578. n.setOptions_(),
  22579. n.options_.overrideNative && t.overrideNativeAudioTracks && t.overrideNativeVideoTracks)
  22580. )
  22581. t.overrideNativeAudioTracks(!0), t.overrideNativeVideoTracks(!0)
  22582. else if (n.options_.overrideNative && (t.featuresNativeVideoTracks || t.featuresNativeAudioTracks))
  22583. throw new Error('Overriding native HLS requires emulated tracks. See https://git.io/vMpjB')
  22584. return (
  22585. n.on(document, ['fullscreenchange', 'webkitfullscreenchange', 'mozfullscreenchange', 'MSFullscreenChange'], function (e) {
  22586. var t = document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement
  22587. t && t.contains(n.tech_.el()) ? n.masterPlaylistController_.fastQualityChange_() : n.masterPlaylistController_.checkABR_()
  22588. }),
  22589. n.on(n.tech_, 'seeking', function () {
  22590. this.ignoreNextSeekingEvent_ ? (this.ignoreNextSeekingEvent_ = !1) : this.setCurrentTime(this.tech_.currentTime())
  22591. }),
  22592. n.on(n.tech_, 'error', function () {
  22593. this.tech_.error() && this.masterPlaylistController_ && this.masterPlaylistController_.pauseLoading()
  22594. }),
  22595. n.on(n.tech_, 'play', n.play),
  22596. n
  22597. )
  22598. }
  22599. mt(e, r)
  22600. var t = e.prototype
  22601. return (
  22602. (t.setOptions_ = function () {
  22603. var e,
  22604. t = this
  22605. ;(this.options_.withCredentials = this.options_.withCredentials || !1),
  22606. (this.options_.handleManifestRedirects = !1 !== this.options_.handleManifestRedirects),
  22607. (this.options_.limitRenditionByPlayerDimensions = !1 !== this.options_.limitRenditionByPlayerDimensions),
  22608. (this.options_.useDevicePixelRatio = this.options_.useDevicePixelRatio || !1),
  22609. (this.options_.smoothQualityChange = this.options_.smoothQualityChange || !1),
  22610. (this.options_.useBandwidthFromLocalStorage =
  22611. 'undefined' != typeof this.source_.useBandwidthFromLocalStorage ? this.source_.useBandwidthFromLocalStorage : this.options_.useBandwidthFromLocalStorage || !1),
  22612. (this.options_.useNetworkInformationApi = this.options_.useNetworkInformationApi || !1),
  22613. (this.options_.useDtsForTimestampOffset = this.options_.useDtsForTimestampOffset || !1),
  22614. (this.options_.customTagParsers = this.options_.customTagParsers || []),
  22615. (this.options_.customTagMappers = this.options_.customTagMappers || []),
  22616. (this.options_.cacheEncryptionKeys = this.options_.cacheEncryptionKeys || !1),
  22617. 'number' != typeof this.options_.blacklistDuration && (this.options_.blacklistDuration = 300),
  22618. 'number' != typeof this.options_.bandwidth &&
  22619. this.options_.useBandwidthFromLocalStorage &&
  22620. ((e = Ac()) &&
  22621. e.bandwidth &&
  22622. ((this.options_.bandwidth = e.bandwidth),
  22623. this.tech_.trigger({ type: 'usage', name: 'vhs-bandwidth-from-local-storage' }),
  22624. this.tech_.trigger({ type: 'usage', name: 'hls-bandwidth-from-local-storage' })),
  22625. e &&
  22626. e.throughput &&
  22627. ((this.options_.throughput = e.throughput),
  22628. this.tech_.trigger({ type: 'usage', name: 'vhs-throughput-from-local-storage' }),
  22629. this.tech_.trigger({ type: 'usage', name: 'hls-throughput-from-local-storage' }))),
  22630. 'number' != typeof this.options_.bandwidth && (this.options_.bandwidth = El.INITIAL_BANDWIDTH),
  22631. (this.options_.enableLowInitialPlaylist = this.options_.enableLowInitialPlaylist && this.options_.bandwidth === El.INITIAL_BANDWIDTH),
  22632. [
  22633. 'withCredentials',
  22634. 'useDevicePixelRatio',
  22635. 'limitRenditionByPlayerDimensions',
  22636. 'bandwidth',
  22637. 'smoothQualityChange',
  22638. 'customTagParsers',
  22639. 'customTagMappers',
  22640. 'handleManifestRedirects',
  22641. 'cacheEncryptionKeys',
  22642. 'playlistSelector',
  22643. 'initialPlaylistSelector',
  22644. 'experimentalBufferBasedABR',
  22645. 'liveRangeSafeTimeDelta',
  22646. 'experimentalLLHLS',
  22647. 'useNetworkInformationApi',
  22648. 'useDtsForTimestampOffset',
  22649. 'experimentalExactManifestTimings',
  22650. 'experimentalLeastPixelDiffSelector',
  22651. ].forEach(function (e) {
  22652. 'undefined' != typeof t.source_[e] && (t.options_[e] = t.source_[e])
  22653. }),
  22654. (this.limitRenditionByPlayerDimensions = this.options_.limitRenditionByPlayerDimensions),
  22655. (this.useDevicePixelRatio = this.options_.useDevicePixelRatio)
  22656. }),
  22657. (t.src = function (e, t) {
  22658. var n = this
  22659. e &&
  22660. (this.setOptions_(),
  22661. (this.options_.src = 0 === (e = this.source_.src).toLowerCase().indexOf('data:application/vnd.videojs.vhs+json,') ? JSON.parse(e.substring(e.indexOf(',') + 1)) : e),
  22662. (this.options_.tech = this.tech_),
  22663. (this.options_.externVhs = Ec),
  22664. (this.options_.sourceType = vr(t)),
  22665. (this.options_.seekTo = function (e) {
  22666. n.tech_.setCurrentTime(e)
  22667. }),
  22668. this.options_.smoothQualityChange && tr.log.warn('smoothQualityChange is deprecated and will be removed in the next major version'),
  22669. (this.masterPlaylistController_ = new bc(this.options_)),
  22670. (t = tr.mergeOptions({ liveRangeSafeTimeDelta: 0.1 }, this.options_, {
  22671. seekable: function () {
  22672. return n.seekable()
  22673. },
  22674. media: function () {
  22675. return n.masterPlaylistController_.media()
  22676. },
  22677. masterPlaylistController: this.masterPlaylistController_,
  22678. })),
  22679. (this.playbackWatcher_ = new Sc(t)),
  22680. this.masterPlaylistController_.on('error', function () {
  22681. var e = tr.players[n.tech_.options_.playerId],
  22682. t = n.masterPlaylistController_.error
  22683. 'object' != typeof t || t.code ? 'string' == typeof t && (t = { message: t, code: 3 }) : (t.code = 3), e.error(t)
  22684. }),
  22685. (t = this.options_.experimentalBufferBasedABR ? Ec.movingAverageBandwidthSelector(0.55) : Ec.STANDARD_PLAYLIST_SELECTOR),
  22686. (this.masterPlaylistController_.selectPlaylist = (this.selectPlaylist || t).bind(this)),
  22687. (this.masterPlaylistController_.selectInitialPlaylist = Ec.INITIAL_PLAYLIST_SELECTOR.bind(this)),
  22688. (this.playlists = this.masterPlaylistController_.masterPlaylistLoader_),
  22689. (this.mediaSource = this.masterPlaylistController_.mediaSource),
  22690. Object.defineProperties(this, {
  22691. selectPlaylist: {
  22692. get: function () {
  22693. return this.masterPlaylistController_.selectPlaylist
  22694. },
  22695. set: function (e) {
  22696. this.masterPlaylistController_.selectPlaylist = e.bind(this)
  22697. },
  22698. },
  22699. throughput: {
  22700. get: function () {
  22701. return this.masterPlaylistController_.mainSegmentLoader_.throughput.rate
  22702. },
  22703. set: function (e) {
  22704. ;(this.masterPlaylistController_.mainSegmentLoader_.throughput.rate = e), (this.masterPlaylistController_.mainSegmentLoader_.throughput.count = 1)
  22705. },
  22706. },
  22707. bandwidth: {
  22708. get: function () {
  22709. var e = this.masterPlaylistController_.mainSegmentLoader_.bandwidth,
  22710. t = window.navigator.connection || window.navigator.mozConnection || window.navigator.webkitConnection
  22711. return (e = this.options_.useNetworkInformationApi && t ? (1e7 <= (t = 1e3 * t.downlink * 1e3) && 1e7 <= e ? Math.max(e, t) : t) : e)
  22712. },
  22713. set: function (e) {
  22714. ;(this.masterPlaylistController_.mainSegmentLoader_.bandwidth = e), (this.masterPlaylistController_.mainSegmentLoader_.throughput = { rate: 0, count: 0 })
  22715. },
  22716. },
  22717. systemBandwidth: {
  22718. get: function () {
  22719. var e = 1 / (this.bandwidth || 1),
  22720. t = 0 < this.throughput ? 1 / this.throughput : 0
  22721. return Math.floor(1 / (e + t))
  22722. },
  22723. set: function () {
  22724. tr.log.error('The "systemBandwidth" property is read-only')
  22725. },
  22726. },
  22727. }),
  22728. this.options_.bandwidth && (this.bandwidth = this.options_.bandwidth),
  22729. this.options_.throughput && (this.throughput = this.options_.throughput),
  22730. Object.defineProperties(this.stats, {
  22731. bandwidth: {
  22732. get: function () {
  22733. return n.bandwidth || 0
  22734. },
  22735. enumerable: !0,
  22736. },
  22737. mediaRequests: {
  22738. get: function () {
  22739. return n.masterPlaylistController_.mediaRequests_() || 0
  22740. },
  22741. enumerable: !0,
  22742. },
  22743. mediaRequestsAborted: {
  22744. get: function () {
  22745. return n.masterPlaylistController_.mediaRequestsAborted_() || 0
  22746. },
  22747. enumerable: !0,
  22748. },
  22749. mediaRequestsTimedout: {
  22750. get: function () {
  22751. return n.masterPlaylistController_.mediaRequestsTimedout_() || 0
  22752. },
  22753. enumerable: !0,
  22754. },
  22755. mediaRequestsErrored: {
  22756. get: function () {
  22757. return n.masterPlaylistController_.mediaRequestsErrored_() || 0
  22758. },
  22759. enumerable: !0,
  22760. },
  22761. mediaTransferDuration: {
  22762. get: function () {
  22763. return n.masterPlaylistController_.mediaTransferDuration_() || 0
  22764. },
  22765. enumerable: !0,
  22766. },
  22767. mediaBytesTransferred: {
  22768. get: function () {
  22769. return n.masterPlaylistController_.mediaBytesTransferred_() || 0
  22770. },
  22771. enumerable: !0,
  22772. },
  22773. mediaSecondsLoaded: {
  22774. get: function () {
  22775. return n.masterPlaylistController_.mediaSecondsLoaded_() || 0
  22776. },
  22777. enumerable: !0,
  22778. },
  22779. mediaAppends: {
  22780. get: function () {
  22781. return n.masterPlaylistController_.mediaAppends_() || 0
  22782. },
  22783. enumerable: !0,
  22784. },
  22785. mainAppendsToLoadedData: {
  22786. get: function () {
  22787. return n.masterPlaylistController_.mainAppendsToLoadedData_() || 0
  22788. },
  22789. enumerable: !0,
  22790. },
  22791. audioAppendsToLoadedData: {
  22792. get: function () {
  22793. return n.masterPlaylistController_.audioAppendsToLoadedData_() || 0
  22794. },
  22795. enumerable: !0,
  22796. },
  22797. appendsToLoadedData: {
  22798. get: function () {
  22799. return n.masterPlaylistController_.appendsToLoadedData_() || 0
  22800. },
  22801. enumerable: !0,
  22802. },
  22803. timeToLoadedData: {
  22804. get: function () {
  22805. return n.masterPlaylistController_.timeToLoadedData_() || 0
  22806. },
  22807. enumerable: !0,
  22808. },
  22809. buffered: {
  22810. get: function () {
  22811. return jo(n.tech_.buffered())
  22812. },
  22813. enumerable: !0,
  22814. },
  22815. currentTime: {
  22816. get: function () {
  22817. return n.tech_.currentTime()
  22818. },
  22819. enumerable: !0,
  22820. },
  22821. currentSource: {
  22822. get: function () {
  22823. return n.tech_.currentSource_
  22824. },
  22825. enumerable: !0,
  22826. },
  22827. currentTech: {
  22828. get: function () {
  22829. return n.tech_.name_
  22830. },
  22831. enumerable: !0,
  22832. },
  22833. duration: {
  22834. get: function () {
  22835. return n.tech_.duration()
  22836. },
  22837. enumerable: !0,
  22838. },
  22839. master: {
  22840. get: function () {
  22841. return n.playlists.master
  22842. },
  22843. enumerable: !0,
  22844. },
  22845. playerDimensions: {
  22846. get: function () {
  22847. return n.tech_.currentDimensions()
  22848. },
  22849. enumerable: !0,
  22850. },
  22851. seekable: {
  22852. get: function () {
  22853. return jo(n.tech_.seekable())
  22854. },
  22855. enumerable: !0,
  22856. },
  22857. timestamp: {
  22858. get: function () {
  22859. return Date.now()
  22860. },
  22861. enumerable: !0,
  22862. },
  22863. videoPlaybackQuality: {
  22864. get: function () {
  22865. return n.tech_.getVideoPlaybackQuality()
  22866. },
  22867. enumerable: !0,
  22868. },
  22869. }),
  22870. this.tech_.one('canplay', this.masterPlaylistController_.setupFirstPlay.bind(this.masterPlaylistController_)),
  22871. this.tech_.on('bandwidthupdate', function () {
  22872. n.options_.useBandwidthFromLocalStorage &&
  22873. (function (e) {
  22874. if (!window.localStorage) return
  22875. var t = (t = Ac()) ? tr.mergeOptions(t, e) : e
  22876. try {
  22877. window.localStorage.setItem(Cc, JSON.stringify(t))
  22878. } catch (e) {
  22879. return
  22880. }
  22881. })({ bandwidth: n.bandwidth, throughput: Math.round(n.throughput) })
  22882. }),
  22883. this.masterPlaylistController_.on('selectedinitialmedia', function () {
  22884. var i
  22885. ;(i = n).representations = function () {
  22886. var e = i.masterPlaylistController_.master(),
  22887. e = au(e) ? i.masterPlaylistController_.getAudioTrackPlaylists_() : e.playlists
  22888. return e
  22889. ? e
  22890. .filter(function (e) {
  22891. return !Zo(e)
  22892. })
  22893. .map(function (e, t) {
  22894. return new Kl(i, e, e.id)
  22895. })
  22896. : []
  22897. }
  22898. }),
  22899. this.masterPlaylistController_.sourceUpdater_.on('createdsourcebuffers', function () {
  22900. n.setupEme_()
  22901. }),
  22902. this.on(this.masterPlaylistController_, 'progress', function () {
  22903. this.tech_.trigger('progress')
  22904. }),
  22905. this.on(this.masterPlaylistController_, 'firstplay', function () {
  22906. this.ignoreNextSeekingEvent_ = !0
  22907. }),
  22908. this.setupQualityLevels_(),
  22909. this.tech_.el() && ((this.mediaSourceUrl_ = window.URL.createObjectURL(this.masterPlaylistController_.mediaSource)), this.tech_.src(this.mediaSourceUrl_)))
  22910. }),
  22911. (t.createKeySessions_ = function () {
  22912. var t = this,
  22913. e = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader
  22914. this.logger_('waiting for EME key session creation'),
  22915. Ic({ player: this.player_, sourceKeySystems: this.source_.keySystems, audioMedia: e && e.media(), mainPlaylists: this.playlists.master.playlists })
  22916. .then(function () {
  22917. t.logger_('created EME key session'), t.masterPlaylistController_.sourceUpdater_.initializedEme()
  22918. })
  22919. .catch(function (e) {
  22920. t.logger_('error while creating EME key session', e), t.player_.error({ message: 'Failed to initialize media keys for EME', code: 3 })
  22921. })
  22922. }),
  22923. (t.handleWaitingForKey_ = function () {
  22924. this.logger_('waitingforkey fired, attempting to create any new key sessions'), this.createKeySessions_()
  22925. }),
  22926. (t.setupEme_ = function () {
  22927. var t = this,
  22928. e = this.masterPlaylistController_.mediaTypes_.AUDIO.activePlaylistLoader,
  22929. e = xc({ player: this.player_, sourceKeySystems: this.source_.keySystems, media: this.playlists.media(), audioMedia: e && e.media() })
  22930. this.player_.tech_.on('keystatuschange', function (e) {
  22931. 'output-restricted' === e.status &&
  22932. t.masterPlaylistController_.blacklistCurrentPlaylist({
  22933. playlist: t.masterPlaylistController_.media(),
  22934. message: 'DRM keystatus changed to ' + e.status + '. Playlist will fail to play. Check for HDCP content.',
  22935. blacklistDuration: 1 / 0,
  22936. })
  22937. }),
  22938. (this.handleWaitingForKey_ = this.handleWaitingForKey_.bind(this)),
  22939. this.player_.tech_.on('waitingforkey', this.handleWaitingForKey_),
  22940. 11 !== tr.browser.IE_VERSION && e ? this.createKeySessions_() : this.masterPlaylistController_.sourceUpdater_.initializedEme()
  22941. }),
  22942. (t.setupQualityLevels_ = function () {
  22943. var i = this,
  22944. e = tr.players[this.tech_.options_.playerId]
  22945. e &&
  22946. e.qualityLevels &&
  22947. !this.qualityLevels_ &&
  22948. ((this.qualityLevels_ = e.qualityLevels()),
  22949. this.masterPlaylistController_.on('selectedinitialmedia', function () {
  22950. var t, e
  22951. ;(t = i.qualityLevels_),
  22952. (e = i).representations().forEach(function (e) {
  22953. t.addQualityLevel(e)
  22954. }),
  22955. kc(t, e.playlists)
  22956. }),
  22957. this.playlists.on('mediachange', function () {
  22958. kc(i.qualityLevels_, i.playlists)
  22959. }))
  22960. }),
  22961. (e.version = function () {
  22962. return { '@videojs/http-streaming': '2.14.2', 'mux.js': '6.0.1', 'mpd-parser': '0.21.1', 'm3u8-parser': '4.7.1', 'aes-decrypter': '3.1.3' }
  22963. }),
  22964. (t.version = function () {
  22965. return this.constructor.version()
  22966. }),
  22967. (t.canChangeType = function () {
  22968. return uc.canChangeType()
  22969. }),
  22970. (t.play = function () {
  22971. this.masterPlaylistController_.play()
  22972. }),
  22973. (t.setCurrentTime = function (e) {
  22974. this.masterPlaylistController_.setCurrentTime(e)
  22975. }),
  22976. (t.duration = function () {
  22977. return this.masterPlaylistController_.duration()
  22978. }),
  22979. (t.seekable = function () {
  22980. return this.masterPlaylistController_.seekable()
  22981. }),
  22982. (t.dispose = function () {
  22983. this.playbackWatcher_ && this.playbackWatcher_.dispose(),
  22984. this.masterPlaylistController_ && this.masterPlaylistController_.dispose(),
  22985. this.qualityLevels_ && this.qualityLevels_.dispose(),
  22986. this.player_ && (delete this.player_.vhs, delete this.player_.dash, delete this.player_.hls),
  22987. this.tech_ && this.tech_.vhs && delete this.tech_.vhs,
  22988. this.tech_ && delete this.tech_.hls,
  22989. this.mediaSourceUrl_ && window.URL.revokeObjectURL && (window.URL.revokeObjectURL(this.mediaSourceUrl_), (this.mediaSourceUrl_ = null)),
  22990. this.tech_ && this.tech_.off('waitingforkey', this.handleWaitingForKey_),
  22991. r.prototype.dispose.call(this)
  22992. }),
  22993. (t.convertToProgramTime = function (e, t) {
  22994. return ku({ playlist: this.masterPlaylistController_.media(), time: e, callback: t })
  22995. }),
  22996. (t.seekToProgramTime = function (e, t, i, n) {
  22997. return (
  22998. void 0 === i && (i = !0),
  22999. void 0 === n && (n = 2),
  23000. Cu({ programTime: e, playlist: this.masterPlaylistController_.media(), retryCount: n, pauseAfterSeek: i, seekTo: this.options_.seekTo, tech: this.options_.tech, callback: t })
  23001. )
  23002. }),
  23003. e
  23004. )
  23005. })(tr.getComponent('Component')),
  23006. Lc = {
  23007. name: 'videojs-http-streaming',
  23008. VERSION: '2.14.2',
  23009. canHandleSource: function (e, t) {
  23010. t = tr.mergeOptions(tr.options, (t = void 0 === t ? {} : t))
  23011. return Lc.canPlayType(e.type, t)
  23012. },
  23013. handleSource: function (e, t, i) {
  23014. i = tr.mergeOptions(tr.options, (i = void 0 === i ? {} : i))
  23015. return (
  23016. (t.vhs = new Pc(e, t, i)),
  23017. tr.hasOwnProperty('hls') ||
  23018. Object.defineProperty(t, 'hls', {
  23019. get: function () {
  23020. return tr.log.warn('player.tech().hls is deprecated. Use player.tech().vhs instead.'), t.vhs
  23021. },
  23022. configurable: !0,
  23023. }),
  23024. (t.vhs.xhr = yu()),
  23025. t.vhs.src(e.src, e.type),
  23026. t.vhs
  23027. )
  23028. },
  23029. canPlayType: function (e, t) {
  23030. var i = tr.mergeOptions(tr.options, (t = void 0 === t ? {} : t)),
  23031. t = i.vhs,
  23032. t = (t = void 0 === t ? {} : t).overrideNative,
  23033. t = void 0 === t ? !tr.browser.IS_ANY_SAFARI : t,
  23034. i = i.hls,
  23035. i = (i = void 0 === i ? {} : i).overrideNative,
  23036. i = void 0 !== i && i,
  23037. e = vr(e)
  23038. return e && (!Ec.supportsTypeNatively(e) || i || t) ? 'maybe' : ''
  23039. },
  23040. }
  23041. return (
  23042. gr('avc1.4d400d,mp4a.40.2') && tr.getTech('Html5').registerSourceHandler(Lc, 0),
  23043. (tr.VhsHandler = Pc),
  23044. Object.defineProperty(tr, 'HlsHandler', {
  23045. get: function () {
  23046. return tr.log.warn('videojs.HlsHandler is deprecated. Use videojs.VhsHandler instead.'), Pc
  23047. },
  23048. configurable: !0,
  23049. }),
  23050. (tr.VhsSourceHandler = Lc),
  23051. Object.defineProperty(tr, 'HlsSourceHandler', {
  23052. get: function () {
  23053. return tr.log.warn('videojs.HlsSourceHandler is deprecated. Use videojs.VhsSourceHandler instead.'), Lc
  23054. },
  23055. configurable: !0,
  23056. }),
  23057. (tr.Vhs = Ec),
  23058. Object.defineProperty(tr, 'Hls', {
  23059. get: function () {
  23060. return tr.log.warn('videojs.Hls is deprecated. Use videojs.Vhs instead.'), Ec
  23061. },
  23062. configurable: !0,
  23063. }),
  23064. tr.use || (tr.registerComponent('Hls', Ec), tr.registerComponent('Vhs', Ec)),
  23065. (tr.options.vhs = tr.options.vhs || {}),
  23066. (tr.options.hls = tr.options.hls || {}),
  23067. (tr.getPlugin && tr.getPlugin('reloadSourceOnError')) ||
  23068. (tr.registerPlugin || tr.plugin)('reloadSourceOnError', function (e) {
  23069. Yl(this, e)
  23070. }),
  23071. tr
  23072. )
  23073. })