video_novhs.min.js 542 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402
  1. /**
  2. * @license
  3. * Video.js 7.8.0 <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/master/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/master/LICENSE>
  11. */
  12. !function(e, t) {
  13. "object" == typeof exports && "undefined" != typeof module ? module.exports = t(require("global/window"), require("global/document")) : "function" == typeof define && define.amd ? define(["global/window", "global/document"], t) : (e = e || self).videojs = t(e.window, e.document)
  14. }(this, function(p, f) {
  15. "use strict";
  16. p = p && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p,
  17. f = f && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
  18. var v = "1.12.7"
  19. , g = "22-7-25"
  20. , y = "7.8.0"
  21. , u = []
  22. , e = function(o, l) {
  23. return function(e, t, n) {
  24. var i = l.levels[t]
  25. , r = new RegExp("^(" + i + ")$");
  26. if ("log" !== e && n.unshift(e.toUpperCase() + ":"),
  27. n.unshift(o + ":"),
  28. u) {
  29. u.push([].concat(n));
  30. var s = u.length - 1e3;
  31. u.splice(0, 0 < s ? s : 0)
  32. }
  33. if (p.console) {
  34. var a = p.console[e];
  35. a || "debug" !== e || (a = p.console.info || p.console.log),
  36. a && i && r.test(e) && a[Array.isArray(n) ? "apply" : "call"](p.console, n)
  37. }
  38. }
  39. };
  40. var m = function t(n) {
  41. function i() {
  42. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  43. t[n] = arguments[n];
  44. r("log", s, t)
  45. }
  46. var r, s = "info";
  47. return r = e(n, i),
  48. i.createLogger = function(e) {
  49. return t(n + ": " + e)
  50. }
  51. ,
  52. i.levels = {
  53. all: "debug|log|warn|error",
  54. off: "",
  55. debug: "debug|log|warn|error",
  56. info: "log|warn|error",
  57. warn: "warn|error",
  58. error: "error",
  59. DEFAULT: s
  60. },
  61. i.level = function(e) {
  62. if ("string" == typeof e) {
  63. if (!i.levels.hasOwnProperty(e))
  64. throw new Error('"' + e + '" in not a valid log level');
  65. s = e
  66. }
  67. return s
  68. }
  69. ,
  70. (i.history = function() {
  71. return u ? [].concat(u) : []
  72. }
  73. ).filter = function(t) {
  74. return (u || []).filter(function(e) {
  75. return new RegExp(".*" + t + ".*").test(e[0])
  76. })
  77. }
  78. ,
  79. i.history.clear = function() {
  80. u && (u.length = 0)
  81. }
  82. ,
  83. i.history.disable = function() {
  84. null !== u && (u.length = 0,
  85. u = null)
  86. }
  87. ,
  88. i.history.enable = function() {
  89. null === u && (u = [])
  90. }
  91. ,
  92. i.error = function() {
  93. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  94. t[n] = arguments[n];
  95. return r("error", s, t)
  96. }
  97. ,
  98. i.warn = function() {
  99. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  100. t[n] = arguments[n];
  101. return r("warn", s, t)
  102. }
  103. ,
  104. i.debug = function() {
  105. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  106. t[n] = arguments[n];
  107. return r("debug", s, t)
  108. }
  109. ,
  110. i
  111. }("VJS")
  112. , _ = m.createLogger
  113. , t = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
  114. function n(e, t) {
  115. return e(t = {
  116. exports: {}
  117. }, t.exports),
  118. t.exports
  119. }
  120. var r = n(function(e) {
  121. function t() {
  122. return e.exports = t = Object.assign || function(e) {
  123. for (var t = 1; t < arguments.length; t++) {
  124. var n = arguments[t];
  125. for (var i in n)
  126. Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
  127. }
  128. return e
  129. }
  130. ,
  131. t.apply(this, arguments)
  132. }
  133. e.exports = t
  134. })
  135. , i = Object.prototype.toString
  136. , s = function(e) {
  137. return l(e) ? Object.keys(e) : []
  138. };
  139. function a(t, n) {
  140. s(t).forEach(function(e) {
  141. return n(t[e], e)
  142. })
  143. }
  144. function o(n, i, e) {
  145. return void 0 === e && (e = 0),
  146. s(n).reduce(function(e, t) {
  147. return i(e, n[t], t)
  148. }, e)
  149. }
  150. function b(n) {
  151. for (var e = arguments.length, t = new Array(1 < e ? e - 1 : 0), i = 1; i < e; i++)
  152. t[i - 1] = arguments[i];
  153. return Object.assign ? r.apply(void 0, [n].concat(t)) : (t.forEach(function(e) {
  154. e && a(e, function(e, t) {
  155. n[t] = e
  156. })
  157. }),
  158. n)
  159. }
  160. function l(e) {
  161. return !!e && "object" == typeof e
  162. }
  163. function c(e) {
  164. return l(e) && "[object Object]" === i.call(e) && e.constructor === Object
  165. }
  166. function h(e, t) {
  167. if (!e || !t)
  168. return "";
  169. if ("function" != typeof p.getComputedStyle)
  170. return "";
  171. var n = p.getComputedStyle(e);
  172. return n ? n.getPropertyValue(t) || n[t] : ""
  173. }
  174. function d(e) {
  175. return "string" == typeof e && Boolean(e.trim())
  176. }
  177. function T(e) {
  178. if (0 <= e.indexOf(" "))
  179. throw new Error("class has illegal whitespace characters")
  180. }
  181. function C() {
  182. return f === p.document
  183. }
  184. function k(e) {
  185. return l(e) && 1 === e.nodeType
  186. }
  187. function E() {
  188. try {
  189. return p.parent !== p.self
  190. } catch (e) {
  191. return !0
  192. }
  193. }
  194. function S(i) {
  195. return function(e, t) {
  196. if (!d(e))
  197. return f[i](null);
  198. d(t) && (t = f.querySelector(t));
  199. var n = k(t) ? t : f;
  200. return n[i] && n[i](e)
  201. }
  202. }
  203. function w(e, n, t, i) {
  204. void 0 === e && (e = "div"),
  205. void 0 === n && (n = {}),
  206. void 0 === t && (t = {});
  207. var r = f.createElement(e);
  208. return Object.getOwnPropertyNames(n).forEach(function(e) {
  209. var t = n[e];
  210. -1 !== e.indexOf("aria-") || "role" === e || "type" === e ? (m.warn("Setting attributes in the second argument of createEl()\nhas been deprecated. Use the third argument instead.\ncreateEl(type, properties, attributes). Attempting to set " + e + " to " + t + "."),
  211. r.setAttribute(e, t)) : "textContent" === e ? x(r, t) : r[e] !== t && (r[e] = t)
  212. }),
  213. Object.getOwnPropertyNames(t).forEach(function(e) {
  214. r.setAttribute(e, t[e])
  215. }),
  216. i && W(r, i),
  217. r
  218. }
  219. function x(e, t) {
  220. return "undefined" == typeof e.textContent ? e.innerText = t : e.textContent = t,
  221. e
  222. }
  223. function A(e, t) {
  224. t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e)
  225. }
  226. function P(e, t) {
  227. return T(t),
  228. e.classList ? e.classList.contains(t) : function(e) {
  229. return new RegExp("(^|\\s)" + e + "($|\\s)")
  230. }(t).test(e.className)
  231. }
  232. function L(e, t) {
  233. return e.classList ? e.classList.add(t) : P(e, t) || (e.className = (e.className + " " + t).trim()),
  234. e
  235. }
  236. function I(e, t) {
  237. return e.classList ? e.classList.remove(t) : (T(t),
  238. e.className = e.className.split(/\s+/).filter(function(e) {
  239. return e !== t
  240. }).join(" ")),
  241. e
  242. }
  243. function M(e, t, n) {
  244. var i = P(e, t);
  245. if ("function" == typeof n && (n = n(e, t)),
  246. "boolean" != typeof n && (n = !i),
  247. n !== i)
  248. return n ? L(e, t) : I(e, t),
  249. e
  250. }
  251. function j(n, i) {
  252. Object.getOwnPropertyNames(i).forEach(function(e) {
  253. var t = i[e];
  254. null === t || "undefined" == typeof t || !1 === t ? n.removeAttribute(e) : n.setAttribute(e, !0 === t ? "" : t)
  255. })
  256. }
  257. function O(e) {
  258. var t = {}
  259. , n = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
  260. if (e && e.attributes && 0 < e.attributes.length)
  261. for (var i = e.attributes, r = i.length - 1; 0 <= r; r--) {
  262. var s = i[r].name
  263. , a = i[r].value;
  264. "boolean" != typeof e[s] && -1 === n.indexOf("," + s + ",") || (a = null !== a),
  265. t[s] = a
  266. }
  267. return t
  268. }
  269. function N(e, t) {
  270. return e.getAttribute(t)
  271. }
  272. function D(e, t, n) {
  273. e.setAttribute(t, n)
  274. }
  275. function B(e, t) {
  276. e.removeAttribute(t)
  277. }
  278. function R() {
  279. f.body.focus(),
  280. f.onselectstart = function() {
  281. return !1
  282. }
  283. }
  284. function F() {
  285. f.onselectstart = function() {
  286. return !0
  287. }
  288. }
  289. function H(e) {
  290. if (e && e.getBoundingClientRect && e.parentNode) {
  291. var t = e.getBoundingClientRect()
  292. , n = {};
  293. return ["bottom", "height", "left", "right", "top", "width"].forEach(function(e) {
  294. void 0 !== t[e] && (n[e] = t[e])
  295. }),
  296. n.height || (n.height = parseFloat(h(e, "height"))),
  297. n.width || (n.width = parseFloat(h(e, "width"))),
  298. n
  299. }
  300. }
  301. function V(e) {
  302. var t;
  303. if (e.getBoundingClientRect && e.parentNode && (t = e.getBoundingClientRect()),
  304. !t)
  305. return {
  306. left: 0,
  307. top: 0
  308. };
  309. var n = f.documentElement
  310. , i = f.body
  311. , r = n.clientLeft || i.clientLeft || 0
  312. , s = p.pageXOffset || i.scrollLeft
  313. , a = t.left + s - r
  314. , o = n.clientTop || i.clientTop || 0
  315. , l = p.pageYOffset || i.scrollTop
  316. , u = t.top + l - o;
  317. return {
  318. left: Math.round(a),
  319. top: Math.round(u)
  320. }
  321. }
  322. function Q(e, t) {
  323. var n = {}
  324. , i = V(e)
  325. , r = e.offsetWidth
  326. , s = e.offsetHeight
  327. , a = i.top
  328. , o = i.left
  329. , l = t.pageY
  330. , u = t.pageX;
  331. return t.changedTouches && (u = t.changedTouches[0].pageX,
  332. l = t.changedTouches[0].pageY),
  333. n.y = Math.max(0, Math.min(1, (a - l + s) / s)),
  334. n.x = Math.max(0, Math.min(1, (u - o) / r)),
  335. n
  336. }
  337. function U(e) {
  338. return l(e) && 3 === e.nodeType
  339. }
  340. function q(e) {
  341. for (; e.firstChild; )
  342. e.removeChild(e.firstChild);
  343. return e
  344. }
  345. function z(e) {
  346. return "function" == typeof e && (e = e()),
  347. (Array.isArray(e) ? e : [e]).map(function(e) {
  348. return "function" == typeof e && (e = e()),
  349. k(e) || U(e) ? e : "string" == typeof e && /\S/.test(e) ? f.createTextNode(e) : void 0
  350. }).filter(function(e) {
  351. return e
  352. })
  353. }
  354. function W(t, e) {
  355. return z(e).forEach(function(e) {
  356. return t.appendChild(e)
  357. }),
  358. t
  359. }
  360. function K(e, t) {
  361. return W(q(e), t)
  362. }
  363. function X(e) {
  364. return void 0 === e.button && void 0 === e.buttons || (0 === e.button && void 0 === e.buttons || ("mouseup" === e.type && 0 === e.button && 0 === e.buttons || 0 === e.button && 1 === e.buttons))
  365. }
  366. function G(e) {
  367. e.oncontextmenu = function() {
  368. return !1
  369. }
  370. }
  371. var Y, $ = S("querySelector"), J = S("querySelectorAll"), Z = Object.freeze({
  372. __proto__: null,
  373. isReal: C,
  374. isEl: k,
  375. isInFrame: E,
  376. createEl: w,
  377. textContent: x,
  378. prependTo: A,
  379. hasClass: P,
  380. addClass: L,
  381. removeClass: I,
  382. toggleClass: M,
  383. setAttributes: j,
  384. getAttributes: O,
  385. getAttribute: N,
  386. setAttribute: D,
  387. removeAttribute: B,
  388. blockTextSelection: R,
  389. unblockTextSelection: F,
  390. getBoundingClientRect: H,
  391. findPosition: V,
  392. getPointerPosition: Q,
  393. isTextNode: U,
  394. emptyEl: q,
  395. normalizeContent: z,
  396. appendContent: W,
  397. insertContent: K,
  398. isSingleLeftClick: X,
  399. isSingleRightClick: function(e) {
  400. return (void 0 !== e.button || void 0 !== e.buttons) && (2 === e.button && void 0 === e.buttons || "mouseup" === e.type && 2 === e.button && 2 === e.buttons)
  401. },
  402. blockContextMenu: G,
  403. $: $,
  404. $$: J
  405. }), ee = !1, te = function() {
  406. if (C() && !1 !== Y.options.autoSetup) {
  407. var e = Array.prototype.slice.call(f.getElementsByTagName("video"))
  408. , t = Array.prototype.slice.call(f.getElementsByTagName("audio"))
  409. , n = Array.prototype.slice.call(f.getElementsByTagName("video-js"))
  410. , i = e.concat(t, n);
  411. if (i && 0 < i.length)
  412. for (var r = 0, s = i.length; r < s; r++) {
  413. var a = i[r];
  414. if (!a || !a.getAttribute) {
  415. ne(1);
  416. break
  417. }
  418. void 0 === a.player && null !== a.getAttribute("data-setup") && Y(a)
  419. }
  420. else
  421. ee || ne(1)
  422. }
  423. };
  424. function ne(e, t) {
  425. t && (Y = t),
  426. p.setTimeout(te, e)
  427. }
  428. function ie() {
  429. ee = !0,
  430. p.removeEventListener("load", ie)
  431. }
  432. C() && ("complete" === f.readyState ? ie() : p.addEventListener("load", ie));
  433. function re(e) {
  434. var t = f.createElement("style");
  435. return t.className = e,
  436. t
  437. }
  438. function se(e, t) {
  439. e.styleSheet ? e.styleSheet.cssText = t : e.textContent = t
  440. }
  441. var ae, oe = 3;
  442. function le() {
  443. return oe++
  444. }
  445. p.WeakMap || (ae = function() {
  446. function e() {
  447. this.vdata = "vdata" + Math.floor(p.performance && p.performance.now() || Date.now()),
  448. this.data = {}
  449. }
  450. var t = e.prototype;
  451. return t.set = function(e, t) {
  452. var n = e[this.vdata] || le();
  453. return e[this.vdata] || (e[this.vdata] = n),
  454. this.data[n] = t,
  455. this
  456. }
  457. ,
  458. t.get = function(e) {
  459. var t = e[this.vdata];
  460. if (t)
  461. return this.data[t];
  462. m("We have no data for this element", e)
  463. }
  464. ,
  465. t.has = function(e) {
  466. return e[this.vdata]in this.data
  467. }
  468. ,
  469. t.delete = function(e) {
  470. var t = e[this.vdata];
  471. t && (delete this.data[t],
  472. delete e[this.vdata])
  473. }
  474. ,
  475. e
  476. }());
  477. var ue, ce = p.WeakMap ? new WeakMap : new ae;
  478. function he(e, t) {
  479. if (ce.has(e)) {
  480. var n = ce.get(e);
  481. 0 === n.handlers[t].length && (delete n.handlers[t],
  482. e.removeEventListener ? e.removeEventListener(t, n.dispatcher, !1) : e.detachEvent && e.detachEvent("on" + t, n.dispatcher)),
  483. Object.getOwnPropertyNames(n.handlers).length <= 0 && (delete n.handlers,
  484. delete n.dispatcher,
  485. delete n.disabled),
  486. 0 === Object.getOwnPropertyNames(n).length && ce.delete(e)
  487. }
  488. }
  489. function de(t, n, e, i) {
  490. e.forEach(function(e) {
  491. t(n, e, i)
  492. })
  493. }
  494. function pe(e) {
  495. if (e.fixed_)
  496. return e;
  497. function t() {
  498. return !0
  499. }
  500. function n() {
  501. return !1
  502. }
  503. if (!e || !e.isPropagationStopped) {
  504. var i = e || p.event;
  505. for (var r in e = {},
  506. i)
  507. "layerX" !== r && "layerY" !== r && "keyLocation" !== r && "webkitMovementX" !== r && "webkitMovementY" !== r && ("returnValue" === r && i.preventDefault || (e[r] = i[r]));
  508. if (e.target || (e.target = e.srcElement || f),
  509. e.relatedTarget || (e.relatedTarget = e.fromElement === e.target ? e.toElement : e.fromElement),
  510. e.preventDefault = function() {
  511. i.preventDefault && i.preventDefault(),
  512. e.returnValue = !1,
  513. i.returnValue = !1,
  514. e.defaultPrevented = !0
  515. }
  516. ,
  517. e.defaultPrevented = !1,
  518. e.stopPropagation = function() {
  519. i.stopPropagation && i.stopPropagation(),
  520. e.cancelBubble = !0,
  521. i.cancelBubble = !0,
  522. e.isPropagationStopped = t
  523. }
  524. ,
  525. e.isPropagationStopped = n,
  526. e.stopImmediatePropagation = function() {
  527. i.stopImmediatePropagation && i.stopImmediatePropagation(),
  528. e.isImmediatePropagationStopped = t,
  529. e.stopPropagation()
  530. }
  531. ,
  532. e.isImmediatePropagationStopped = n,
  533. null !== e.clientX && void 0 !== e.clientX) {
  534. var s = f.documentElement
  535. , a = f.body;
  536. e.pageX = e.clientX + (s && s.scrollLeft || a && a.scrollLeft || 0) - (s && s.clientLeft || a && a.clientLeft || 0),
  537. e.pageY = e.clientY + (s && s.scrollTop || a && a.scrollTop || 0) - (s && s.clientTop || a && a.clientTop || 0)
  538. }
  539. e.which = e.charCode || e.keyCode,
  540. null !== e.button && void 0 !== e.button && (e.button = 1 & e.button ? 0 : 4 & e.button ? 1 : 2 & e.button ? 2 : 0)
  541. }
  542. return e.fixed_ = !0,
  543. e
  544. }
  545. var fe = function() {
  546. if ("boolean" != typeof ue) {
  547. ue = !1;
  548. try {
  549. var e = Object.defineProperty({}, "passive", {
  550. get: function() {
  551. ue = !0
  552. }
  553. });
  554. p.addEventListener("test", null, e),
  555. p.removeEventListener("test", null, e)
  556. } catch (e) {}
  557. }
  558. return ue
  559. }
  560. , ve = ["touchstart", "touchmove"];
  561. function ge(a, e, t) {
  562. if (Array.isArray(e))
  563. return de(ge, a, e, t);
  564. ce.has(a) || ce.set(a, {});
  565. var o = ce.get(a);
  566. if (o.handlers || (o.handlers = {}),
  567. o.handlers[e] || (o.handlers[e] = []),
  568. t.guid || (t.guid = le()),
  569. o.handlers[e].push(t),
  570. o.dispatcher || (o.disabled = !1,
  571. o.dispatcher = function(e, t) {
  572. if (!o.disabled) {
  573. e = pe(e);
  574. var n = o.handlers[e.type];
  575. if (n)
  576. for (var i = n.slice(0), r = 0, s = i.length; r < s && !e.isImmediatePropagationStopped(); r++)
  577. try {
  578. i[r].call(a, e, t)
  579. } catch (e) {
  580. m.error(e)
  581. }
  582. }
  583. }
  584. ),
  585. 1 === o.handlers[e].length)
  586. if (a.addEventListener) {
  587. var n = !1;
  588. fe() && -1 < ve.indexOf(e) && (n = {
  589. passive: !0
  590. }),
  591. a.addEventListener(e, o.dispatcher, n)
  592. } else
  593. a.attachEvent && a.attachEvent("on" + e, o.dispatcher)
  594. }
  595. function ye(e, t, n) {
  596. if (ce.has(e)) {
  597. var i = ce.get(e);
  598. if (i.handlers) {
  599. if (Array.isArray(t))
  600. return de(ye, e, t, n);
  601. var r = function(e, t) {
  602. i.handlers[t] = [],
  603. he(e, t)
  604. };
  605. if (void 0 !== t) {
  606. var s = i.handlers[t];
  607. if (s)
  608. if (n) {
  609. if (n.guid)
  610. for (var a = 0; a < s.length; a++)
  611. s[a].guid === n.guid && s.splice(a--, 1);
  612. he(e, t)
  613. } else
  614. r(e, t)
  615. } else
  616. for (var o in i.handlers)
  617. Object.prototype.hasOwnProperty.call(i.handlers || {}, o) && r(e, o)
  618. }
  619. }
  620. }
  621. function me(e, t, n) {
  622. var i = ce.has(e) ? ce.get(e) : {}
  623. , r = e.parentNode || e.ownerDocument;
  624. if ("string" == typeof t ? t = {
  625. type: t,
  626. target: e
  627. } : t.target || (t.target = e),
  628. t = pe(t),
  629. i.dispatcher && i.dispatcher.call(e, t, n),
  630. r && !t.isPropagationStopped() && !0 === t.bubbles)
  631. me.call(null, r, t, n);
  632. else if (!r && !t.defaultPrevented && t.target && t.target[t.type]) {
  633. ce.has(t.target) || ce.set(t.target, {});
  634. var s = ce.get(t.target);
  635. t.target[t.type] && (s.disabled = !0,
  636. "function" == typeof t.target[t.type] && t.target[t.type](),
  637. s.disabled = !1)
  638. }
  639. return !t.defaultPrevented
  640. }
  641. function _e(e, t, n) {
  642. if (Array.isArray(t))
  643. return de(_e, e, t, n);
  644. function i() {
  645. ye(e, t, i),
  646. n.apply(this, arguments)
  647. }
  648. i.guid = n.guid = n.guid || le(),
  649. ge(e, t, i)
  650. }
  651. function be(e, t, n) {
  652. function i() {
  653. ye(e, t, i),
  654. n.apply(this, arguments)
  655. }
  656. i.guid = n.guid = n.guid || le(),
  657. ge(e, t, i)
  658. }
  659. function Te(e, t, n) {
  660. t.guid || (t.guid = le());
  661. var i = t.bind(e);
  662. return i.guid = n ? n + "_" + t.guid : t.guid,
  663. i
  664. }
  665. function Ce(t, n) {
  666. var i = p.performance.now();
  667. return function() {
  668. var e = p.performance.now();
  669. n <= e - i && (t.apply(void 0, arguments),
  670. i = e)
  671. }
  672. }
  673. function ke() {}
  674. var Ee, Se = Object.freeze({
  675. __proto__: null,
  676. fixEvent: pe,
  677. on: ge,
  678. off: ye,
  679. trigger: me,
  680. one: _e,
  681. any: be
  682. });
  683. ke.prototype.allowedEvents_ = {},
  684. ke.prototype.addEventListener = ke.prototype.on = function(e, t) {
  685. var n = this.addEventListener;
  686. this.addEventListener = function() {}
  687. ,
  688. ge(this, e, t),
  689. this.addEventListener = n
  690. }
  691. ,
  692. ke.prototype.removeEventListener = ke.prototype.off = function(e, t) {
  693. ye(this, e, t)
  694. }
  695. ,
  696. ke.prototype.one = function(e, t) {
  697. var n = this.addEventListener;
  698. this.addEventListener = function() {}
  699. ,
  700. _e(this, e, t),
  701. this.addEventListener = n
  702. }
  703. ,
  704. ke.prototype.any = function(e, t) {
  705. var n = this.addEventListener;
  706. this.addEventListener = function() {}
  707. ,
  708. be(this, e, t),
  709. this.addEventListener = n
  710. }
  711. ,
  712. ke.prototype.dispatchEvent = ke.prototype.trigger = function(e) {
  713. var t = e.type || e;
  714. "string" == typeof e && (e = {
  715. type: t
  716. }),
  717. e = pe(e),
  718. this.allowedEvents_[t] && this["on" + t] && this["on" + t](e),
  719. me(this, e)
  720. }
  721. ,
  722. ke.prototype.queueTrigger = function(e) {
  723. var t = this;
  724. Ee = Ee || new Map;
  725. var n = e.type || e
  726. , i = Ee.get(this);
  727. i || (i = new Map,
  728. Ee.set(this, i));
  729. var r = i.get(n);
  730. i.delete(n),
  731. p.clearTimeout(r);
  732. var s = p.setTimeout(function() {
  733. 0 === i.size && (i = null,
  734. Ee.delete(t)),
  735. t.trigger(e)
  736. }, 0);
  737. i.set(n, s)
  738. }
  739. ;
  740. function we(e) {
  741. return "string" == typeof e && /\S/.test(e) || Array.isArray(e) && !!e.length
  742. }
  743. function xe(e) {
  744. if (!e.nodeName && !Me(e))
  745. throw new Error("Invalid target; must be a DOM node or evented object.")
  746. }
  747. function Ae(e) {
  748. if (!we(e))
  749. throw new Error("Invalid event type; must be a non-empty string or array.")
  750. }
  751. function Pe(e) {
  752. if ("function" != typeof e)
  753. throw new Error("Invalid listener; must be a function.")
  754. }
  755. function Le(e, t) {
  756. var n, i, r, s = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_;
  757. return r = s ? (n = e.eventBusEl_,
  758. 3 <= t.length && t.shift(),
  759. i = t[0],
  760. t[1]) : (n = t[0],
  761. i = t[1],
  762. t[2]),
  763. xe(n),
  764. Ae(i),
  765. Pe(r),
  766. {
  767. isTargetingSelf: s,
  768. target: n,
  769. type: i,
  770. listener: r = Te(e, r)
  771. }
  772. }
  773. function Ie(e, t, n, i) {
  774. xe(e),
  775. e.nodeName ? Se[t](e, n, i) : e[t](n, i)
  776. }
  777. var Me = function(t) {
  778. return t instanceof ke || !!t.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(e) {
  779. return "function" == typeof t[e]
  780. })
  781. }
  782. , je = {
  783. on: function() {
  784. for (var e = this, t = arguments.length, n = new Array(t), i = 0; i < t; i++)
  785. n[i] = arguments[i];
  786. var r = Le(this, n)
  787. , s = r.isTargetingSelf
  788. , a = r.target
  789. , o = r.type
  790. , l = r.listener;
  791. if (Ie(a, "on", o, l),
  792. !s) {
  793. var u = function() {
  794. return e.off(a, o, l)
  795. };
  796. u.guid = l.guid;
  797. var c = function() {
  798. return e.off("dispose", u)
  799. };
  800. c.guid = l.guid,
  801. Ie(this, "on", "dispose", u),
  802. Ie(a, "on", "dispose", c)
  803. }
  804. },
  805. one: function() {
  806. for (var r = this, e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  807. t[n] = arguments[n];
  808. var i = Le(this, t)
  809. , s = i.isTargetingSelf
  810. , a = i.target
  811. , o = i.type
  812. , l = i.listener;
  813. if (s)
  814. Ie(a, "one", o, l);
  815. else {
  816. var u = function e() {
  817. r.off(a, o, e);
  818. for (var t = arguments.length, n = new Array(t), i = 0; i < t; i++)
  819. n[i] = arguments[i];
  820. l.apply(null, n)
  821. };
  822. u.guid = l.guid,
  823. Ie(a, "one", o, u)
  824. }
  825. },
  826. any: function() {
  827. for (var r = this, e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  828. t[n] = arguments[n];
  829. var i = Le(this, t)
  830. , s = i.isTargetingSelf
  831. , a = i.target
  832. , o = i.type
  833. , l = i.listener;
  834. if (s)
  835. Ie(a, "any", o, l);
  836. else {
  837. var u = function e() {
  838. r.off(a, o, e);
  839. for (var t = arguments.length, n = new Array(t), i = 0; i < t; i++)
  840. n[i] = arguments[i];
  841. l.apply(null, n)
  842. };
  843. u.guid = l.guid,
  844. Ie(a, "any", o, u)
  845. }
  846. },
  847. off: function(e, t, n) {
  848. if (!e || we(e))
  849. ye(this.eventBusEl_, e, t);
  850. else {
  851. var i = e
  852. , r = t;
  853. xe(i),
  854. Ae(r),
  855. Pe(n),
  856. n = Te(this, n),
  857. this.off("dispose", n),
  858. i.nodeName ? (ye(i, r, n),
  859. ye(i, "dispose", n)) : Me(i) && (i.off(r, n),
  860. i.off("dispose", n))
  861. }
  862. },
  863. trigger: function(e, t) {
  864. return me(this.eventBusEl_, e, t)
  865. }
  866. };
  867. function Oe(e, t) {
  868. void 0 === t && (t = {});
  869. var n = t.eventBusKey;
  870. if (n) {
  871. if (!e[n].nodeName)
  872. throw new Error('The eventBusKey "' + n + '" does not refer to an element.');
  873. e.eventBusEl_ = e[n]
  874. } else
  875. e.eventBusEl_ = w("span", {
  876. className: "vjs-event-bus"
  877. });
  878. return b(e, je),
  879. e.eventedCallbacks && e.eventedCallbacks.forEach(function(e) {
  880. e()
  881. }),
  882. e.on("dispose", function() {
  883. e.off(),
  884. p.setTimeout(function() {
  885. e.eventBusEl_ = null
  886. }, 0)
  887. }),
  888. e
  889. }
  890. var Ne = {
  891. state: {},
  892. setState: function(e) {
  893. var n, i = this;
  894. return "function" == typeof e && (e = e()),
  895. a(e, function(e, t) {
  896. i.state[t] !== e && ((n = n || {})[t] = {
  897. from: i.state[t],
  898. to: e
  899. }),
  900. i.state[t] = e
  901. }),
  902. n && Me(this) && this.trigger({
  903. changes: n,
  904. type: "statechanged"
  905. }),
  906. n
  907. }
  908. };
  909. function De(e, t) {
  910. return b(e, Ne),
  911. e.state = b({}, e.state, t),
  912. "function" == typeof e.handleStateChanged && Me(e) && e.on("statechanged", e.handleStateChanged),
  913. e
  914. }
  915. function Be(e) {
  916. return "string" != typeof e ? e : e.replace(/./, function(e) {
  917. return e.toLowerCase()
  918. })
  919. }
  920. function Re(e) {
  921. return "string" != typeof e ? e : e.replace(/./, function(e) {
  922. return e.toUpperCase()
  923. })
  924. }
  925. function Fe() {
  926. for (var n = {}, e = arguments.length, t = new Array(e), i = 0; i < e; i++)
  927. t[i] = arguments[i];
  928. return t.forEach(function(e) {
  929. e && a(e, function(e, t) {
  930. c(e) ? (c(n[t]) || (n[t] = {}),
  931. n[t] = Fe(n[t], e)) : n[t] = e
  932. })
  933. }),
  934. n
  935. }
  936. var He = function() {
  937. function u(e, t, n) {
  938. if (!e && this.play ? this.player_ = e = this : this.player_ = e,
  939. this.isDisposed_ = !1,
  940. this.parentComponent_ = null,
  941. this.options_ = Fe({}, this.options_),
  942. t = this.options_ = Fe(this.options_, t),
  943. this.id_ = t.id || t.el && t.el.id,
  944. !this.id_) {
  945. var i = e && e.id && e.id() || "no_player";
  946. this.id_ = i + "_component_" + le()
  947. }
  948. var r;
  949. this.name_ = t.name || null,
  950. t.el ? this.el_ = t.el : !1 !== t.createEl && (this.el_ = this.createEl()),
  951. !1 !== t.evented && Oe(this, {
  952. eventBusKey: this.el_ ? "el_" : null
  953. }),
  954. De(this, this.constructor.defaultState),
  955. this.children_ = [],
  956. this.childIndex_ = {},
  957. this.childNameIndex_ = {},
  958. p.Set || (r = function() {
  959. function e() {
  960. this.set_ = {}
  961. }
  962. var t = e.prototype;
  963. return t.has = function(e) {
  964. return e in this.set_
  965. }
  966. ,
  967. t.delete = function(e) {
  968. var t = this.has(e);
  969. return delete this.set_[e],
  970. t
  971. }
  972. ,
  973. t.add = function(e) {
  974. return this.set_[e] = 1,
  975. this
  976. }
  977. ,
  978. t.forEach = function(e, t) {
  979. for (var n in this.set_)
  980. e.call(t, n, n, this)
  981. }
  982. ,
  983. e
  984. }()),
  985. this.setTimeoutIds_ = p.Set ? new Set : new r,
  986. this.setIntervalIds_ = p.Set ? new Set : new r,
  987. this.rafIds_ = p.Set ? new Set : new r,
  988. (this.clearingTimersOnDispose_ = !1) !== t.initChildren && this.initChildren(),
  989. this.ready(n),
  990. !1 !== t.reportTouchActivity && this.enableTouchActivity()
  991. }
  992. var e = u.prototype;
  993. return e.dispose = function() {
  994. if (!this.isDisposed_) {
  995. if (this.trigger({
  996. type: "dispose",
  997. bubbles: !1
  998. }),
  999. this.isDisposed_ = !0,
  1000. this.children_)
  1001. for (var e = this.children_.length - 1; 0 <= e; e--)
  1002. this.children_[e].dispose && this.children_[e].dispose();
  1003. this.children_ = null,
  1004. this.childIndex_ = null,
  1005. this.childNameIndex_ = null,
  1006. this.parentComponent_ = null,
  1007. this.el_ && (this.el_.parentNode && this.el_.parentNode.removeChild(this.el_),
  1008. ce.has(this.el_) && ce.delete(this.el_),
  1009. this.el_ = null),
  1010. this.player_ = null
  1011. }
  1012. }
  1013. ,
  1014. e.isDisposed = function() {
  1015. return Boolean(this.isDisposed_)
  1016. }
  1017. ,
  1018. e.player = function() {
  1019. return this.player_
  1020. }
  1021. ,
  1022. e.options = function(e) {
  1023. return e && (this.options_ = Fe(this.options_, e)),
  1024. this.options_
  1025. }
  1026. ,
  1027. e.el = function() {
  1028. return this.el_
  1029. }
  1030. ,
  1031. e.createEl = function(e, t, n) {
  1032. return w(e, t, n)
  1033. }
  1034. ,
  1035. e.localize = function(e, r, t) {
  1036. void 0 === t && (t = e);
  1037. var n = this.player_.language && this.player_.language()
  1038. , i = this.player_.languages && this.player_.languages()
  1039. , s = i && i[n]
  1040. , a = n && n.split("-")[0]
  1041. , o = i && i[a]
  1042. , l = t;
  1043. return s && s[e] ? l = s[e] : o && o[e] && (l = o[e]),
  1044. r && (l = l.replace(/\{(\d+)\}/g, function(e, t) {
  1045. var n = r[t - 1]
  1046. , i = n;
  1047. return "undefined" == typeof n && (i = e),
  1048. i
  1049. })),
  1050. l
  1051. }
  1052. ,
  1053. e.contentEl = function() {
  1054. return this.contentEl_ || this.el_
  1055. }
  1056. ,
  1057. e.id = function() {
  1058. return this.id_
  1059. }
  1060. ,
  1061. e.name = function() {
  1062. return this.name_
  1063. }
  1064. ,
  1065. e.children = function() {
  1066. return this.children_
  1067. }
  1068. ,
  1069. e.getChildById = function(e) {
  1070. return this.childIndex_[e]
  1071. }
  1072. ,
  1073. e.getChild = function(e) {
  1074. if (e)
  1075. return this.childNameIndex_[e]
  1076. }
  1077. ,
  1078. e.getDescendant = function() {
  1079. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  1080. t[n] = arguments[n];
  1081. t = t.reduce(function(e, t) {
  1082. return e.concat(t)
  1083. }, []);
  1084. for (var i = this, r = 0; r < t.length; r++)
  1085. if (!(i = i.getChild(t[r])) || !i.getChild)
  1086. return;
  1087. return i
  1088. }
  1089. ,
  1090. e.addChild = function(e, t, n) {
  1091. var i, r;
  1092. if (void 0 === t && (t = {}),
  1093. void 0 === n && (n = this.children_.length),
  1094. "string" == typeof e) {
  1095. r = Re(e);
  1096. var s = t.componentClass || r;
  1097. t.name = r;
  1098. var a = u.getComponent(s);
  1099. if (!a)
  1100. throw new Error("Component " + s + " does not exist");
  1101. if ("function" != typeof a)
  1102. return null;
  1103. i = new a(this.player_ || this,t)
  1104. } else
  1105. i = e;
  1106. if (i.parentComponent_ && i.parentComponent_.removeChild(i),
  1107. this.children_.splice(n, 0, i),
  1108. i.parentComponent_ = this,
  1109. "function" == typeof i.id && (this.childIndex_[i.id()] = i),
  1110. (r = r || i.name && Re(i.name())) && (this.childNameIndex_[r] = i,
  1111. this.childNameIndex_[Be(r)] = i),
  1112. "function" == typeof i.el && i.el()) {
  1113. var o = null;
  1114. this.children_[n + 1] && this.children_[n + 1].el_ && (o = this.children_[n + 1].el_),
  1115. this.contentEl().insertBefore(i.el(), o)
  1116. }
  1117. return i
  1118. }
  1119. ,
  1120. e.removeChild = function(e) {
  1121. if ("string" == typeof e && (e = this.getChild(e)),
  1122. e && this.children_) {
  1123. for (var t = !1, n = this.children_.length - 1; 0 <= n; n--)
  1124. if (this.children_[n] === e) {
  1125. t = !0,
  1126. this.children_.splice(n, 1);
  1127. break
  1128. }
  1129. if (t) {
  1130. e.parentComponent_ = null,
  1131. this.childIndex_[e.id()] = null,
  1132. this.childNameIndex_[Re(e.name())] = null,
  1133. this.childNameIndex_[Be(e.name())] = null;
  1134. var i = e.el();
  1135. i && i.parentNode === this.contentEl() && this.contentEl().removeChild(e.el())
  1136. }
  1137. }
  1138. }
  1139. ,
  1140. e.initChildren = function() {
  1141. var r = this
  1142. , i = this.options_.children;
  1143. if (i) {
  1144. var e, s = this.options_, n = u.getComponent("Tech");
  1145. (e = Array.isArray(i) ? i : Object.keys(i)).concat(Object.keys(this.options_).filter(function(t) {
  1146. return !e.some(function(e) {
  1147. return "string" == typeof e ? t === e : t === e.name
  1148. })
  1149. })).map(function(e) {
  1150. var t, n;
  1151. return n = "string" == typeof e ? i[t = e] || r.options_[t] || {} : (t = e.name,
  1152. e),
  1153. {
  1154. name: t,
  1155. opts: n
  1156. }
  1157. }).filter(function(e) {
  1158. var t = u.getComponent(e.opts.componentClass || Re(e.name));
  1159. return t && !n.isTech(t)
  1160. }).forEach(function(e) {
  1161. var t = e.name
  1162. , n = e.opts;
  1163. if (void 0 !== s[t] && (n = s[t]),
  1164. !1 !== n) {
  1165. !0 === n && (n = {}),
  1166. n.playerOptions = r.options_.playerOptions;
  1167. var i = r.addChild(t, n);
  1168. i && (r[t] = i)
  1169. }
  1170. })
  1171. }
  1172. }
  1173. ,
  1174. e.buildCSSClass = function() {
  1175. return ""
  1176. }
  1177. ,
  1178. e.ready = function(e, t) {
  1179. if (void 0 === t && (t = !1),
  1180. e)
  1181. return this.isReady_ ? void (t ? e.call(this) : this.setTimeout(e, 1)) : (this.readyQueue_ = this.readyQueue_ || [],
  1182. void this.readyQueue_.push(e))
  1183. }
  1184. ,
  1185. e.triggerReady = function() {
  1186. this.isReady_ = !0,
  1187. this.setTimeout(function() {
  1188. var e = this.readyQueue_;
  1189. this.readyQueue_ = [],
  1190. e && 0 < e.length && e.forEach(function(e) {
  1191. e.call(this)
  1192. }, this),
  1193. this.trigger("ready")
  1194. }, 1)
  1195. }
  1196. ,
  1197. e.$ = function(e, t) {
  1198. return $(e, t || this.contentEl())
  1199. }
  1200. ,
  1201. e.$$ = function(e, t) {
  1202. return J(e, t || this.contentEl())
  1203. }
  1204. ,
  1205. e.hasClass = function(e) {
  1206. return P(this.el_, e)
  1207. }
  1208. ,
  1209. e.addClass = function(e) {
  1210. L(this.el_, e)
  1211. }
  1212. ,
  1213. e.removeClass = function(e) {
  1214. I(this.el_, e)
  1215. }
  1216. ,
  1217. e.toggleClass = function(e, t) {
  1218. M(this.el_, e, t)
  1219. }
  1220. ,
  1221. e.show = function() {
  1222. this.removeClass("vjs-hidden")
  1223. }
  1224. ,
  1225. e.hide = function() {
  1226. this.addClass("vjs-hidden")
  1227. }
  1228. ,
  1229. e.lockShowing = function() {
  1230. this.addClass("vjs-lock-showing")
  1231. }
  1232. ,
  1233. e.unlockShowing = function() {
  1234. this.removeClass("vjs-lock-showing")
  1235. }
  1236. ,
  1237. e.getAttribute = function(e) {
  1238. return N(this.el_, e)
  1239. }
  1240. ,
  1241. e.setAttribute = function(e, t) {
  1242. D(this.el_, e, t)
  1243. }
  1244. ,
  1245. e.removeAttribute = function(e) {
  1246. B(this.el_, e)
  1247. }
  1248. ,
  1249. e.width = function(e, t) {
  1250. return this.dimension("width", e, t)
  1251. }
  1252. ,
  1253. e.height = function(e, t) {
  1254. return this.dimension("height", e, t)
  1255. }
  1256. ,
  1257. e.dimensions = function(e, t) {
  1258. this.width(e, !0),
  1259. this.height(t)
  1260. }
  1261. ,
  1262. e.dimension = function(e, t, n) {
  1263. if (void 0 !== t)
  1264. return null !== t && t == t || (t = 0),
  1265. -1 !== ("" + t).indexOf("%") || -1 !== ("" + t).indexOf("px") ? this.el_.style[e] = t : this.el_.style[e] = "auto" === t ? "" : t + "px",
  1266. void (n || this.trigger("componentresize"));
  1267. if (!this.el_)
  1268. return 0;
  1269. var i = this.el_.style[e]
  1270. , r = i.indexOf("px");
  1271. return -1 !== r ? parseInt(i.slice(0, r), 10) : parseInt(this.el_["offset" + Re(e)], 10)
  1272. }
  1273. ,
  1274. e.currentDimension = function(e) {
  1275. var t = 0;
  1276. if ("width" !== e && "height" !== e)
  1277. throw new Error("currentDimension only accepts width or height value");
  1278. if (t = h(this.el_, e),
  1279. 0 === (t = parseFloat(t)) || isNaN(t)) {
  1280. var n = "offset" + Re(e);
  1281. t = this.el_[n]
  1282. }
  1283. return t
  1284. }
  1285. ,
  1286. e.currentDimensions = function() {
  1287. return {
  1288. width: this.currentDimension("width"),
  1289. height: this.currentDimension("height")
  1290. }
  1291. }
  1292. ,
  1293. e.currentWidth = function() {
  1294. return this.currentDimension("width")
  1295. }
  1296. ,
  1297. e.currentHeight = function() {
  1298. return this.currentDimension("height")
  1299. }
  1300. ,
  1301. e.focus = function() {
  1302. this.el_.focus()
  1303. }
  1304. ,
  1305. e.blur = function() {
  1306. this.el_.blur()
  1307. }
  1308. ,
  1309. e.handleKeyDown = function(e) {
  1310. this.player_ && (e.stopPropagation(),
  1311. this.player_.handleKeyDown(e))
  1312. }
  1313. ,
  1314. e.handleKeyPress = function(e) {
  1315. this.handleKeyDown(e)
  1316. }
  1317. ,
  1318. e.emitTapEvents = function() {
  1319. var i, t = 0, r = null;
  1320. this.on("touchstart", function(e) {
  1321. 1 === e.touches.length && (r = {
  1322. pageX: e.touches[0].pageX,
  1323. pageY: e.touches[0].pageY
  1324. },
  1325. t = p.performance.now(),
  1326. i = !0)
  1327. }),
  1328. this.on("touchmove", function(e) {
  1329. if (1 < e.touches.length)
  1330. i = !1;
  1331. else if (r) {
  1332. var t = e.touches[0].pageX - r.pageX
  1333. , n = e.touches[0].pageY - r.pageY;
  1334. 10 < Math.sqrt(t * t + n * n) && (i = !1)
  1335. }
  1336. });
  1337. function e() {
  1338. i = !1
  1339. }
  1340. this.on("touchleave", e),
  1341. this.on("touchcancel", e),
  1342. this.on("touchend", function(e) {
  1343. !(r = null) === i && p.performance.now() - t < 200 && (e.preventDefault(),
  1344. this.trigger("tap"))
  1345. })
  1346. }
  1347. ,
  1348. e.enableTouchActivity = function() {
  1349. if (this.player() && this.player().reportUserActivity) {
  1350. var t, n = Te(this.player(), this.player().reportUserActivity);
  1351. this.on("touchstart", function() {
  1352. n(),
  1353. this.clearInterval(t),
  1354. t = this.setInterval(n, 250)
  1355. });
  1356. var e = function(e) {
  1357. n(),
  1358. this.clearInterval(t)
  1359. };
  1360. this.on("touchmove", n),
  1361. this.on("touchend", e),
  1362. this.on("touchcancel", e)
  1363. }
  1364. }
  1365. ,
  1366. e.setTimeout = function(e, t) {
  1367. var n, i = this;
  1368. return e = Te(this, e),
  1369. this.clearTimersOnDispose_(),
  1370. n = p.setTimeout(function() {
  1371. i.setTimeoutIds_.has(n) && i.setTimeoutIds_.delete(n),
  1372. e()
  1373. }, t),
  1374. this.setTimeoutIds_.add(n),
  1375. n
  1376. }
  1377. ,
  1378. e.clearTimeout = function(e) {
  1379. return this.setTimeoutIds_.has(e) && (this.setTimeoutIds_.delete(e),
  1380. p.clearTimeout(e)),
  1381. e
  1382. }
  1383. ,
  1384. e.setInterval = function(e, t) {
  1385. e = Te(this, e),
  1386. this.clearTimersOnDispose_();
  1387. var n = p.setInterval(e, t);
  1388. return this.setIntervalIds_.add(n),
  1389. n
  1390. }
  1391. ,
  1392. e.clearInterval = function(e) {
  1393. return this.setIntervalIds_.has(e) && (this.setIntervalIds_.delete(e),
  1394. p.clearInterval(e)),
  1395. e
  1396. }
  1397. ,
  1398. e.requestAnimationFrame = function(e) {
  1399. var t, n = this;
  1400. return this.supportsRaf_ ? (this.clearTimersOnDispose_(),
  1401. e = Te(this, e),
  1402. t = p.requestAnimationFrame(function() {
  1403. n.rafIds_.has(t) && n.rafIds_.delete(t),
  1404. e()
  1405. }),
  1406. this.rafIds_.add(t),
  1407. t) : this.setTimeout(e, 1e3 / 60)
  1408. }
  1409. ,
  1410. e.cancelAnimationFrame = function(e) {
  1411. return this.supportsRaf_ ? (this.rafIds_.has(e) && (this.rafIds_.delete(e),
  1412. p.cancelAnimationFrame(e)),
  1413. e) : this.clearTimeout(e)
  1414. }
  1415. ,
  1416. e.clearTimersOnDispose_ = function() {
  1417. var i = this;
  1418. this.clearingTimersOnDispose_ || (this.clearingTimersOnDispose_ = !0,
  1419. this.one("dispose", function() {
  1420. [["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function(e) {
  1421. var t = e[0]
  1422. , n = e[1];
  1423. i[t].forEach(i[n], i)
  1424. }),
  1425. i.clearingTimersOnDispose_ = !1
  1426. }))
  1427. }
  1428. ,
  1429. u.registerComponent = function(e, t) {
  1430. if ("string" != typeof e || !e)
  1431. throw new Error('Illegal component name, "' + e + '"; must be a non-empty string.');
  1432. var n, i = u.getComponent("Tech"), r = i && i.isTech(t), s = u === t || u.prototype.isPrototypeOf(t.prototype);
  1433. if (r || !s)
  1434. throw n = r ? "techs must be registered using Tech.registerTech()" : "must be a Component subclass",
  1435. new Error('Illegal component, "' + e + '"; ' + n + ".");
  1436. e = Re(e),
  1437. u.components_ || (u.components_ = {});
  1438. var a = u.getComponent("Player");
  1439. if ("Player" === e && a && a.players) {
  1440. var o = a.players
  1441. , l = Object.keys(o);
  1442. if (o && 0 < l.length && l.map(function(e) {
  1443. return o[e]
  1444. }).every(Boolean))
  1445. throw new Error("Can not register Player component after player has been created.")
  1446. }
  1447. return u.components_[e] = t,
  1448. u.components_[Be(e)] = t
  1449. }
  1450. ,
  1451. u.getComponent = function(e) {
  1452. if (e && u.components_)
  1453. return u.components_[e]
  1454. }
  1455. ,
  1456. u
  1457. }();
  1458. He.prototype.supportsRaf_ = "function" == typeof p.requestAnimationFrame && "function" == typeof p.cancelAnimationFrame,
  1459. He.registerComponent("Component", He);
  1460. var Ve = function(e) {
  1461. if (void 0 === e)
  1462. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  1463. return e
  1464. };
  1465. n(function(t) {
  1466. function n(e) {
  1467. return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? t.exports = n = function(e) {
  1468. return typeof e
  1469. }
  1470. : t.exports = n = function(e) {
  1471. return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
  1472. }
  1473. ,
  1474. n(e)
  1475. }
  1476. t.exports = n
  1477. }),
  1478. n(function(t) {
  1479. function n(e) {
  1480. return t.exports = n = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
  1481. return e.__proto__ || Object.getPrototypeOf(e)
  1482. }
  1483. ,
  1484. n(e)
  1485. }
  1486. t.exports = n
  1487. });
  1488. var Qe, Ue, qe, ze, We = function(e, t) {
  1489. e.prototype = Object.create(t.prototype),
  1490. (e.prototype.constructor = e).__proto__ = t
  1491. }, Ke = p.navigator && p.navigator.userAgent || "", Xe = /AppleWebKit\/([\d.]+)/i.exec(Ke), Ge = Xe ? parseFloat(Xe.pop()) : null, Ye = /iPod/i.test(Ke), $e = (Qe = Ke.match(/OS (\d+)_/i)) && Qe[1] ? Qe[1] : null, Je = /Android/i.test(Ke), Ze = function() {
  1492. var e = Ke.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
  1493. if (!e)
  1494. return null;
  1495. var t = e[1] && parseFloat(e[1])
  1496. , n = e[2] && parseFloat(e[2]);
  1497. return t && n ? parseFloat(e[1] + "." + e[2]) : t || null
  1498. }(), et = Je && Ze < 5 && Ge < 537, tt = /Firefox/i.test(Ke), nt = /Edg/i.test(Ke), it = !nt && (/Chrome/i.test(Ke) || /CriOS/i.test(Ke)), rt = (Ue = Ke.match(/(Chrome|CriOS)\/(\d+)/)) && Ue[2] ? parseFloat(Ue[2]) : null, st = (qe = /MSIE\s(\d+)\.\d/.exec(Ke),
  1499. !(ze = qe && parseFloat(qe[1])) && /Trident\/7.0/i.test(Ke) && /rv:11.0/.test(Ke) && (ze = 11),
  1500. ze), at = /Safari/i.test(Ke) && !it && !Je && !nt, ot = /Windows/i.test(Ke), lt = C() && ("ontouchstart"in p || p.navigator.maxTouchPoints || p.DocumentTouch && p.document instanceof p.DocumentTouch), ut = /iPad/i.test(Ke) || at && lt && !/iPhone/i.test(Ke), ct = /iPhone/i.test(Ke) && !ut, ht = ct || ut || Ye, dt = (at || ht) && !it, pt = Object.freeze({
  1501. __proto__: null,
  1502. IS_IPOD: Ye,
  1503. IOS_VERSION: $e,
  1504. IS_ANDROID: Je,
  1505. ANDROID_VERSION: Ze,
  1506. IS_NATIVE_ANDROID: et,
  1507. IS_FIREFOX: tt,
  1508. IS_EDGE: nt,
  1509. IS_CHROME: it,
  1510. CHROME_VERSION: rt,
  1511. IE_VERSION: st,
  1512. IS_SAFARI: at,
  1513. IS_WINDOWS: ot,
  1514. TOUCH_ENABLED: lt,
  1515. IS_IPAD: ut,
  1516. IS_IPHONE: ct,
  1517. IS_IOS: ht,
  1518. IS_ANY_SAFARI: dt
  1519. });
  1520. function ft(e, t, n, i) {
  1521. return function(e, t, n) {
  1522. if ("number" != typeof t || t < 0 || n < t)
  1523. throw new Error("Failed to execute '" + e + "' on 'TimeRanges': The index provided (" + t + ") is non-numeric or out of bounds (0-" + n + ").")
  1524. }(e, i, n.length - 1),
  1525. n[i][t]
  1526. }
  1527. function vt(e) {
  1528. return void 0 === e || 0 === e.length ? {
  1529. length: 0,
  1530. start: function() {
  1531. throw new Error("This TimeRanges object is empty")
  1532. },
  1533. end: function() {
  1534. throw new Error("This TimeRanges object is empty")
  1535. }
  1536. } : {
  1537. length: e.length,
  1538. start: ft.bind(null, "start", 0, e),
  1539. end: ft.bind(null, "end", 1, e)
  1540. }
  1541. }
  1542. function gt(e, t) {
  1543. return Array.isArray(e) ? vt(e) : void 0 === e || void 0 === t ? vt() : vt([[e, t]])
  1544. }
  1545. function yt(e, t) {
  1546. var n, i, r = 0;
  1547. if (!t)
  1548. return 0;
  1549. e && e.length || (e = gt(0, 0));
  1550. for (var s = 0; s < e.length; s++)
  1551. n = e.start(s),
  1552. t < (i = e.end(s)) && (i = t),
  1553. r += i - n;
  1554. return r / t
  1555. }
  1556. for (var mt, _t = {
  1557. prefixed: !0
  1558. }, bt = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror", "fullscreen"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror", "-webkit-full-screen"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror", "-moz-full-screen"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError", "-ms-fullscreen"]], Tt = bt[0], Ct = 0; Ct < bt.length; Ct++)
  1559. if (bt[Ct][1]in f) {
  1560. mt = bt[Ct];
  1561. break
  1562. }
  1563. if (mt) {
  1564. for (var kt = 0; kt < mt.length; kt++)
  1565. _t[Tt[kt]] = mt[kt];
  1566. _t.prefixed = mt[0] !== Tt[0]
  1567. }
  1568. function Et(e) {
  1569. if (e instanceof Et)
  1570. return e;
  1571. "number" == typeof e ? this.code = e : "string" == typeof e ? this.message = e : l(e) && ("number" == typeof e.code && (this.code = e.code),
  1572. b(this, e)),
  1573. this.message || (this.message = Et.defaultMessages[this.code] || "")
  1574. }
  1575. Et.prototype.code = 0,
  1576. Et.prototype.message = "",
  1577. Et.prototype.status = null,
  1578. Et.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"],
  1579. Et.defaultMessages = {
  1580. 1: "You aborted the media playback",
  1581. 2: "A network error caused the media download to fail part-way.",
  1582. 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
  1583. 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
  1584. 5: "The media is encrypted and we do not have the keys to decrypt it."
  1585. };
  1586. for (var St = 0; St < Et.errorTypes.length; St++)
  1587. Et[Et.errorTypes[St]] = St,
  1588. Et.prototype[Et.errorTypes[St]] = St;
  1589. var wt = function(e, t) {
  1590. var n, i = null;
  1591. try {
  1592. n = JSON.parse(e, t)
  1593. } catch (e) {
  1594. i = e
  1595. }
  1596. return [i, n]
  1597. };
  1598. function xt(e) {
  1599. return null != e && "function" == typeof e.then
  1600. }
  1601. function At(e) {
  1602. xt(e) && e.then(null, function(e) {})
  1603. }
  1604. function Pt(i) {
  1605. return ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(e, t, n) {
  1606. return i[t] && (e[t] = i[t]),
  1607. e
  1608. }, {
  1609. cues: i.cues && Array.prototype.map.call(i.cues, function(e) {
  1610. return {
  1611. startTime: e.startTime,
  1612. endTime: e.endTime,
  1613. text: e.text,
  1614. id: e.id
  1615. }
  1616. })
  1617. })
  1618. }
  1619. var Lt = function(e) {
  1620. var t = e.$$("track")
  1621. , n = Array.prototype.map.call(t, function(e) {
  1622. return e.track
  1623. });
  1624. return Array.prototype.map.call(t, function(e) {
  1625. var t = Pt(e.track);
  1626. return e.src && (t.src = e.src),
  1627. t
  1628. }).concat(Array.prototype.filter.call(e.textTracks(), function(e) {
  1629. return -1 === n.indexOf(e)
  1630. }).map(Pt))
  1631. }
  1632. , It = function(e, n) {
  1633. return e.forEach(function(e) {
  1634. var t = n.addRemoteTextTrack(e).track;
  1635. !e.src && e.cues && e.cues.forEach(function(e) {
  1636. return t.addCue(e)
  1637. })
  1638. }),
  1639. n.textTracks()
  1640. }
  1641. , Mt = n(function(e, t) {
  1642. function n(e) {
  1643. if (e && "object" == typeof e) {
  1644. var t = e.which || e.keyCode || e.charCode;
  1645. t && (e = t)
  1646. }
  1647. if ("number" == typeof e)
  1648. return a[e];
  1649. var n, i = String(e);
  1650. return (n = r[i.toLowerCase()]) ? n : (n = s[i.toLowerCase()]) || (1 === i.length ? i.charCodeAt(0) : void 0)
  1651. }
  1652. n.isEventKey = function(e, t) {
  1653. if (e && "object" == typeof e) {
  1654. var n = e.which || e.keyCode || e.charCode;
  1655. if (null == n)
  1656. return !1;
  1657. if ("string" == typeof t) {
  1658. var i;
  1659. if (i = r[t.toLowerCase()])
  1660. return i === n;
  1661. if (i = s[t.toLowerCase()])
  1662. return i === n
  1663. } else if ("number" == typeof t)
  1664. return t === n;
  1665. return !1
  1666. }
  1667. }
  1668. ;
  1669. var r = (t = e.exports = n).code = t.codes = {
  1670. backspace: 8,
  1671. tab: 9,
  1672. enter: 13,
  1673. shift: 16,
  1674. ctrl: 17,
  1675. alt: 18,
  1676. "pause/break": 19,
  1677. "caps lock": 20,
  1678. esc: 27,
  1679. space: 32,
  1680. "page up": 33,
  1681. "page down": 34,
  1682. end: 35,
  1683. home: 36,
  1684. left: 37,
  1685. up: 38,
  1686. right: 39,
  1687. down: 40,
  1688. insert: 45,
  1689. delete: 46,
  1690. command: 91,
  1691. "left command": 91,
  1692. "right command": 93,
  1693. "numpad *": 106,
  1694. "numpad +": 107,
  1695. "numpad -": 109,
  1696. "numpad .": 110,
  1697. "numpad /": 111,
  1698. "num lock": 144,
  1699. "scroll lock": 145,
  1700. "my computer": 182,
  1701. "my calculator": 183,
  1702. ";": 186,
  1703. "=": 187,
  1704. ",": 188,
  1705. "-": 189,
  1706. ".": 190,
  1707. "/": 191,
  1708. "`": 192,
  1709. "[": 219,
  1710. "\\": 220,
  1711. "]": 221,
  1712. "'": 222
  1713. }
  1714. , s = t.aliases = {
  1715. windows: 91,
  1716. "⇧": 16,
  1717. "⌥": 18,
  1718. "⌃": 17,
  1719. "⌘": 91,
  1720. ctl: 17,
  1721. control: 17,
  1722. option: 18,
  1723. pause: 19,
  1724. break: 19,
  1725. caps: 20,
  1726. return: 13,
  1727. escape: 27,
  1728. spc: 32,
  1729. spacebar: 32,
  1730. pgup: 33,
  1731. pgdn: 34,
  1732. ins: 45,
  1733. del: 46,
  1734. cmd: 91
  1735. };
  1736. for (i = 97; i < 123; i++)
  1737. r[String.fromCharCode(i)] = i - 32;
  1738. for (var i = 48; i < 58; i++)
  1739. r[i - 48] = i;
  1740. for (i = 1; i < 13; i++)
  1741. r["f" + i] = i + 111;
  1742. for (i = 0; i < 10; i++)
  1743. r["numpad " + i] = i + 96;
  1744. var a = t.names = t.title = {};
  1745. for (i in r)
  1746. a[r[i]] = i;
  1747. for (var o in s)
  1748. r[o] = s[o]
  1749. })
  1750. , jt = (Mt.code,
  1751. Mt.codes,
  1752. Mt.aliases,
  1753. Mt.names,
  1754. Mt.title,
  1755. "vjs-modal-dialog")
  1756. , Ot = function(i) {
  1757. function e(e, t) {
  1758. var n;
  1759. return (n = i.call(this, e, t) || this).opened_ = n.hasBeenOpened_ = n.hasBeenFilled_ = !1,
  1760. n.closeable(!n.options_.uncloseable),
  1761. n.content(n.options_.content),
  1762. n.contentEl_ = w("div", {
  1763. className: jt + "-content"
  1764. }, {
  1765. role: "document"
  1766. }),
  1767. n.descEl_ = w("p", {
  1768. className: jt + "-description vjs-control-text",
  1769. id: n.el().getAttribute("aria-describedby")
  1770. }),
  1771. x(n.descEl_, n.description()),
  1772. n.el_.appendChild(n.descEl_),
  1773. n.el_.appendChild(n.contentEl_),
  1774. G(n.el_),
  1775. n
  1776. }
  1777. We(e, i);
  1778. var t = e.prototype;
  1779. return t.createEl = function() {
  1780. return i.prototype.createEl.call(this, "div", {
  1781. className: this.buildCSSClass(),
  1782. tabIndex: -1
  1783. }, {
  1784. "aria-describedby": this.id() + "_description",
  1785. "aria-hidden": "true",
  1786. "aria-label": this.label(),
  1787. role: "dialog"
  1788. })
  1789. }
  1790. ,
  1791. t.dispose = function() {
  1792. this.contentEl_ = null,
  1793. this.descEl_ = null,
  1794. this.previouslyActiveEl_ = null,
  1795. i.prototype.dispose.call(this)
  1796. }
  1797. ,
  1798. t.buildCSSClass = function() {
  1799. return jt + " vjs-hidden " + i.prototype.buildCSSClass.call(this)
  1800. }
  1801. ,
  1802. t.label = function() {
  1803. return this.localize(this.options_.label || "Modal Window")
  1804. }
  1805. ,
  1806. t.description = function() {
  1807. var e = this.options_.description || this.localize("This is a modal window.");
  1808. return this.closeable() && (e += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),
  1809. e
  1810. }
  1811. ,
  1812. t.open = function() {
  1813. if (!this.opened_) {
  1814. var e = this.player();
  1815. this.trigger("beforemodalopen"),
  1816. this.opened_ = !0,
  1817. !this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_) || this.fill(),
  1818. this.wasPlaying_ = !e.paused(),
  1819. this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(),
  1820. this.on("keydown", this.handleKeyDown),
  1821. this.hadControls_ = e.controls(),
  1822. e.controls(!1),
  1823. this.show(),
  1824. this.conditionalFocus_(),
  1825. this.el().setAttribute("aria-hidden", "false"),
  1826. this.trigger("modalopen"),
  1827. this.hasBeenOpened_ = !0
  1828. }
  1829. }
  1830. ,
  1831. t.opened = function(e) {
  1832. return "boolean" == typeof e && this[e ? "open" : "close"](),
  1833. this.player_.error(1),
  1834. this.opened_
  1835. }
  1836. ,
  1837. t.close = function() {
  1838. if (this.opened_) {
  1839. var e = this.player();
  1840. this.trigger("beforemodalclose"),
  1841. this.opened_ = !1,
  1842. this.wasPlaying_ && this.options_.pauseOnOpen && e.play(),
  1843. this.off("keydown", this.handleKeyDown),
  1844. this.hadControls_ && e.controls(!0),
  1845. this.hide(),
  1846. this.el().setAttribute("aria-hidden", "true"),
  1847. this.trigger("modalclose"),
  1848. this.conditionalBlur_(),
  1849. this.options_.temporary && this.dispose()
  1850. }
  1851. }
  1852. ,
  1853. t.refresh = function() {
  1854. this.player_.log("[model-display] refresh()1"),
  1855. p.location.reload(),
  1856. this.player_.log("[model-display] refresh()2")
  1857. }
  1858. ,
  1859. t.closeable = function(e) {
  1860. if ("boolean" == typeof e) {
  1861. var t = this.closeable_ = !!e
  1862. , n = this.getChild("closeButton");
  1863. if (t && !n) {
  1864. var i = this.contentEl_;
  1865. this.contentEl_ = this.el_,
  1866. n = this.addChild("closeButton", {
  1867. controlText: "Close Modal Dialog"
  1868. }),
  1869. this.contentEl_ = i,
  1870. this.on(n, "close", this.close)
  1871. }
  1872. !t && n && (this.off(n, "close", this.close),
  1873. this.removeChild(n),
  1874. n.dispose())
  1875. }
  1876. return this.closeable_
  1877. }
  1878. ,
  1879. t.refreshable = function(e) {
  1880. if ("boolean" == typeof e) {
  1881. var t = this.refreshable_ = !!e
  1882. , n = this.getChild("refreshButton");
  1883. if (t && !n) {
  1884. var i = this.contentEl_;
  1885. this.contentEl_ = this.el_,
  1886. n = this.addChild("refreshButton", {
  1887. controlText: "Refresh Page"
  1888. }),
  1889. this.contentEl_ = i,
  1890. this.on(n, "refresh", this.refresh)
  1891. }
  1892. !t && n && (this.off(n, "refresh", this.refresh),
  1893. this.removeChild(n),
  1894. n.dispose())
  1895. }
  1896. return this.refreshable_
  1897. }
  1898. ,
  1899. t.fill = function() {
  1900. this.fillWith(this.content())
  1901. }
  1902. ,
  1903. t.fillWith = function(e) {
  1904. var t = this.contentEl()
  1905. , n = t.parentNode
  1906. , i = t.nextSibling;
  1907. this.trigger("beforemodalfill"),
  1908. this.hasBeenFilled_ = !0,
  1909. n.removeChild(t),
  1910. this.empty(),
  1911. K(t, e),
  1912. this.trigger("modalfill"),
  1913. i ? n.insertBefore(t, i) : n.appendChild(t);
  1914. var r = this.getChild("closeButton");
  1915. r && n.appendChild(r.el_)
  1916. }
  1917. ,
  1918. t.empty = function() {
  1919. this.trigger("beforemodalempty"),
  1920. q(this.contentEl()),
  1921. this.trigger("modalempty")
  1922. }
  1923. ,
  1924. t.content = function(e) {
  1925. return "undefined" != typeof e && (this.content_ = e),
  1926. this.content_
  1927. }
  1928. ,
  1929. t.conditionalFocus_ = function() {
  1930. var e = f.activeElement
  1931. , t = this.player_.el_;
  1932. this.previouslyActiveEl_ = null,
  1933. !t.contains(e) && t !== e || (this.previouslyActiveEl_ = e,
  1934. this.focus())
  1935. }
  1936. ,
  1937. t.conditionalBlur_ = function() {
  1938. this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(),
  1939. this.previouslyActiveEl_ = null)
  1940. }
  1941. ,
  1942. t.handleKeyDown = function(e) {
  1943. if (e.stopPropagation(),
  1944. Mt.isEventKey(e, "Escape") && this.closeable())
  1945. return e.preventDefault(),
  1946. void this.close();
  1947. if (Mt.isEventKey(e, "Tab")) {
  1948. for (var t, n = this.focusableEls_(), i = this.el_.querySelector(":focus"), r = 0; r < n.length; r++)
  1949. if (i === n[r]) {
  1950. t = r;
  1951. break
  1952. }
  1953. f.activeElement === this.el_ && (t = 0),
  1954. e.shiftKey && 0 === t ? (n[n.length - 1].focus(),
  1955. e.preventDefault()) : e.shiftKey || t !== n.length - 1 || (n[0].focus(),
  1956. e.preventDefault())
  1957. }
  1958. }
  1959. ,
  1960. t.focusableEls_ = function() {
  1961. var e = this.el_.querySelectorAll("*");
  1962. return Array.prototype.filter.call(e, function(e) {
  1963. return (e instanceof p.HTMLAnchorElement || e instanceof p.HTMLAreaElement) && e.hasAttribute("href") || (e instanceof p.HTMLInputElement || e instanceof p.HTMLSelectElement || e instanceof p.HTMLTextAreaElement || e instanceof p.HTMLButtonElement) && !e.hasAttribute("disabled") || e instanceof p.HTMLIFrameElement || e instanceof p.HTMLObjectElement || e instanceof p.HTMLEmbedElement || e.hasAttribute("tabindex") && -1 !== e.getAttribute("tabindex") || e.hasAttribute("contenteditable")
  1964. })
  1965. }
  1966. ,
  1967. e
  1968. }(He);
  1969. Ot.prototype.options_ = {
  1970. pauseOnOpen: !0,
  1971. temporary: !0
  1972. },
  1973. He.registerComponent("ModalDialog", Ot);
  1974. function Nt(e, t) {
  1975. e = e < 0 ? 0 : e;
  1976. var n = Math.floor(e % 60)
  1977. , i = Math.floor(e / 60 % 60)
  1978. , r = Math.floor(e / 3600)
  1979. , s = Math.floor(t / 60 % 60)
  1980. , a = Math.floor(t / 3600);
  1981. return !isNaN(e) && e !== 1 / 0 || (r = i = n = "-"),
  1982. (r = 0 < r || 0 < a ? r + ":" : "") + (i = ((r || 10 <= s) && i < 10 ? "0" + i : i) + ":") + (n = n < 10 ? "0" + n : n)
  1983. }
  1984. var Dt = Nt;
  1985. function Bt(e, t) {
  1986. return void 0 === t && (t = e),
  1987. Dt(e, t)
  1988. }
  1989. var Rt = function(i) {
  1990. function e(e, t) {
  1991. var n;
  1992. return (n = i.call(this, e, t) || this).on(e, ["timeupdate", "ended"], n.updateContent),
  1993. n.updateTextNode_(),
  1994. n
  1995. }
  1996. We(e, i);
  1997. var t = e.prototype;
  1998. return t.createEl = function() {
  1999. var e = this.buildCSSClass()
  2000. , t = i.prototype.createEl.call(this, "div", {
  2001. className: e + " vjs-time-control vjs-control",
  2002. innerHTML: '<span class="vjs-control-text" role="presentation">' + this.localize(this.labelText_) + " </span>"
  2003. });
  2004. return this.contentEl_ = w("span", {
  2005. className: e + "-display"
  2006. }, {
  2007. "aria-live": "off",
  2008. role: "presentation"
  2009. }),
  2010. t.appendChild(this.contentEl_),
  2011. t
  2012. }
  2013. ,
  2014. t.dispose = function() {
  2015. this.contentEl_ = null,
  2016. this.textNode_ = null,
  2017. i.prototype.dispose.call(this)
  2018. }
  2019. ,
  2020. t.updateTextNode_ = function(e) {
  2021. var t = this;
  2022. void 0 === e && (e = 0),
  2023. e = Bt(e),
  2024. this.formattedTime_ !== e && (this.formattedTime_ = e,
  2025. this.requestAnimationFrame(function() {
  2026. if (t.contentEl_) {
  2027. var e = t.textNode_;
  2028. t.textNode_ = f.createTextNode(t.formattedTime_),
  2029. t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
  2030. }
  2031. }))
  2032. }
  2033. ,
  2034. t.updateContent = function(e) {}
  2035. ,
  2036. e
  2037. }(He);
  2038. Rt.prototype.labelText_ = "Time",
  2039. Rt.prototype.controlText_ = "Time",
  2040. He.registerComponent("TimeDisplay", Rt);
  2041. var Ft = function(i) {
  2042. function e(e, t) {
  2043. var n;
  2044. return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
  2045. n.on("mousedown", n.handleMouseDown),
  2046. n.on("click", n.handleClick),
  2047. n
  2048. }
  2049. We(e, i);
  2050. var t = e.prototype;
  2051. return t.skipTime = function() {
  2052. return 5
  2053. }
  2054. ,
  2055. t.buildCSSClass = function() {
  2056. return "ad-skip-time"
  2057. }
  2058. ,
  2059. t.createEl = function() {
  2060. return i.prototype.createEl.call(this)
  2061. }
  2062. ,
  2063. t.updateContent = function(e) {
  2064. var t, n, i;
  2065. "number" == typeof this.player_.duration() && (this.player_.ended() ? t = 0 : n = this.player_.remainingTimeDisplay ? (t = this.player_.remainingTimeDisplay(),
  2066. this.player_.remainingTimeDisplay() - this.skipTime()) : (t = this.player_.remainingTimeDisplay(),
  2067. this.player_.remainingTime() - this.skipTime()),
  2068. i = 180 < n ? "" : 0 < n ? (this.hasClass("ad-skip-btn") && this.removeClass("ad-skip-btn"),
  2069. "zh-cn" === this.player_.language() ? "" + t + this.localize("Sec") + " | 可在" + n + this.localize("Sec") + "后" + this.localize("Skip") : "" + t + this.localize("Sec") + " | " + this.localize("Skip") + " in " + n + this.localize(" Sec")) : (this.hasClass("ad-skip-btn") || this.addClass("ad-skip-btn"),
  2070. "" + t + this.localize("Sec") + " | " + this.localize("Skip This AD")),
  2071. this.updateTextNodeNew_(i))
  2072. }
  2073. ,
  2074. t.updateTextNodeNew_ = function(e) {
  2075. var t = this;
  2076. void 0 === e && (e = 0),
  2077. this.formattedTime_ !== e && (this.formattedTime_ = e,
  2078. this.requestAnimationFrame(function() {
  2079. if (t.contentEl_) {
  2080. var e = t.textNode_;
  2081. t.textNode_ = f.createTextNode(t.formattedTime_),
  2082. t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
  2083. }
  2084. }))
  2085. }
  2086. ,
  2087. t.handleMouseDown = function(e) {
  2088. X(e) && this.player_.ads && this.player_.remainingTimeDisplay() <= this.skipTime() && this.player_.currentTime(this.player_.duration() - .1),
  2089. e.stopPropagation()
  2090. }
  2091. ,
  2092. t.handleClick = function(e) {
  2093. e.stopPropagation()
  2094. }
  2095. ,
  2096. e
  2097. }(Rt);
  2098. Ft.prototype.labelText_ = "Skip Time",
  2099. Ft.prototype.controlText_ = "Skip Time",
  2100. He.registerComponent("SkipADDisplay", Ft);
  2101. var Ht = function(i) {
  2102. function e(e, t) {
  2103. var n;
  2104. return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
  2105. n.on("click", n.handleClick),
  2106. n.remainAdTime_ = 60,
  2107. n
  2108. }
  2109. We(e, i);
  2110. var t = e.prototype;
  2111. return t.buildCSSClass = function() {
  2112. return "ad-countdown-time"
  2113. }
  2114. ,
  2115. t.createEl = function() {
  2116. var e = i.prototype.createEl.call(this);
  2117. return e.appendChild(w("span", {
  2118. className: "ad-vip-can-skip",
  2119. innerHTML: " | " + this.localize("Activate Video Card to skip ADs")
  2120. }), this.contentEl_),
  2121. e.appendChild(w("span", {
  2122. className: "ad-discount1",
  2123. innerHTML: " "
  2124. }), this.contentEl_),
  2125. e
  2126. }
  2127. ,
  2128. t.updateContent = function(e) {
  2129. if ("number" == typeof this.player_.duration()) {
  2130. var t, n = "" + ((t = this.player_.ended() ? 0 : (this.player_.remainingTimeDisplay,
  2131. this.player_.remainingTimeDisplay())) + this.remainAdTime_);
  2132. 90 < t ? this.updateTextNodeNew_(" ") : this.updateTextNodeNew_(n)
  2133. }
  2134. }
  2135. ,
  2136. t.updateRemainAdTime = function(e) {
  2137. this.remainAdTime_ = e
  2138. }
  2139. ,
  2140. t.updateTextNodeNew_ = function(e) {
  2141. var t = this;
  2142. void 0 === e && (e = 0),
  2143. this.formattedTime_ !== e && (this.formattedTime_ = e,
  2144. this.requestAnimationFrame(function() {
  2145. if (t.contentEl_) {
  2146. var e = t.textNode_;
  2147. t.textNode_ = f.createTextNode(t.formattedTime_),
  2148. t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
  2149. }
  2150. }))
  2151. }
  2152. ,
  2153. t.handleClick = function(e) {
  2154. this.player().trigger("vipstatus"),
  2155. e.stopPropagation()
  2156. }
  2157. ,
  2158. e
  2159. }(Rt);
  2160. Ht.prototype.labelText_ = "ADCountdown Time",
  2161. Ht.prototype.controlText_ = "ADCountdown Time",
  2162. He.registerComponent("ADCountdownDisplay", Ht);
  2163. var Vt = function(r) {
  2164. function e(e, t) {
  2165. var n;
  2166. return (n = r.call(this, e, t) || this).emitTapEvents(),
  2167. n.enable(),
  2168. n
  2169. }
  2170. We(e, r);
  2171. var t = e.prototype;
  2172. return t.createEl = function(e, t, n) {
  2173. void 0 === e && (e = "div"),
  2174. void 0 === t && (t = {}),
  2175. void 0 === n && (n = {}),
  2176. t = b({
  2177. innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
  2178. className: this.buildCSSClass(),
  2179. tabIndex: 0
  2180. }, t),
  2181. "button" === e && m.error("Creating a ClickableComponent with an HTML element of " + e + " is not supported; use a Button instead."),
  2182. n = b({
  2183. role: "button"
  2184. }, n),
  2185. this.tabIndex_ = t.tabIndex;
  2186. var i = r.prototype.createEl.call(this, e, t, n);
  2187. return this.createControlTextEl(i),
  2188. i
  2189. }
  2190. ,
  2191. t.dispose = function() {
  2192. this.controlTextEl_ = null,
  2193. r.prototype.dispose.call(this)
  2194. }
  2195. ,
  2196. t.createControlTextEl = function(e) {
  2197. return this.controlTextEl_ = w("span", {
  2198. className: "vjs-control-text"
  2199. }, {
  2200. "aria-live": "polite"
  2201. }),
  2202. e && e.appendChild(this.controlTextEl_),
  2203. this.controlText(this.controlText_, e),
  2204. this.controlTextEl_
  2205. }
  2206. ,
  2207. t.controlText = function(e, t) {
  2208. if (void 0 === t && (t = this.el()),
  2209. void 0 === e)
  2210. return this.controlText_ || "Need Text";
  2211. var n = this.localize(e);
  2212. this.controlText_ = e,
  2213. x(this.controlTextEl_, n),
  2214. this.nonIconControl || t.setAttribute("title", n)
  2215. }
  2216. ,
  2217. t.buildCSSClass = function() {
  2218. return "vjs-control vjs-button " + r.prototype.buildCSSClass.call(this)
  2219. }
  2220. ,
  2221. t.enable = function() {
  2222. this.enabled_ || (this.enabled_ = !0,
  2223. this.removeClass("vjs-disabled"),
  2224. this.el_.setAttribute("aria-disabled", "false"),
  2225. "undefined" != typeof this.tabIndex_ && this.el_.setAttribute("tabIndex", this.tabIndex_),
  2226. this.on(["tap", "click"], this.handleClick),
  2227. this.on("keydown", this.handleKeyDown))
  2228. }
  2229. ,
  2230. t.disable = function() {
  2231. this.enabled_ = !1,
  2232. this.addClass("vjs-disabled"),
  2233. this.el_.setAttribute("aria-disabled", "true"),
  2234. "undefined" != typeof this.tabIndex_ && this.el_.removeAttribute("tabIndex"),
  2235. this.off("mouseover", this.handleMouseOver),
  2236. this.off("mouseout", this.handleMouseOut),
  2237. this.off(["tap", "click"], this.handleClick),
  2238. this.off("keydown", this.handleKeyDown)
  2239. }
  2240. ,
  2241. t.handleClick = function(e) {
  2242. this.options_.clickHandler && this.options_.clickHandler.call(this, arguments)
  2243. }
  2244. ,
  2245. t.handleKeyDown = function(e) {
  2246. Mt.isEventKey(e, "Space") || Mt.isEventKey(e, "Enter") ? (e.preventDefault(),
  2247. e.stopPropagation()) : r.prototype.handleKeyDown.call(this, e)
  2248. }
  2249. ,
  2250. e
  2251. }(He);
  2252. He.registerComponent("ClickableComponent", Vt);
  2253. var Qt = function(t) {
  2254. function e() {
  2255. return t.apply(this, arguments) || this
  2256. }
  2257. We(e, t);
  2258. var n = e.prototype;
  2259. return n.createEl = function(e, t, n) {
  2260. void 0 === t && (t = {}),
  2261. void 0 === n && (n = {}),
  2262. t = b({
  2263. innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
  2264. className: this.buildCSSClass()
  2265. }, t),
  2266. n = b({
  2267. type: "button"
  2268. }, n);
  2269. var i = He.prototype.createEl.call(this, "button", t, n);
  2270. return this.createControlTextEl(i),
  2271. i
  2272. }
  2273. ,
  2274. n.addChild = function(e, t) {
  2275. void 0 === t && (t = {});
  2276. var n = this.constructor.name;
  2277. return m.warn("Adding an actionable (user controllable) child to a Button (" + n + ") is not supported; use a ClickableComponent instead."),
  2278. He.prototype.addChild.call(this, e, t)
  2279. }
  2280. ,
  2281. n.enable = function() {
  2282. t.prototype.enable.call(this),
  2283. this.el_.removeAttribute("disabled")
  2284. }
  2285. ,
  2286. n.disable = function() {
  2287. t.prototype.disable.call(this),
  2288. this.el_.setAttribute("disabled", "disabled")
  2289. }
  2290. ,
  2291. n.handleKeyDown = function(e) {
  2292. t.prototype.handleKeyDown.call(this, e)
  2293. }
  2294. ,
  2295. e
  2296. }(Vt);
  2297. He.registerComponent("Button", Qt);
  2298. function Ut(e, t) {
  2299. t.tech_ && !t.tech_.featuresMuteControl && e.addClass("vjs-hidden"),
  2300. e.on(t, "loadstart", function() {
  2301. t.tech_.featuresMuteControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden")
  2302. })
  2303. }
  2304. var qt = function(i) {
  2305. function e(e, t) {
  2306. var n;
  2307. return n = i.call(this, e, t) || this,
  2308. Ut(Ve(n), e),
  2309. G(n.el()),
  2310. n.el().oncontextmenu = function(e) {
  2311. return !0
  2312. }
  2313. ,
  2314. n.on(e, ["loadstart", "volumechange"], n.update),
  2315. n
  2316. }
  2317. We(e, i);
  2318. var t = e.prototype;
  2319. return t.buildCSSClass = function() {
  2320. return "ads-mute vjs-mute-control " + i.prototype.buildCSSClass.call(this)
  2321. }
  2322. ,
  2323. t.handleClick = function(e) {
  2324. var t = this.player_.volume()
  2325. , n = this.player_.lastVolume_();
  2326. if (0 === t) {
  2327. var i = n < .1 ? .1 : n;
  2328. this.player_.volume(i),
  2329. this.player_.muted(!1)
  2330. } else
  2331. this.player_.muted(!this.player_.muted());
  2332. e.stopPropagation()
  2333. }
  2334. ,
  2335. t.update = function(e) {
  2336. this.updateIcon_(),
  2337. this.updateControlText_()
  2338. }
  2339. ,
  2340. t.updateIcon_ = function() {
  2341. var e = this.player_.volume()
  2342. , t = 3;
  2343. ht && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted),
  2344. 0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2);
  2345. for (var n = 0; n < 4; n++)
  2346. I(this.el_, "vjs-vol-" + n);
  2347. L(this.el_, "vjs-vol-" + t)
  2348. }
  2349. ,
  2350. t.updateControlText_ = function() {
  2351. var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute";
  2352. this.controlText() !== e && this.controlText(e)
  2353. }
  2354. ,
  2355. e
  2356. }(Qt);
  2357. qt.prototype.controlText_ = "Mute",
  2358. He.registerComponent("AdsMuteToggle", qt);
  2359. var zt = function(i) {
  2360. function e(e, t) {
  2361. var n;
  2362. return (n = i.call(this, e, t) || this).on(e, "fullscreenchange", n.handleFullscreenChange),
  2363. !1 === f[e.fsApi_.fullscreenEnabled] && n.disable(),
  2364. n
  2365. }
  2366. We(e, i);
  2367. var t = e.prototype;
  2368. return t.buildCSSClass = function() {
  2369. return "ads-fullscreen-btn vjs-fullscreen-control " + i.prototype.buildCSSClass.call(this)
  2370. }
  2371. ,
  2372. t.handleFullscreenChange = function(e) {
  2373. this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen")
  2374. }
  2375. ,
  2376. t.handleClick = function(e) {
  2377. this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen(),
  2378. e.stopPropagation()
  2379. }
  2380. ,
  2381. e
  2382. }(Qt);
  2383. zt.prototype.controlText_ = "Fullscreen",
  2384. He.registerComponent("AdsFullscreenToggle", zt);
  2385. var Wt = function(s) {
  2386. function e(e, t) {
  2387. var n;
  2388. if ((n = s.call(this, e, t) || this).adLink = "https://www.cctv.com",
  2389. n.on("click", n.handleClick),
  2390. !0 !== n.player().options().enableVip) {
  2391. var i = new Ft(e,t);
  2392. n.addChild(i)
  2393. } else {
  2394. var r = new Ht(e,t);
  2395. n.addChild(r),
  2396. n.adCountdownDisplay = r
  2397. }
  2398. return n
  2399. }
  2400. We(e, s);
  2401. var t = e.prototype;
  2402. return t.createEl = function() {
  2403. var e = this.buildCSSClass()
  2404. , t = s.prototype.createEl.call(this, "div", {
  2405. className: e + "ads-overlay"
  2406. });
  2407. this.contentTextEl_ = w("span", {
  2408. className: "ads-label-text",
  2409. innerHTML: ""
  2410. }, {
  2411. "aria-live": "off",
  2412. role: "presentation"
  2413. }),
  2414. t.appendChild(this.contentTextEl_),
  2415. G(t);
  2416. var n = this.player();
  2417. return t.oncontextmenu = function(e) {
  2418. return (null === e.target || P(e.target, "ads-overlay")) && (!0 === e.ctrlKey && e.altKey ? n.showContextMenu(e, !0) : n.showContextMenu(e, !1)),
  2419. !1
  2420. }
  2421. ,
  2422. t
  2423. }
  2424. ,
  2425. t.dispose = function() {
  2426. this.contentTextEl_ = null,
  2427. this.contentEl_ = null,
  2428. this.textNode_ = null,
  2429. s.prototype.dispose.call(this)
  2430. }
  2431. ,
  2432. t.updateTextNode = function(n, i, e) {
  2433. var r = this;
  2434. !0 === this.player().options().enableVip && this.adCountdownDisplay.updateRemainAdTime(e),
  2435. this.requestAnimationFrame(function() {
  2436. if (r.contentTextEl_ && (void 0 !== i && (r.adLink = i),
  2437. !0 !== r.player().options().enableVip)) {
  2438. var e = r.textNode_
  2439. , t = n.split("/");
  2440. "zh-cn" === r.player_.language() ? r.textNode_ = f.createTextNode("第 " + t[0] + " 个广告 • 共 " + t[1] + " 个") : r.textNode_ = f.createTextNode("AD: " + t[0] + " of " + t[1]),
  2441. r.textNode_ && (e ? r.contentTextEl_.replaceChild(r.textNode_, e) : r.contentTextEl_.appendChild(r.textNode_))
  2442. }
  2443. })
  2444. }
  2445. ,
  2446. t.handleClick = function() {
  2447. void 0 !== p && p.open(this.adLink, "_blank")
  2448. }
  2449. ,
  2450. t.updateContent = function(e) {}
  2451. ,
  2452. e
  2453. }(He);
  2454. Wt.prototype.labelText_ = "AD",
  2455. Wt.prototype.controlText_ = "AD Label",
  2456. Wt.prototype.options_ = {
  2457. children: ["adsMuteToggle", "adsFullscreenToggle"]
  2458. },
  2459. He.registerComponent("adsOverLay", Wt);
  2460. var Kt = function(i) {
  2461. function e(e, t) {
  2462. var n;
  2463. return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
  2464. n.off(e, ["timeupdate", "ended"], n.updateContent),
  2465. n.showActivity_ = !0,
  2466. !(n.played_ = !1) === n.player().options().skipAdTip ? (n.hide(),
  2467. n.on(e, "play", n.firstplay)) : n.addClass("ad-vip-skip-hint-hide"),
  2468. n
  2469. }
  2470. We(e, i);
  2471. var t = e.prototype;
  2472. return t.buildCSSClass = function() {
  2473. return "ad-vip-skip-hint"
  2474. }
  2475. ,
  2476. t.createEl = function() {
  2477. return i.prototype.createEl.call(this)
  2478. }
  2479. ,
  2480. t.updateContent = function(e) {
  2481. this.updateTextNodeNew_()
  2482. }
  2483. ,
  2484. t.firstplay = function(e) {
  2485. var t;
  2486. this.played_ || (this.played_ = !0,
  2487. this.show(),
  2488. this.setInterval(function() {
  2489. if (this.showActivity_) {
  2490. this.showActivity_ = !1,
  2491. this.clearTimeout(t);
  2492. t = this.setTimeout(function() {
  2493. this.addClass("ad-vip-skip-hint-close")
  2494. }, 3e3)
  2495. }
  2496. }, 250))
  2497. }
  2498. ,
  2499. t.updateTextNodeNew_ = function() {
  2500. if (this.label_ = this.localize("ADs have been skipped"),
  2501. this.contentEl_) {
  2502. var e = this.textNode_;
  2503. this.textNode_ = f.createTextNode(this.label_),
  2504. this.textNode_ && (e ? this.contentEl_.replaceChild(this.textNode_, e) : this.contentEl_.appendChild(this.textNode_))
  2505. }
  2506. }
  2507. ,
  2508. e
  2509. }(Rt);
  2510. Kt.prototype.labelText_ = "",
  2511. Kt.prototype.controlText_ = "",
  2512. He.registerComponent("VipSkipAdTip", Kt);
  2513. var Xt = function(r) {
  2514. function e(e, t, n) {
  2515. var i;
  2516. return (i = r.call(this, e, t) || this).on("click", i.handleClick),
  2517. i
  2518. }
  2519. We(e, r);
  2520. var t = e.prototype;
  2521. return t.setAdData = function(e) {
  2522. this.adLink = e.clickUrl,
  2523. this.eventExposure = e.eventExposure,
  2524. this.eventExposure1 = e.eventExposure1,
  2525. this.imgUrl = e.url,
  2526. this.imgWidth = e.width,
  2527. this.imgHeight = e.height;
  2528. var t = this.el().getElementsByTagName("img")[0];
  2529. t.src = this.imgUrl,
  2530. t.style.width = this.imgWidth + "px",
  2531. t.style.height = this.imgHeight + "px",
  2532. this.el().style.width = this.imgWidth + "px",
  2533. this.el().style.height = this.imgHeight + "px"
  2534. }
  2535. ,
  2536. t.createEl = function() {
  2537. var e = this.buildCSSClass();
  2538. return r.prototype.createEl.call(this, "div", {
  2539. className: e + "pause-ad-content",
  2540. innerHTML: '<img class="pause-ad-img" role="presentation" src="" onload=\'\'></img>'
  2541. })
  2542. }
  2543. ,
  2544. t.dispose = function() {
  2545. this.contentTextEl_ = null,
  2546. this.contentEl_ = null,
  2547. this.textNode_ = null,
  2548. r.prototype.dispose.call(this)
  2549. }
  2550. ,
  2551. t.showAd = function() {
  2552. this.show()
  2553. }
  2554. ,
  2555. t.hideAd = function() {
  2556. this.hide()
  2557. }
  2558. ,
  2559. t.handleClick = function(e) {
  2560. void 0 !== p && void 0 !== this.adLink && p.open(this.adLink, "_blank")
  2561. }
  2562. ,
  2563. t.updateContent = function(e) {}
  2564. ,
  2565. e
  2566. }(He);
  2567. Xt.prototype.options_ = {
  2568. children: ["PauseAdCloseButton"]
  2569. },
  2570. He.registerComponent("pauseAdContent", Xt);
  2571. var Gt = function(i) {
  2572. function e(e, t) {
  2573. var n;
  2574. return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
  2575. n
  2576. }
  2577. We(e, i);
  2578. var t = e.prototype;
  2579. return t.buildCSSClass = function() {
  2580. return "pause-ad-close " + i.prototype.buildCSSClass.call(this)
  2581. }
  2582. ,
  2583. t.handleClick = function(e) {}
  2584. ,
  2585. t.playerResize = function() {}
  2586. ,
  2587. e
  2588. }(Qt);
  2589. He.registerComponent("PauseAdCloseButton", Gt);
  2590. var Yt = function(e) {
  2591. var t = $t.call(e);
  2592. return "[object Function]" === t || "function" == typeof e && "[object RegExp]" !== t || "undefined" != typeof window && (e === window.setTimeout || e === window.alert || e === window.confirm || e === window.prompt)
  2593. }/**
  2594. * @license
  2595. * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
  2596. * Copyright (c) 2014 David Björklund
  2597. * Available under the MIT license
  2598. * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
  2599. */
  2600. , $t = Object.prototype.toString;
  2601. var Jt = function(e) {
  2602. var r = {};
  2603. return e && e.trim().split("\n").forEach(function(e) {
  2604. var t = e.indexOf(":")
  2605. , n = e.slice(0, t).trim().toLowerCase()
  2606. , i = e.slice(t + 1).trim();
  2607. "undefined" == typeof r[n] ? r[n] = i : Array.isArray(r[n]) ? r[n].push(i) : r[n] = [r[n], i]
  2608. }),
  2609. r
  2610. }
  2611. , Zt = nn
  2612. , en = nn;
  2613. function tn(e, t, n) {
  2614. var i = e;
  2615. return Yt(t) ? (n = t,
  2616. "string" == typeof e && (i = {
  2617. uri: e
  2618. })) : i = r({}, t, {
  2619. uri: e
  2620. }),
  2621. i.callback = n,
  2622. i
  2623. }
  2624. function nn(e, t, n) {
  2625. return rn(t = tn(e, t, n))
  2626. }
  2627. function rn(i) {
  2628. if ("undefined" == typeof i.callback)
  2629. throw new Error("callback argument missing");
  2630. var r = !1
  2631. , s = function(e, t, n) {
  2632. r || (r = !0,
  2633. i.callback(e, t, n))
  2634. };
  2635. function t(e) {
  2636. return clearTimeout(o),
  2637. e instanceof Error || (e = new Error("" + (e || "Unknown XMLHttpRequest Error"))),
  2638. e.statusCode = 0,
  2639. s(e, v)
  2640. }
  2641. function e() {
  2642. if (!a) {
  2643. var e;
  2644. clearTimeout(o),
  2645. e = i.useXDR && void 0 === l.status ? 200 : 1223 === l.status ? 204 : l.status;
  2646. var t = v
  2647. , n = null;
  2648. return 0 !== e ? (t = {
  2649. body: function() {
  2650. var e = void 0;
  2651. if (e = l.response ? l.response : l.responseText || function(e) {
  2652. try {
  2653. if ("document" === e.responseType)
  2654. return e.responseXML;
  2655. var t = e.responseXML && "parsererror" === e.responseXML.documentElement.nodeName;
  2656. if ("" === e.responseType && !t)
  2657. return e.responseXML
  2658. } catch (e) {}
  2659. return null
  2660. }(l),
  2661. f)
  2662. try {
  2663. e = JSON.parse(e)
  2664. } catch (e) {}
  2665. return e
  2666. }(),
  2667. statusCode: e,
  2668. method: c,
  2669. headers: {},
  2670. url: u,
  2671. rawRequest: l
  2672. },
  2673. l.getAllResponseHeaders && (t.headers = Jt(l.getAllResponseHeaders()))) : n = new Error("Internal XMLHttpRequest Error"),
  2674. s(n, t, t.body)
  2675. }
  2676. }
  2677. var n, a, o, l = i.xhr || null, u = (l = l || (i.cors || i.useXDR ? new nn.XDomainRequest : new nn.XMLHttpRequest)).url = i.uri || i.url, c = l.method = i.method || "GET", h = i.body || i.data, d = l.headers = i.headers || {}, p = !!i.sync, f = !1, v = {
  2678. body: void 0,
  2679. headers: {},
  2680. statusCode: 0,
  2681. method: c,
  2682. url: u,
  2683. rawRequest: l
  2684. };
  2685. if ("json"in i && !1 !== i.json && (f = !0,
  2686. d.accept || d.Accept || (d.Accept = "application/json"),
  2687. "GET" !== c && "HEAD" !== c && (d["content-type"] || d["Content-Type"] || (d["Content-Type"] = "application/json"),
  2688. h = JSON.stringify(!0 === i.json ? h : i.json))),
  2689. l.onreadystatechange = function() {
  2690. 4 === l.readyState && setTimeout(e, 0)
  2691. }
  2692. ,
  2693. l.onload = e,
  2694. l.onerror = t,
  2695. l.onprogress = function() {}
  2696. ,
  2697. l.onabort = function() {
  2698. a = !0
  2699. }
  2700. ,
  2701. l.ontimeout = t,
  2702. l.open(c, u, !p, i.username, i.password),
  2703. p || (l.withCredentials = !!i.withCredentials),
  2704. !p && 0 < i.timeout && (o = setTimeout(function() {
  2705. if (!a) {
  2706. a = !0,
  2707. l.abort("timeout");
  2708. var e = new Error("XMLHttpRequest timeout");
  2709. e.code = "ETIMEDOUT",
  2710. t(e)
  2711. }
  2712. }, i.timeout)),
  2713. l.setRequestHeader)
  2714. for (n in d)
  2715. d.hasOwnProperty(n) && l.setRequestHeader(n, d[n]);
  2716. else if (i.headers && !function(e) {
  2717. for (var t in e)
  2718. if (e.hasOwnProperty(t))
  2719. return !1;
  2720. return !0
  2721. }(i.headers))
  2722. throw new Error("Headers cannot be set on an XDomainRequest object");
  2723. return "responseType"in i && (l.responseType = i.responseType),
  2724. "beforeSend"in i && "function" == typeof i.beforeSend && i.beforeSend(l),
  2725. l.send(h || null),
  2726. l
  2727. }
  2728. nn.XMLHttpRequest = p.XMLHttpRequest || function() {}
  2729. ,
  2730. nn.XDomainRequest = "withCredentials"in new nn.XMLHttpRequest ? nn.XMLHttpRequest : p.XDomainRequest,
  2731. function(e, t) {
  2732. for (var n = 0; n < e.length; n++)
  2733. t(e[n])
  2734. }(["get", "put", "post", "patch", "head", "delete"], function(i) {
  2735. nn["delete" === i ? "del" : i] = function(e, t, n) {
  2736. return (t = tn(e, t, n)).method = i.toUpperCase(),
  2737. rn(t)
  2738. }
  2739. }),
  2740. Zt.default = en;
  2741. function sn(e) {
  2742. var t = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"]
  2743. , n = f.createElement("a");
  2744. n.href = e;
  2745. var i, r = "" === n.host && "file:" !== n.protocol;
  2746. r && ((i = f.createElement("div")).innerHTML = '<a href="' + e + '"></a>',
  2747. n = i.firstChild,
  2748. i.setAttribute("style", "display:none; position:absolute;"),
  2749. f.body.appendChild(i));
  2750. for (var s = {}, a = 0; a < t.length; a++)
  2751. s[t[a]] = n[t[a]];
  2752. return "http:" === s.protocol && (s.host = s.host.replace(/:80$/, "")),
  2753. "https:" === s.protocol && (s.host = s.host.replace(/:443$/, "")),
  2754. s.protocol || (s.protocol = p.location.protocol),
  2755. r && f.body.removeChild(i),
  2756. s
  2757. }
  2758. function an(e) {
  2759. if (!e.match(/^https?:\/\//)) {
  2760. var t = f.createElement("div");
  2761. t.innerHTML = '<a href="' + e + '">x</a>',
  2762. e = t.firstChild.href
  2763. }
  2764. return e
  2765. }
  2766. function on(e) {
  2767. if ("string" == typeof e) {
  2768. var t = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);
  2769. if (t)
  2770. return t.pop().toLowerCase()
  2771. }
  2772. return ""
  2773. }
  2774. function ln(e, t) {
  2775. void 0 === t && (t = p.location);
  2776. var n = sn(e);
  2777. return (":" === n.protocol ? t.protocol : n.protocol) + n.host !== t.protocol + t.host
  2778. }
  2779. var un = Object.freeze({
  2780. __proto__: null,
  2781. parseUrl: sn,
  2782. getAbsoluteURL: an,
  2783. getFileExtension: on,
  2784. isCrossOrigin: ln
  2785. })
  2786. , cn = function(r) {
  2787. function e(e, t) {
  2788. var n;
  2789. (n = r.call(this, e, t) || this).hide(),
  2790. n.isPlaying_ = !1,
  2791. n.on(e, "pause", n.onPause),
  2792. n.on(e, "play", n.hideAd),
  2793. n.on(e, "ended", n.onEnded);
  2794. var i = n.getChild("pauseAdContent").getChild("PauseAdCloseButton");
  2795. return n.on(i, "click", n.hideAd),
  2796. n
  2797. }
  2798. We(e, r);
  2799. var t = e.prototype;
  2800. return t.imgLoaded = function() {}
  2801. ,
  2802. t.playerResize = function() {}
  2803. ,
  2804. t.createEl = function() {
  2805. var e = this.buildCSSClass();
  2806. return r.prototype.createEl.call(this, "div", {
  2807. className: e + "pause-ad-overlay"
  2808. })
  2809. }
  2810. ,
  2811. t.dispose = function() {
  2812. this.contentTextEl_ = null,
  2813. this.contentEl_ = null,
  2814. this.textNode_ = null,
  2815. r.prototype.dispose.call(this)
  2816. }
  2817. ,
  2818. t.showAd = function(e) {
  2819. var t = JSON.parse(e)
  2820. , n = this.getChild("PauseAdContent");
  2821. t[0] && (n.setAdData(t[0]),
  2822. this.adWidth = t[0].width,
  2823. this.adHeight = t[0].height,
  2824. this.show())
  2825. }
  2826. ,
  2827. t.hideAd = function(e) {
  2828. this.isPlaying_ = !0,
  2829. this.hide(),
  2830. e.stopPropagation()
  2831. }
  2832. ,
  2833. t.onPause = function() {
  2834. this.isPlaying_ = !1;
  2835. setTimeout(this.getAdData, 300, this)
  2836. }
  2837. ,
  2838. t.onEnded = function() {
  2839. this.isPlaying_ = !0
  2840. }
  2841. ,
  2842. t.getAdData = function(i) {
  2843. if (!i.isPlaying_ && i.player_.ads && !1 === i.player_.ads.isInAdMode() && !1 !== i.player_.options().pauseAd && void 0 !== i.player_.options().pauseAdUrl && "" !== i.player_.options().pauseAdUrl) {
  2844. var e = {
  2845. uri: i.player_.options().pauseAdUrl
  2846. }
  2847. , t = ln(i.player_.options().pauseAdUrl);
  2848. t && (e.cors = t),
  2849. Zt(e, Te(i, function(e, t, n) {
  2850. if (e)
  2851. return !1;
  2852. null != n && !1 === i.isPlaying_ && i.showAd(n)
  2853. }))
  2854. }
  2855. }
  2856. ,
  2857. t.handleClick = function() {
  2858. void 0 !== p && p.open(this.adLink, "_blank")
  2859. }
  2860. ,
  2861. t.updateContent = function(e) {}
  2862. ,
  2863. e
  2864. }(He);
  2865. cn.prototype.options_ = {
  2866. children: ["pauseAdContent"]
  2867. },
  2868. He.registerComponent("pauseAdOverLay", cn);
  2869. var hn = function(r) {
  2870. function e(e, t, n) {
  2871. var i;
  2872. return (i = r.call(this, e, t) || this).on("click", i.handleClick),
  2873. i
  2874. }
  2875. We(e, r);
  2876. var t = e.prototype;
  2877. return t.setAdData = function(e) {
  2878. this.adLink = e.clickUrl,
  2879. this.eventExposure = e.eventExposure,
  2880. this.eventExposure1 = e.eventExposure1,
  2881. this.imgUrl = e.url;
  2882. var t = this.el().getElementsByTagName("img")[0];
  2883. t.src = this.imgUrl,
  2884. t.style.width = "540px",
  2885. t.style.height = "70px",
  2886. this.el().style.width = "540px",
  2887. this.el().style.height = "70px"
  2888. }
  2889. ,
  2890. t.createEl = function() {
  2891. var e = this.buildCSSClass();
  2892. return r.prototype.createEl.call(this, "div", {
  2893. className: e + "banner-ad-content",
  2894. innerHTML: '<img class="banner-ad-img" role="presentation" src="" ></img>'
  2895. })
  2896. }
  2897. ,
  2898. t.dispose = function() {
  2899. this.contentTextEl_ = null,
  2900. this.contentEl_ = null,
  2901. this.textNode_ = null,
  2902. r.prototype.dispose.call(this)
  2903. }
  2904. ,
  2905. t.showAd = function() {
  2906. this.show()
  2907. }
  2908. ,
  2909. t.hideAd = function() {
  2910. this.hide()
  2911. }
  2912. ,
  2913. t.handleClick = function(e) {
  2914. void 0 !== p && void 0 !== this.adLink && p.open(this.adLink, "_blank")
  2915. }
  2916. ,
  2917. t.updateContent = function(e) {}
  2918. ,
  2919. e
  2920. }(He);
  2921. hn.prototype.options_ = {
  2922. children: ["BannerAdCloseButton"]
  2923. },
  2924. He.registerComponent("BannerAdContent", hn);
  2925. var dn = function(i) {
  2926. function e(e, t) {
  2927. var n;
  2928. return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
  2929. n
  2930. }
  2931. We(e, i);
  2932. var t = e.prototype;
  2933. return t.buildCSSClass = function() {
  2934. return "banner-ad-close " + i.prototype.buildCSSClass.call(this)
  2935. }
  2936. ,
  2937. t.handleClick = function(e) {}
  2938. ,
  2939. t.playerResize = function() {}
  2940. ,
  2941. e
  2942. }(Qt);
  2943. He.registerComponent("BannerAdCloseButton", dn);
  2944. var pn = function(r) {
  2945. function e(e, t) {
  2946. var n;
  2947. (n = r.call(this, e, t) || this).player_.mainContentDuration_ = void 0,
  2948. n.timer = void 0,
  2949. n.bannerAd1Showed = !1,
  2950. n.bannerAd2Showed = !1,
  2951. n.hide(),
  2952. n.on(e, "timeupdate", n.timeUpdata);
  2953. var i = n.getChild("bannerAdContent").getChild("BannerAdCloseButton");
  2954. return n.on(i, "click", n.hideAd),
  2955. n
  2956. }
  2957. We(e, r);
  2958. var t = e.prototype;
  2959. return t.imgLoaded = function() {}
  2960. ,
  2961. t.playerResize = function() {}
  2962. ,
  2963. t.createEl = function() {
  2964. var e = this.buildCSSClass();
  2965. return r.prototype.createEl.call(this, "div", {
  2966. className: e + "banner-ad-overlay"
  2967. })
  2968. }
  2969. ,
  2970. t.dispose = function() {
  2971. this.contentTextEl_ = null,
  2972. this.contentEl_ = null,
  2973. this.textNode_ = null,
  2974. r.prototype.dispose.call(this)
  2975. }
  2976. ,
  2977. t.showAd = function(e) {
  2978. var t = JSON.parse(e)
  2979. , n = this.getChild("BannerAdContent");
  2980. t[0] && (n.setAdData(t[0]),
  2981. this.show(),
  2982. this.timer && clearTimeout(this.timer),
  2983. this.timer = setTimeout(this.timeHide, 1e4, this))
  2984. }
  2985. ,
  2986. t.timeHide = function(e) {
  2987. e.hide()
  2988. }
  2989. ,
  2990. t.hideAd = function(e) {
  2991. clearTimeout(this.timer),
  2992. this.hide(),
  2993. e.stopPropagation()
  2994. }
  2995. ,
  2996. t.timeUpdata = function() {
  2997. !this.bannerAd2Showed && 300 < this.player_.mainContentDuration_ && 180 <= this.player_.currentTime() ? (this.bannerAd2Showed = !0,
  2998. this.getAdData()) : !this.bannerAd1Showed && 300 < this.player_.mainContentDuration_ && 60 <= this.player_.currentTime() && this.player_.currentTime() < 180 ? (this.bannerAd1Showed = !0,
  2999. this.getAdData()) : !this.bannerAd1Showed && 60 <= this.player_.mainContentDuration_ && this.player_.mainContentDuration_ <= 300 && 60 <= this.player_.currentTime() && (this.bannerAd1Showed = !0,
  3000. this.getAdData())
  3001. }
  3002. ,
  3003. t.getAdData = function() {
  3004. var i = this;
  3005. if (i.player_.ads && !1 === i.player_.ads.isInAdMode() && !1 !== i.player_.options().bannerAd && void 0 !== i.player_.options().bannerAdUrl && "" !== i.player_.options().bannerAdUrl) {
  3006. var e = {
  3007. uri: i.player_.options().bannerAdUrl
  3008. }
  3009. , t = ln(i.player_.options().bannerAdUrl);
  3010. t && (e.cors = t),
  3011. Zt(e, Te(i, function(e, t, n) {
  3012. if (e)
  3013. return !1;
  3014. null != n && i.showAd(n)
  3015. }))
  3016. }
  3017. }
  3018. ,
  3019. t.handleClick = function() {
  3020. void 0 !== p && p.open(this.adLink, "_blank")
  3021. }
  3022. ,
  3023. t.updateContent = function(e) {}
  3024. ,
  3025. e
  3026. }(He);
  3027. pn.prototype.options_ = {
  3028. children: ["bannerAdContent"]
  3029. },
  3030. He.registerComponent("bannerAdOverLay", pn);
  3031. var fn = function(i) {
  3032. function e(e) {
  3033. var t;
  3034. void 0 === e && (e = []),
  3035. (t = i.call(this) || this).tracks_ = [],
  3036. Object.defineProperty(Ve(t), "length", {
  3037. get: function() {
  3038. return this.tracks_.length
  3039. }
  3040. });
  3041. for (var n = 0; n < e.length; n++)
  3042. t.addTrack(e[n]);
  3043. return t
  3044. }
  3045. We(e, i);
  3046. var t = e.prototype;
  3047. return t.addTrack = function(e) {
  3048. var t = this.tracks_.length;
  3049. "" + t in this || Object.defineProperty(this, t, {
  3050. get: function() {
  3051. return this.tracks_[t]
  3052. }
  3053. }),
  3054. -1 === this.tracks_.indexOf(e) && (this.tracks_.push(e),
  3055. this.trigger({
  3056. track: e,
  3057. type: "addtrack",
  3058. target: this
  3059. }))
  3060. }
  3061. ,
  3062. t.removeTrack = function(e) {
  3063. for (var t, n = 0, i = this.length; n < i; n++)
  3064. if (this[n] === e) {
  3065. (t = this[n]).off && t.off(),
  3066. this.tracks_.splice(n, 1);
  3067. break
  3068. }
  3069. t && this.trigger({
  3070. track: t,
  3071. type: "removetrack",
  3072. target: this
  3073. })
  3074. }
  3075. ,
  3076. t.getTrackById = function(e) {
  3077. for (var t = null, n = 0, i = this.length; n < i; n++) {
  3078. var r = this[n];
  3079. if (r.id === e) {
  3080. t = r;
  3081. break
  3082. }
  3083. }
  3084. return t
  3085. }
  3086. ,
  3087. e
  3088. }(ke);
  3089. for (var vn in fn.prototype.allowedEvents_ = {
  3090. change: "change",
  3091. addtrack: "addtrack",
  3092. removetrack: "removetrack"
  3093. },
  3094. fn.prototype.allowedEvents_)
  3095. fn.prototype["on" + vn] = null;
  3096. function gn(e, t) {
  3097. for (var n = 0; n < e.length; n++)
  3098. Object.keys(e[n]).length && t.id !== e[n].id && (e[n].enabled = !1)
  3099. }
  3100. function yn(e, t) {
  3101. for (var n = 0; n < e.length; n++)
  3102. Object.keys(e[n]).length && t.id !== e[n].id && (e[n].selected = !1)
  3103. }
  3104. function mn(e, t) {
  3105. var n = new p.WebVTT.Parser(p,p.vttjs,p.WebVTT.StringDecoder())
  3106. , i = [];
  3107. n.oncue = function(e) {
  3108. t.addCue(e)
  3109. }
  3110. ,
  3111. n.onparsingerror = function(e) {
  3112. i.push(e)
  3113. }
  3114. ,
  3115. n.onflush = function() {
  3116. t.trigger({
  3117. type: "loadeddata",
  3118. target: t
  3119. })
  3120. }
  3121. ,
  3122. n.parse(e),
  3123. 0 < i.length && (p.console && p.console.groupCollapsed && p.console.groupCollapsed("Text Track parsing errors for " + t.src),
  3124. i.forEach(function(e) {
  3125. return m.error(e)
  3126. }),
  3127. p.console && p.console.groupEnd && p.console.groupEnd()),
  3128. n.flush()
  3129. }
  3130. function _n(e, i) {
  3131. var t = {
  3132. uri: e
  3133. }
  3134. , n = ln(e);
  3135. n && (t.cors = n),
  3136. Zt(t, Te(this, function(e, t, n) {
  3137. if (e)
  3138. return m.error(e, t);
  3139. i.loaded_ = !0,
  3140. "function" != typeof p.WebVTT ? i.tech_ && i.tech_.any(["vttjsloaded", "vttjserror"], function(e) {
  3141. if ("vttjserror" !== e.type)
  3142. return mn(n, i);
  3143. m.error("vttjs failed to load, stopping trying to process " + i.src)
  3144. }) : mn(n, i)
  3145. }))
  3146. }
  3147. var bn = function(i) {
  3148. function e(e) {
  3149. var t;
  3150. void 0 === e && (e = []);
  3151. for (var n = e.length - 1; 0 <= n; n--)
  3152. if (e[n].enabled) {
  3153. gn(e, e[n]);
  3154. break
  3155. }
  3156. return (t = i.call(this, e) || this).changing_ = !1,
  3157. t
  3158. }
  3159. We(e, i);
  3160. var t = e.prototype;
  3161. return t.addTrack = function(e) {
  3162. var t = this;
  3163. e.enabled && gn(this, e),
  3164. i.prototype.addTrack.call(this, e),
  3165. e.addEventListener && (e.enabledChange_ = function() {
  3166. t.changing_ || (t.changing_ = !0,
  3167. gn(t, e),
  3168. t.changing_ = !1,
  3169. t.trigger("change"))
  3170. }
  3171. ,
  3172. e.addEventListener("enabledchange", e.enabledChange_))
  3173. }
  3174. ,
  3175. t.removeTrack = function(e) {
  3176. i.prototype.removeTrack.call(this, e),
  3177. e.removeEventListener && e.enabledChange_ && (e.removeEventListener("enabledchange", e.enabledChange_),
  3178. e.enabledChange_ = null)
  3179. }
  3180. ,
  3181. e
  3182. }(fn)
  3183. , Tn = function(i) {
  3184. function e(e) {
  3185. var t;
  3186. void 0 === e && (e = []);
  3187. for (var n = e.length - 1; 0 <= n; n--)
  3188. if (e[n].selected) {
  3189. yn(e, e[n]);
  3190. break
  3191. }
  3192. return (t = i.call(this, e) || this).changing_ = !1,
  3193. Object.defineProperty(Ve(t), "selectedIndex", {
  3194. get: function() {
  3195. for (var e = 0; e < this.length; e++)
  3196. if (this[e].selected)
  3197. return e;
  3198. return -1
  3199. },
  3200. set: function() {}
  3201. }),
  3202. t
  3203. }
  3204. We(e, i);
  3205. var t = e.prototype;
  3206. return t.addTrack = function(e) {
  3207. var t = this;
  3208. e.selected && yn(this, e),
  3209. i.prototype.addTrack.call(this, e),
  3210. e.addEventListener && (e.selectedChange_ = function() {
  3211. t.changing_ || (t.changing_ = !0,
  3212. yn(t, e),
  3213. t.changing_ = !1,
  3214. t.trigger("change"))
  3215. }
  3216. ,
  3217. e.addEventListener("selectedchange", e.selectedChange_))
  3218. }
  3219. ,
  3220. t.removeTrack = function(e) {
  3221. i.prototype.removeTrack.call(this, e),
  3222. e.removeEventListener && e.selectedChange_ && (e.removeEventListener("selectedchange", e.selectedChange_),
  3223. e.selectedChange_ = null)
  3224. }
  3225. ,
  3226. e
  3227. }(fn)
  3228. , Cn = function(n) {
  3229. function e() {
  3230. return n.apply(this, arguments) || this
  3231. }
  3232. We(e, n);
  3233. var t = e.prototype;
  3234. return t.addTrack = function(e) {
  3235. var t = this;
  3236. n.prototype.addTrack.call(this, e),
  3237. this.queueChange_ || (this.queueChange_ = function() {
  3238. return t.queueTrigger("change")
  3239. }
  3240. ),
  3241. this.triggerSelectedlanguagechange || (this.triggerSelectedlanguagechange_ = function() {
  3242. return t.trigger("selectedlanguagechange")
  3243. }
  3244. ),
  3245. e.addEventListener("modechange", this.queueChange_);
  3246. -1 === ["metadata", "chapters"].indexOf(e.kind) && e.addEventListener("modechange", this.triggerSelectedlanguagechange_)
  3247. }
  3248. ,
  3249. t.removeTrack = function(e) {
  3250. n.prototype.removeTrack.call(this, e),
  3251. e.removeEventListener && (this.queueChange_ && e.removeEventListener("modechange", this.queueChange_),
  3252. this.selectedlanguagechange_ && e.removeEventListener("modechange", this.triggerSelectedlanguagechange_))
  3253. }
  3254. ,
  3255. e
  3256. }(fn)
  3257. , kn = function() {
  3258. function e(e) {
  3259. void 0 === e && (e = []),
  3260. this.trackElements_ = [],
  3261. Object.defineProperty(this, "length", {
  3262. get: function() {
  3263. return this.trackElements_.length
  3264. }
  3265. });
  3266. for (var t = 0, n = e.length; t < n; t++)
  3267. this.addTrackElement_(e[t])
  3268. }
  3269. var t = e.prototype;
  3270. return t.addTrackElement_ = function(e) {
  3271. var t = this.trackElements_.length;
  3272. "" + t in this || Object.defineProperty(this, t, {
  3273. get: function() {
  3274. return this.trackElements_[t]
  3275. }
  3276. }),
  3277. -1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e)
  3278. }
  3279. ,
  3280. t.getTrackElementByTrack_ = function(e) {
  3281. for (var t, n = 0, i = this.trackElements_.length; n < i; n++)
  3282. if (e === this.trackElements_[n].track) {
  3283. t = this.trackElements_[n];
  3284. break
  3285. }
  3286. return t
  3287. }
  3288. ,
  3289. t.removeTrackElement_ = function(e) {
  3290. for (var t = 0, n = this.trackElements_.length; t < n; t++)
  3291. if (e === this.trackElements_[t]) {
  3292. this.trackElements_[t].track && "function" == typeof this.trackElements_[t].track.off && this.trackElements_[t].track.off(),
  3293. "function" == typeof this.trackElements_[t].off && this.trackElements_[t].off(),
  3294. this.trackElements_.splice(t, 1);
  3295. break
  3296. }
  3297. }
  3298. ,
  3299. e
  3300. }()
  3301. , En = function() {
  3302. function t(e) {
  3303. t.prototype.setCues_.call(this, e),
  3304. Object.defineProperty(this, "length", {
  3305. get: function() {
  3306. return this.length_
  3307. }
  3308. })
  3309. }
  3310. var e = t.prototype;
  3311. return e.setCues_ = function(e) {
  3312. var t = this.length || 0
  3313. , n = 0
  3314. , i = e.length;
  3315. this.cues_ = e,
  3316. this.length_ = e.length;
  3317. function r(e) {
  3318. "" + e in this || Object.defineProperty(this, "" + e, {
  3319. get: function() {
  3320. return this.cues_[e]
  3321. }
  3322. })
  3323. }
  3324. if (t < i)
  3325. for (n = t; n < i; n++)
  3326. r.call(this, n)
  3327. }
  3328. ,
  3329. e.getCueById = function(e) {
  3330. for (var t = null, n = 0, i = this.length; n < i; n++) {
  3331. var r = this[n];
  3332. if (r.id === e) {
  3333. t = r;
  3334. break
  3335. }
  3336. }
  3337. return t
  3338. }
  3339. ,
  3340. t
  3341. }()
  3342. , Sn = {
  3343. alternative: "alternative",
  3344. captions: "captions",
  3345. main: "main",
  3346. sign: "sign",
  3347. subtitles: "subtitles",
  3348. commentary: "commentary"
  3349. }
  3350. , wn = {
  3351. alternative: "alternative",
  3352. descriptions: "descriptions",
  3353. main: "main",
  3354. "main-desc": "main-desc",
  3355. translation: "translation",
  3356. commentary: "commentary"
  3357. }
  3358. , xn = {
  3359. subtitles: "subtitles",
  3360. captions: "captions",
  3361. descriptions: "descriptions",
  3362. chapters: "chapters",
  3363. metadata: "metadata"
  3364. }
  3365. , An = {
  3366. disabled: "disabled",
  3367. hidden: "hidden",
  3368. showing: "showing"
  3369. }
  3370. , Pn = function(s) {
  3371. function e(e) {
  3372. var t;
  3373. void 0 === e && (e = {}),
  3374. t = s.call(this) || this;
  3375. function n(e) {
  3376. Object.defineProperty(Ve(t), e, {
  3377. get: function() {
  3378. return i[e]
  3379. },
  3380. set: function() {}
  3381. })
  3382. }
  3383. var i = {
  3384. id: e.id || "vjs_track_" + le(),
  3385. kind: e.kind || "",
  3386. label: e.label || "",
  3387. language: e.language || ""
  3388. };
  3389. for (var r in i)
  3390. n(r);
  3391. return t
  3392. }
  3393. return We(e, s),
  3394. e
  3395. }(ke)
  3396. , Ln = function(u) {
  3397. function e(e) {
  3398. var t;
  3399. if (void 0 === e && (e = {}),
  3400. !e.tech)
  3401. throw new Error("A tech was not provided.");
  3402. var n = Fe(e, {
  3403. kind: xn[e.kind] || "subtitles",
  3404. language: e.language || e.srclang || ""
  3405. })
  3406. , i = An[n.mode] || "disabled"
  3407. , r = n.default;
  3408. "metadata" !== n.kind && "chapters" !== n.kind || (i = "hidden"),
  3409. (t = u.call(this, n) || this).tech_ = n.tech,
  3410. t.cues_ = [],
  3411. t.activeCues_ = [],
  3412. t.preload_ = !1 !== t.tech_.preloadTextTracks;
  3413. var s = new En(t.cues_)
  3414. , a = new En(t.activeCues_)
  3415. , o = !1
  3416. , l = Te(Ve(t), function() {
  3417. this.activeCues = this.activeCues,
  3418. o && (this.trigger("cuechange"),
  3419. o = !1)
  3420. });
  3421. return "disabled" !== i && t.tech_.ready(function() {
  3422. t.tech_.on("timeupdate", l)
  3423. }, !0),
  3424. Object.defineProperties(Ve(t), {
  3425. default: {
  3426. get: function() {
  3427. return r
  3428. },
  3429. set: function() {}
  3430. },
  3431. mode: {
  3432. get: function() {
  3433. return i
  3434. },
  3435. set: function(e) {
  3436. var t = this;
  3437. An[e] && (i = e,
  3438. this.preload_ || "disabled" === i || 0 !== this.cues.length || _n(this.src, this),
  3439. "disabled" !== i ? this.tech_.ready(function() {
  3440. t.tech_.on("timeupdate", l)
  3441. }, !0) : this.tech_.off("timeupdate", l),
  3442. this.trigger("modechange"))
  3443. }
  3444. },
  3445. cues: {
  3446. get: function() {
  3447. return this.loaded_ ? s : null
  3448. },
  3449. set: function() {}
  3450. },
  3451. activeCues: {
  3452. get: function() {
  3453. if (!this.loaded_)
  3454. return null;
  3455. if (0 === this.cues.length)
  3456. return a;
  3457. for (var e = this.tech_.currentTime(), t = [], n = 0, i = this.cues.length; n < i; n++) {
  3458. var r = this.cues[n];
  3459. r.startTime <= e && r.endTime >= e ? t.push(r) : r.startTime === r.endTime && r.startTime <= e && r.startTime + .5 >= e && t.push(r)
  3460. }
  3461. if (o = !1,
  3462. t.length !== this.activeCues_.length)
  3463. o = !0;
  3464. else
  3465. for (var s = 0; s < t.length; s++)
  3466. -1 === this.activeCues_.indexOf(t[s]) && (o = !0);
  3467. return this.activeCues_ = t,
  3468. a.setCues_(this.activeCues_),
  3469. a
  3470. },
  3471. set: function() {}
  3472. }
  3473. }),
  3474. n.src ? (t.src = n.src,
  3475. t.preload_ || (t.loaded_ = !0),
  3476. (t.preload_ || r || "subtitles" !== n.kind && "captions" !== n.kind) && _n(t.src, Ve(t))) : t.loaded_ = !0,
  3477. t
  3478. }
  3479. We(e, u);
  3480. var t = e.prototype;
  3481. return t.addCue = function(e) {
  3482. var t = e;
  3483. if (p.vttjs && !(e instanceof p.vttjs.VTTCue)) {
  3484. for (var n in t = new p.vttjs.VTTCue(e.startTime,e.endTime,e.text),
  3485. e)
  3486. n in t || (t[n] = e[n]);
  3487. t.id = e.id,
  3488. t.originalCue_ = e
  3489. }
  3490. for (var i = this.tech_.textTracks(), r = 0; r < i.length; r++)
  3491. i[r] !== this && i[r].removeCue(t);
  3492. this.cues_.push(t),
  3493. this.cues.setCues_(this.cues_)
  3494. }
  3495. ,
  3496. t.removeCue = function(e) {
  3497. for (var t = this.cues_.length; t--; ) {
  3498. var n = this.cues_[t];
  3499. if (n === e || n.originalCue_ && n.originalCue_ === e) {
  3500. this.cues_.splice(t, 1),
  3501. this.cues.setCues_(this.cues_);
  3502. break
  3503. }
  3504. }
  3505. }
  3506. ,
  3507. e
  3508. }(Pn);
  3509. Ln.prototype.allowedEvents_ = {
  3510. cuechange: "cuechange"
  3511. };
  3512. var In = function(r) {
  3513. function e(e) {
  3514. var t;
  3515. void 0 === e && (e = {});
  3516. var n = Fe(e, {
  3517. kind: wn[e.kind] || ""
  3518. });
  3519. t = r.call(this, n) || this;
  3520. var i = !1;
  3521. return Object.defineProperty(Ve(t), "enabled", {
  3522. get: function() {
  3523. return i
  3524. },
  3525. set: function(e) {
  3526. "boolean" == typeof e && e !== i && (i = e,
  3527. this.trigger("enabledchange"))
  3528. }
  3529. }),
  3530. n.enabled && (t.enabled = n.enabled),
  3531. t.loaded_ = !0,
  3532. t
  3533. }
  3534. return We(e, r),
  3535. e
  3536. }(Pn)
  3537. , Mn = function(r) {
  3538. function e(e) {
  3539. var t;
  3540. void 0 === e && (e = {});
  3541. var n = Fe(e, {
  3542. kind: Sn[e.kind] || ""
  3543. });
  3544. t = r.call(this, n) || this;
  3545. var i = !1;
  3546. return Object.defineProperty(Ve(t), "selected", {
  3547. get: function() {
  3548. return i
  3549. },
  3550. set: function(e) {
  3551. "boolean" == typeof e && e !== i && (i = e,
  3552. this.trigger("selectedchange"))
  3553. }
  3554. }),
  3555. n.selected && (t.selected = n.selected),
  3556. t
  3557. }
  3558. return We(e, r),
  3559. e
  3560. }(Pn)
  3561. , jn = function(r) {
  3562. function e(e) {
  3563. var t, n;
  3564. void 0 === e && (e = {}),
  3565. t = r.call(this) || this;
  3566. var i = new Ln(e);
  3567. return t.kind = i.kind,
  3568. t.src = i.src,
  3569. t.srclang = i.language,
  3570. t.label = i.label,
  3571. t.default = i.default,
  3572. Object.defineProperties(Ve(t), {
  3573. readyState: {
  3574. get: function() {
  3575. return n
  3576. }
  3577. },
  3578. track: {
  3579. get: function() {
  3580. return i
  3581. }
  3582. }
  3583. }),
  3584. n = 0,
  3585. i.addEventListener("loadeddata", function() {
  3586. n = 2,
  3587. t.trigger({
  3588. type: "load",
  3589. target: Ve(t)
  3590. })
  3591. }),
  3592. t
  3593. }
  3594. return We(e, r),
  3595. e
  3596. }(ke);
  3597. jn.prototype.allowedEvents_ = {
  3598. load: "load"
  3599. },
  3600. jn.NONE = 0,
  3601. jn.LOADING = 1,
  3602. jn.LOADED = 2,
  3603. jn.ERROR = 3;
  3604. var On = {
  3605. audio: {
  3606. ListClass: bn,
  3607. TrackClass: In,
  3608. capitalName: "Audio"
  3609. },
  3610. video: {
  3611. ListClass: Tn,
  3612. TrackClass: Mn,
  3613. capitalName: "Video"
  3614. },
  3615. text: {
  3616. ListClass: Cn,
  3617. TrackClass: Ln,
  3618. capitalName: "Text"
  3619. }
  3620. };
  3621. Object.keys(On).forEach(function(e) {
  3622. On[e].getterName = e + "Tracks",
  3623. On[e].privateName = e + "Tracks_"
  3624. });
  3625. var Nn = {
  3626. remoteText: {
  3627. ListClass: Cn,
  3628. TrackClass: Ln,
  3629. capitalName: "RemoteText",
  3630. getterName: "remoteTextTracks",
  3631. privateName: "remoteTextTracks_"
  3632. },
  3633. remoteTextEl: {
  3634. ListClass: kn,
  3635. TrackClass: jn,
  3636. capitalName: "RemoteTextTrackEls",
  3637. getterName: "remoteTextTrackEls",
  3638. privateName: "remoteTextTrackEls_"
  3639. }
  3640. }
  3641. , Dn = r({}, On, Nn);
  3642. Nn.names = Object.keys(Nn),
  3643. On.names = Object.keys(On),
  3644. Dn.names = [].concat(Nn.names).concat(On.names);
  3645. var Bn = Object.create || function(e) {
  3646. if (1 !== arguments.length)
  3647. throw new Error("Object.create shim only accepts one parameter.");
  3648. return Rn.prototype = e,
  3649. new Rn
  3650. }
  3651. ;
  3652. function Rn() {}
  3653. function Fn(e, t) {
  3654. this.name = "ParsingError",
  3655. this.code = e.code,
  3656. this.message = t || e.message
  3657. }
  3658. function Hn(e) {
  3659. function t(e, t, n, i) {
  3660. return 3600 * (0 | e) + 60 * (0 | t) + (0 | n) + (0 | i) / 1e3
  3661. }
  3662. var n = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
  3663. return n ? n[3] ? t(n[1], n[2], n[3].replace(":", ""), n[4]) : 59 < n[1] ? t(n[1], n[2], 0, n[4]) : t(0, n[1], n[2], n[4]) : null
  3664. }
  3665. function Vn() {
  3666. this.values = Bn(null)
  3667. }
  3668. function Qn(e, t, n, i) {
  3669. var r = i ? e.split(i) : [e];
  3670. for (var s in r)
  3671. if ("string" == typeof r[s]) {
  3672. var a = r[s].split(n);
  3673. if (2 === a.length)
  3674. t(a[0], a[1])
  3675. }
  3676. }
  3677. function Un(t, e, a) {
  3678. var n = t;
  3679. function i() {
  3680. var e = Hn(t);
  3681. if (null === e)
  3682. throw new Fn(Fn.Errors.BadTimeStamp,"Malformed timestamp: " + n);
  3683. return t = t.replace(/^[^\sa-zA-Z-]+/, ""),
  3684. e
  3685. }
  3686. function r() {
  3687. t = t.replace(/^\s+/, "")
  3688. }
  3689. if (r(),
  3690. e.startTime = i(),
  3691. r(),
  3692. "--\x3e" !== t.substr(0, 3))
  3693. throw new Fn(Fn.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): " + n);
  3694. t = t.substr(3),
  3695. r(),
  3696. e.endTime = i(),
  3697. r(),
  3698. function(e, t) {
  3699. var s = new Vn;
  3700. Qn(e, function(e, t) {
  3701. switch (e) {
  3702. case "region":
  3703. for (var n = a.length - 1; 0 <= n; n--)
  3704. if (a[n].id === t) {
  3705. s.set(e, a[n].region);
  3706. break
  3707. }
  3708. break;
  3709. case "vertical":
  3710. s.alt(e, t, ["rl", "lr"]);
  3711. break;
  3712. case "line":
  3713. var i = t.split(",")
  3714. , r = i[0];
  3715. s.integer(e, r),
  3716. s.percent(e, r) && s.set("snapToLines", !1),
  3717. s.alt(e, r, ["auto"]),
  3718. 2 === i.length && s.alt("lineAlign", i[1], ["start", "center", "end"]);
  3719. break;
  3720. case "position":
  3721. i = t.split(","),
  3722. s.percent(e, i[0]),
  3723. 2 === i.length && s.alt("positionAlign", i[1], ["start", "center", "end"]);
  3724. break;
  3725. case "size":
  3726. s.percent(e, t);
  3727. break;
  3728. case "align":
  3729. s.alt(e, t, ["start", "center", "end", "left", "right"])
  3730. }
  3731. }, /:/, /\s/),
  3732. t.region = s.get("region", null),
  3733. t.vertical = s.get("vertical", "");
  3734. try {
  3735. t.line = s.get("line", "auto")
  3736. } catch (e) {}
  3737. t.lineAlign = s.get("lineAlign", "start"),
  3738. t.snapToLines = s.get("snapToLines", !0),
  3739. t.size = s.get("size", 100);
  3740. try {
  3741. t.align = s.get("align", "center")
  3742. } catch (e) {
  3743. t.align = s.get("align", "middle")
  3744. }
  3745. try {
  3746. t.position = s.get("position", "auto")
  3747. } catch (e) {
  3748. t.position = s.get("position", {
  3749. start: 0,
  3750. left: 0,
  3751. center: 50,
  3752. middle: 50,
  3753. end: 100,
  3754. right: 100
  3755. }, t.align)
  3756. }
  3757. t.positionAlign = s.get("positionAlign", {
  3758. start: "start",
  3759. left: "start",
  3760. center: "center",
  3761. middle: "center",
  3762. end: "end",
  3763. right: "end"
  3764. }, t.align)
  3765. }(t, e)
  3766. }
  3767. ((Fn.prototype = Bn(Error.prototype)).constructor = Fn).Errors = {
  3768. BadSignature: {
  3769. code: 0,
  3770. message: "Malformed WebVTT signature."
  3771. },
  3772. BadTimeStamp: {
  3773. code: 1,
  3774. message: "Malformed time stamp."
  3775. }
  3776. },
  3777. Vn.prototype = {
  3778. set: function(e, t) {
  3779. this.get(e) || "" === t || (this.values[e] = t)
  3780. },
  3781. get: function(e, t, n) {
  3782. return n ? this.has(e) ? this.values[e] : t[n] : this.has(e) ? this.values[e] : t
  3783. },
  3784. has: function(e) {
  3785. return e in this.values
  3786. },
  3787. alt: function(e, t, n) {
  3788. for (var i = 0; i < n.length; ++i)
  3789. if (t === n[i]) {
  3790. this.set(e, t);
  3791. break
  3792. }
  3793. },
  3794. integer: function(e, t) {
  3795. /^-?\d+$/.test(t) && this.set(e, parseInt(t, 10))
  3796. },
  3797. percent: function(e, t) {
  3798. return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && (this.set(e, t),
  3799. !0)
  3800. }
  3801. };
  3802. var qn = f.createElement("textarea")
  3803. , zn = {
  3804. c: "span",
  3805. i: "i",
  3806. b: "b",
  3807. u: "u",
  3808. ruby: "ruby",
  3809. rt: "rt",
  3810. v: "span",
  3811. lang: "span"
  3812. }
  3813. , Wn = {
  3814. white: "rgba(255,255,255,1)",
  3815. lime: "rgba(0,255,0,1)",
  3816. cyan: "rgba(0,255,255,1)",
  3817. red: "rgba(255,0,0,1)",
  3818. yellow: "rgba(255,255,0,1)",
  3819. magenta: "rgba(255,0,255,1)",
  3820. blue: "rgba(0,0,255,1)",
  3821. black: "rgba(0,0,0,1)"
  3822. }
  3823. , Kn = {
  3824. v: "title",
  3825. lang: "lang"
  3826. }
  3827. , Xn = {
  3828. rt: "ruby"
  3829. };
  3830. function Gn(s, n) {
  3831. function e() {
  3832. if (!n)
  3833. return null;
  3834. var e, t = n.match(/^([^<]*)(<[^>]*>?)?/);
  3835. return e = t[1] ? t[1] : t[2],
  3836. n = n.substr(e.length),
  3837. e
  3838. }
  3839. function t(e, t) {
  3840. var n = zn[e];
  3841. if (!n)
  3842. return null;
  3843. var i = s.document.createElement(n)
  3844. , r = Kn[e];
  3845. return r && t && (i[r] = t.trim()),
  3846. i
  3847. }
  3848. for (var i, r, a, o, l = s.document.createElement("div"), u = l, c = []; null !== (i = e()); )
  3849. if ("<" !== i[0])
  3850. u.appendChild(s.document.createTextNode((r = i,
  3851. qn.innerHTML = r,
  3852. r = qn.textContent,
  3853. qn.textContent = "",
  3854. r)));
  3855. else {
  3856. if ("/" === i[1]) {
  3857. c.length && c[c.length - 1] === i.substr(2).replace(">", "") && (c.pop(),
  3858. u = u.parentNode);
  3859. continue
  3860. }
  3861. var h, d = Hn(i.substr(1, i.length - 2));
  3862. if (d) {
  3863. h = s.document.createProcessingInstruction("timestamp", d),
  3864. u.appendChild(h);
  3865. continue
  3866. }
  3867. var p = i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
  3868. if (!p)
  3869. continue;
  3870. if (!(h = t(p[1], p[3])))
  3871. continue;
  3872. if (a = u,
  3873. Xn[(o = h).localName] && Xn[o.localName] !== a.localName)
  3874. continue;
  3875. if (p[2]) {
  3876. var f = p[2].split(".");
  3877. f.forEach(function(e) {
  3878. var t = /^bg_/.test(e)
  3879. , n = t ? e.slice(3) : e;
  3880. if (Wn.hasOwnProperty(n)) {
  3881. var i = t ? "background-color" : "color"
  3882. , r = Wn[n];
  3883. h.style[i] = r
  3884. }
  3885. }),
  3886. h.className = f.join(" ")
  3887. }
  3888. c.push(p[1]),
  3889. u.appendChild(h),
  3890. u = h
  3891. }
  3892. return l
  3893. }
  3894. var Yn = [[1470, 1470], [1472, 1472], [1475, 1475], [1478, 1478], [1488, 1514], [1520, 1524], [1544, 1544], [1547, 1547], [1549, 1549], [1563, 1563], [1566, 1610], [1645, 1647], [1649, 1749], [1765, 1766], [1774, 1775], [1786, 1805], [1807, 1808], [1810, 1839], [1869, 1957], [1969, 1969], [1984, 2026], [2036, 2037], [2042, 2042], [2048, 2069], [2074, 2074], [2084, 2084], [2088, 2088], [2096, 2110], [2112, 2136], [2142, 2142], [2208, 2208], [2210, 2220], [8207, 8207], [64285, 64285], [64287, 64296], [64298, 64310], [64312, 64316], [64318, 64318], [64320, 64321], [64323, 64324], [64326, 64449], [64467, 64829], [64848, 64911], [64914, 64967], [65008, 65020], [65136, 65140], [65142, 65276], [67584, 67589], [67592, 67592], [67594, 67637], [67639, 67640], [67644, 67644], [67647, 67669], [67671, 67679], [67840, 67867], [67872, 67897], [67903, 67903], [67968, 68023], [68030, 68031], [68096, 68096], [68112, 68115], [68117, 68119], [68121, 68147], [68160, 68167], [68176, 68184], [68192, 68223], [68352, 68405], [68416, 68437], [68440, 68466], [68472, 68479], [68608, 68680], [126464, 126467], [126469, 126495], [126497, 126498], [126500, 126500], [126503, 126503], [126505, 126514], [126516, 126519], [126521, 126521], [126523, 126523], [126530, 126530], [126535, 126535], [126537, 126537], [126539, 126539], [126541, 126543], [126545, 126546], [126548, 126548], [126551, 126551], [126553, 126553], [126555, 126555], [126557, 126557], [126559, 126559], [126561, 126562], [126564, 126564], [126567, 126570], [126572, 126578], [126580, 126583], [126585, 126588], [126590, 126590], [126592, 126601], [126603, 126619], [126625, 126627], [126629, 126633], [126635, 126651], [1114109, 1114109]];
  3895. function $n(e) {
  3896. for (var t = 0; t < Yn.length; t++) {
  3897. var n = Yn[t];
  3898. if (e >= n[0] && e <= n[1])
  3899. return !0
  3900. }
  3901. return !1
  3902. }
  3903. function Jn() {}
  3904. function Zn(e, t, n) {
  3905. Jn.call(this),
  3906. this.cue = t,
  3907. this.cueDiv = Gn(e, t.text);
  3908. var i = {
  3909. color: "rgba(255, 255, 255, 1)",
  3910. backgroundColor: "rgba(0, 0, 0, 0.8)",
  3911. position: "relative",
  3912. left: 0,
  3913. right: 0,
  3914. top: 0,
  3915. bottom: 0,
  3916. display: "inline",
  3917. writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
  3918. unicodeBidi: "plaintext"
  3919. };
  3920. this.applyStyles(i, this.cueDiv),
  3921. this.div = e.document.createElement("div"),
  3922. i = {
  3923. direction: function(e) {
  3924. var t = []
  3925. , n = "";
  3926. if (!e || !e.childNodes)
  3927. return "ltr";
  3928. function r(e, t) {
  3929. for (var n = t.childNodes.length - 1; 0 <= n; n--)
  3930. e.push(t.childNodes[n])
  3931. }
  3932. function s(e) {
  3933. if (!e || !e.length)
  3934. return null;
  3935. var t = e.pop()
  3936. , n = t.textContent || t.innerText;
  3937. if (n) {
  3938. var i = n.match(/^.*(\n|\r)/);
  3939. return i ? i[e.length = 0] : n
  3940. }
  3941. return "ruby" === t.tagName ? s(e) : t.childNodes ? (r(e, t),
  3942. s(e)) : void 0
  3943. }
  3944. for (r(t, e); n = s(t); )
  3945. for (var i = 0; i < n.length; i++)
  3946. if ($n(n.charCodeAt(i)))
  3947. return "rtl";
  3948. return "ltr"
  3949. }(this.cueDiv),
  3950. writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
  3951. unicodeBidi: "plaintext",
  3952. textAlign: "middle" === t.align ? "center" : t.align,
  3953. font: n.font,
  3954. whiteSpace: "pre-line",
  3955. position: "absolute"
  3956. },
  3957. this.applyStyles(i),
  3958. this.div.appendChild(this.cueDiv);
  3959. var r = 0;
  3960. switch (t.positionAlign) {
  3961. case "start":
  3962. r = t.position;
  3963. break;
  3964. case "center":
  3965. r = t.position - t.size / 2;
  3966. break;
  3967. case "end":
  3968. r = t.position - t.size
  3969. }
  3970. "" === t.vertical ? this.applyStyles({
  3971. left: this.formatStyle(r, "%"),
  3972. width: this.formatStyle(t.size, "%")
  3973. }) : this.applyStyles({
  3974. top: this.formatStyle(r, "%"),
  3975. height: this.formatStyle(t.size, "%")
  3976. }),
  3977. this.move = function(e) {
  3978. this.applyStyles({
  3979. top: this.formatStyle(e.top, "px"),
  3980. bottom: this.formatStyle(e.bottom, "px"),
  3981. left: this.formatStyle(e.left, "px"),
  3982. right: this.formatStyle(e.right, "px"),
  3983. height: this.formatStyle(e.height, "px"),
  3984. width: this.formatStyle(e.width, "px")
  3985. })
  3986. }
  3987. }
  3988. function ei(e) {
  3989. var t, n, i, r;
  3990. if (e.div) {
  3991. n = e.div.offsetHeight,
  3992. i = e.div.offsetWidth,
  3993. r = e.div.offsetTop;
  3994. var s = (s = e.div.childNodes) && (s = s[0]) && s.getClientRects && s.getClientRects();
  3995. e = e.div.getBoundingClientRect(),
  3996. t = s ? Math.max(s[0] && s[0].height || 0, e.height / s.length) : 0
  3997. }
  3998. this.left = e.left,
  3999. this.right = e.right,
  4000. this.top = e.top || r,
  4001. this.height = e.height || n,
  4002. this.bottom = e.bottom || r + (e.height || n),
  4003. this.width = e.width || i,
  4004. this.lineHeight = void 0 !== t ? t : e.lineHeight
  4005. }
  4006. function ti(e, t, o, l) {
  4007. var n = new ei(t)
  4008. , i = t.cue
  4009. , r = function(e) {
  4010. if ("number" == typeof e.line && (e.snapToLines || 0 <= e.line && e.line <= 100))
  4011. return e.line;
  4012. if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement)
  4013. return -1;
  4014. for (var t = e.track, n = t.textTrackList, i = 0, r = 0; r < n.length && n[r] !== t; r++)
  4015. "showing" === n[r].mode && i++;
  4016. return -1 * ++i
  4017. }(i)
  4018. , s = [];
  4019. if (i.snapToLines) {
  4020. var a;
  4021. switch (i.vertical) {
  4022. case "":
  4023. s = ["+y", "-y"],
  4024. a = "height";
  4025. break;
  4026. case "rl":
  4027. s = ["+x", "-x"],
  4028. a = "width";
  4029. break;
  4030. case "lr":
  4031. s = ["-x", "+x"],
  4032. a = "width"
  4033. }
  4034. var u = n.lineHeight
  4035. , c = u * Math.round(r)
  4036. , h = o[a] + u
  4037. , d = s[0];
  4038. Math.abs(c) > h && (c = c < 0 ? -1 : 1,
  4039. c *= Math.ceil(h / u) * u),
  4040. r < 0 && (c += "" === i.vertical ? o.height : o.width,
  4041. s = s.reverse()),
  4042. n.move(d, c)
  4043. } else {
  4044. var p = n.lineHeight / o.height * 100;
  4045. switch (i.lineAlign) {
  4046. case "center":
  4047. r -= p / 2;
  4048. break;
  4049. case "end":
  4050. r -= p
  4051. }
  4052. switch (i.vertical) {
  4053. case "":
  4054. t.applyStyles({
  4055. top: t.formatStyle(r, "%")
  4056. });
  4057. break;
  4058. case "rl":
  4059. t.applyStyles({
  4060. left: t.formatStyle(r, "%")
  4061. });
  4062. break;
  4063. case "lr":
  4064. t.applyStyles({
  4065. right: t.formatStyle(r, "%")
  4066. })
  4067. }
  4068. s = ["+y", "-x", "+x", "-y"],
  4069. n = new ei(t)
  4070. }
  4071. var f = function(e, t) {
  4072. for (var n, i = new ei(e), r = 1, s = 0; s < t.length; s++) {
  4073. for (; e.overlapsOppositeAxis(o, t[s]) || e.within(o) && e.overlapsAny(l); )
  4074. e.move(t[s]);
  4075. if (e.within(o))
  4076. return e;
  4077. var a = e.intersectPercentage(o);
  4078. a < r && (n = new ei(e),
  4079. r = a),
  4080. e = new ei(i)
  4081. }
  4082. return n || i
  4083. }(n, s);
  4084. t.move(f.toCSSCompatValues(o))
  4085. }
  4086. function ni() {}
  4087. Jn.prototype.applyStyles = function(e, t) {
  4088. for (var n in t = t || this.div,
  4089. e)
  4090. e.hasOwnProperty(n) && (t.style[n] = e[n])
  4091. }
  4092. ,
  4093. Jn.prototype.formatStyle = function(e, t) {
  4094. return 0 === e ? 0 : e + t
  4095. }
  4096. ,
  4097. (Zn.prototype = Bn(Jn.prototype)).constructor = Zn,
  4098. ei.prototype.move = function(e, t) {
  4099. switch (t = void 0 !== t ? t : this.lineHeight,
  4100. e) {
  4101. case "+x":
  4102. this.left += t,
  4103. this.right += t;
  4104. break;
  4105. case "-x":
  4106. this.left -= t,
  4107. this.right -= t;
  4108. break;
  4109. case "+y":
  4110. this.top += t,
  4111. this.bottom += t;
  4112. break;
  4113. case "-y":
  4114. this.top -= t,
  4115. this.bottom -= t
  4116. }
  4117. }
  4118. ,
  4119. ei.prototype.overlaps = function(e) {
  4120. return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top
  4121. }
  4122. ,
  4123. ei.prototype.overlapsAny = function(e) {
  4124. for (var t = 0; t < e.length; t++)
  4125. if (this.overlaps(e[t]))
  4126. return !0;
  4127. return !1
  4128. }
  4129. ,
  4130. ei.prototype.within = function(e) {
  4131. return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right
  4132. }
  4133. ,
  4134. ei.prototype.overlapsOppositeAxis = function(e, t) {
  4135. switch (t) {
  4136. case "+x":
  4137. return this.left < e.left;
  4138. case "-x":
  4139. return this.right > e.right;
  4140. case "+y":
  4141. return this.top < e.top;
  4142. case "-y":
  4143. return this.bottom > e.bottom
  4144. }
  4145. }
  4146. ,
  4147. ei.prototype.intersectPercentage = function(e) {
  4148. 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)
  4149. }
  4150. ,
  4151. ei.prototype.toCSSCompatValues = function(e) {
  4152. return {
  4153. top: this.top - e.top,
  4154. bottom: e.bottom - this.bottom,
  4155. left: this.left - e.left,
  4156. right: e.right - this.right,
  4157. height: this.height,
  4158. width: this.width
  4159. }
  4160. }
  4161. ,
  4162. ei.getSimpleBoxPosition = function(e) {
  4163. var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0
  4164. , n = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0
  4165. , i = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0;
  4166. return {
  4167. left: (e = e.div ? e.div.getBoundingClientRect() : e.tagName ? e.getBoundingClientRect() : e).left,
  4168. right: e.right,
  4169. top: e.top || i,
  4170. height: e.height || t,
  4171. bottom: e.bottom || i + (e.height || t),
  4172. width: e.width || n
  4173. }
  4174. }
  4175. ,
  4176. ni.StringDecoder = function() {
  4177. return {
  4178. decode: function(e) {
  4179. if (!e)
  4180. return "";
  4181. if ("string" != typeof e)
  4182. throw new Error("Error - expected string data.");
  4183. return decodeURIComponent(encodeURIComponent(e))
  4184. }
  4185. }
  4186. }
  4187. ,
  4188. ni.convertCueToDOMTree = function(e, t) {
  4189. return e && t ? Gn(e, t) : null
  4190. }
  4191. ;
  4192. ni.processCues = function(i, r, e) {
  4193. if (!i || !r || !e)
  4194. return null;
  4195. for (; e.firstChild; )
  4196. e.removeChild(e.firstChild);
  4197. var s = i.document.createElement("div");
  4198. if (s.style.position = "absolute",
  4199. s.style.left = "0",
  4200. s.style.right = "0",
  4201. s.style.top = "0",
  4202. s.style.bottom = "0",
  4203. s.style.margin = "1.5%",
  4204. e.appendChild(s),
  4205. function(e) {
  4206. for (var t = 0; t < e.length; t++)
  4207. if (e[t].hasBeenReset || !e[t].displayState)
  4208. return !0;
  4209. return !1
  4210. }(r)) {
  4211. var a = []
  4212. , o = ei.getSimpleBoxPosition(s)
  4213. , l = {
  4214. font: Math.round(.05 * o.height * 100) / 100 + "px sans-serif"
  4215. };
  4216. !function() {
  4217. for (var e, t, n = 0; n < r.length; n++)
  4218. t = r[n],
  4219. e = new Zn(i,t,l),
  4220. s.appendChild(e.div),
  4221. ti(0, e, o, a),
  4222. t.displayState = e.div,
  4223. a.push(ei.getSimpleBoxPosition(e))
  4224. }()
  4225. } else
  4226. for (var t = 0; t < r.length; t++)
  4227. s.appendChild(r[t].displayState)
  4228. }
  4229. ,
  4230. (ni.Parser = function(e, t, n) {
  4231. n || (n = t,
  4232. t = {}),
  4233. t = t || {},
  4234. this.window = e,
  4235. this.vttjs = t,
  4236. this.state = "INITIAL",
  4237. this.buffer = "",
  4238. this.decoder = n || new TextDecoder("utf8"),
  4239. this.regionList = []
  4240. }
  4241. ).prototype = {
  4242. reportOrThrowError: function(e) {
  4243. if (!(e instanceof Fn))
  4244. throw e;
  4245. this.onparsingerror && this.onparsingerror(e)
  4246. },
  4247. parse: function(e) {
  4248. var i = this;
  4249. function t() {
  4250. for (var e = i.buffer, t = 0; t < e.length && "\r" !== e[t] && "\n" !== e[t]; )
  4251. ++t;
  4252. var n = e.substr(0, t);
  4253. return "\r" === e[t] && ++t,
  4254. "\n" === e[t] && ++t,
  4255. i.buffer = e.substr(t),
  4256. n
  4257. }
  4258. function n(e) {
  4259. e.match(/X-TIMESTAMP-MAP/) ? Qn(e, function(e, t) {
  4260. switch (e) {
  4261. case "X-TIMESTAMP-MAP":
  4262. !function(e) {
  4263. var n = new Vn;
  4264. Qn(e, function(e, t) {
  4265. switch (e) {
  4266. case "MPEGT":
  4267. n.integer(e + "S", t);
  4268. break;
  4269. case "LOCA":
  4270. n.set(e + "L", Hn(t))
  4271. }
  4272. }, /[^\d]:/, /,/),
  4273. i.ontimestampmap && i.ontimestampmap({
  4274. MPEGTS: n.get("MPEGTS"),
  4275. LOCAL: n.get("LOCAL")
  4276. })
  4277. }(t)
  4278. }
  4279. }, /=/) : Qn(e, function(e, t) {
  4280. switch (e) {
  4281. case "Region":
  4282. !function(e) {
  4283. var r = new Vn;
  4284. if (Qn(e, function(e, t) {
  4285. switch (e) {
  4286. case "id":
  4287. r.set(e, t);
  4288. break;
  4289. case "width":
  4290. r.percent(e, t);
  4291. break;
  4292. case "lines":
  4293. r.integer(e, t);
  4294. break;
  4295. case "regionanchor":
  4296. case "viewportanchor":
  4297. var n = t.split(",");
  4298. if (2 !== n.length)
  4299. break;
  4300. var i = new Vn;
  4301. if (i.percent("x", n[0]),
  4302. i.percent("y", n[1]),
  4303. !i.has("x") || !i.has("y"))
  4304. break;
  4305. r.set(e + "X", i.get("x")),
  4306. r.set(e + "Y", i.get("y"));
  4307. break;
  4308. case "scroll":
  4309. r.alt(e, t, ["up"])
  4310. }
  4311. }, /=/, /\s/),
  4312. r.has("id")) {
  4313. var t = new (i.vttjs.VTTRegion || i.window.VTTRegion);
  4314. t.width = r.get("width", 100),
  4315. t.lines = r.get("lines", 3),
  4316. t.regionAnchorX = r.get("regionanchorX", 0),
  4317. t.regionAnchorY = r.get("regionanchorY", 100),
  4318. t.viewportAnchorX = r.get("viewportanchorX", 0),
  4319. t.viewportAnchorY = r.get("viewportanchorY", 100),
  4320. t.scroll = r.get("scroll", ""),
  4321. i.onregion && i.onregion(t),
  4322. i.regionList.push({
  4323. id: r.get("id"),
  4324. region: t
  4325. })
  4326. }
  4327. }(t)
  4328. }
  4329. }, /:/)
  4330. }
  4331. e && (i.buffer += i.decoder.decode(e, {
  4332. stream: !0
  4333. }));
  4334. try {
  4335. var r;
  4336. if ("INITIAL" === i.state) {
  4337. if (!/\r\n|\n/.test(i.buffer))
  4338. return this;
  4339. var s = (r = t()).match(/^WEBVTT([ \t].*)?$/);
  4340. if (!s || !s[0])
  4341. throw new Fn(Fn.Errors.BadSignature);
  4342. i.state = "HEADER"
  4343. }
  4344. for (var a = !1; i.buffer; ) {
  4345. if (!/\r\n|\n/.test(i.buffer))
  4346. return this;
  4347. switch (a ? a = !1 : r = t(),
  4348. i.state) {
  4349. case "HEADER":
  4350. /:/.test(r) ? n(r) : r || (i.state = "ID");
  4351. continue;
  4352. case "NOTE":
  4353. r || (i.state = "ID");
  4354. continue;
  4355. case "ID":
  4356. if (/^NOTE($|[ \t])/.test(r)) {
  4357. i.state = "NOTE";
  4358. break
  4359. }
  4360. if (!r)
  4361. continue;
  4362. i.cue = new (i.vttjs.VTTCue || i.window.VTTCue)(0,0,"");
  4363. try {
  4364. i.cue.align = "center"
  4365. } catch (e) {
  4366. i.cue.align = "middle"
  4367. }
  4368. if (i.state = "CUE",
  4369. -1 === r.indexOf("--\x3e")) {
  4370. i.cue.id = r;
  4371. continue
  4372. }
  4373. case "CUE":
  4374. try {
  4375. Un(r, i.cue, i.regionList)
  4376. } catch (e) {
  4377. i.reportOrThrowError(e),
  4378. i.cue = null,
  4379. i.state = "BADCUE";
  4380. continue
  4381. }
  4382. i.state = "CUETEXT";
  4383. continue;
  4384. case "CUETEXT":
  4385. var o = -1 !== r.indexOf("--\x3e");
  4386. if (!r || o && (a = !0)) {
  4387. i.oncue && i.oncue(i.cue),
  4388. i.cue = null,
  4389. i.state = "ID";
  4390. continue
  4391. }
  4392. i.cue.text && (i.cue.text += "\n"),
  4393. i.cue.text += r.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
  4394. continue;
  4395. case "BADCUE":
  4396. r || (i.state = "ID");
  4397. continue
  4398. }
  4399. }
  4400. } catch (e) {
  4401. i.reportOrThrowError(e),
  4402. "CUETEXT" === i.state && i.cue && i.oncue && i.oncue(i.cue),
  4403. i.cue = null,
  4404. i.state = "INITIAL" === i.state ? "BADWEBVTT" : "BADCUE"
  4405. }
  4406. return this
  4407. },
  4408. flush: function() {
  4409. var t = this;
  4410. try {
  4411. if (t.buffer += t.decoder.decode(),
  4412. !t.cue && "HEADER" !== t.state || (t.buffer += "\n\n",
  4413. t.parse()),
  4414. "INITIAL" === t.state)
  4415. throw new Fn(Fn.Errors.BadSignature)
  4416. } catch (e) {
  4417. t.reportOrThrowError(e)
  4418. }
  4419. return t.onflush && t.onflush(),
  4420. this
  4421. }
  4422. };
  4423. var ii = ni
  4424. , ri = {
  4425. "": 1,
  4426. lr: 1,
  4427. rl: 1
  4428. }
  4429. , si = {
  4430. start: 1,
  4431. center: 1,
  4432. end: 1,
  4433. left: 1,
  4434. right: 1,
  4435. auto: 1,
  4436. "line-left": 1,
  4437. "line-right": 1
  4438. };
  4439. function ai(e) {
  4440. return "string" == typeof e && (!!si[e.toLowerCase()] && e.toLowerCase())
  4441. }
  4442. function oi(e, t, n) {
  4443. this.hasBeenReset = !1;
  4444. var i = ""
  4445. , r = !1
  4446. , s = e
  4447. , a = t
  4448. , o = n
  4449. , l = null
  4450. , u = ""
  4451. , c = !0
  4452. , h = "auto"
  4453. , d = "start"
  4454. , p = "auto"
  4455. , f = "auto"
  4456. , v = 100
  4457. , g = "center";
  4458. Object.defineProperties(this, {
  4459. id: {
  4460. enumerable: !0,
  4461. get: function() {
  4462. return i
  4463. },
  4464. set: function(e) {
  4465. i = "" + e
  4466. }
  4467. },
  4468. pauseOnExit: {
  4469. enumerable: !0,
  4470. get: function() {
  4471. return r
  4472. },
  4473. set: function(e) {
  4474. r = !!e
  4475. }
  4476. },
  4477. startTime: {
  4478. enumerable: !0,
  4479. get: function() {
  4480. return s
  4481. },
  4482. set: function(e) {
  4483. if ("number" != typeof e)
  4484. throw new TypeError("Start time must be set to a number.");
  4485. s = e,
  4486. this.hasBeenReset = !0
  4487. }
  4488. },
  4489. endTime: {
  4490. enumerable: !0,
  4491. get: function() {
  4492. return a
  4493. },
  4494. set: function(e) {
  4495. if ("number" != typeof e)
  4496. throw new TypeError("End time must be set to a number.");
  4497. a = e,
  4498. this.hasBeenReset = !0
  4499. }
  4500. },
  4501. text: {
  4502. enumerable: !0,
  4503. get: function() {
  4504. return o
  4505. },
  4506. set: function(e) {
  4507. o = "" + e,
  4508. this.hasBeenReset = !0
  4509. }
  4510. },
  4511. region: {
  4512. enumerable: !0,
  4513. get: function() {
  4514. return l
  4515. },
  4516. set: function(e) {
  4517. l = e,
  4518. this.hasBeenReset = !0
  4519. }
  4520. },
  4521. vertical: {
  4522. enumerable: !0,
  4523. get: function() {
  4524. return u
  4525. },
  4526. set: function(e) {
  4527. var t = function(e) {
  4528. return "string" == typeof e && (!!ri[e.toLowerCase()] && e.toLowerCase())
  4529. }(e);
  4530. if (!1 === t)
  4531. throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
  4532. u = t,
  4533. this.hasBeenReset = !0
  4534. }
  4535. },
  4536. snapToLines: {
  4537. enumerable: !0,
  4538. get: function() {
  4539. return c
  4540. },
  4541. set: function(e) {
  4542. c = !!e,
  4543. this.hasBeenReset = !0
  4544. }
  4545. },
  4546. line: {
  4547. enumerable: !0,
  4548. get: function() {
  4549. return h
  4550. },
  4551. set: function(e) {
  4552. if ("number" != typeof e && "auto" !== e)
  4553. throw new SyntaxError("Line: an invalid number or illegal string was specified.");
  4554. h = e,
  4555. this.hasBeenReset = !0
  4556. }
  4557. },
  4558. lineAlign: {
  4559. enumerable: !0,
  4560. get: function() {
  4561. return d
  4562. },
  4563. set: function(e) {
  4564. var t = ai(e);
  4565. t && (d = t,
  4566. this.hasBeenReset = !0)
  4567. }
  4568. },
  4569. position: {
  4570. enumerable: !0,
  4571. get: function() {
  4572. return p
  4573. },
  4574. set: function(e) {
  4575. if (e < 0 || 100 < e)
  4576. throw new Error("Position must be between 0 and 100.");
  4577. p = e,
  4578. this.hasBeenReset = !0
  4579. }
  4580. },
  4581. positionAlign: {
  4582. enumerable: !0,
  4583. get: function() {
  4584. return f
  4585. },
  4586. set: function(e) {
  4587. var t = ai(e);
  4588. t && (f = t,
  4589. this.hasBeenReset = !0)
  4590. }
  4591. },
  4592. size: {
  4593. enumerable: !0,
  4594. get: function() {
  4595. return v
  4596. },
  4597. set: function(e) {
  4598. if (e < 0 || 100 < e)
  4599. throw new Error("Size must be between 0 and 100.");
  4600. v = e,
  4601. this.hasBeenReset = !0
  4602. }
  4603. },
  4604. align: {
  4605. enumerable: !0,
  4606. get: function() {
  4607. return g
  4608. },
  4609. set: function(e) {
  4610. var t = ai(e);
  4611. if (!t)
  4612. throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
  4613. g = t,
  4614. this.hasBeenReset = !0
  4615. }
  4616. }
  4617. }),
  4618. this.displayState = void 0
  4619. }
  4620. oi.prototype.getCueAsHTML = function() {
  4621. return WebVTT.convertCueToDOMTree(window, this.text)
  4622. }
  4623. ;
  4624. var li = oi
  4625. , ui = {
  4626. "": !0,
  4627. up: !0
  4628. };
  4629. function ci(e) {
  4630. return "number" == typeof e && 0 <= e && e <= 100
  4631. }
  4632. function hi() {
  4633. var t = 100
  4634. , n = 3
  4635. , i = 0
  4636. , r = 100
  4637. , s = 0
  4638. , a = 100
  4639. , o = "";
  4640. Object.defineProperties(this, {
  4641. width: {
  4642. enumerable: !0,
  4643. get: function() {
  4644. return t
  4645. },
  4646. set: function(e) {
  4647. if (!ci(e))
  4648. throw new Error("Width must be between 0 and 100.");
  4649. t = e
  4650. }
  4651. },
  4652. lines: {
  4653. enumerable: !0,
  4654. get: function() {
  4655. return n
  4656. },
  4657. set: function(e) {
  4658. if ("number" != typeof e)
  4659. throw new TypeError("Lines must be set to a number.");
  4660. n = e
  4661. }
  4662. },
  4663. regionAnchorY: {
  4664. enumerable: !0,
  4665. get: function() {
  4666. return r
  4667. },
  4668. set: function(e) {
  4669. if (!ci(e))
  4670. throw new Error("RegionAnchorX must be between 0 and 100.");
  4671. r = e
  4672. }
  4673. },
  4674. regionAnchorX: {
  4675. enumerable: !0,
  4676. get: function() {
  4677. return i
  4678. },
  4679. set: function(e) {
  4680. if (!ci(e))
  4681. throw new Error("RegionAnchorY must be between 0 and 100.");
  4682. i = e
  4683. }
  4684. },
  4685. viewportAnchorY: {
  4686. enumerable: !0,
  4687. get: function() {
  4688. return a
  4689. },
  4690. set: function(e) {
  4691. if (!ci(e))
  4692. throw new Error("ViewportAnchorY must be between 0 and 100.");
  4693. a = e
  4694. }
  4695. },
  4696. viewportAnchorX: {
  4697. enumerable: !0,
  4698. get: function() {
  4699. return s
  4700. },
  4701. set: function(e) {
  4702. if (!ci(e))
  4703. throw new Error("ViewportAnchorX must be between 0 and 100.");
  4704. s = e
  4705. }
  4706. },
  4707. scroll: {
  4708. enumerable: !0,
  4709. get: function() {
  4710. return o
  4711. },
  4712. set: function(e) {
  4713. var t = function(e) {
  4714. return "string" == typeof e && (!!ui[e.toLowerCase()] && e.toLowerCase())
  4715. }(e);
  4716. !1 === t || (o = t)
  4717. }
  4718. }
  4719. })
  4720. }
  4721. var di = n(function(e) {
  4722. var t = e.exports = {
  4723. WebVTT: ii,
  4724. VTTCue: li,
  4725. VTTRegion: hi
  4726. };
  4727. p.vttjs = t,
  4728. p.WebVTT = t.WebVTT;
  4729. var n = t.VTTCue
  4730. , i = t.VTTRegion
  4731. , r = p.VTTCue
  4732. , s = p.VTTRegion;
  4733. t.shim = function() {
  4734. p.VTTCue = n,
  4735. p.VTTRegion = i
  4736. }
  4737. ,
  4738. t.restore = function() {
  4739. p.VTTCue = r,
  4740. p.VTTRegion = s
  4741. }
  4742. ,
  4743. p.VTTCue || t.shim()
  4744. });
  4745. di.WebVTT,
  4746. di.VTTCue,
  4747. di.VTTRegion;
  4748. var pi = function(t) {
  4749. function n(n, e) {
  4750. var i;
  4751. return void 0 === n && (n = {}),
  4752. void 0 === e && (e = function() {}
  4753. ),
  4754. n.reportTouchActivity = !1,
  4755. (i = t.call(this, null, n, e) || this).hasStarted_ = !1,
  4756. i.on("playing", function() {
  4757. this.hasStarted_ = !0
  4758. }),
  4759. i.on("loadstart", function() {
  4760. this.hasStarted_ = !1
  4761. }),
  4762. Dn.names.forEach(function(e) {
  4763. var t = Dn[e];
  4764. n && n[t.getterName] && (i[t.privateName] = n[t.getterName])
  4765. }),
  4766. i.featuresProgressEvents || i.manualProgressOn(),
  4767. i.featuresTimeupdateEvents || i.manualTimeUpdatesOn(),
  4768. ["Text", "Audio", "Video"].forEach(function(e) {
  4769. !1 === n["native" + e + "Tracks"] && (i["featuresNative" + e + "Tracks"] = !1)
  4770. }),
  4771. !1 === n.nativeCaptions || !1 === n.nativeTextTracks ? i.featuresNativeTextTracks = !1 : !0 !== n.nativeCaptions && !0 !== n.nativeTextTracks || (i.featuresNativeTextTracks = !0),
  4772. i.featuresNativeTextTracks || i.emulateTextTracks(),
  4773. i.preloadTextTracks = !1 !== n.preloadTextTracks,
  4774. i.autoRemoteTextTracks_ = new Dn.text.ListClass,
  4775. i.initTrackListeners(),
  4776. n.nativeControlsForTouch || i.emitTapEvents(),
  4777. i.constructor && (i.name_ = i.constructor.name || "Unknown Tech"),
  4778. i
  4779. }
  4780. We(n, t);
  4781. var e = n.prototype;
  4782. return e.triggerSourceset = function(e) {
  4783. var t = this;
  4784. this.isReady_ || this.one("ready", function() {
  4785. return t.setTimeout(function() {
  4786. return t.triggerSourceset(e)
  4787. }, 1)
  4788. }),
  4789. this.trigger({
  4790. src: e,
  4791. type: "sourceset"
  4792. })
  4793. }
  4794. ,
  4795. e.manualProgressOn = function() {
  4796. this.on("durationchange", this.onDurationChange),
  4797. this.manualProgress = !0,
  4798. this.one("ready", this.trackProgress)
  4799. }
  4800. ,
  4801. e.manualProgressOff = function() {
  4802. this.manualProgress = !1,
  4803. this.stopTrackingProgress(),
  4804. this.off("durationchange", this.onDurationChange)
  4805. }
  4806. ,
  4807. e.trackProgress = function(e) {
  4808. this.stopTrackingProgress(),
  4809. this.progressInterval = this.setInterval(Te(this, function() {
  4810. var e = this.bufferedPercent();
  4811. this.bufferedPercent_ !== e && this.trigger("progress"),
  4812. 1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress()
  4813. }), 500)
  4814. }
  4815. ,
  4816. e.onDurationChange = function(e) {
  4817. this.duration_ = this.duration()
  4818. }
  4819. ,
  4820. e.buffered = function() {
  4821. return gt(0, 0)
  4822. }
  4823. ,
  4824. e.bufferedPercent = function() {
  4825. return yt(this.buffered(), this.duration_)
  4826. }
  4827. ,
  4828. e.stopTrackingProgress = function() {
  4829. this.clearInterval(this.progressInterval)
  4830. }
  4831. ,
  4832. e.manualTimeUpdatesOn = function() {
  4833. this.manualTimeUpdates = !0,
  4834. this.on("play", this.trackCurrentTime),
  4835. this.on("pause", this.stopTrackingCurrentTime)
  4836. }
  4837. ,
  4838. e.manualTimeUpdatesOff = function() {
  4839. this.manualTimeUpdates = !1,
  4840. this.stopTrackingCurrentTime(),
  4841. this.off("play", this.trackCurrentTime),
  4842. this.off("pause", this.stopTrackingCurrentTime)
  4843. }
  4844. ,
  4845. e.trackCurrentTime = function() {
  4846. this.currentTimeInterval && this.stopTrackingCurrentTime(),
  4847. this.currentTimeInterval = this.setInterval(function() {
  4848. this.trigger({
  4849. type: "timeupdate",
  4850. target: this,
  4851. manuallyTriggered: !0
  4852. })
  4853. }, 250)
  4854. }
  4855. ,
  4856. e.stopTrackingCurrentTime = function() {
  4857. this.clearInterval(this.currentTimeInterval),
  4858. this.trigger({
  4859. type: "timeupdate",
  4860. target: this,
  4861. manuallyTriggered: !0
  4862. })
  4863. }
  4864. ,
  4865. e.dispose = function() {
  4866. this.clearTracks(On.names),
  4867. this.manualProgress && this.manualProgressOff(),
  4868. this.manualTimeUpdates && this.manualTimeUpdatesOff(),
  4869. t.prototype.dispose.call(this)
  4870. }
  4871. ,
  4872. e.clearTracks = function(e) {
  4873. var r = this;
  4874. (e = [].concat(e)).forEach(function(e) {
  4875. for (var t = r[e + "Tracks"]() || [], n = t.length; n--; ) {
  4876. var i = t[n];
  4877. "text" === e && r.removeRemoteTextTrack(i),
  4878. t.removeTrack(i)
  4879. }
  4880. })
  4881. }
  4882. ,
  4883. e.cleanupAutoTextTracks = function() {
  4884. for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--; ) {
  4885. var n = e[t];
  4886. this.removeRemoteTextTrack(n)
  4887. }
  4888. }
  4889. ,
  4890. e.reset = function() {}
  4891. ,
  4892. e.error = function(e) {
  4893. return void 0 !== e && (this.error_ = new Et(e),
  4894. this.trigger("error")),
  4895. this.error_
  4896. }
  4897. ,
  4898. e.played = function() {
  4899. return this.hasStarted_ ? gt(0, 0) : gt()
  4900. }
  4901. ,
  4902. e.setCurrentTime = function() {
  4903. this.manualTimeUpdates && this.trigger({
  4904. type: "timeupdate",
  4905. target: this,
  4906. manuallyTriggered: !0
  4907. })
  4908. }
  4909. ,
  4910. e.initTrackListeners = function() {
  4911. var r = this;
  4912. On.names.forEach(function(e) {
  4913. function t() {
  4914. r.trigger(e + "trackchange")
  4915. }
  4916. var n = On[e]
  4917. , i = r[n.getterName]();
  4918. i.addEventListener("removetrack", t),
  4919. i.addEventListener("addtrack", t),
  4920. r.on("dispose", function() {
  4921. i.removeEventListener("removetrack", t),
  4922. i.removeEventListener("addtrack", t)
  4923. })
  4924. })
  4925. }
  4926. ,
  4927. e.addWebVttScript_ = function() {
  4928. var e = this;
  4929. if (!p.WebVTT)
  4930. if (f.body.contains(this.el())) {
  4931. if (!this.options_["vtt.js"] && c(di) && 0 < Object.keys(di).length)
  4932. return void this.trigger("vttjsloaded");
  4933. var t = f.createElement("script");
  4934. t.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",
  4935. t.onload = function() {
  4936. e.trigger("vttjsloaded")
  4937. }
  4938. ,
  4939. t.onerror = function() {
  4940. e.trigger("vttjserror")
  4941. }
  4942. ,
  4943. this.on("dispose", function() {
  4944. t.onload = null,
  4945. t.onerror = null
  4946. }),
  4947. p.WebVTT = !0,
  4948. this.el().parentNode.appendChild(t)
  4949. } else
  4950. this.ready(this.addWebVttScript_)
  4951. }
  4952. ,
  4953. e.emulateTextTracks = function() {
  4954. function t(e) {
  4955. return i.addTrack(e.track)
  4956. }
  4957. function n(e) {
  4958. return i.removeTrack(e.track)
  4959. }
  4960. var e = this
  4961. , i = this.textTracks()
  4962. , r = this.remoteTextTracks();
  4963. r.on("addtrack", t),
  4964. r.on("removetrack", n),
  4965. this.addWebVttScript_();
  4966. function s() {
  4967. return e.trigger("texttrackchange")
  4968. }
  4969. function a() {
  4970. s();
  4971. for (var e = 0; e < i.length; e++) {
  4972. var t = i[e];
  4973. t.removeEventListener("cuechange", s),
  4974. "showing" === t.mode && t.addEventListener("cuechange", s)
  4975. }
  4976. }
  4977. a(),
  4978. i.addEventListener("change", a),
  4979. i.addEventListener("addtrack", a),
  4980. i.addEventListener("removetrack", a),
  4981. this.on("dispose", function() {
  4982. r.off("addtrack", t),
  4983. r.off("removetrack", n),
  4984. i.removeEventListener("change", a),
  4985. i.removeEventListener("addtrack", a),
  4986. i.removeEventListener("removetrack", a);
  4987. for (var e = 0; e < i.length; e++) {
  4988. i[e].removeEventListener("cuechange", s)
  4989. }
  4990. })
  4991. }
  4992. ,
  4993. e.addTextTrack = function(e, t, n) {
  4994. if (!e)
  4995. throw new Error("TextTrack kind is required but was not provided");
  4996. return function(e, t, n, i, r) {
  4997. void 0 === r && (r = {});
  4998. var s = e.textTracks();
  4999. r.kind = t,
  5000. n && (r.label = n),
  5001. i && (r.language = i),
  5002. r.tech = e;
  5003. var a = new Dn.text.TrackClass(r);
  5004. return s.addTrack(a),
  5005. a
  5006. }(this, e, t, n)
  5007. }
  5008. ,
  5009. e.createRemoteTextTrack = function(e) {
  5010. var t = Fe(e, {
  5011. tech: this
  5012. });
  5013. return new Nn.remoteTextEl.TrackClass(t)
  5014. }
  5015. ,
  5016. e.addRemoteTextTrack = function(e, t) {
  5017. var n = this;
  5018. void 0 === e && (e = {});
  5019. var i = this.createRemoteTextTrack(e);
  5020. return !0 !== t && !1 !== t && (m.warn('Calling addRemoteTextTrack without explicitly setting the "manualCleanup" parameter to `true` is deprecated and default to `false` in future version of video.js'),
  5021. t = !0),
  5022. this.remoteTextTrackEls().addTrackElement_(i),
  5023. this.remoteTextTracks().addTrack(i.track),
  5024. !0 !== t && this.ready(function() {
  5025. return n.autoRemoteTextTracks_.addTrack(i.track)
  5026. }),
  5027. i
  5028. }
  5029. ,
  5030. e.removeRemoteTextTrack = function(e) {
  5031. var t = this.remoteTextTrackEls().getTrackElementByTrack_(e);
  5032. this.remoteTextTrackEls().removeTrackElement_(t),
  5033. this.remoteTextTracks().removeTrack(e),
  5034. this.autoRemoteTextTracks_.removeTrack(e)
  5035. }
  5036. ,
  5037. e.getVideoPlaybackQuality = function() {
  5038. return {}
  5039. }
  5040. ,
  5041. e.requestPictureInPicture = function() {
  5042. var e = this.options_.Promise || p.Promise;
  5043. if (e)
  5044. return e.reject()
  5045. }
  5046. ,
  5047. e.setPoster = function() {}
  5048. ,
  5049. e.playsinline = function() {}
  5050. ,
  5051. e.setPlaysinline = function() {}
  5052. ,
  5053. e.overrideNativeAudioTracks = function() {}
  5054. ,
  5055. e.overrideNativeVideoTracks = function() {}
  5056. ,
  5057. e.canPlayType = function() {
  5058. return ""
  5059. }
  5060. ,
  5061. n.canPlayType = function() {
  5062. return ""
  5063. }
  5064. ,
  5065. n.canPlaySource = function(e, t) {
  5066. return n.canPlayType(e.type)
  5067. }
  5068. ,
  5069. n.isTech = function(e) {
  5070. return e.prototype instanceof n || e instanceof n || e === n
  5071. }
  5072. ,
  5073. n.registerTech = function(e, t) {
  5074. if (n.techs_ || (n.techs_ = {}),
  5075. !n.isTech(t))
  5076. throw new Error("Tech " + e + " must be a Tech");
  5077. if (!n.canPlayType)
  5078. throw new Error("Techs must have a static canPlayType method on them");
  5079. if (!n.canPlaySource)
  5080. throw new Error("Techs must have a static canPlaySource method on them");
  5081. return e = Re(e),
  5082. n.techs_[e] = t,
  5083. n.techs_[Be(e)] = t,
  5084. "Tech" !== e && n.defaultTechOrder_.push(e),
  5085. t
  5086. }
  5087. ,
  5088. n.getTech = function(e) {
  5089. if (e)
  5090. return n.techs_ && n.techs_[e] ? n.techs_[e] : (e = Re(e),
  5091. p && p.videojs && p.videojs[e] ? (m.warn("The " + e + " tech was added to the videojs object when it should be registered using videojs.registerTech(name, tech)"),
  5092. p.videojs[e]) : void 0)
  5093. }
  5094. ,
  5095. n
  5096. }(He);
  5097. Dn.names.forEach(function(e) {
  5098. var t = Dn[e];
  5099. pi.prototype[t.getterName] = function() {
  5100. return this[t.privateName] = this[t.privateName] || new t.ListClass,
  5101. this[t.privateName]
  5102. }
  5103. }),
  5104. pi.prototype.featuresVolumeControl = !0,
  5105. pi.prototype.featuresMuteControl = !0,
  5106. pi.prototype.featuresFullscreenResize = !1,
  5107. pi.prototype.featuresPlaybackRate = !1,
  5108. pi.prototype.featuresPlaybackQuality = !0,
  5109. pi.prototype.featuresProgressEvents = !1,
  5110. pi.prototype.featuresSourceset = !1,
  5111. pi.prototype.featuresTimeupdateEvents = !1,
  5112. pi.prototype.featuresNativeTextTracks = !1,
  5113. pi.withSourceHandlers = function(r) {
  5114. r.registerSourceHandler = function(e, t) {
  5115. var n = r.sourceHandlers;
  5116. n = n || (r.sourceHandlers = []),
  5117. void 0 === t && (t = n.length),
  5118. n.splice(t, 0, e)
  5119. }
  5120. ,
  5121. r.canPlayType = function(e) {
  5122. for (var t, n = r.sourceHandlers || [], i = 0; i < n.length; i++)
  5123. if (t = n[i].canPlayType(e))
  5124. return t;
  5125. return ""
  5126. }
  5127. ,
  5128. r.selectSourceHandler = function(e, t) {
  5129. for (var n = r.sourceHandlers || [], i = 0; i < n.length; i++)
  5130. if (n[i].canHandleSource(e, t))
  5131. return n[i];
  5132. return null
  5133. }
  5134. ,
  5135. r.canPlaySource = function(e, t) {
  5136. var n = r.selectSourceHandler(e, t);
  5137. return n ? n.canHandleSource(e, t) : ""
  5138. }
  5139. ;
  5140. ["seekable", "seeking", "duration"].forEach(function(e) {
  5141. var t = this[e];
  5142. "function" == typeof t && (this[e] = function() {
  5143. return this.sourceHandler_ && this.sourceHandler_[e] ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) : t.apply(this, arguments)
  5144. }
  5145. )
  5146. }, r.prototype),
  5147. r.prototype.setSource = function(e) {
  5148. var t = r.selectSourceHandler(e, this.options_);
  5149. t || (r.nativeSourceHandler ? t = r.nativeSourceHandler : m.error("No source handler found for the current source.")),
  5150. this.disposeSourceHandler(),
  5151. this.off("dispose", this.disposeSourceHandler),
  5152. t !== r.nativeSourceHandler && (this.currentSource_ = e),
  5153. this.sourceHandler_ = t.handleSource(e, this, this.options_),
  5154. this.one("dispose", this.disposeSourceHandler)
  5155. }
  5156. ,
  5157. r.prototype.disposeSourceHandler = function() {
  5158. this.currentSource_ && (this.clearTracks(["audio", "video"]),
  5159. this.currentSource_ = null),
  5160. this.cleanupAutoTextTracks(),
  5161. this.sourceHandler_ && (this.sourceHandler_.dispose && this.sourceHandler_.dispose(),
  5162. this.sourceHandler_ = null)
  5163. }
  5164. }
  5165. ,
  5166. He.registerComponent("Tech", pi),
  5167. pi.registerTech("Tech", pi),
  5168. pi.defaultTechOrder_ = [];
  5169. var fi = {}
  5170. , vi = {}
  5171. , gi = {};
  5172. function yi(e, t, n) {
  5173. e.setTimeout(function() {
  5174. return function n(i, e, r, s, a, o) {
  5175. void 0 === i && (i = {});
  5176. void 0 === e && (e = []);
  5177. void 0 === a && (a = []);
  5178. void 0 === o && (o = !1);
  5179. var t = e
  5180. , l = t[0]
  5181. , u = t.slice(1);
  5182. if ("string" == typeof l)
  5183. n(i, fi[l], r, s, a, o);
  5184. else if (l) {
  5185. var c = ki(s, l);
  5186. if (!c.setSource)
  5187. return a.push(c),
  5188. n(i, u, r, s, a, o);
  5189. c.setSource(b({}, i), function(e, t) {
  5190. if (e)
  5191. return n(i, u, r, s, a, o);
  5192. a.push(c),
  5193. n(t, i.type === t.type ? u : fi[t.type], r, s, a, o)
  5194. })
  5195. } else
  5196. u.length ? n(i, u, r, s, a, o) : o ? r(i, a) : n(i, fi["*"], r, s, a, !0)
  5197. }(t, fi[t.type], n, e)
  5198. }, 1)
  5199. }
  5200. function mi(e, t, n, i) {
  5201. void 0 === i && (i = null);
  5202. var r = "call" + Re(n)
  5203. , s = e.reduce(Ci(r), i)
  5204. , a = s === gi
  5205. , o = a ? null : t[n](s);
  5206. return function(e, t, n, i) {
  5207. for (var r = e.length - 1; 0 <= r; r--) {
  5208. var s = e[r];
  5209. s[t] && s[t](i, n)
  5210. }
  5211. }(e, n, o, a),
  5212. o
  5213. }
  5214. var _i = {
  5215. buffered: 1,
  5216. currentTime: 1,
  5217. duration: 1,
  5218. muted: 1,
  5219. played: 1,
  5220. paused: 1,
  5221. seekable: 1,
  5222. volume: 1
  5223. }
  5224. , bi = {
  5225. setCurrentTime: 1,
  5226. setMuted: 1,
  5227. setVolume: 1
  5228. }
  5229. , Ti = {
  5230. play: 1,
  5231. pause: 1
  5232. };
  5233. function Ci(n) {
  5234. return function(e, t) {
  5235. return e === gi ? gi : t[n] ? t[n](e) : e
  5236. }
  5237. }
  5238. function ki(e, t) {
  5239. var n = vi[e.id()]
  5240. , i = null;
  5241. if (null == n)
  5242. return i = t(e),
  5243. vi[e.id()] = [[t, i]],
  5244. i;
  5245. for (var r = 0; r < n.length; r++) {
  5246. var s = n[r]
  5247. , a = s[0]
  5248. , o = s[1];
  5249. a === t && (i = o)
  5250. }
  5251. return null === i && (i = t(e),
  5252. n.push([t, i])),
  5253. i
  5254. }
  5255. function Ei(e) {
  5256. void 0 === e && (e = "");
  5257. var t = on(e);
  5258. return Si[t.toLowerCase()] || ""
  5259. }
  5260. var Si = {
  5261. opus: "video/ogg",
  5262. ogv: "video/ogg",
  5263. mp4: "video/mp4",
  5264. mov: "video/mp4",
  5265. m4v: "video/mp4",
  5266. mkv: "video/x-matroska",
  5267. m4a: "audio/mp4",
  5268. mp3: "audio/mpeg",
  5269. aac: "audio/aac",
  5270. oga: "audio/ogg",
  5271. m3u8: "application/x-mpegURL",
  5272. jpg: "image/jpeg",
  5273. jpeg: "image/jpeg",
  5274. gif: "image/gif",
  5275. png: "image/png",
  5276. svg: "image/svg+xml",
  5277. webp: "image/webp"
  5278. };
  5279. function wi(e) {
  5280. if (!e.type) {
  5281. var t = Ei(e.src);
  5282. t && (e.type = t)
  5283. }
  5284. return e
  5285. }
  5286. var xi = Object.assign ? Object.assign : function(n, e, t, i) {
  5287. for (var r = 1; r < arguments.length; r++)
  5288. ji(Object(arguments[r]), function(e, t) {
  5289. n[t] = e
  5290. });
  5291. return n
  5292. }
  5293. , Ai = function() {
  5294. {
  5295. if (Object.create)
  5296. return function(e, t, n, i) {
  5297. var r = Mi(arguments, 1);
  5298. return xi.apply(this, [Object.create(e)].concat(r))
  5299. }
  5300. ;
  5301. var s = function() {};
  5302. return function(e, t, n, i) {
  5303. var r = Mi(arguments, 1);
  5304. return s.prototype = e,
  5305. xi.apply(this, [new s].concat(r))
  5306. }
  5307. }
  5308. }()
  5309. , Pi = String.prototype.trim ? function(e) {
  5310. return String.prototype.trim.call(e)
  5311. }
  5312. : function(e) {
  5313. return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
  5314. }
  5315. , Li = "undefined" != typeof window ? window : t
  5316. , Ii = {
  5317. assign: xi,
  5318. create: Ai,
  5319. trim: Pi,
  5320. bind: function(e, t) {
  5321. return function() {
  5322. return t.apply(e, Array.prototype.slice.call(arguments, 0))
  5323. }
  5324. },
  5325. slice: Mi,
  5326. each: ji,
  5327. map: function(e, n) {
  5328. var i = Ni(e) ? [] : {};
  5329. return Oi(e, function(e, t) {
  5330. return i[t] = n(e, t),
  5331. !1
  5332. }),
  5333. i
  5334. },
  5335. pluck: Oi,
  5336. isList: Ni,
  5337. isFunction: function(e) {
  5338. return e && "[object Function]" === {}.toString.call(e)
  5339. },
  5340. isObject: function(e) {
  5341. return e && "[object Object]" === {}.toString.call(e)
  5342. },
  5343. Global: Li
  5344. };
  5345. function Mi(e, t) {
  5346. return Array.prototype.slice.call(e, t || 0)
  5347. }
  5348. function ji(e, n) {
  5349. Oi(e, function(e, t) {
  5350. return n(e, t),
  5351. !1
  5352. })
  5353. }
  5354. function Oi(e, t) {
  5355. if (Ni(e)) {
  5356. for (var n = 0; n < e.length; n++)
  5357. if (t(e[n], n))
  5358. return e[n]
  5359. } else
  5360. for (var i in e)
  5361. if (e.hasOwnProperty(i) && t(e[i], i))
  5362. return e[i]
  5363. }
  5364. function Ni(e) {
  5365. return null != e && "function" != typeof e && "number" == typeof e.length
  5366. }
  5367. var Di = Ii.slice
  5368. , Bi = Ii.pluck
  5369. , Ri = Ii.each
  5370. , Fi = Ii.bind
  5371. , Hi = Ii.create
  5372. , Vi = Ii.isList
  5373. , Qi = Ii.isFunction
  5374. , Ui = Ii.isObject
  5375. , qi = {
  5376. createStore: Wi
  5377. }
  5378. , zi = {
  5379. version: "2.0.12",
  5380. enabled: !1,
  5381. get: function(e, t) {
  5382. var n = this.storage.read(this._namespacePrefix + e);
  5383. return this._deserialize(n, t)
  5384. },
  5385. set: function(e, t) {
  5386. return void 0 === t ? this.remove(e) : (this.storage.write(this._namespacePrefix + e, this._serialize(t)),
  5387. t)
  5388. },
  5389. remove: function(e) {
  5390. this.storage.remove(this._namespacePrefix + e)
  5391. },
  5392. each: function(n) {
  5393. var i = this;
  5394. this.storage.each(function(e, t) {
  5395. n.call(i, i._deserialize(e), (t || "").replace(i._namespaceRegexp, ""))
  5396. })
  5397. },
  5398. clearAll: function() {
  5399. this.storage.clearAll()
  5400. },
  5401. hasNamespace: function(e) {
  5402. return this._namespacePrefix == "__storejs_" + e + "_"
  5403. },
  5404. createStore: function() {
  5405. return Wi.apply(this, arguments)
  5406. },
  5407. addPlugin: function(e) {
  5408. this._addPlugin(e)
  5409. },
  5410. namespace: function(e) {
  5411. return Wi(this.storage, this.plugins, e)
  5412. }
  5413. };
  5414. function Wi(e, t, n) {
  5415. n = n || "",
  5416. e && !Vi(e) && (e = [e]),
  5417. t && !Vi(t) && (t = [t]);
  5418. var i = n ? "__storejs_" + n + "_" : ""
  5419. , r = n ? new RegExp("^" + i) : null;
  5420. if (!/^[a-zA-Z0-9_\-]*$/.test(n))
  5421. throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");
  5422. var s = Hi({
  5423. _namespacePrefix: i,
  5424. _namespaceRegexp: r,
  5425. _testStorage: function(e) {
  5426. try {
  5427. var t = "__storejs__test__";
  5428. e.write(t, t);
  5429. var n = e.read(t) === t;
  5430. return e.remove(t),
  5431. n
  5432. } catch (e) {
  5433. return !1
  5434. }
  5435. },
  5436. _assignPluginFnProp: function(i, e) {
  5437. var r = this[e];
  5438. this[e] = function() {
  5439. var n = Di(arguments, 0)
  5440. , e = this;
  5441. var t = [function() {
  5442. if (r)
  5443. return Ri(arguments, function(e, t) {
  5444. n[t] = e
  5445. }),
  5446. r.apply(e, n)
  5447. }
  5448. ].concat(n);
  5449. return i.apply(e, t)
  5450. }
  5451. },
  5452. _serialize: function(e) {
  5453. return JSON.stringify(e)
  5454. },
  5455. _deserialize: function(t, e) {
  5456. if (!t)
  5457. return e;
  5458. var n = "";
  5459. try {
  5460. n = JSON.parse(t)
  5461. } catch (e) {
  5462. n = t
  5463. }
  5464. return void 0 !== n ? n : e
  5465. },
  5466. _addStorage: function(e) {
  5467. this.enabled || this._testStorage(e) && (this.storage = e,
  5468. this.enabled = !0)
  5469. },
  5470. _addPlugin: function(n) {
  5471. var i = this;
  5472. if (Vi(n))
  5473. Ri(n, function(e) {
  5474. i._addPlugin(e)
  5475. });
  5476. else if (!Bi(this.plugins, function(e) {
  5477. return n === e
  5478. })) {
  5479. if (this.plugins.push(n),
  5480. !Qi(n))
  5481. throw new Error("Plugins must be function values that return objects");
  5482. var e = n.call(this);
  5483. if (!Ui(e))
  5484. throw new Error("Plugins must return an object of function properties");
  5485. Ri(e, function(e, t) {
  5486. if (!Qi(e))
  5487. throw new Error("Bad plugin property: " + t + " from plugin " + n.name + ". Plugins should only return functions.");
  5488. i._assignPluginFnProp(e, t)
  5489. })
  5490. }
  5491. },
  5492. addStorage: function(e) {
  5493. !function() {
  5494. var e = "undefined" == typeof console ? null : console;
  5495. e && (e.warn ? e.warn : e.log).apply(e, arguments)
  5496. }("store.addStorage(storage) is deprecated. Use createStore([storages])"),
  5497. this._addStorage(e)
  5498. }
  5499. }, zi, {
  5500. plugins: []
  5501. });
  5502. return s.raw = {},
  5503. Ri(s, function(e, t) {
  5504. Qi(e) && (s.raw[t] = Fi(s, e))
  5505. }),
  5506. Ri(e, function(e) {
  5507. s._addStorage(e)
  5508. }),
  5509. Ri(t, function(e) {
  5510. s._addPlugin(e)
  5511. }),
  5512. s
  5513. }
  5514. var Ki = Ii.Global
  5515. , Xi = {
  5516. name: "localStorage",
  5517. read: Yi,
  5518. write: function(e, t) {
  5519. return Gi().setItem(e, t)
  5520. },
  5521. each: function(e) {
  5522. for (var t = Gi().length - 1; 0 <= t; t--) {
  5523. var n = Gi().key(t);
  5524. e(Yi(n), n)
  5525. }
  5526. },
  5527. remove: function(e) {
  5528. return Gi().removeItem(e)
  5529. },
  5530. clearAll: function() {
  5531. return Gi().clear()
  5532. }
  5533. };
  5534. function Gi() {
  5535. return Ki.localStorage
  5536. }
  5537. function Yi(e) {
  5538. return Gi().getItem(e)
  5539. }
  5540. var $i = Ii.Global
  5541. , Ji = {
  5542. name: "sessionStorage",
  5543. read: er,
  5544. write: function(e, t) {
  5545. return Zi().setItem(e, t)
  5546. },
  5547. each: function(e) {
  5548. for (var t = Zi().length - 1; 0 <= t; t--) {
  5549. var n = Zi().key(t);
  5550. e(er(n), n)
  5551. }
  5552. },
  5553. remove: function(e) {
  5554. return Zi().removeItem(e)
  5555. },
  5556. clearAll: function() {
  5557. return Zi().clear()
  5558. }
  5559. };
  5560. function Zi() {
  5561. return $i.sessionStorage
  5562. }
  5563. function er(e) {
  5564. return Zi().getItem(e)
  5565. }
  5566. var tr = Ii.trim
  5567. , nr = {
  5568. name: "cookieStorage",
  5569. read: function(e) {
  5570. if (!e || !ar(e))
  5571. return null;
  5572. var t = "(?:^|.*;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";
  5573. return unescape(ir.cookie.replace(new RegExp(t), "$1"))
  5574. },
  5575. write: function(e, t) {
  5576. if (!e)
  5577. return;
  5578. ir.cookie = escape(e) + "=" + escape(t) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"
  5579. },
  5580. each: rr,
  5581. remove: sr,
  5582. clearAll: function() {
  5583. rr(function(e, t) {
  5584. sr(t)
  5585. })
  5586. }
  5587. }
  5588. , ir = Ii.Global.document;
  5589. function rr(e) {
  5590. for (var t = ir.cookie.split(/; ?/g), n = t.length - 1; 0 <= n; n--)
  5591. if (tr(t[n])) {
  5592. var i = t[n].split("=")
  5593. , r = unescape(i[0]);
  5594. e(unescape(i[1]), r)
  5595. }
  5596. }
  5597. function sr(e) {
  5598. e && ar(e) && (ir.cookie = escape(e) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")
  5599. }
  5600. function ar(e) {
  5601. return new RegExp("(?:^|;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(ir.cookie)
  5602. }
  5603. var or = {
  5604. name: "memoryStorage",
  5605. read: function(e) {
  5606. return lr[e]
  5607. },
  5608. write: function(e, t) {
  5609. lr[e] = t
  5610. },
  5611. each: function(e) {
  5612. for (var t in lr)
  5613. lr.hasOwnProperty(t) && e(lr[t], t)
  5614. },
  5615. remove: function(e) {
  5616. delete lr[e]
  5617. },
  5618. clearAll: function(e) {
  5619. lr = {}
  5620. }
  5621. }
  5622. , lr = {};
  5623. var ur = [Xi, Ji, nr, or]
  5624. , cr = qi.createStore(ur, [])
  5625. , hr = "vjs-text-track-settings"
  5626. , dr = ["#000", "Black"]
  5627. , pr = ["#00F", "Blue"]
  5628. , fr = ["#0FF", "Cyan"]
  5629. , vr = ["#0F0", "Green"]
  5630. , gr = ["#F0F", "Magenta"]
  5631. , yr = ["#F00", "Red"]
  5632. , mr = ["#FFF", "White"]
  5633. , _r = ["#FF0", "Yellow"]
  5634. , br = ["1", "Opaque"]
  5635. , Tr = ["0.5", "Semi-Transparent"]
  5636. , Cr = ["0", "Transparent"]
  5637. , kr = {
  5638. backgroundColor: {
  5639. selector: ".vjs-bg-color > select",
  5640. id: "captions-background-color-%s",
  5641. label: "Color",
  5642. options: [dr, mr, yr, vr, pr, _r, gr, fr]
  5643. },
  5644. backgroundOpacity: {
  5645. selector: ".vjs-bg-opacity > select",
  5646. id: "captions-background-opacity-%s",
  5647. label: "Transparency",
  5648. options: [br, Tr, Cr]
  5649. },
  5650. color: {
  5651. selector: ".vjs-fg-color > select",
  5652. id: "captions-foreground-color-%s",
  5653. label: "Color",
  5654. options: [mr, dr, yr, vr, pr, _r, gr, fr]
  5655. },
  5656. edgeStyle: {
  5657. selector: ".vjs-edge-style > select",
  5658. id: "%s",
  5659. label: "Text Edge Style",
  5660. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  5661. },
  5662. fontFamily: {
  5663. selector: ".vjs-font-family > select",
  5664. id: "captions-font-family-%s",
  5665. label: "Font Family",
  5666. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  5667. },
  5668. fontPercent: {
  5669. selector: ".vjs-font-percent > select",
  5670. id: "captions-font-size-%s",
  5671. label: "Font Size",
  5672. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  5673. default: 2,
  5674. parser: function(e) {
  5675. return "1.00" === e ? null : Number(e)
  5676. }
  5677. },
  5678. textOpacity: {
  5679. selector: ".vjs-text-opacity > select",
  5680. id: "captions-foreground-opacity-%s",
  5681. label: "Transparency",
  5682. options: [br, Tr]
  5683. },
  5684. windowColor: {
  5685. selector: ".vjs-window-color > select",
  5686. id: "captions-window-color-%s",
  5687. label: "Color"
  5688. },
  5689. windowOpacity: {
  5690. selector: ".vjs-window-opacity > select",
  5691. id: "captions-window-opacity-%s",
  5692. label: "Transparency",
  5693. options: [Cr, Tr, br]
  5694. }
  5695. };
  5696. function Er(e, t) {
  5697. if (t && (e = t(e)),
  5698. e && "none" !== e)
  5699. return e
  5700. }
  5701. kr.windowColor.options = kr.backgroundColor.options;
  5702. var Sr = function(i) {
  5703. function e(e, t) {
  5704. var n;
  5705. return t.temporary = !1,
  5706. t.pauseOnOpen = !1,
  5707. (n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
  5708. n.fill(),
  5709. n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
  5710. n.endDialog = w("p", {
  5711. className: "vjs-control-text",
  5712. textContent: n.localize("End of dialog window.")
  5713. }),
  5714. n.el().appendChild(n.endDialog),
  5715. n.setDefaults(),
  5716. void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
  5717. n.on(n.$(".vjs-done-button"), "click", function() {
  5718. n.saveSettings(),
  5719. n.close()
  5720. }),
  5721. n.on(n.$(".vjs-default-button"), "click", function() {
  5722. n.setDefaults(),
  5723. n.updateDisplay()
  5724. }),
  5725. a(kr, function(e) {
  5726. n.on(n.$(e.selector), "change", n.updateDisplay)
  5727. }),
  5728. n.options_.persistTextTrackSettings && n.restoreSettings(),
  5729. n
  5730. }
  5731. We(e, i);
  5732. var t = e.prototype;
  5733. return t.dispose = function() {
  5734. this.endDialog = null,
  5735. i.prototype.dispose.call(this)
  5736. }
  5737. ,
  5738. t.createElSelect_ = function(e, t, n) {
  5739. var i = this;
  5740. void 0 === t && (t = ""),
  5741. void 0 === n && (n = "label");
  5742. var r = kr[e]
  5743. , s = r.id.replace("%s", this.id_)
  5744. , a = [t, s].join(" ").trim();
  5745. return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "</" + n + ">", '<select aria-labelledby="' + a + '">'].concat(r.options.map(function(e) {
  5746. var t = s + "-" + e[1].replace(/\W+/g, "");
  5747. return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + " " + t + '">', i.localize(e[1]), "</option>"].join("")
  5748. })).concat("</select>").join("")
  5749. }
  5750. ,
  5751. t.createElFgColor_ = function() {
  5752. var e = "captions-text-legend-" + this.id_;
  5753. return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", e), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", e), "</span>", "</fieldset>"].join("")
  5754. }
  5755. ,
  5756. t.createElBgColor_ = function() {
  5757. var e = "captions-background-" + this.id_;
  5758. return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", e), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", e), "</span>", "</fieldset>"].join("")
  5759. }
  5760. ,
  5761. t.createElWinColor_ = function() {
  5762. var e = "captions-window-" + this.id_;
  5763. return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", e), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", e), "</span>", "</fieldset>"].join("")
  5764. }
  5765. ,
  5766. t.createElColors_ = function() {
  5767. return w("div", {
  5768. className: "vjs-track-settings-colors",
  5769. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  5770. })
  5771. }
  5772. ,
  5773. t.createElFont_ = function() {
  5774. return w("div", {
  5775. className: "vjs-track-settings-font",
  5776. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  5777. })
  5778. }
  5779. ,
  5780. t.createElControls_ = function() {
  5781. var e = this.localize("restore all settings to the default values");
  5782. return w("div", {
  5783. className: "vjs-track-settings-controls",
  5784. innerHTML: ['<button type="button" class="vjs-default-button" title="' + e + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + e + "</span>", "</button>", '<button type="button" class="vjs-done-button">' + this.localize("Done") + "</button>"].join("")
  5785. })
  5786. }
  5787. ,
  5788. t.content = function() {
  5789. return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
  5790. }
  5791. ,
  5792. t.label = function() {
  5793. return this.localize("Caption Settings Dialog")
  5794. }
  5795. ,
  5796. t.description = function() {
  5797. return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
  5798. }
  5799. ,
  5800. t.buildCSSClass = function() {
  5801. return i.prototype.buildCSSClass.call(this) + "vjs-debug"
  5802. }
  5803. ,
  5804. t.getValues = function() {
  5805. var r = this;
  5806. return o(kr, function(e, t, n) {
  5807. var i = function(e, t) {
  5808. return Er(e.options[e.options.selectedIndex].value, t)
  5809. }(r.$(t.selector), t.parser);
  5810. return void 0 !== i && (e[n] = i),
  5811. e
  5812. }, {})
  5813. }
  5814. ,
  5815. t.setValues = function(n) {
  5816. var i = this;
  5817. a(kr, function(e, t) {
  5818. !function(e, t, n) {
  5819. if (t)
  5820. for (var i = 0; i < e.options.length; i++)
  5821. if (Er(e.options[i].value, n) === t) {
  5822. e.selectedIndex = i;
  5823. break
  5824. }
  5825. }(i.$(e.selector), n[t], e.parser)
  5826. })
  5827. }
  5828. ,
  5829. t.setDefaults = function() {
  5830. var n = this;
  5831. a(kr, function(e) {
  5832. var t = e.hasOwnProperty("default") ? e.default : 0;
  5833. n.$(e.selector).selectedIndex = t
  5834. })
  5835. }
  5836. ,
  5837. t.restoreSettings = function() {
  5838. var e;
  5839. try {
  5840. e = JSON.parse(p.localStorage.getItem(hr))
  5841. } catch (e) {
  5842. m.warn(e)
  5843. }
  5844. e && this.setValues(e)
  5845. }
  5846. ,
  5847. t.saveSettings = function() {
  5848. if (this.options_.persistTextTrackSettings) {
  5849. var e = this.getValues();
  5850. try {
  5851. Object.keys(e).length ? p.localStorage.setItem(hr, JSON.stringify(e)) : p.localStorage.removeItem(hr)
  5852. } catch (e) {
  5853. m.warn(e)
  5854. }
  5855. }
  5856. }
  5857. ,
  5858. t.updateDisplay = function() {
  5859. var e = this.player_.getChild("textTrackDisplay");
  5860. e && e.updateDisplay()
  5861. }
  5862. ,
  5863. t.conditionalBlur_ = function() {
  5864. this.previouslyActiveEl_ = null;
  5865. var e = this.player_.controlBar
  5866. , t = e && e.subsCapsButton
  5867. , n = e && e.captionsButton;
  5868. t ? t.focus() : n && n.focus()
  5869. }
  5870. ,
  5871. e
  5872. }(Ot);
  5873. He.registerComponent("DebugDialog", Sr);
  5874. var wr = function(p) {
  5875. function e(e, t, n, i, r, s) {
  5876. var a;
  5877. void 0 === n && (n = ""),
  5878. (a = p.call(this, e, t) || this).parseContent(n),
  5879. a.barrageId = i;
  5880. var o = 9
  5881. , l = 35
  5882. , u = ["#ffffff", "#ff5353", "#42ebff", "#fad400", "#ff7f01", "#7ff75b"]
  5883. , c = "#ffffff"
  5884. , h = 10
  5885. , d = 40;
  5886. return void 0 !== a.options().playerOptions.config && (o = a.options().playerOptions.config.barrage.marginTop,
  5887. l = a.options().playerOptions.config.barrage.lineHeight,
  5888. u = a.options().playerOptions.config.barrage.color,
  5889. c = a.options().playerOptions.config.barrage.colorSelf,
  5890. h = a.options().playerOptions.config.barrage.paddingSelf,
  5891. d = a.options().playerOptions.config.barrage.borderRadius),
  5892. a.el().style.top = r * l + o + "px",
  5893. a.el().style.color = u[Math.floor(Math.random() * u.length)],
  5894. !0 === s && (a.el().style.color = c,
  5895. a.el().style.paddingLeft = h + "px",
  5896. a.el().style.paddingRight = h + "px",
  5897. a.el().style["border-radius"] = d + "px",
  5898. a.addClass("selfBarrageBorder")),
  5899. a.el().oncontextmenu = function(e) {
  5900. return !1
  5901. }
  5902. ,
  5903. a.on(["tap", "click"], a.handleClick),
  5904. a
  5905. }
  5906. We(e, p);
  5907. var t = e.prototype;
  5908. return t.handleClick = function() {
  5909. this.player_.log("[barrage-display] click!" + this.barrageId)
  5910. }
  5911. ,
  5912. t.parseContent = function(e) {
  5913. if (-1 !== e.indexOf("[/") && -1 !== e.indexOf("]")) {
  5914. for (var t, n = Mr.getEmoList().length, i = !1, r = 0; r < n; r++) {
  5915. var s = e.indexOf(Mr.getEmoList()[r].text);
  5916. if (-1 !== s) {
  5917. if (i = !0,
  5918. 0 !== s) {
  5919. var a = e.substring(0, s);
  5920. if (this.strContainEmo(a))
  5921. continue;
  5922. this.addContent(a),
  5923. this.addEmo(Mr.getEmoList()[r].name)
  5924. } else
  5925. this.addEmo(Mr.getEmoList()[r].name);
  5926. t = e.substr(s + Mr.getEmoList()[r].text.length);
  5927. break
  5928. }
  5929. }
  5930. i ? this.parseContent(t) : this.addContent(e)
  5931. } else
  5932. this.addContent(e)
  5933. }
  5934. ,
  5935. t.strContainEmo = function(e) {
  5936. for (var t = !1, n = Mr.getEmoList().length, i = 0; i < n; i++)
  5937. if (-1 !== e.indexOf(Mr.getEmoList()[i].text)) {
  5938. t = !0;
  5939. break
  5940. }
  5941. return t
  5942. }
  5943. ,
  5944. t.createEl = function() {
  5945. var e = p.prototype.createEl.call(this, "div", {
  5946. className: "barrage-display"
  5947. })
  5948. , t = 17
  5949. , n = 35;
  5950. return void 0 !== this.options().playerOptions.config && (t = this.options().playerOptions.config.barrage.fontSize,
  5951. n = this.options().playerOptions.config.barrage.lineHeight),
  5952. e.style["font-size"] = t + "px",
  5953. e.style.height = n + "px",
  5954. e.style["line-height"] = n + "px",
  5955. e.style.left = this.player_.currentWidth() + "px",
  5956. e
  5957. }
  5958. ,
  5959. t.addEmo = function(e) {
  5960. this.emoEl_ = w("img", {
  5961. className: "barrage-emo",
  5962. src: Mr.emoPicUrlPre() + "/" + e
  5963. }),
  5964. this.el().appendChild(this.emoEl_)
  5965. }
  5966. ,
  5967. t.addContent = function(e) {
  5968. this.contentEl_ = w("span", {
  5969. className: "barrage-content",
  5970. innerHTML: "" + e
  5971. }),
  5972. this.el().appendChild(w("span", {
  5973. className: "barrage-content",
  5974. innerHTML: "" + e
  5975. }))
  5976. }
  5977. ,
  5978. t.dispose = function() {
  5979. this.contentEl_ = null,
  5980. this.textNode_ = null,
  5981. p.prototype.dispose.call(this)
  5982. }
  5983. ,
  5984. e
  5985. }(He);
  5986. wr.prototype.labelText_ = "",
  5987. wr.prototype.controlText_ = "",
  5988. He.registerComponent("BarrageDisplay", wr);
  5989. function xr(e, i) {
  5990. var t = {
  5991. uri: e
  5992. }
  5993. , n = ln(e);
  5994. n && (t.cors = n),
  5995. Zt(t, Te(this, function(e, t, n) {
  5996. if (e)
  5997. return m.error(e, t);
  5998. !function(e, t) {
  5999. t.emoJSON(JSON.parse(e)),
  6000. t.onEmoConfigLoaded()
  6001. }(n, i)
  6002. }))
  6003. }
  6004. function Ar(e, i) {
  6005. var t = {
  6006. uri: e
  6007. }
  6008. , n = ln(e);
  6009. n && (t.cors = n),
  6010. Zt(t, Te(this, function(e, t, n) {
  6011. if (e)
  6012. return m.error(e, t);
  6013. i.commentLoaded(n)
  6014. }))
  6015. }
  6016. var Pr, Lr = [], Ir = !1, Mr = function(a) {
  6017. function e(e, t, n) {
  6018. var i;
  6019. (i = a.call(this, e, t, n) || this).isVod = i.player_.options_.barrageVod,
  6020. i.isVod ? i.BARRAGE_TIME_INTERVAL = 300 : (i.BARRAGE_TIME_INTERVAL = 60,
  6021. i.liveBarrageLoadCounter = -1,
  6022. void 0 !== i.player_.options_.barrageItemId && (i.liveBarrageLoadTimer = i.setInterval(i.liveBarrageLoadTimerHandler, 1e3))),
  6023. i.SHOW_TIME = 1e4,
  6024. i.FOLLOW_RATE = !0,
  6025. i.narrageIdCounter = 1,
  6026. i.commentData = [],
  6027. i.barrageDisplay = [];
  6028. var r = Te(Ve(i), i.updateDisplay);
  6029. e.on("timeupdate", Te(Ve(i), i.timeUpdateHandler)),
  6030. e.on("seeking", Te(Ve(i), i.seeking)),
  6031. e.on("loadstart", Te(Ve(i), i.toggleDisplay)),
  6032. e.on("texttrackchange", r),
  6033. i.on(e, "play", i.play),
  6034. i.on(e, "pause", i.pause),
  6035. e.ready(Te(Ve(i), function() {
  6036. e.tech_ && e.tech_.featuresNativeTextTracks ? this.hide() : (e.on("fullscreenchange", r),
  6037. e.on("playerresize", r),
  6038. p.addEventListener("orientationchange", r),
  6039. e.on("dispose", function() {
  6040. return p.removeEventListener("orientationchange", r)
  6041. }))
  6042. })),
  6043. !0 !== i.player_.options_.hasBarrage || Ir || xr(i.player_.httpPre_ + i.player_.options_.barrageConfigUrl, Ve(i)),
  6044. i.currentTimeInSecond_ = -1,
  6045. i.loadCommentTimeInSecond_ = -1,
  6046. i.lastTime = -1,
  6047. i.totalTime = 0,
  6048. i.counter = 0,
  6049. i.paused = !0;
  6050. var s = Ve(i);
  6051. return p.requestAnimationFrame(function() {
  6052. s.updateAnimation()
  6053. }),
  6054. i
  6055. }
  6056. We(e, a);
  6057. var t = e.prototype;
  6058. return t.updateAnimation = function() {
  6059. this.counter++;
  6060. var e = (new Date).getTime()
  6061. , t = e - this.lastTime;
  6062. -1 === this.lastTime && (t = 5),
  6063. this.totalTime += t,
  6064. this.lastTime = e;
  6065. for (var n, i = this.barrageDisplay.length - 1; 0 <= i; i--) {
  6066. n = this.barrageDisplay[i].el();
  6067. var r = this.player().playbackRate();
  6068. this.isVod ? this.paused || (!0 === this.FOLLOW_RATE ? this.barrageDisplay[i].showTime += t * r : this.barrageDisplay[i].showTime += t) : this.barrageDisplay[i].showTime += t,
  6069. 0 < n.offsetLeft + n.offsetWidth ? n.style.left = this.player_.currentWidth() - this.barrageDisplay[i].distance * this.barrageDisplay[i].showTime / this.SHOW_TIME + "px" : (this.removeChild(this.barrageDisplay[i]),
  6070. this.barrageDisplay.splice(i, 1))
  6071. }
  6072. var s = this;
  6073. p.requestAnimationFrame(function() {
  6074. s.updateAnimation()
  6075. })
  6076. }
  6077. ,
  6078. t.play = function() {
  6079. this.paused = !1,
  6080. this.lastTime = -1
  6081. }
  6082. ,
  6083. t.pause = function() {
  6084. this.paused = !0,
  6085. this.lastTime = -1
  6086. }
  6087. ,
  6088. t.open = function() {}
  6089. ,
  6090. t.close = function() {}
  6091. ,
  6092. e.getEmoList = function() {
  6093. return Lr
  6094. }
  6095. ,
  6096. e.emoPicUrlPre = function() {
  6097. return Pr
  6098. }
  6099. ,
  6100. t.currentTimeInSecond = function(e) {
  6101. if (void 0 === e)
  6102. return this.currentTimeInSecond_;
  6103. this.currentTimeInSecond_ = e
  6104. }
  6105. ,
  6106. t.timeUpdateHandler = function() {
  6107. if (Ir && (!this.player_.ads || !0 !== this.player_.ads.isInAdMode())) {
  6108. var e = Math.round(this.player_.currentTime());
  6109. if (this.currentTimeInSecond() !== e && (this.currentTimeInSecond(e),
  6110. this.isVod))
  6111. for (var t = this.commentData.length - 1; 0 <= t; t--)
  6112. this.commentData[t].relative_time <= 1e3 * this.player_.currentTime() && (this.addBarrage(this.commentData[t].message, !1),
  6113. this.commentData.splice(t, 1));
  6114. if (this.isVod) {
  6115. if (this.currentTimeInSecond() < 0)
  6116. return;
  6117. if (!0 !== this.player_.options_.hasBarrage)
  6118. return;
  6119. if (-1 === this.loadCommentTimeInSecond_ || this.loadCommentTimeInSecond_ + this.BARRAGE_TIME_INTERVAL <= this.currentTimeInSecond()) {
  6120. this.loadCommentTimeInSecond_ = this.currentTimeInSecond();
  6121. var n = this.player_.httpPre_ + this.player_.options_.barrageContentUrl + "app=" + this.player_.options_.barrageApp + "&prepage=1000&itemid=" + this.player_.options_.barrageItemId + "&relative_time=" + 1e3 * this.loadCommentTimeInSecond_ + "&relative_end_time=" + 1e3 * (this.loadCommentTimeInSecond_ + this.BARRAGE_TIME_INTERVAL);
  6122. Ar(n, this)
  6123. }
  6124. }
  6125. }
  6126. }
  6127. ,
  6128. t.liveBarrageLoadTimerHandler = function() {
  6129. if (this.liveBarrageLoadCounter++,
  6130. this.liveBarrageLoadCounter % 4 == 0 && (this.player_.log("show live"),
  6131. 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 0),
  6132. 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 1),
  6133. 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 2)),
  6134. 60 <= this.liveBarrageLoadCounter || 0 === this.liveBarrageLoadCounter) {
  6135. this.liveBarrageLoadCounter = 0,
  6136. this.player_.log("loadComments live");
  6137. var e = this.player_.httpPre_ + this.player_.options_.barrageContentUrl + "app=" + this.player_.options_.barrageApp + "&prepage=45&itemid=" + this.player_.options_.barrageItemId + "&nature=1";
  6138. Ar(e, this)
  6139. }
  6140. }
  6141. ,
  6142. t.seeking = function() {
  6143. if (this.isVod) {
  6144. for (this.commentData.length = 0; 0 < this.barrageDisplay.length; )
  6145. this.removeChild(this.barrageDisplay.pop());
  6146. this.loadCommentTimeInSecond_ = -1
  6147. }
  6148. }
  6149. ,
  6150. t.emoJSON = function(e) {
  6151. if (void 0 === e)
  6152. return this.emoJSON_;
  6153. this.emoJSON_ = e
  6154. }
  6155. ,
  6156. t.emoData = function() {
  6157. return this.emoJSON().data
  6158. }
  6159. ,
  6160. t.onEmoConfigLoaded = function() {
  6161. if (this.player().options().debug && this.player_.log("[barrage-layer] config loaded"),
  6162. !0 !== Ir) {
  6163. Ir = !0,
  6164. Pr = this.emoJSON_.picUrl;
  6165. for (var e = this.emoData().length, t = 0; t < e; t++)
  6166. Lr.push(this.emoData()[t])
  6167. }
  6168. }
  6169. ,
  6170. t.commentLoaded = function(e) {
  6171. if (this.isVod) {
  6172. if (void 0 === this.commentData)
  6173. return;
  6174. this.commentData.length = 0;
  6175. var t, n = JSON.parse(e);
  6176. t = n.data.content.length;
  6177. for (var i = 0; i < t; i++)
  6178. this.commentData.push(n.data.content[i])
  6179. } else {
  6180. if (void 0 === this.commentData)
  6181. return;
  6182. this.commentData.length = 0;
  6183. var r, s = JSON.parse(e);
  6184. r = s.data.content.length;
  6185. for (var a = 0; a < r; a++)
  6186. this.commentData.push(s.data.content[a])
  6187. }
  6188. }
  6189. ,
  6190. t.showBarrage = function(e) {
  6191. this.player_.ads && !0 === this.player_.ads.isInAdMode() || this.addBarrage(e, !0)
  6192. }
  6193. ,
  6194. t.addBarrage = function(e, t, n) {
  6195. this.narrageIdCounter++;
  6196. void 0 === n && (n = Math.floor(3 * Math.random()));
  6197. var i = new wr(this.player_,this.options_,e,"b" + this.narrageIdCounter,n,t);
  6198. this.addChild(i),
  6199. i.velocity = (this.player_.currentWidth() + i.width()) / this.SHOW_TIME,
  6200. i.distance = this.player_.currentWidth() + i.width(),
  6201. i.showTime = 0,
  6202. this.barrageDisplay.push(i)
  6203. }
  6204. ,
  6205. t.toggleDisplay = function() {
  6206. this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show()
  6207. }
  6208. ,
  6209. t.createEl = function() {
  6210. return a.prototype.createEl.call(this, "div", {
  6211. className: "vjs-barrage-layer"
  6212. })
  6213. }
  6214. ,
  6215. t.updateDisplay = function() {}
  6216. ,
  6217. e
  6218. }(He);
  6219. He.registerComponent("BarrageLayer", Mr);
  6220. var jr = function(i) {
  6221. function e(e, t) {
  6222. var n;
  6223. return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
  6224. n
  6225. }
  6226. We(e, i);
  6227. var t = e.prototype;
  6228. return t.buildCSSClass = function() {
  6229. return "choose-video-button-prev"
  6230. }
  6231. ,
  6232. t.handleClick = function(e) {
  6233. var t = this.player().getChild("chooseVideoPanel");
  6234. void 0 !== t && t.prevPage_()
  6235. }
  6236. ,
  6237. t.hide = function() {
  6238. this.addClass("hideButton")
  6239. }
  6240. ,
  6241. t.show = function() {
  6242. this.removeClass("hideButton")
  6243. }
  6244. ,
  6245. t.playerResize = function() {
  6246. this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
  6247. }
  6248. ,
  6249. e
  6250. }(Qt);
  6251. He.registerComponent("PrevPageButton", jr);
  6252. var Or = function(i) {
  6253. function e(e, t) {
  6254. var n;
  6255. return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
  6256. n
  6257. }
  6258. We(e, i);
  6259. var t = e.prototype;
  6260. return t.buildCSSClass = function() {
  6261. return "choose-video-button-next"
  6262. }
  6263. ,
  6264. t.handleClick = function(e) {
  6265. var t = this.player().getChild("chooseVideoPanel");
  6266. void 0 !== t && t.nextPage_()
  6267. }
  6268. ,
  6269. t.playerResize = function() {
  6270. this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
  6271. }
  6272. ,
  6273. e
  6274. }(Qt);
  6275. He.registerComponent("NextPageButton", Or);
  6276. var Nr = function(n) {
  6277. function e(e, t) {
  6278. return void 0 === t && (t = {}),
  6279. n.call(this, e, t) || this
  6280. }
  6281. We(e, n);
  6282. var t = e.prototype;
  6283. return t.panelState_ = function() {}
  6284. ,
  6285. t.createEl = function() {
  6286. return n.prototype.createEl.call(this, "div", {
  6287. className: "choose-video-content",
  6288. innerHTML: ""
  6289. })
  6290. }
  6291. ,
  6292. t.resetPage = function() {}
  6293. ,
  6294. t.updatePage = function(e) {
  6295. var t = this.player().options_.chooseVideoData.data.list
  6296. , n = 8;
  6297. e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
  6298. 600 <= this.player().currentHeight() && (n = 12,
  6299. e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1)),
  6300. e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
  6301. this.el().innerHTML = "";
  6302. for (var i = "<ul>", r = 0; r < n; r++)
  6303. void 0 !== t[e * n + r] && (i += '<li><div class="choose-video-content-item"><a href="' + t[e * n + r].url + '" target="_blank"><img width="100%" src="' + t[e * n + r].image + '" /><div>' + t[e * n + r].title + "</div></a></div></li>"),
  6304. r === n - 1 && (i += "</ul>");
  6305. this.el().innerHTML = i;
  6306. var s = .23 * this.player().currentWidth() / 16 * 9 + 40;
  6307. this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - n / 4 * s) / 2 + 20 + "px"
  6308. }
  6309. ,
  6310. t.dispose = function() {
  6311. n.prototype.dispose.call(this)
  6312. }
  6313. ,
  6314. e
  6315. }(He);
  6316. He.registerComponent("ChooseVideoPage", Nr);
  6317. var Dr = function(i) {
  6318. function e(e, t) {
  6319. var n;
  6320. return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
  6321. n
  6322. }
  6323. We(e, i);
  6324. var t = e.prototype;
  6325. return t.buildCSSClass = function() {
  6326. return "choose-video-close " + i.prototype.buildCSSClass.call(this)
  6327. }
  6328. ,
  6329. t.handleClick = function(e) {}
  6330. ,
  6331. t.playerResize = function() {
  6332. var e = 8;
  6333. 600 <= this.player().currentHeight() && (e = 12);
  6334. var t = .23 * this.player().currentWidth() / 16 * 9 + 40;
  6335. this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - e / 4 * t) / 2 + "px"
  6336. }
  6337. ,
  6338. e
  6339. }(Qt);
  6340. He.registerComponent("ChooseVideoCloseButton", Dr);
  6341. var Br = function(o) {
  6342. function e(e, t) {
  6343. var n;
  6344. void 0 === t && (t = {}),
  6345. (n = o.call(this, e, t) || this).on(e, "playerresize", n.playerResize);
  6346. var i = new jr(e,t)
  6347. , r = new Or(e,t);
  6348. n.leftBtn(i),
  6349. n.rightBtn(r);
  6350. var s = new Nr(e,t);
  6351. n.page(s),
  6352. n.addChild(i),
  6353. n.addChild(s),
  6354. n.addChild(r);
  6355. var a = new Dr(e,t);
  6356. return n.addChild(a),
  6357. n.on(a, "click", n.hide),
  6358. n
  6359. }
  6360. We(e, o);
  6361. var t = e.prototype;
  6362. return t.leftBtn = function(e) {
  6363. if (void 0 === e)
  6364. return this.leftBtn_;
  6365. this.leftBtn_ = e
  6366. }
  6367. ,
  6368. t.rightBtn = function(e) {
  6369. if (void 0 === e)
  6370. return this.rightBtn_;
  6371. this.rightBtn_ = e
  6372. }
  6373. ,
  6374. t.page = function(e) {
  6375. if (void 0 === e)
  6376. return this.page_;
  6377. this.page_ = e
  6378. }
  6379. ,
  6380. t.pageNum = function(e) {
  6381. if (void 0 === e)
  6382. return void 0 === this.pageNum_ && (this.pageNum_ = 0),
  6383. this.pageNum_;
  6384. this.pageNum_ !== e && (this.pageNum_ = e,
  6385. this.pageNum_ < 0 && (this.pageNum_ = 0),
  6386. this.updatePage())
  6387. }
  6388. ,
  6389. t.playerResize = function() {
  6390. this.updatePage()
  6391. }
  6392. ,
  6393. t.prevPage_ = function() {
  6394. this.pageNum() <= 0 || this.pageNum(this.pageNum() - 1)
  6395. }
  6396. ,
  6397. t.nextPage_ = function() {
  6398. this.pageNum(this.pageNum() + 1)
  6399. }
  6400. ,
  6401. t.createEl = function() {
  6402. return o.prototype.createEl.call(this, "div", {
  6403. className: "choose-video-panel vjs-hidden"
  6404. })
  6405. }
  6406. ,
  6407. t.hideToggle = function() {
  6408. this.hasClass("vjs-hidden") ? this.show() : this.hide()
  6409. }
  6410. ,
  6411. t.hide = function() {
  6412. this.hasClass("vjs-hidden") || this.addClass("vjs-hidden"),
  6413. this.player().getChild("ControlBar").getChild("chooseVideoButton").updateButtonState()
  6414. }
  6415. ,
  6416. t.show = function() {
  6417. this.removeClass("vjs-hidden")
  6418. }
  6419. ,
  6420. t.updatePage = function() {
  6421. this.pageNum() <= 0 ? this.leftBtn_.hide() : this.leftBtn_.show();
  6422. var e = 8;
  6423. 600 <= this.player().currentHeight() && (e = 12);
  6424. var t = Math.ceil(this.player().options_.chooseVideoData.data.list.length / e) - 1;
  6425. this.pageNum() >= t ? this.rightBtn_.hide() : this.rightBtn_.show(),
  6426. this.page().updatePage(this.pageNum())
  6427. }
  6428. ,
  6429. t.dispose = function() {
  6430. o.prototype.dispose.call(this)
  6431. }
  6432. ,
  6433. e
  6434. }(He);
  6435. He.registerComponent("ChooseVideoPanel", Br);
  6436. var Rr = function(i) {
  6437. function e(e, t) {
  6438. var n;
  6439. return void 0 === t && (t = {}),
  6440. n = i.call(this, e, t) || this,
  6441. t.replay = void 0 === t.replay || t.replay,
  6442. n.on(e, "play", n.handlePlay),
  6443. n.on(e, "pause", n.handlePause),
  6444. t.replay && n.on(e, "ended", n.handleEnded),
  6445. n
  6446. }
  6447. We(e, i);
  6448. var t = e.prototype;
  6449. return t.buildCSSClass = function() {
  6450. return i.prototype.buildCSSClass.call(this) + " vjs-play-control-mini"
  6451. }
  6452. ,
  6453. t.handleClick = function(e) {
  6454. this.player_.paused() ? this.player_.play() : this.player_.pause()
  6455. }
  6456. ,
  6457. t.handleSeeked = function(e) {
  6458. this.removeClass("vjs-ended"),
  6459. this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
  6460. }
  6461. ,
  6462. t.handlePlay = function(e) {
  6463. this.removeClass("vjs-ended"),
  6464. this.removeClass("vjs-paused"),
  6465. this.addClass("vjs-playing"),
  6466. this.controlText("Pause")
  6467. }
  6468. ,
  6469. t.handlePause = function(e) {
  6470. this.removeClass("vjs-playing"),
  6471. this.addClass("vjs-paused"),
  6472. this.controlText("Play")
  6473. }
  6474. ,
  6475. t.handleEnded = function(e) {
  6476. this.removeClass("vjs-playing"),
  6477. this.addClass("vjs-ended"),
  6478. this.controlText("Replay"),
  6479. this.one(this.player_, "seeked", this.handleSeeked)
  6480. }
  6481. ,
  6482. e
  6483. }(Qt);
  6484. Rr.prototype.controlText_ = "Play",
  6485. He.registerComponent("PlayToggleMini", Rr);
  6486. var Fr = function(i) {
  6487. function e(e, t) {
  6488. var n;
  6489. return n = i.call(this, e, t) || this,
  6490. t && (n.menuButton_ = t.menuButton),
  6491. n.focusedChild_ = -1,
  6492. n.on("mouseover", n.handleMouseOver),
  6493. n.on("mouseout", n.handleMouseOut),
  6494. n.boundHandleBlur_ = Te(Ve(n), n.handleBlur),
  6495. n.boundHandleTapClick_ = Te(Ve(n), n.handleTapClick),
  6496. n
  6497. }
  6498. We(e, i);
  6499. var t = e.prototype;
  6500. return t.handleMouseOver = function(e) {
  6501. this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.addClass("vjs-hover")
  6502. }
  6503. ,
  6504. t.handleMouseOut = function(e) {
  6505. this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.removeClass("vjs-hover")
  6506. }
  6507. ,
  6508. t.addEventListenerForItem = function(e) {
  6509. e instanceof He && (this.on(e, "blur", this.boundHandleBlur_),
  6510. this.on(e, ["tap", "click"], this.boundHandleTapClick_))
  6511. }
  6512. ,
  6513. t.removeEventListenerForItem = function(e) {
  6514. e instanceof He && (this.off(e, "blur", this.boundHandleBlur_),
  6515. this.off(e, ["tap", "click"], this.boundHandleTapClick_))
  6516. }
  6517. ,
  6518. t.removeChild = function(e) {
  6519. "string" == typeof e && (e = this.getChild(e)),
  6520. this.removeEventListenerForItem(e),
  6521. i.prototype.removeChild.call(this, e)
  6522. }
  6523. ,
  6524. t.addItem = function(e) {
  6525. var t = this.addChild(e);
  6526. t && this.addEventListenerForItem(t)
  6527. }
  6528. ,
  6529. t.createEl = function() {
  6530. var e = this.options_.contentElType || "ul";
  6531. this.contentEl_ = w(e, {
  6532. className: "vjs-menu-content"
  6533. }),
  6534. this.contentEl_.setAttribute("role", "menu");
  6535. var t = i.prototype.createEl.call(this, "div", {
  6536. append: this.contentEl_,
  6537. className: "vjs-menu"
  6538. });
  6539. return t.appendChild(this.contentEl_),
  6540. ge(t, "click", function(e) {
  6541. e.preventDefault(),
  6542. e.stopImmediatePropagation()
  6543. }),
  6544. t
  6545. }
  6546. ,
  6547. t.dispose = function() {
  6548. this.contentEl_ = null,
  6549. this.boundHandleBlur_ = null,
  6550. this.boundHandleTapClick_ = null,
  6551. i.prototype.dispose.call(this)
  6552. }
  6553. ,
  6554. t.handleBlur = function(e) {
  6555. var t = e.relatedTarget || f.activeElement;
  6556. if (!this.children().some(function(e) {
  6557. return e.el() === t
  6558. })) {
  6559. var n = this.menuButton_;
  6560. n && n.buttonPressed_ && t !== n.el().firstChild && n.unpressButton()
  6561. }
  6562. }
  6563. ,
  6564. t.handleTapClick = function(t) {
  6565. if (this.menuButton_) {
  6566. this.menuButton_.unpressButton();
  6567. var e = this.children();
  6568. if (!Array.isArray(e))
  6569. return;
  6570. var n = e.filter(function(e) {
  6571. return e.el() === t.target
  6572. })[0];
  6573. if (!n)
  6574. return;
  6575. "CaptionSettingsMenuItem" !== n.name() && this.menuButton_.focus()
  6576. }
  6577. }
  6578. ,
  6579. t.handleKeyDown = function(e) {
  6580. Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
  6581. e.stopPropagation(),
  6582. this.stepForward()) : (Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up")) && (e.preventDefault(),
  6583. e.stopPropagation(),
  6584. this.stepBack())
  6585. }
  6586. ,
  6587. t.stepForward = function() {
  6588. var e = 0;
  6589. void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1),
  6590. this.focus(e)
  6591. }
  6592. ,
  6593. t.stepBack = function() {
  6594. var e = 0;
  6595. void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1),
  6596. this.focus(e)
  6597. }
  6598. ,
  6599. t.focus = function(e) {
  6600. void 0 === e && (e = 0);
  6601. var t = this.children().slice();
  6602. t.length && t[0].className && /vjs-menu-title/.test(t[0].className) && t.shift(),
  6603. 0 < t.length && (e < 0 ? e = 0 : e >= t.length && (e = t.length - 1),
  6604. t[this.focusedChild_ = e].el_.focus())
  6605. }
  6606. ,
  6607. e
  6608. }(He);
  6609. He.registerComponent("Menu", Fr);
  6610. var Hr = function(r) {
  6611. function e(e, t) {
  6612. var n;
  6613. void 0 === t && (t = {}),
  6614. (n = r.call(this, e, t) || this).menuButton_ = new Qt(e,t),
  6615. n.menuButton_.controlText(n.controlText_),
  6616. n.menuButton_.el_.setAttribute("aria-haspopup", "true");
  6617. var i = Qt.prototype.buildCSSClass();
  6618. return n.menuButton_.el_.className = n.buildCSSClass() + " " + i,
  6619. n.menuButton_.removeClass("vjs-control"),
  6620. n.addChild(n.menuButton_),
  6621. n.update(),
  6622. n.enabled_ = !0,
  6623. n.on(n.menuButton_, "tap", n.handleClick),
  6624. n.on(n.menuButton_, "click", n.handleClick),
  6625. n.on(n.menuButton_, "keydown", n.handleKeyDown),
  6626. n.on(n.menuButton_, "mouseenter", function() {
  6627. n.addClass("vjs-hover"),
  6628. n.menu.show(),
  6629. n.handleMouseEnter(),
  6630. ge(f, "keyup", Te(Ve(n), n.handleMenuKeyUp))
  6631. }),
  6632. n.on("mouseleave", n.handleMouseLeave),
  6633. n.on("keydown", n.handleSubmenuKeyDown),
  6634. n
  6635. }
  6636. We(e, r);
  6637. var t = e.prototype;
  6638. return t.update = function() {
  6639. var e = this.createMenu();
  6640. this.menu && (this.menu.dispose(),
  6641. this.removeChild(this.menu)),
  6642. this.menu = e,
  6643. this.addChild(e),
  6644. this.buttonPressed_ = !1,
  6645. this.menuButton_.el_.setAttribute("aria-expanded", "false"),
  6646. this.items && this.items.length <= this.hideThreshold_ ? this.hide() : this.show()
  6647. }
  6648. ,
  6649. t.createMenu = function() {
  6650. var e = new Fr(this.player_,{
  6651. menuButton: this
  6652. });
  6653. if (this.hideThreshold_ = 0,
  6654. this.options_.title) {
  6655. var t = w("li", {
  6656. className: "vjs-menu-title",
  6657. innerHTML: Re(this.options_.title),
  6658. tabIndex: -1
  6659. });
  6660. this.hideThreshold_ += 1;
  6661. var n = new He(this.player_,{
  6662. el: t
  6663. });
  6664. e.addItem(n)
  6665. }
  6666. if (this.items = this.createItems(),
  6667. this.items)
  6668. for (var i = 0; i < this.items.length; i++)
  6669. e.addItem(this.items[i]);
  6670. return e
  6671. }
  6672. ,
  6673. t.createItems = function() {}
  6674. ,
  6675. t.createEl = function() {
  6676. return r.prototype.createEl.call(this, "div", {
  6677. className: this.buildWrapperCSSClass()
  6678. }, {})
  6679. }
  6680. ,
  6681. t.buildWrapperCSSClass = function() {
  6682. var e = "vjs-menu-button";
  6683. return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
  6684. "vjs-menu-button " + e + " " + Qt.prototype.buildCSSClass() + " " + r.prototype.buildCSSClass.call(this)
  6685. }
  6686. ,
  6687. t.buildCSSClass = function() {
  6688. var e = "vjs-menu-button";
  6689. return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
  6690. "vjs-menu-button " + e + " " + r.prototype.buildCSSClass.call(this)
  6691. }
  6692. ,
  6693. t.controlText = function(e, t) {
  6694. return void 0 === t && (t = this.menuButton_.el()),
  6695. this.menuButton_.controlText(e, t)
  6696. }
  6697. ,
  6698. t.dispose = function() {
  6699. this.handleMouseLeave(),
  6700. r.prototype.dispose.call(this)
  6701. }
  6702. ,
  6703. t.handleClick = function(e) {
  6704. this.buttonPressed_ ? this.unpressButton() : this.pressButton()
  6705. }
  6706. ,
  6707. t.handleMouseLeave = function(e) {
  6708. this.removeClass("vjs-hover"),
  6709. ye(f, "keyup", Te(this, this.handleMenuKeyUp))
  6710. }
  6711. ,
  6712. t.focus = function() {
  6713. this.menuButton_.focus()
  6714. }
  6715. ,
  6716. t.blur = function() {
  6717. this.menuButton_.blur()
  6718. }
  6719. ,
  6720. t.handleKeyDown = function(e) {
  6721. Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab") ? (this.buttonPressed_ && this.unpressButton(),
  6722. Mt.isEventKey(e, "Tab") || (e.preventDefault(),
  6723. this.menuButton_.focus())) : (Mt.isEventKey(e, "Up") || Mt.isEventKey(e, "Down")) && (this.buttonPressed_ || (e.preventDefault(),
  6724. this.pressButton()))
  6725. }
  6726. ,
  6727. t.handleMenuKeyUp = function(e) {
  6728. (Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && this.removeClass("vjs-hover")
  6729. }
  6730. ,
  6731. t.handleMouseEnter = function() {}
  6732. ,
  6733. t.handleSubmenuKeyPress = function(e) {
  6734. this.handleSubmenuKeyDown(e)
  6735. }
  6736. ,
  6737. t.handleSubmenuKeyDown = function(e) {
  6738. (Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && (this.buttonPressed_ && this.unpressButton(),
  6739. Mt.isEventKey(e, "Tab") || (e.preventDefault(),
  6740. this.menuButton_.focus()))
  6741. }
  6742. ,
  6743. t.pressButton = function() {
  6744. if (this.enabled_) {
  6745. if (this.buttonPressed_ = !0,
  6746. this.menu.show(),
  6747. this.menu.lockShowing(),
  6748. this.menuButton_.el_.setAttribute("aria-expanded", "true"),
  6749. ht && E())
  6750. return;
  6751. this.menu.focus()
  6752. }
  6753. }
  6754. ,
  6755. t.unpressButton = function() {
  6756. this.enabled_ && (this.buttonPressed_ = !1,
  6757. this.menu.unlockShowing(),
  6758. this.menu.hide(),
  6759. this.menuButton_.el_.setAttribute("aria-expanded", "false"))
  6760. }
  6761. ,
  6762. t.disable = function() {
  6763. this.unpressButton(),
  6764. this.enabled_ = !1,
  6765. this.addClass("vjs-disabled"),
  6766. this.menuButton_.disable()
  6767. }
  6768. ,
  6769. t.enable = function() {
  6770. this.enabled_ = !0,
  6771. this.removeClass("vjs-disabled"),
  6772. this.menuButton_.enable()
  6773. }
  6774. ,
  6775. e
  6776. }(He);
  6777. He.registerComponent("MenuButton", Hr);
  6778. var Vr = ["Tab", "Esc", "Up", "Down", "Right", "Left"]
  6779. , Qr = function(i) {
  6780. function e(e, t) {
  6781. var n;
  6782. return (n = i.call(this, e, t) || this).selectable = t.selectable,
  6783. n.isSelected_ = t.selected || !1,
  6784. n.multiSelectable = t.multiSelectable,
  6785. n.selected(n.isSelected_),
  6786. n.selectable ? n.multiSelectable ? n.el_.setAttribute("role", "menuitemcheckbox") : n.el_.setAttribute("role", "menuitemradio") : n.el_.setAttribute("role", "menuitem"),
  6787. n.off("mouseover", n.handleMouseOver),
  6788. n.off("mouseout", n.handleMouseOut),
  6789. n
  6790. }
  6791. We(e, i);
  6792. var t = e.prototype;
  6793. return t.handleMouseOver = function(e) {}
  6794. ,
  6795. t.handleMouseOut = function(e) {}
  6796. ,
  6797. t.createEl = function(e, t, n) {
  6798. return this.nonIconControl = !0,
  6799. i.prototype.createEl.call(this, "li", b({
  6800. className: "vjs-menu-item",
  6801. innerHTML: '<span class="vjs-menu-item-text">' + this.localize(this.options_.label) + "</span>",
  6802. tabIndex: -1
  6803. }, t), n)
  6804. }
  6805. ,
  6806. t.handleKeyDown = function(t) {
  6807. Vr.some(function(e) {
  6808. return Mt.isEventKey(t, e)
  6809. }) || i.prototype.handleKeyDown.call(this, t)
  6810. }
  6811. ,
  6812. t.handleClick = function(e) {
  6813. this.selected(!0)
  6814. }
  6815. ,
  6816. t.selected = function(e) {
  6817. this.selectable && (e ? (this.addClass("vjs-selected"),
  6818. this.el_.setAttribute("aria-checked", "true"),
  6819. this.controlText(", selected"),
  6820. this.isSelected_ = !0) : (this.removeClass("vjs-selected"),
  6821. this.el_.setAttribute("aria-checked", "false"),
  6822. this.controlText(""),
  6823. this.isSelected_ = !1))
  6824. }
  6825. ,
  6826. e
  6827. }(Vt);
  6828. He.registerComponent("MenuItem", Qr);
  6829. var Ur = function(r) {
  6830. function e(e, t) {
  6831. var n, i = t.content;
  6832. return t.label = i,
  6833. t.selectable = !0,
  6834. t.multiSelectable = !1,
  6835. (n = r.call(this, e, t) || this).label = i,
  6836. n.on("mouseover", n.handleMouseOver),
  6837. n.on("mouseout", n.handleMouseOut),
  6838. n
  6839. }
  6840. We(e, r);
  6841. var t = e.prototype;
  6842. return t.handleClick = function(e) {
  6843. if (!0 === e.shiftKey) {
  6844. var t = this.player_.getDebugInfo()
  6845. , n = f.createElement("textarea");
  6846. n.value = t,
  6847. f.body.appendChild(n),
  6848. n.select();
  6849. var i = f.execCommand("copy");
  6850. f.body.removeChild(n),
  6851. i ? this.player_.log("[CMI] debug info has copied") : this.player_.warn("[CMI] copy failed!")
  6852. }
  6853. r.prototype.handleClick.call(this)
  6854. }
  6855. ,
  6856. t.handleMouseOver = function(e) {}
  6857. ,
  6858. t.handleMouseOut = function(e) {
  6859. this.selected(!1)
  6860. }
  6861. ,
  6862. e
  6863. }(Qr);
  6864. Ur.prototype.contentElType = "button",
  6865. He.registerComponent("ContextMenuItem", Ur);
  6866. var qr = function(i) {
  6867. function e(e, t) {
  6868. var n;
  6869. return (n = i.call(this, e, t) || this).showDebug_ = !1,
  6870. n
  6871. }
  6872. We(e, i);
  6873. var t = e.prototype;
  6874. return t.createEl = function() {
  6875. var e = i.prototype.createEl.call(this);
  6876. return e.oncontextmenu = function() {
  6877. return !1
  6878. }
  6879. ,
  6880. e
  6881. }
  6882. ,
  6883. t.moveAndShow = function(e, t) {
  6884. this.showDebug_ = t,
  6885. this.showDebug_ && this.player_.log("[player] show debug contextmenu"),
  6886. this.update(),
  6887. this.el().style.left = e.offsetX + "px",
  6888. this.el().style.top = e.offsetY + "px",
  6889. this.addClass("vjs-hover"),
  6890. this.menu.show()
  6891. }
  6892. ,
  6893. t.dispose = function() {
  6894. this.labelEl_ = null,
  6895. i.prototype.dispose.call(this)
  6896. }
  6897. ,
  6898. t.buildCSSClass = function() {
  6899. return "context-menu-button " + i.prototype.buildCSSClass.call(this)
  6900. }
  6901. ,
  6902. t.buildWrapperCSSClass = function() {
  6903. return "context-menu " + i.prototype.buildWrapperCSSClass.call(this)
  6904. }
  6905. ,
  6906. t.createMenu = function() {
  6907. var e = new Fr(this.player());
  6908. return e.addChild(new Ur(this.player(),{
  6909. content: "core:" + this.player_.playerversion + "&nbsp;&nbsp;" + this.player_.updatedate
  6910. })),
  6911. e.addChild(new Ur(this.player(),{
  6912. content: "wrap:" + this.options().playerOptions.wrapperVersion + "&nbsp;&nbsp;" + this.options().playerOptions.wrapperupdate
  6913. })),
  6914. this.showDebug_ && e.addChild(new Ur(this.player(),{
  6915. content: "debug info..."
  6916. })),
  6917. e
  6918. }
  6919. ,
  6920. t.updateARIAAttributes = function() {
  6921. this.el().setAttribute("aria-valuenow", this.player().playbackRate())
  6922. }
  6923. ,
  6924. t.handleClick = function(e) {}
  6925. ,
  6926. e
  6927. }(Hr);
  6928. qr.prototype.controlText_ = "",
  6929. He.registerComponent("ContextMenuButton", qr);
  6930. var zr = function(u) {
  6931. function e(e, t, n) {
  6932. var i, r = Fe({
  6933. createEl: !1
  6934. }, t);
  6935. if (i = u.call(this, e, r, n) || this,
  6936. t.playerOptions.sources && 0 !== t.playerOptions.sources.length)
  6937. e.src(t.playerOptions.sources);
  6938. else
  6939. for (var s = 0, a = t.playerOptions.techOrder; s < a.length; s++) {
  6940. var o = Re(a[s])
  6941. , l = pi.getTech(o);
  6942. if (o || (l = He.getComponent(o)),
  6943. l && l.isSupported()) {
  6944. e.loadTech_(o);
  6945. break
  6946. }
  6947. }
  6948. return i
  6949. }
  6950. return We(e, u),
  6951. e
  6952. }(He);
  6953. He.registerComponent("MediaLoader", zr);
  6954. var Wr = function(i) {
  6955. function e(e, t) {
  6956. var n;
  6957. return n = i.call(this, e, t) || this,
  6958. oo.browser.IS_SAFARI ? (n.canplay(!1),
  6959. n.on(e, "canplaythrough", n.canClick)) : n.canplay(!0),
  6960. n.update(),
  6961. e.on("posterchange", Te(Ve(n), n.update)),
  6962. G(n.el()),
  6963. n
  6964. }
  6965. We(e, i);
  6966. var t = e.prototype;
  6967. return t.canClick = function() {
  6968. this.canplay(!0)
  6969. }
  6970. ,
  6971. t.canplay = function(e) {
  6972. return void 0 !== e && (this.canplay_ = e),
  6973. this.canplay_
  6974. }
  6975. ,
  6976. t.dispose = function() {
  6977. this.player().off("posterchange", this.update),
  6978. i.prototype.dispose.call(this)
  6979. }
  6980. ,
  6981. t.createEl = function() {
  6982. return w("div", {
  6983. className: "vjs-poster",
  6984. tabIndex: -1
  6985. })
  6986. }
  6987. ,
  6988. t.update = function(e) {
  6989. var t = this.player().poster();
  6990. this.setSrc(t),
  6991. t ? this.show() : this.hide()
  6992. }
  6993. ,
  6994. t.setSrc = function(e) {
  6995. var t = "";
  6996. e && (t = 'url("' + e + '")'),
  6997. this.el_.style.backgroundImage = t
  6998. }
  6999. ,
  7000. t.handleClick = function(e) {
  7001. if (!0 === this.canplay() && this.player_.controls()) {
  7002. var t = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
  7003. !this.player_.tech(!0) || (st || nt) && t || this.player_.tech(!0).focus(),
  7004. this.player_.paused() ? At(this.player_.play()) : this.player_.pause()
  7005. }
  7006. }
  7007. ,
  7008. e
  7009. }(Vt);
  7010. He.registerComponent("PosterImage", Wr);
  7011. var Kr = function(r) {
  7012. function e() {
  7013. return r.apply(this, arguments) || this
  7014. }
  7015. return We(e, r),
  7016. e.prototype.createEl = function() {
  7017. var e = this.player_.isAudio()
  7018. , t = this.localize(e ? "Audio Player" : "Video Player")
  7019. , n = w("span", {
  7020. className: "vjs-control-text",
  7021. innerHTML: this.localize("{1} is loading.", [t])
  7022. })
  7023. , i = r.prototype.createEl.call(this, "div", {
  7024. className: "vjs-loading-spinner",
  7025. dir: "ltr"
  7026. });
  7027. return i.appendChild(n),
  7028. i
  7029. }
  7030. ,
  7031. e
  7032. }(He);
  7033. He.registerComponent("LoadingSpinner", Kr);
  7034. var Xr = function(i) {
  7035. function e(e, t) {
  7036. var n;
  7037. return (n = i.call(this, e, t) || this).mouseused_ = !1,
  7038. oo.browser.IS_SAFARI && (n.hide(),
  7039. n.one(e, "canplay", n.beforeShow)),
  7040. oo.browser.IS_FIREFOX && n.hide(),
  7041. n.one(e, "canplaythrough", n.show),
  7042. n.on("mousedown", n.handleMouseDown),
  7043. G(n.el()),
  7044. n
  7045. }
  7046. We(e, i);
  7047. var t = e.prototype;
  7048. return t.buildCSSClass = function() {
  7049. return "vjs-big-play-button"
  7050. }
  7051. ,
  7052. t.show = function() {
  7053. this.player().options().debug && this.player().log("show-bigplaybutton"),
  7054. oo.browser.IS_SAFARI,
  7055. i.prototype.show.call(this)
  7056. }
  7057. ,
  7058. t.beforeShow = function() {
  7059. this.player().log("beforeShow"),
  7060. this.setTimeout(function() {
  7061. this.show()
  7062. }, 100)
  7063. }
  7064. ,
  7065. t.handleClick = function(e) {
  7066. oo.browser.IS_SAFARI;
  7067. var t = this.player_.play();
  7068. if (this.mouseused_ && e.clientX && e.clientY) {
  7069. var n = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
  7070. return At(t),
  7071. void (!this.player_.tech(!0) || (st || nt) && n || this.player_.tech(!0).focus())
  7072. }
  7073. var i = this.player_.getChild("controlBar")
  7074. , r = i && i.getChild("playToggle");
  7075. if (r) {
  7076. var s = function() {
  7077. return r.focus()
  7078. };
  7079. xt(t) ? t.then(s, function() {}) : this.setTimeout(s, 1)
  7080. } else
  7081. this.player_.tech(!0).focus()
  7082. }
  7083. ,
  7084. t.handleKeyDown = function(e) {
  7085. this.mouseused_ = !1,
  7086. i.prototype.handleKeyDown.call(this, e)
  7087. }
  7088. ,
  7089. t.handleMouseDown = function(e) {
  7090. this.mouseused_ = !0
  7091. }
  7092. ,
  7093. e
  7094. }(Qt);
  7095. Xr.prototype.controlText_ = "Play Video",
  7096. He.registerComponent("BigPlayButton", Xr);
  7097. var Gr = function(i) {
  7098. function e(e, t) {
  7099. var n;
  7100. return (n = i.call(this, e, t) || this).controlText(t && t.controlText || n.localize("Close")),
  7101. n
  7102. }
  7103. We(e, i);
  7104. var t = e.prototype;
  7105. return t.buildCSSClass = function() {
  7106. return "vjs-close-button " + i.prototype.buildCSSClass.call(this)
  7107. }
  7108. ,
  7109. t.handleClick = function(e) {
  7110. this.trigger({
  7111. type: "close",
  7112. bubbles: !1
  7113. })
  7114. }
  7115. ,
  7116. t.handleKeyDown = function(e) {
  7117. Mt.isEventKey(e, "Esc") ? (e.preventDefault(),
  7118. e.stopPropagation(),
  7119. this.trigger("click")) : i.prototype.handleKeyDown.call(this, e)
  7120. }
  7121. ,
  7122. e
  7123. }(Qt);
  7124. He.registerComponent("CloseButton", Gr);
  7125. var Yr = function(i) {
  7126. function e(e, t) {
  7127. var n;
  7128. return void 0 === t && (t = {}),
  7129. n = i.call(this, e, t) || this,
  7130. t.replay = void 0 === t.replay || t.replay,
  7131. n.on(e, "play", n.handlePlay),
  7132. n.on(e, "pause", n.handlePause),
  7133. t.replay && n.on(e, "ended", n.handleEnded),
  7134. n
  7135. }
  7136. We(e, i);
  7137. var t = e.prototype;
  7138. return t.buildCSSClass = function() {
  7139. return "vjs-play-control " + i.prototype.buildCSSClass.call(this)
  7140. }
  7141. ,
  7142. t.handleClick = function(e) {
  7143. this.player_.paused() ? this.player_.play() : this.player_.pause()
  7144. }
  7145. ,
  7146. t.handleSeeked = function(e) {
  7147. this.removeClass("vjs-ended"),
  7148. this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
  7149. }
  7150. ,
  7151. t.handlePlay = function(e) {
  7152. this.removeClass("vjs-ended"),
  7153. this.removeClass("vjs-paused"),
  7154. this.addClass("vjs-playing"),
  7155. this.controlText("Pause")
  7156. }
  7157. ,
  7158. t.handlePause = function(e) {
  7159. this.removeClass("vjs-playing"),
  7160. this.addClass("vjs-paused"),
  7161. this.controlText("Play")
  7162. }
  7163. ,
  7164. t.handleEnded = function(e) {
  7165. this.removeClass("vjs-playing"),
  7166. this.addClass("vjs-ended"),
  7167. this.controlText("Replay"),
  7168. this.one(this.player_, "seeked", this.handleSeeked)
  7169. }
  7170. ,
  7171. e
  7172. }(Qt);
  7173. Yr.prototype.controlText_ = "Play",
  7174. He.registerComponent("PlayToggle", Yr);
  7175. var $r = function(i) {
  7176. function e(e, t) {
  7177. var n;
  7178. return void 0 === t && (t = {}),
  7179. t.vertical = !0,
  7180. "undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
  7181. t.volumeBar.vertical = t.vertical),
  7182. (n = i.call(this, e, t) || this).throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
  7183. n.on("click", n.handlerClick),
  7184. n.on("touchstart", n.handleMouseDown),
  7185. n
  7186. }
  7187. We(e, i);
  7188. var t = e.prototype;
  7189. return t.createEl = function() {
  7190. return i.prototype.createEl.call(this, "div", {
  7191. className: "vjs-next-control-container",
  7192. innerHTML: '<div class="next-image"><img src="' + this.player().options_.nextImageUrl + '"/></div><div class="next-title">' + this.player().options_.nextTitle + "</div>"
  7193. })
  7194. }
  7195. ,
  7196. t.handleMouseDown = function(e) {}
  7197. ,
  7198. t.handlerMouseOver = function(e) {}
  7199. ,
  7200. t.handlerClick = function(e) {}
  7201. ,
  7202. t.handleMouseUp = function(e) {}
  7203. ,
  7204. t.handleMouseMove = function(e) {}
  7205. ,
  7206. e
  7207. }(He);
  7208. $r.prototype.options_ = {},
  7209. He.registerComponent("NextControl", $r);
  7210. var Jr = function(i) {
  7211. function e(e, t) {
  7212. var n;
  7213. return void 0 === t && (t = {}),
  7214. n = i.call(this, e, t) || this,
  7215. t.next = void 0 === t.next || t.next,
  7216. n.on("mouseover", n.handleMouseOver),
  7217. n.on("mouseout", n.handleMouseOut),
  7218. n
  7219. }
  7220. We(e, i);
  7221. var t = e.prototype;
  7222. return t.buildCSSClass = function() {
  7223. return "vjs-next-control " + i.prototype.buildCSSClass.call(this)
  7224. }
  7225. ,
  7226. t.handleClick = function(e) {}
  7227. ,
  7228. t.handleMouseOver = function(e) {}
  7229. ,
  7230. t.handleMouseOut = function(e) {}
  7231. ,
  7232. t.handleKeyPress = function(e) {}
  7233. ,
  7234. t.handlePlay = function(e) {
  7235. this.removeClass("vjs-ended"),
  7236. this.removeClass("vjs-paused"),
  7237. this.addClass("vjs-playing"),
  7238. this.controlText("Next")
  7239. }
  7240. ,
  7241. t.handlePause = function(e) {
  7242. this.removeClass("vjs-playing"),
  7243. this.addClass("vjs-paused"),
  7244. this.controlText("Next")
  7245. }
  7246. ,
  7247. t.handleEnded = function(e) {
  7248. this.removeClass("vjs-playing"),
  7249. this.addClass("vjs-ended"),
  7250. this.controlText("Next")
  7251. }
  7252. ,
  7253. e
  7254. }(Qt);
  7255. Jr.prototype.controlText_ = "Next",
  7256. He.registerComponent("NextButton", Jr);
  7257. var Zr = function(i) {
  7258. function e(e, t) {
  7259. var n;
  7260. return void 0 === t && (t = {}),
  7261. t.inline = !1,
  7262. (n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
  7263. n.on("click", n.handlerClick),
  7264. n.on("mouseover", n.handleMouseOver),
  7265. n.on("mouseout", n.handleMouseOut),
  7266. n
  7267. }
  7268. We(e, i);
  7269. var t = e.prototype;
  7270. return t.volumePanelState_ = function() {}
  7271. ,
  7272. t.createEl = function() {
  7273. return i.prototype.createEl.call(this, "div", {
  7274. className: "vjs-next-panel vjs-control vjs-next-panel-vertical"
  7275. })
  7276. }
  7277. ,
  7278. t.dispose = function() {
  7279. this.handleMouseOut(),
  7280. i.prototype.dispose.call(this)
  7281. }
  7282. ,
  7283. t.handleVolumeControlKeyUp = function(e) {
  7284. Mt.isEventKey(e, "Esc")
  7285. }
  7286. ,
  7287. t.handleMouseOver = function(e) {
  7288. this.addClass("vjs-hover"),
  7289. ge(f, "keyup", Te(this, this.handleKeyPress))
  7290. }
  7291. ,
  7292. t.handleMouseOut = function(e) {
  7293. this.removeClass("vjs-hover"),
  7294. ye(f, "keyup", Te(this, this.handleKeyPress))
  7295. }
  7296. ,
  7297. t.handlerClick = function(e) {
  7298. this.player().trigger("nextvideo")
  7299. }
  7300. ,
  7301. t.handleKeyPress = function(e) {
  7302. Mt.isEventKey(e, "Esc") && this.handleMouseOut()
  7303. }
  7304. ,
  7305. e
  7306. }(He);
  7307. Zr.prototype.options_ = {
  7308. children: ["nextButton", "nextControl"]
  7309. },
  7310. He.registerComponent("NextPanel", Zr);
  7311. var es = function(i) {
  7312. function e(e, t) {
  7313. var n;
  7314. return (n = i.call(this, e, t) || this).on(e, "webfullscreenchange", n.handleWebfullscreenChange),
  7315. !1 === f[e.fsApi_.webfullscreenEnabled] && n.disable(),
  7316. n
  7317. }
  7318. We(e, i);
  7319. var t = e.prototype;
  7320. return t.buildCSSClass = function() {
  7321. return "vjs-webfullscreen-control " + i.prototype.buildCSSClass.call(this)
  7322. }
  7323. ,
  7324. t.handleWebfullscreenChange = function(e) {
  7325. this.player_.isWebFullscreen() ? this.controlText("Non-Webfullscreen") : this.controlText("Webfullscreen")
  7326. }
  7327. ,
  7328. t.handleClick = function(e) {
  7329. this.player_.isWebFullscreen() ? this.player_.exitFullWindow() : this.player_.enterFullWindow()
  7330. }
  7331. ,
  7332. e
  7333. }(Qt);
  7334. es.prototype.controlText_ = "Webfullscreen",
  7335. He.registerComponent("WebfullscreenToggle", es);
  7336. var ts = function(r) {
  7337. function e(e, t) {
  7338. var n, i = t.content;
  7339. return t.multiSelectable = !1,
  7340. (n = r.call(this, e, t) || this).label = i,
  7341. n.on(e, "autonextchange", n.update),
  7342. n
  7343. }
  7344. We(e, r);
  7345. var t = e.prototype;
  7346. return t.createEl = function(e, t, n) {
  7347. return this.nonIconControl = !0,
  7348. r.prototype.createEl.call(this, "li", b({
  7349. className: "vjs-menu-item",
  7350. innerHTML: '<span class="vjs-menu-item-text">' + this.localize(this.options_.content) + '</span> <div class="vjs-menu-item-selector"> <div class="vjs-menu-item-selector-mask"> </div> </div>',
  7351. tabIndex: -1
  7352. }, t), n)
  7353. }
  7354. ,
  7355. t.handleClick = function(e) {
  7356. !0 === this.player().autoNext() ? this.player().autoNext(!1) : (this.player().autoNext(!0),
  7357. this.player().loop2(!1))
  7358. }
  7359. ,
  7360. t.update = function(e) {
  7361. !0 === this.player().autoNext() ? (this.removeClass("selectorOff"),
  7362. this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
  7363. this.addClass("selectorOff"))
  7364. }
  7365. ,
  7366. e
  7367. }(Qr);
  7368. ts.prototype.contentElType = "button",
  7369. He.registerComponent("SetupMenuItemAutoNext", ts);
  7370. var ns = function(r) {
  7371. function e(e, t) {
  7372. var n, i = t.content;
  7373. return t.multiSelectable = !1,
  7374. (n = r.call(this, e, t) || this).label = i,
  7375. n.on(e, "loop2change", n.update),
  7376. n
  7377. }
  7378. We(e, r);
  7379. var t = e.prototype;
  7380. return t.createEl = function(e, t, n) {
  7381. return this.nonIconControl = !0,
  7382. r.prototype.createEl.call(this, "li", b({
  7383. className: "vjs-menu-item",
  7384. innerHTML: '<span class="vjs-menu-item-text">' + this.localize(this.options_.content) + '</span> <div class="vjs-menu-item-selector"> <div class="vjs-menu-item-selector-mask"> </div> </div>',
  7385. tabIndex: -1
  7386. }, t), n)
  7387. }
  7388. ,
  7389. t.handleClick = function(e) {
  7390. !0 === this.player().loop2() ? this.player().loop2(!1) : (this.player().loop2(!0),
  7391. this.player().autoNext(!1)),
  7392. this.player().log("loop2 click" + this.player().loop2())
  7393. }
  7394. ,
  7395. t.update = function(e) {
  7396. !0 === this.player().loop2() ? (this.removeClass("selectorOff"),
  7397. this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
  7398. this.addClass("selectorOff"))
  7399. }
  7400. ,
  7401. e
  7402. }(Qr);
  7403. ns.prototype.contentElType = "button",
  7404. He.registerComponent("SetupMenuItemLoop", ns);
  7405. var is = function(n) {
  7406. function e(e, t) {
  7407. return n.call(this, e, t) || this
  7408. }
  7409. We(e, n);
  7410. var t = e.prototype;
  7411. return t.createEl = function() {
  7412. var e = n.prototype.createEl.call(this);
  7413. return this.labelEl_ = w("div", {
  7414. className: "vjs-setup-value",
  7415. innerHTML: ""
  7416. }),
  7417. e.appendChild(this.labelEl_),
  7418. e
  7419. }
  7420. ,
  7421. t.dispose = function() {
  7422. this.labelEl_ = null,
  7423. n.prototype.dispose.call(this)
  7424. }
  7425. ,
  7426. t.buildCSSClass = function() {
  7427. return "vjs-setup " + n.prototype.buildCSSClass.call(this)
  7428. }
  7429. ,
  7430. t.buildWrapperCSSClass = function() {
  7431. return "vjs-setup " + n.prototype.buildWrapperCSSClass.call(this)
  7432. }
  7433. ,
  7434. t.createMenu = function() {
  7435. var e = new Fr(this.player());
  7436. return !0 === this.player().options_.controlBar.nextPanel && e.addChild(new ts(this.player(),{
  7437. content: "Auto Next"
  7438. })),
  7439. e.addChild(new ns(this.player(),{
  7440. content: "Loop"
  7441. })),
  7442. e
  7443. }
  7444. ,
  7445. t.updateARIAAttributes = function() {}
  7446. ,
  7447. t.handleClick = function(e) {}
  7448. ,
  7449. t.handleMouseEnter = function() {
  7450. this.player().trigger("analyticALI.play.1.17")
  7451. }
  7452. ,
  7453. e
  7454. }(Hr);
  7455. is.prototype.controlText_ = "Setup",
  7456. He.registerComponent("SetupMenuButton", is);
  7457. var rs = function(i) {
  7458. function e(e, t) {
  7459. var n;
  7460. return (n = i.call(this, e, t) || this).updateLabel(),
  7461. n.on(e, "choosevideochange", n.updateLabel),
  7462. n
  7463. }
  7464. We(e, i);
  7465. var t = e.prototype;
  7466. return t.createEl = function() {
  7467. var e = i.prototype.createEl.call(this);
  7468. return this.labelEl_ = w("div", {
  7469. className: "choose-video-value",
  7470. innerHTML: "videos"
  7471. }),
  7472. e.appendChild(this.labelEl_),
  7473. e
  7474. }
  7475. ,
  7476. t.dispose = function() {
  7477. this.labelEl_ = null,
  7478. i.prototype.dispose.call(this)
  7479. }
  7480. ,
  7481. t.buildCSSClass = function() {
  7482. return "choose-video " + i.prototype.buildCSSClass.call(this)
  7483. }
  7484. ,
  7485. t.buildWrapperCSSClass = function() {
  7486. return "choose-video " + i.prototype.buildWrapperCSSClass.call(this)
  7487. }
  7488. ,
  7489. t.createMenu = function() {
  7490. return new Fr(this.player())
  7491. }
  7492. ,
  7493. t.updateMenu = function() {}
  7494. ,
  7495. t.updateARIAAttributes = function() {}
  7496. ,
  7497. t.handleClick = function(e) {
  7498. var t = this.player().getChild("chooseVideoPanel");
  7499. void 0 !== t && (t.hideToggle(),
  7500. t.updatePage(),
  7501. this.updateButtonState())
  7502. }
  7503. ,
  7504. t.updateButtonState = function() {
  7505. var e = this.player().getChild("chooseVideoPanel");
  7506. void 0 !== e && (e.hasClass("vjs-hidden") ? this.removeClass("vjs-selected") : this.addClass("vjs-selected"))
  7507. }
  7508. ,
  7509. t.handleMouseEnter = function() {}
  7510. ,
  7511. t.updateVisibility = function(e) {}
  7512. ,
  7513. t.updateLabel = function(e) {
  7514. this.labelEl_.innerHTML = "" + this.localize("videos")
  7515. }
  7516. ,
  7517. e
  7518. }(Hr);
  7519. rs.prototype.controlText_ = "videos",
  7520. He.registerComponent("ChooseVideoButton", rs);
  7521. var ss = function(s) {
  7522. function e(e, t) {
  7523. var n, i = t.tracks;
  7524. if ((n = s.call(this, e, t) || this).items.length <= 1 && n.hide(),
  7525. !i)
  7526. return Ve(n);
  7527. var r = Te(Ve(n), n.update);
  7528. return i.addEventListener("removetrack", r),
  7529. i.addEventListener("addtrack", r),
  7530. n.player_.on("ready", r),
  7531. n.player_.on("dispose", function() {
  7532. i.removeEventListener("removetrack", r),
  7533. i.removeEventListener("addtrack", r)
  7534. }),
  7535. n
  7536. }
  7537. return We(e, s),
  7538. e
  7539. }(Hr);
  7540. He.registerComponent("TrackButton", ss);
  7541. var as = function(r) {
  7542. function e(e, t) {
  7543. return r.call(this, e, t) || this
  7544. }
  7545. We(e, r);
  7546. var t = e.prototype;
  7547. return t.createEl = function(e, t, n) {
  7548. var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.audioLabel);
  7549. return i += "</span>",
  7550. r.prototype.createEl.call(this, e, b({
  7551. innerHTML: i
  7552. }, t), n)
  7553. }
  7554. ,
  7555. t.handleClick = function(e) {
  7556. r.prototype.handleClick.call(this, e),
  7557. this.player().changeAudioMode(this.options_.audioModeIndex)
  7558. }
  7559. ,
  7560. e
  7561. }(Qr);
  7562. He.registerComponent("audioModeMenuItem", as);
  7563. var os = function(i) {
  7564. function e(e, t) {
  7565. var n;
  7566. return void 0 === t && (t = {}),
  7567. (n = i.call(this, e, t) || this).on(e, "changeAudioMode", n.onChange),
  7568. n.show(),
  7569. n
  7570. }
  7571. We(e, i);
  7572. var t = e.prototype;
  7573. return t.createEl = function() {
  7574. var e = i.prototype.createEl.call(this);
  7575. return this.labelEl_ = w("div", {
  7576. className: "vjs-audio-button-value",
  7577. innerHTML: "" + this.localize("original")
  7578. }),
  7579. e.appendChild(this.labelEl_),
  7580. e
  7581. }
  7582. ,
  7583. t.buildCSSClass = function() {
  7584. return "vjs-audio-button " + i.prototype.buildCSSClass.call(this)
  7585. }
  7586. ,
  7587. t.buildWrapperCSSClass = function() {
  7588. return "vjs-audio-button " + i.prototype.buildWrapperCSSClass.call(this)
  7589. }
  7590. ,
  7591. t.createItems = function(e) {
  7592. return void 0 === e && (e = []),
  7593. e.push(new as(this.player_,{
  7594. audioModeIndex: 0,
  7595. audioLabel: "original",
  7596. selectable: !0,
  7597. multiSelectable: !1
  7598. })),
  7599. e.push(new as(this.player_,{
  7600. audioModeIndex: 1,
  7601. audioLabel: "earphone",
  7602. selectable: !0,
  7603. multiSelectable: !1
  7604. })),
  7605. e.push(new as(this.player_,{
  7606. audioModeIndex: 2,
  7607. audioLabel: "soundbox",
  7608. selectable: !0,
  7609. multiSelectable: !1
  7610. })),
  7611. e[0].selected(!0),
  7612. e
  7613. }
  7614. ,
  7615. t.onChange = function(e) {
  7616. for (var t = 0; t < this.items.length; t++)
  7617. this.items[t].selected(!1);
  7618. this.items[e.audioMode].selected(!0),
  7619. this.labelEl_.innerHTML = "" + this.localize(this.items[e.audioMode].options_.audioLabel)
  7620. }
  7621. ,
  7622. e
  7623. }(ss);
  7624. os.prototype.controlText_ = "audio mode",
  7625. He.registerComponent("AudioModeButton", os);
  7626. var ls = function(n) {
  7627. function e(e, t) {
  7628. return n.call(this, e, t) || this
  7629. }
  7630. We(e, n);
  7631. var t = e.prototype;
  7632. return t.createEl = function() {
  7633. var e = "vjs-quality-menu-permit"
  7634. , t = n.prototype.createEl.call(this, "span", {
  7635. className: e
  7636. });
  7637. return this.contentEl_ = w("span", {
  7638. className: e + "-display",
  7639. innerHTML: "" + this.localize("登录看")
  7640. }, {
  7641. "aria-live": "off",
  7642. role: "presentation"
  7643. }),
  7644. t.appendChild(this.contentEl_),
  7645. t
  7646. }
  7647. ,
  7648. t.visible = function(e) {
  7649. e ? this.removeClass("opacity-0") : this.addClass("opacity-0")
  7650. }
  7651. ,
  7652. t.dispose = function() {
  7653. this.contentEl_ = null,
  7654. this.textNode_ = null,
  7655. n.prototype.dispose.call(this)
  7656. }
  7657. ,
  7658. t.updateContent = function(e) {}
  7659. ,
  7660. e
  7661. }(He);
  7662. ls.prototype.labelText_ = "Time",
  7663. ls.prototype.controlText_ = "PlaybackQualityMenuPermit",
  7664. He.registerComponent("PlaybackQualityMenuPermit", ls);
  7665. var us = function(l) {
  7666. function e(e, t, n) {
  7667. var i, r = t.quality, s = t.quality;
  7668. if (t.label = r,
  7669. t.selected = 1 === s,
  7670. t.selectable = !0,
  7671. t.multiSelectable = !1,
  7672. (i = l.call(this, e, t) || this).label = r,
  7673. i.quality = s,
  7674. i.permit = t.permit,
  7675. n) {
  7676. var a = new ls(e,t);
  7677. i.permit,
  7678. 0,
  7679. i.permit <= 0 && a.visible(!1),
  7680. i.addChild(a)
  7681. }
  7682. i.on(e, "qualitychange", i.update);
  7683. var o = i.player_.qualityLevels();
  7684. return i.on(o, "change", i.update2),
  7685. i
  7686. }
  7687. We(e, l);
  7688. var t = e.prototype;
  7689. return t.handleClick = function(e) {
  7690. if (0 !== this.permit)
  7691. return this.player().log("this.permit" + this.permit),
  7692. this.player().pause(),
  7693. this.player().trigger("loginstatus"),
  7694. void cr.set("h5vodlocaldata", {
  7695. lastQuality: this.label,
  7696. lastVolume: this.player().volume()
  7697. });
  7698. l.prototype.handleClick.call(this),
  7699. this.player().switchQualityDirect(this.label),
  7700. this.player().trigger("analyticALI.play.1.13")
  7701. }
  7702. ,
  7703. t.update = function(e) {
  7704. this.selected(this.player().getCurentQuality() === this.quality)
  7705. }
  7706. ,
  7707. t.update2 = function(e) {
  7708. this.selected(this.player().getCurentQuality() === this.quality)
  7709. }
  7710. ,
  7711. t.playbackQualities = function() {
  7712. return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
  7713. }
  7714. ,
  7715. t.playbackQualityIndexs = function() {
  7716. return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
  7717. }
  7718. ,
  7719. e
  7720. }(Qr);
  7721. us.prototype.contentElType = "Playback Quality",
  7722. He.registerComponent("PlaybackQualityMenuItem", us);
  7723. var cs = function(r) {
  7724. function e(e, t) {
  7725. var n;
  7726. (n = r.call(this, e, t) || this).updateVisibility(),
  7727. n.updateLabel(),
  7728. n.on(e, "loadstart", n.updateVisibility),
  7729. n.on(e, "loadedmetadata", n.updateMenu);
  7730. n.player().options().qualityPermitMode;
  7731. n.on(e, "qualitychange", n.updateLabel);
  7732. var i = n.player_.qualityLevels();
  7733. return n.on(i, "change", n.updateLabel2),
  7734. n
  7735. }
  7736. We(e, r);
  7737. var t = e.prototype;
  7738. return t.createEl = function() {
  7739. var e = r.prototype.createEl.call(this);
  7740. return this.labelEl_ = w("div", {
  7741. className: "vjs-playback-quality-value",
  7742. innerHTML: "HD"
  7743. }),
  7744. e.appendChild(this.labelEl_),
  7745. e
  7746. }
  7747. ,
  7748. t.dispose = function() {
  7749. this.labelEl_ = null,
  7750. r.prototype.dispose.call(this)
  7751. }
  7752. ,
  7753. t.buildCSSClass = function() {
  7754. return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
  7755. }
  7756. ,
  7757. t.buildWrapperCSSClass = function() {
  7758. return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
  7759. }
  7760. ,
  7761. t.createMenu = function() {
  7762. for (var e = new Fr(this.player()), t = !!this.player().options().qualityPermitMode, n = this.player().options().customQualityList, i = t ? n : ["HD-"], r = !1, s = i.length - 1; 0 <= s; s--)
  7763. if (0 < i[s].permition) {
  7764. r = !0;
  7765. break
  7766. }
  7767. if (r && this.addClass("vjs-playback-quality-wide"),
  7768. i)
  7769. for (var a = i.length - 1; 0 <= a; a--) {
  7770. var o = void 0;
  7771. i[a].enabled && (o = t && r ? new us(this.player(),{
  7772. quality: "" + i[a].label,
  7773. permit: i[a].permition
  7774. },!0) : new us(this.player(),{
  7775. quality: "" + i[a].label,
  7776. permit: 0
  7777. },!1),
  7778. e.addChild(o))
  7779. }
  7780. return e
  7781. }
  7782. ,
  7783. t.updateMenu = function() {
  7784. var e = !!this.player().options().qualityPermitMode;
  7785. if (this.player().changingToMainContent() && e)
  7786. for (var t = this.player_.qualityLevels().length, n = 0; n < t; n++) {
  7787. var i = this.player().options_.playbackQualities
  7788. , r = this.player().options_.playbackQualityIndex[i.lastIndexOf(this.player().getMainContentQuality())];
  7789. this.player_.qualityLevels()[n].enabled = n === r
  7790. }
  7791. }
  7792. ,
  7793. t.initSwitchQuality = function() {
  7794. var e = this.player_.qualityLevels().length;
  7795. this.player_.clearPlaybackQualityLevel();
  7796. for (var t = 0; t < e; t++)
  7797. this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
  7798. this.player().switchQuality(this.player().options().customDefaultQuality, !0),
  7799. this.updateLabel()
  7800. }
  7801. ,
  7802. t.updateARIAAttributes = function() {
  7803. this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
  7804. }
  7805. ,
  7806. t.handleClick = function(e) {
  7807. for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
  7808. if (n[r] > t) {
  7809. i = n[r];
  7810. break
  7811. }
  7812. this.player().playbackQuality(i)
  7813. }
  7814. ,
  7815. t.handleMouseEnter = function() {
  7816. this.player().trigger("analyticALI.play.1.14")
  7817. }
  7818. ,
  7819. t.playbackQualities = function() {
  7820. return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
  7821. }
  7822. ,
  7823. t.playbackQualityIndexs = function() {
  7824. return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
  7825. }
  7826. ,
  7827. t.playbackQualitySupported = function() {
  7828. return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
  7829. }
  7830. ,
  7831. t.updateVisibility = function(e) {
  7832. this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
  7833. }
  7834. ,
  7835. t.updateLabel = function(e) {
  7836. this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
  7837. }
  7838. ,
  7839. t.updateLabel2 = function(e) {
  7840. this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
  7841. }
  7842. ,
  7843. e
  7844. }(Hr);
  7845. cs.prototype.controlText_ = "Playback Quality",
  7846. He.registerComponent("PlaybackQualityMenuButton", cs);
  7847. var hs = function(a) {
  7848. function e(e, t) {
  7849. var n, i = t.quality, r = t.quality;
  7850. t.label = i,
  7851. t.selected = 1 === r,
  7852. t.selectable = !0,
  7853. t.multiSelectable = !1,
  7854. (n = a.call(this, e, t) || this).label = i,
  7855. n.quality = r,
  7856. n.on(e, "qualitychange", n.update);
  7857. var s = n.player_.qualityLevels();
  7858. return n.on(s, "change", n.update2),
  7859. n
  7860. }
  7861. We(e, a);
  7862. var t = e.prototype;
  7863. return t.handleClick = function(e) {
  7864. a.prototype.handleClick.call(this),
  7865. this.player().switchQuality(this.label),
  7866. this.player().trigger("analyticALI.play.1.13")
  7867. }
  7868. ,
  7869. t.update = function(e) {
  7870. this.selected(this.player().getCurentQuality() === this.quality)
  7871. }
  7872. ,
  7873. t.update2 = function(e) {
  7874. this.selected(this.player().getCurentQuality() === this.quality)
  7875. }
  7876. ,
  7877. t.playbackQualities = function() {
  7878. return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
  7879. }
  7880. ,
  7881. t.playbackQualityIndexs = function() {
  7882. return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
  7883. }
  7884. ,
  7885. e
  7886. }(Qr);
  7887. hs.prototype.contentElType = "Playback Quality",
  7888. He.registerComponent("PlaybackQualityMenuItem3", hs);
  7889. var ds = function(r) {
  7890. function e(e, t) {
  7891. var n;
  7892. if ((n = r.call(this, e, t) || this).player().options().qualityPermitMode)
  7893. return Ve(n);
  7894. n.updateVisibility(),
  7895. n.updateLabel(),
  7896. n.on(e, "loadstart", n.updateVisibility),
  7897. n.on(e, "loadedmetadata", n.updateMenu),
  7898. n.on(e, "qualitychange", n.updateLabel);
  7899. var i = n.player_.qualityLevels();
  7900. return n.on(i, "change", n.updateLabel2),
  7901. n
  7902. }
  7903. We(e, r);
  7904. var t = e.prototype;
  7905. return t.createEl = function() {
  7906. var e = r.prototype.createEl.call(this);
  7907. return this.labelEl_ = w("div", {
  7908. className: "vjs-playback-quality-value",
  7909. innerHTML: "HD"
  7910. }),
  7911. e.appendChild(this.labelEl_),
  7912. e
  7913. }
  7914. ,
  7915. t.dispose = function() {
  7916. this.labelEl_ = null,
  7917. r.prototype.dispose.call(this)
  7918. }
  7919. ,
  7920. t.buildCSSClass = function() {
  7921. return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
  7922. }
  7923. ,
  7924. t.buildWrapperCSSClass = function() {
  7925. return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
  7926. }
  7927. ,
  7928. t.createMenu = function() {
  7929. for (var e = new Fr(this.player()), t = ["HD-"], n = t.length - 1; 0 <= n; n--)
  7930. e.addChild(new hs(this.player(),{
  7931. quality: "" + t[n]
  7932. }));
  7933. return e
  7934. }
  7935. ,
  7936. t.updateMenu = function() {
  7937. var e = this.player_.qualityLevels().length;
  7938. this.player_.clearPlaybackQualityLevel();
  7939. for (var t = 0; t < e; t++)
  7940. this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
  7941. for (var n, i = this.playbackQualities(), r = this.menu; 0 < r.children_.length; )
  7942. n = r.children_[0],
  7943. r.removeChild(n);
  7944. var s, a, o = cr.get("h5vodlocaldata");
  7945. if (void 0 !== o && void 0 !== o.lastQuality && 0 < this.player_.GET_DEFAULT_QUALITY_LABELS().indexOf(o.lastQuality) ? s = o.lastQuality : (s = "",
  7946. this.player_.log("no lastQuality")),
  7947. "" !== s && 0 <= i.indexOf(s))
  7948. a = s;
  7949. else if (null !== this.player_.options_.vdnDefaultStream) {
  7950. a = this.player_.options_.vdnDefaultStream,
  7951. this.player().options().debug && this.player_.log("vdn vdnDefaultStream: " + a)
  7952. }
  7953. if (i.indexOf(a) < 0 && (a = 1 === this.player_.options_.logicIndex ? this.player_.GET_DEFAULT_QUALITY_LABELS()[6] : this.player_.GET_DEFAULT_QUALITY_LABELS()[3]),
  7954. 0 <= i.indexOf(a) || (a = 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[3]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[3] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[4]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[4] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[2]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[2] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[5]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[5] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[1]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[1] : 0 <= i.indexOf(this.player_.GET_DEFAULT_QUALITY_LABELS()[7]) ? this.player_.GET_DEFAULT_QUALITY_LABELS()[7] : i[0]),
  7955. this.player().options().debug && this.player_.log("[PlaybackQualityMenuItem3] defaultStream: " + a),
  7956. this.player().switchQuality(a, !0),
  7957. this.updateLabel(),
  7958. i)
  7959. for (var l = i.length - 1; 0 <= l; l--) {
  7960. var u = new hs(this.player(),{
  7961. quality: "" + i[l]
  7962. });
  7963. r.addChild(u),
  7964. u.update()
  7965. }
  7966. }
  7967. ,
  7968. t.updateARIAAttributes = function() {
  7969. this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
  7970. }
  7971. ,
  7972. t.handleClick = function(e) {
  7973. for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
  7974. if (n[r] > t) {
  7975. i = n[r];
  7976. break
  7977. }
  7978. this.player().playbackQuality(i)
  7979. }
  7980. ,
  7981. t.handleMouseEnter = function() {
  7982. this.player().trigger("analyticALI.play.1.14")
  7983. }
  7984. ,
  7985. t.playbackQualities = function() {
  7986. return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
  7987. }
  7988. ,
  7989. t.playbackQualityIndexs = function() {
  7990. return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
  7991. }
  7992. ,
  7993. t.playbackQualitySupported = function() {
  7994. return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
  7995. }
  7996. ,
  7997. t.updateVisibility = function(e) {
  7998. this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
  7999. }
  8000. ,
  8001. t.updateLabel = function(e) {
  8002. this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
  8003. }
  8004. ,
  8005. t.updateLabel2 = function(e) {
  8006. this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
  8007. }
  8008. ,
  8009. e
  8010. }(Hr);
  8011. ds.prototype.controlText_ = "Playback Quality",
  8012. He.registerComponent("PlaybackQualityMenuButton3", ds);
  8013. var ps = function(e) {
  8014. function t() {
  8015. return e.apply(this, arguments) || this
  8016. }
  8017. We(t, e);
  8018. var n = t.prototype;
  8019. return n.buildCSSClass = function() {
  8020. return "vjs-current-time"
  8021. }
  8022. ,
  8023. n.updateContent = function(e) {
  8024. var t;
  8025. t = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(),
  8026. this.updateTextNode_(t)
  8027. }
  8028. ,
  8029. t
  8030. }(Rt);
  8031. ps.prototype.labelText_ = "Current Time",
  8032. ps.prototype.controlText_ = "Current Time",
  8033. He.registerComponent("CurrentTimeDisplay", ps);
  8034. var fs = function(i) {
  8035. function e(e, t) {
  8036. var n;
  8037. return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
  8038. n.on(e, "loadstart", n.updateContent),
  8039. n.on(e, "loadedmetadata", n.updateContent),
  8040. n
  8041. }
  8042. We(e, i);
  8043. var t = e.prototype;
  8044. return t.buildCSSClass = function() {
  8045. return "vjs-duration"
  8046. }
  8047. ,
  8048. t.updateContent = function(e) {
  8049. var t = this.player_.duration();
  8050. this.updateTextNode_(t)
  8051. }
  8052. ,
  8053. e
  8054. }(Rt);
  8055. fs.prototype.labelText_ = "Duration",
  8056. fs.prototype.controlText_ = "Duration",
  8057. He.registerComponent("DurationDisplay", fs);
  8058. var vs = function(e) {
  8059. function t() {
  8060. return e.apply(this, arguments) || this
  8061. }
  8062. return We(t, e),
  8063. t.prototype.createEl = function() {
  8064. return e.prototype.createEl.call(this, "div", {
  8065. className: "vjs-time-control vjs-time-divider",
  8066. innerHTML: "<div><span>/</span></div>"
  8067. }, {
  8068. "aria-hidden": !0
  8069. })
  8070. }
  8071. ,
  8072. t
  8073. }(He);
  8074. He.registerComponent("TimeDivider", vs);
  8075. var gs = function(i) {
  8076. function e(e, t) {
  8077. var n;
  8078. return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
  8079. n
  8080. }
  8081. We(e, i);
  8082. var t = e.prototype;
  8083. return t.buildCSSClass = function() {
  8084. return "vjs-remaining-time"
  8085. }
  8086. ,
  8087. t.createEl = function() {
  8088. var e = i.prototype.createEl.call(this);
  8089. return e.insertBefore(w("span", {}, {
  8090. "aria-hidden": !0
  8091. }, "-"), this.contentEl_),
  8092. e
  8093. }
  8094. ,
  8095. t.updateContent = function(e) {
  8096. var t;
  8097. "number" == typeof this.player_.duration() && (t = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime(),
  8098. this.updateTextNode_(t))
  8099. }
  8100. ,
  8101. e
  8102. }(Rt);
  8103. gs.prototype.labelText_ = "Remaining Time",
  8104. gs.prototype.controlText_ = "Remaining Time",
  8105. He.registerComponent("RemainingTimeDisplay", gs);
  8106. var ys = function(i) {
  8107. function e(e, t) {
  8108. var n;
  8109. return (n = i.call(this, e, t) || this).updateShowing(),
  8110. n.on(n.player(), "durationchange", n.updateShowing),
  8111. n
  8112. }
  8113. We(e, i);
  8114. var t = e.prototype;
  8115. return t.createEl = function() {
  8116. var e = i.prototype.createEl.call(this, "div", {
  8117. className: "vjs-live-control vjs-control"
  8118. });
  8119. return this.contentEl_ = w("div", {
  8120. className: "vjs-live-display",
  8121. innerHTML: '<span class="vjs-control-text">' + this.localize("Stream Type") + " </span>" + this.localize("LIVE")
  8122. }, {
  8123. "aria-live": "off"
  8124. }),
  8125. e.appendChild(this.contentEl_),
  8126. e
  8127. }
  8128. ,
  8129. t.dispose = function() {
  8130. this.contentEl_ = null,
  8131. i.prototype.dispose.call(this)
  8132. }
  8133. ,
  8134. t.updateShowing = function(e) {
  8135. this.player().duration() === 1 / 0 ? this.show() : this.hide()
  8136. }
  8137. ,
  8138. e
  8139. }(He);
  8140. He.registerComponent("LiveDisplay", ys);
  8141. var ms = function(i) {
  8142. function e(e, t) {
  8143. var n;
  8144. return (n = i.call(this, e, t) || this).updateLiveEdgeStatus(),
  8145. n.player_.liveTracker && n.on(n.player_.liveTracker, "liveedgechange", n.updateLiveEdgeStatus),
  8146. n
  8147. }
  8148. We(e, i);
  8149. var t = e.prototype;
  8150. return t.createEl = function() {
  8151. var e = i.prototype.createEl.call(this, "button", {
  8152. className: "vjs-seek-to-live-control vjs-control"
  8153. });
  8154. return this.textEl_ = w("span", {
  8155. className: "vjs-seek-to-live-text",
  8156. innerHTML: this.localize("LIVE")
  8157. }, {
  8158. "aria-hidden": "true"
  8159. }),
  8160. e.appendChild(this.textEl_),
  8161. e
  8162. }
  8163. ,
  8164. t.updateLiveEdgeStatus = function() {
  8165. !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() ? (this.setAttribute("aria-disabled", !0),
  8166. this.addClass("vjs-at-live-edge"),
  8167. this.controlText("Seek to live, currently playing live")) : (this.setAttribute("aria-disabled", !1),
  8168. this.removeClass("vjs-at-live-edge"),
  8169. this.controlText("Seek to live, currently behind live"))
  8170. }
  8171. ,
  8172. t.handleClick = function() {
  8173. this.player_.liveTracker.seekToLiveEdge()
  8174. }
  8175. ,
  8176. t.dispose = function() {
  8177. this.player_.liveTracker && this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatus),
  8178. this.textEl_ = null,
  8179. i.prototype.dispose.call(this)
  8180. }
  8181. ,
  8182. e
  8183. }(Qt);
  8184. ms.prototype.controlText_ = "Seek to live, currently playing live",
  8185. He.registerComponent("SeekToLive", ms);
  8186. function _s(e, t, n) {
  8187. return e = Number(e),
  8188. Math.min(n, Math.max(t, isNaN(e) ? t : e))
  8189. }
  8190. var bs = function(i) {
  8191. function e(e, t) {
  8192. var n;
  8193. return (n = i.call(this, e, t) || this).bar = n.getChild(n.options_.barName),
  8194. n.vertical(!!n.options_.vertical),
  8195. n.enable(),
  8196. n
  8197. }
  8198. We(e, i);
  8199. var t = e.prototype;
  8200. return t.enabled = function() {
  8201. return this.enabled_
  8202. }
  8203. ,
  8204. t.enable = function() {
  8205. this.enabled() || (this.on("mousedown", this.handleMouseDown),
  8206. this.on("touchstart", this.handleMouseDown),
  8207. this.on("keydown", this.handleKeyDown),
  8208. this.on("click", this.handleClick),
  8209. this.on(this.player_, "controlsvisible", this.update),
  8210. this.playerEvent && this.on(this.player_, this.playerEvent, this.update),
  8211. this.removeClass("disabled"),
  8212. this.setAttribute("tabindex", 0),
  8213. this.enabled_ = !0)
  8214. }
  8215. ,
  8216. t.disable = function() {
  8217. if (this.enabled()) {
  8218. var e = this.bar.el_.ownerDocument;
  8219. this.off("mousedown", this.handleMouseDown),
  8220. this.off("touchstart", this.handleMouseDown),
  8221. this.off("keydown", this.handleKeyDown),
  8222. this.off("click", this.handleClick),
  8223. this.off(this.player_, "controlsvisible", this.update),
  8224. this.off(e, "mousemove", this.handleMouseMove),
  8225. this.off(e, "mouseup", this.handleMouseUp),
  8226. this.off(e, "touchmove", this.handleMouseMove),
  8227. this.off(e, "touchend", this.handleMouseUp),
  8228. this.removeAttribute("tabindex"),
  8229. this.addClass("disabled"),
  8230. this.playerEvent && this.off(this.player_, this.playerEvent, this.update),
  8231. this.enabled_ = !1
  8232. }
  8233. }
  8234. ,
  8235. t.createEl = function(e, t, n) {
  8236. return void 0 === t && (t = {}),
  8237. void 0 === n && (n = {}),
  8238. t.className = t.className + " vjs-slider",
  8239. t = b({
  8240. tabIndex: 0
  8241. }, t),
  8242. n = b({
  8243. role: "slider",
  8244. "aria-valuenow": 0,
  8245. "aria-valuemin": 0,
  8246. "aria-valuemax": 100,
  8247. tabIndex: 0
  8248. }, n),
  8249. i.prototype.createEl.call(this, e, t, n)
  8250. }
  8251. ,
  8252. t.handleMouseDown = function(e) {
  8253. var t = this.bar.el_.ownerDocument;
  8254. "mousedown" === e.type && e.preventDefault(),
  8255. "touchstart" !== e.type || it || e.preventDefault(),
  8256. R(),
  8257. this.addClass("vjs-sliding"),
  8258. this.trigger("slideractive"),
  8259. this.on(t, "mousemove", this.handleMouseMove),
  8260. this.on(t, "mouseup", this.handleMouseUp),
  8261. this.on(t, "touchmove", this.handleMouseMove),
  8262. this.on(t, "touchend", this.handleMouseUp),
  8263. this.handleMouseMove(e)
  8264. }
  8265. ,
  8266. t.handleMouseMove = function(e) {}
  8267. ,
  8268. t.handleMouseUp = function() {
  8269. var e = this.bar.el_.ownerDocument;
  8270. F(),
  8271. this.removeClass("vjs-sliding"),
  8272. this.trigger("sliderinactive"),
  8273. this.off(e, "mousemove", this.handleMouseMove),
  8274. this.off(e, "mouseup", this.handleMouseUp),
  8275. this.off(e, "touchmove", this.handleMouseMove),
  8276. this.off(e, "touchend", this.handleMouseUp),
  8277. this.update()
  8278. }
  8279. ,
  8280. t.update = function() {
  8281. var t = this;
  8282. if (this.el_ && this.bar) {
  8283. var n = this.getProgress();
  8284. return n === this.progress_ || (this.progress_ = n,
  8285. this.requestAnimationFrame(function() {
  8286. var e = t.vertical() ? "height" : "width";
  8287. t.bar.el().style[e] = (100 * n).toFixed(2) + "%"
  8288. })),
  8289. n
  8290. }
  8291. }
  8292. ,
  8293. t.getProgress = function() {
  8294. return Number(_s(this.getPercent(), 0, 1).toFixed(4))
  8295. }
  8296. ,
  8297. t.calculateDistance = function(e) {
  8298. var t = Q(this.el_, e);
  8299. return this.vertical() ? t.y : t.x
  8300. }
  8301. ,
  8302. t.handleKeyDown = function(e) {
  8303. Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
  8304. e.stopPropagation(),
  8305. this.stepBack()) : Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up") ? (e.preventDefault(),
  8306. e.stopPropagation(),
  8307. this.stepForward()) : i.prototype.handleKeyDown.call(this, e)
  8308. }
  8309. ,
  8310. t.handleClick = function(e) {
  8311. e.stopPropagation(),
  8312. e.preventDefault()
  8313. }
  8314. ,
  8315. t.vertical = function(e) {
  8316. if (void 0 === e)
  8317. return this.vertical_ || !1;
  8318. this.vertical_ = !!e,
  8319. this.vertical_ ? this.addClass("vjs-slider-vertical") : this.addClass("vjs-slider-horizontal")
  8320. }
  8321. ,
  8322. e
  8323. }(He);
  8324. He.registerComponent("Slider", bs);
  8325. function Ts(e, t) {
  8326. return _s(e / t * 100, 0, 100).toFixed(2) + "%"
  8327. }
  8328. var Cs = function(r) {
  8329. function e(e, t) {
  8330. var n;
  8331. return (n = r.call(this, e, t) || this).partEls_ = [],
  8332. n.on(e, "progress", n.update),
  8333. n
  8334. }
  8335. We(e, r);
  8336. var t = e.prototype;
  8337. return t.createEl = function() {
  8338. var e = r.prototype.createEl.call(this, "div", {
  8339. className: "vjs-load-progress"
  8340. })
  8341. , t = w("span", {
  8342. className: "vjs-control-text"
  8343. })
  8344. , n = w("span", {
  8345. textContent: this.localize("Loaded")
  8346. })
  8347. , i = f.createTextNode(": ");
  8348. return this.percentageEl_ = w("span", {
  8349. className: "vjs-control-text-loaded-percentage",
  8350. textContent: "0%"
  8351. }),
  8352. e.appendChild(t),
  8353. t.appendChild(n),
  8354. t.appendChild(i),
  8355. t.appendChild(this.percentageEl_),
  8356. e
  8357. }
  8358. ,
  8359. t.dispose = function() {
  8360. this.partEls_ = null,
  8361. this.percentageEl_ = null,
  8362. r.prototype.dispose.call(this)
  8363. }
  8364. ,
  8365. t.update = function(e) {
  8366. var h = this;
  8367. this.requestAnimationFrame(function() {
  8368. var e = h.player_.liveTracker
  8369. , t = h.player_.buffered()
  8370. , n = e && e.isLive() ? e.seekableEnd() : h.player_.duration()
  8371. , i = h.player_.bufferedEnd()
  8372. , r = h.partEls_
  8373. , s = Ts(i, n);
  8374. h.percent_ !== s && (h.el_.style.width = s,
  8375. x(h.percentageEl_, s),
  8376. h.percent_ = s);
  8377. for (var a = 0; a < t.length; a++) {
  8378. var o = t.start(a)
  8379. , l = t.end(a)
  8380. , u = r[a];
  8381. u || (u = h.el_.appendChild(w()),
  8382. r[a] = u),
  8383. u.dataset.start === o && u.dataset.end === l || (u.dataset.start = o,
  8384. u.dataset.end = l,
  8385. u.style.left = Ts(o, i),
  8386. u.style.width = Ts(l - o, i))
  8387. }
  8388. for (var c = r.length; c > t.length; c--)
  8389. h.el_.removeChild(r[c - 1]);
  8390. r.length = t.length
  8391. })
  8392. }
  8393. ,
  8394. e
  8395. }(He);
  8396. He.registerComponent("LoadProgressBar", Cs);
  8397. var ks = function(i) {
  8398. function e(e, t) {
  8399. var n;
  8400. return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
  8401. n
  8402. }
  8403. We(e, i);
  8404. var t = e.prototype;
  8405. return t.createEl = function() {
  8406. return i.prototype.createEl.call(this, "div", {
  8407. className: "vjs-time-tooltip"
  8408. }, {
  8409. "aria-hidden": "true"
  8410. })
  8411. }
  8412. ,
  8413. t.update = function(e, t, n) {
  8414. var i = H(this.el_)
  8415. , r = H(this.player_.el())
  8416. , s = e.width * t;
  8417. if (r && i) {
  8418. var a = e.left - r.left + s
  8419. , o = e.width - s + (r.right - e.right)
  8420. , l = i.width / 2;
  8421. a < l ? l += l - a : o < l && (l = o),
  8422. l < 0 ? l = 0 : l > i.width && (l = i.width),
  8423. this.el_.style.right = "-" + l + "px",
  8424. this.write(n)
  8425. }
  8426. }
  8427. ,
  8428. t.write = function(e) {
  8429. x(this.el_, e)
  8430. }
  8431. ,
  8432. t.updateTime = function(r, s, a, o) {
  8433. var l = this;
  8434. this.rafId_ && this.cancelAnimationFrame(this.rafId_),
  8435. this.rafId_ = this.requestAnimationFrame(function() {
  8436. var e, t = l.player_.duration();
  8437. if (l.player_.liveTracker && l.player_.liveTracker.isLive()) {
  8438. var n = l.player_.liveTracker.liveWindow()
  8439. , i = n - s * n;
  8440. e = (i < 1 ? "" : "-") + Bt(i, n)
  8441. } else
  8442. e = Bt(a, t);
  8443. l.update(r, s, e),
  8444. o && o()
  8445. })
  8446. }
  8447. ,
  8448. e
  8449. }(He);
  8450. He.registerComponent("TimeTooltip", ks);
  8451. var Es = function(i) {
  8452. function e(e, t) {
  8453. var n;
  8454. return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
  8455. n
  8456. }
  8457. We(e, i);
  8458. var t = e.prototype;
  8459. return t.createEl = function() {
  8460. return i.prototype.createEl.call(this, "div", {
  8461. className: "vjs-play-progress vjs-slider-bar"
  8462. }, {
  8463. "aria-hidden": "true"
  8464. })
  8465. }
  8466. ,
  8467. t.update = function(e, t) {
  8468. var n = this.getChild("timeTooltip");
  8469. if (n) {
  8470. var i = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
  8471. n.updateTime(e, t, i)
  8472. }
  8473. }
  8474. ,
  8475. e
  8476. }(He);
  8477. Es.prototype.options_ = {
  8478. children: []
  8479. },
  8480. He.registerComponent("PlayProgressBar", Es);
  8481. var Ss = function(i) {
  8482. function e(e, t) {
  8483. var n;
  8484. return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
  8485. n
  8486. }
  8487. We(e, i);
  8488. var t = e.prototype;
  8489. return t.createEl = function() {
  8490. return i.prototype.createEl.call(this, "div", {
  8491. className: "vjs-mouse-display"
  8492. })
  8493. }
  8494. ,
  8495. t.update = function(e, t) {
  8496. var n = this
  8497. , i = t * this.player_.duration();
  8498. this.getChild("timeTooltip").updateTime(e, t, i, function() {
  8499. n.el_.style.left = e.width * t + "px"
  8500. })
  8501. }
  8502. ,
  8503. e
  8504. }(He);
  8505. Ss.prototype.options_ = {
  8506. children: ["timeTooltip"]
  8507. },
  8508. He.registerComponent("MouseTimeDisplay", Ss);
  8509. var ws = function(r) {
  8510. function e(e, t, n) {
  8511. var i;
  8512. return void 0 === n && (n = 0),
  8513. (i = r.call(this, e, t) || this).index_ = n,
  8514. i.start_ = e.options_.cuePoints[n].start,
  8515. i.title_ = e.options_.cuePoints[n].title,
  8516. i.end_ = e.options_.cuePoints[n].end,
  8517. i.guid_ = e.options_.cuePoints[n].guid,
  8518. i.on(e, "durationchange", i.update),
  8519. i.on(i.el_, "mouseover", i.handleMouseOver),
  8520. i.on(i.el_, "mouseout", i.handleMouseOut),
  8521. i.on(i.el_, "mousedown", i.handleMouseDown),
  8522. i
  8523. }
  8524. We(e, r);
  8525. var t = e.prototype;
  8526. return t.createEl = function() {
  8527. return r.prototype.createEl.call(this, "div", {
  8528. className: "vjs-cue-point"
  8529. }, {
  8530. "aria-hidden": "true"
  8531. })
  8532. }
  8533. ,
  8534. t.getIndex = function() {
  8535. return this.index_
  8536. }
  8537. ,
  8538. t.getStart = function() {
  8539. return this.start_
  8540. }
  8541. ,
  8542. t.getTitle = function() {
  8543. return this.title_
  8544. }
  8545. ,
  8546. t.getEnd = function() {
  8547. return this.end_
  8548. }
  8549. ,
  8550. t.handleMouseOver = function(e) {
  8551. this.parentComponent_.parentComponent_.getChild("cuePointPreview").show(),
  8552. this.parentComponent_.parentComponent_.getChild("cuePointPreview").updateCue(this.index_, this.guid_, this.title_, this.start_ / 1e3),
  8553. this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").hide()
  8554. }
  8555. ,
  8556. t.handleMouseOut = function(e) {
  8557. this.parentComponent_.parentComponent_.getChild("cuePointPreview").hide(),
  8558. this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").show()
  8559. }
  8560. ,
  8561. t.handleClick = function(e) {
  8562. e.stopPropagation()
  8563. }
  8564. ,
  8565. t.handleMouseDown = function(e) {
  8566. this.player_.currentTime(this.start_ / 1e3),
  8567. e.stopPropagation()
  8568. }
  8569. ,
  8570. t.update = function() {
  8571. isNaN(this.player_.duration()) && this.player_.duration(),
  8572. this.el().style.left = this.getStart() / 1e3 / this.player_.duration() * 100 + "%"
  8573. }
  8574. ,
  8575. e
  8576. }(He);
  8577. ws.prototype.options_ = {
  8578. children: []
  8579. },
  8580. He.registerComponent("CuePoint", ws);
  8581. var xs = function(s) {
  8582. function e(e, t) {
  8583. var n;
  8584. if ((n = s.call(this, e, t) || this).setEventHandlers_(),
  8585. void 0 !== e.options_.cuePoints && 0 < e.options_.cuePoints.length)
  8586. for (var i = 0; i < e.options_.cuePoints.length; i++) {
  8587. var r = new ws(e,t,i);
  8588. n.addChild(r)
  8589. }
  8590. return n
  8591. }
  8592. We(e, s);
  8593. var t = e.prototype;
  8594. return t.setEventHandlers_ = function() {
  8595. this.update_ = Te(this, this.update),
  8596. this.update = Ce(this.update_, 30),
  8597. this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update),
  8598. this.player_.liveTracker && this.on(this.player_.liveTracker, "liveedgechange", this.update),
  8599. this.updateInterval = null,
  8600. this.on(this.player_, ["playing"], this.enableInterval_),
  8601. this.on(this.player_, ["ended", "pause", "waiting"], this.disableInterval_),
  8602. "hidden"in f && "visibilityState"in f && this.on(f, "visibilitychange", this.toggleVisibility_)
  8603. }
  8604. ,
  8605. t.toggleVisibility_ = function(e) {
  8606. f.hidden ? this.disableInterval_(e) : (this.enableInterval_(),
  8607. this.update())
  8608. }
  8609. ,
  8610. t.enableInterval_ = function() {
  8611. this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30))
  8612. }
  8613. ,
  8614. t.disableInterval_ = function(e) {
  8615. this.player_.liveTracker && this.player_.liveTracker.isLive() && "ended" !== e.type || this.updateInterval && (this.clearInterval(this.updateInterval),
  8616. this.updateInterval = null)
  8617. }
  8618. ,
  8619. t.createEl = function() {
  8620. return s.prototype.createEl.call(this, "div", {
  8621. className: "vjs-progress-holder"
  8622. }, {
  8623. "aria-label": this.localize("Progress Bar")
  8624. })
  8625. }
  8626. ,
  8627. t.update = function(e) {
  8628. var i = this
  8629. , r = s.prototype.update.call(this);
  8630. return this.requestAnimationFrame(function() {
  8631. var e = i.player_.ended() ? i.player_.duration() : i.getCurrentTime_()
  8632. , t = i.player_.liveTracker
  8633. , n = i.player_.duration();
  8634. t && t.isLive() && (n = i.player_.liveTracker.liveCurrentTime()),
  8635. i.percent_ !== r && (i.el_.setAttribute("aria-valuenow", (100 * r).toFixed(2)),
  8636. i.percent_ = r),
  8637. i.currentTime_ === e && i.duration_ === n || (i.el_.setAttribute("aria-valuetext", i.localize("progress bar timing: currentTime={1} duration={2}", [Bt(e, n), Bt(n, n)], "{1} of {2}")),
  8638. i.currentTime_ = e,
  8639. i.duration_ = n),
  8640. i.bar && i.bar.update(H(i.el()), i.getProgress())
  8641. }),
  8642. r
  8643. }
  8644. ,
  8645. t.getCurrentTime_ = function() {
  8646. return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()
  8647. }
  8648. ,
  8649. t.getPercent = function() {
  8650. var e, t = this.getCurrentTime_(), n = this.player_.liveTracker;
  8651. return n && n.isLive() ? (e = (t - n.seekableStart()) / n.liveWindow(),
  8652. n.atLiveEdge() && (e = 1)) : e = t / this.player_.duration(),
  8653. e
  8654. }
  8655. ,
  8656. t.handleMouseDown = function(e) {
  8657. X(e) && (e.stopPropagation(),
  8658. this.player_.scrubbing(!0),
  8659. this.videoWasPlaying = !this.player_.paused(),
  8660. this.player_.pause(),
  8661. s.prototype.handleMouseDown.call(this, e))
  8662. }
  8663. ,
  8664. t.handleMouseMove = function(e) {
  8665. if (X(e)) {
  8666. var t, n = this.calculateDistance(e), i = this.player_.liveTracker;
  8667. if (i && i.isLive()) {
  8668. if (.99 <= n)
  8669. return void i.seekToLiveEdge();
  8670. var r = i.seekableStart()
  8671. , s = i.liveCurrentTime();
  8672. if (s <= (t = r + n * i.liveWindow()) && (t = s),
  8673. t <= r && (t = r + .1),
  8674. t === 1 / 0)
  8675. return
  8676. } else
  8677. (t = n * this.player_.duration()) === this.player_.duration() && (t -= .1);
  8678. this.player_.currentTime(t)
  8679. }
  8680. }
  8681. ,
  8682. t.enable = function() {
  8683. s.prototype.enable.call(this);
  8684. var e = this.getChild("mouseTimeDisplay");
  8685. e && e.show()
  8686. }
  8687. ,
  8688. t.disable = function() {
  8689. s.prototype.disable.call(this);
  8690. var e = this.getChild("mouseTimeDisplay");
  8691. e && e.hide()
  8692. }
  8693. ,
  8694. t.handleMouseUp = function(e) {
  8695. s.prototype.handleMouseUp.call(this, e),
  8696. e && e.stopPropagation(),
  8697. this.player_.scrubbing(!1),
  8698. this.player_.trigger({
  8699. type: "timeupdate",
  8700. target: this,
  8701. manuallyTriggered: !0
  8702. }),
  8703. this.videoWasPlaying ? At(this.player_.play()) : this.update_()
  8704. }
  8705. ,
  8706. t.stepForward = function() {
  8707. this.player_.currentTime(this.player_.currentTime() + 10)
  8708. }
  8709. ,
  8710. t.stepBack = function() {
  8711. this.player_.currentTime(this.player_.currentTime() - 10)
  8712. }
  8713. ,
  8714. t.handleAction = function(e) {
  8715. this.player_.paused() ? this.player_.play() : this.player_.pause()
  8716. }
  8717. ,
  8718. t.handleKeyDown = function(e) {
  8719. if (Mt.isEventKey(e, "Space") || Mt.isEventKey(e, "Enter"))
  8720. e.preventDefault(),
  8721. e.stopPropagation(),
  8722. this.handleAction(e);
  8723. else if (Mt.isEventKey(e, "Home"))
  8724. e.preventDefault(),
  8725. e.stopPropagation(),
  8726. this.player_.currentTime(0);
  8727. else if (Mt.isEventKey(e, "End"))
  8728. e.preventDefault(),
  8729. e.stopPropagation(),
  8730. this.player_.currentTime(this.player_.duration());
  8731. else if (/^[0-9]$/.test(Mt(e))) {
  8732. e.preventDefault(),
  8733. e.stopPropagation();
  8734. var t = 10 * (Mt.codes[Mt(e)] - Mt.codes[0]) / 100;
  8735. this.player_.currentTime(this.player_.duration() * t)
  8736. } else
  8737. Mt.isEventKey(e, "PgDn") ? (e.preventDefault(),
  8738. e.stopPropagation(),
  8739. this.player_.currentTime(this.player_.currentTime() - 120)) : Mt.isEventKey(e, "PgUp") ? (e.preventDefault(),
  8740. e.stopPropagation(),
  8741. this.player_.currentTime(this.player_.currentTime() + 120)) : s.prototype.handleKeyDown.call(this, e)
  8742. }
  8743. ,
  8744. e
  8745. }(bs);
  8746. xs.prototype.options_ = {
  8747. children: ["loadProgressBar", "playProgressBar"],
  8748. barName: "playProgressBar"
  8749. },
  8750. ht || Je || xs.prototype.options_.children.push("mouseTimeDisplay"),
  8751. He.registerComponent("SeekBar", xs);
  8752. var As = function(i) {
  8753. function e(e, t) {
  8754. var n;
  8755. return void 0 === t && (t = {}),
  8756. (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
  8757. n.on("mouseover", n.handlerMouseOver),
  8758. n.on("click", n.handlerClick),
  8759. n
  8760. }
  8761. We(e, i);
  8762. var t = e.prototype;
  8763. return t.createEl = function() {
  8764. return i.prototype.createEl.call(this, "div", {
  8765. className: "cue-point-preview vjs-hidden",
  8766. innerHTML: '<div class="cue-point-preview-image"></div><div class="cue-point-preview-title">-</div><span class="cue-point-preview-time">88:88</span>'
  8767. })
  8768. }
  8769. ,
  8770. t.updateCue = function(e, t, n, i) {
  8771. var r = Bt(i, this.player_.duration())
  8772. , s = this.player_.httpPre_ + this.player_.options_.videoSnapUrl;
  8773. void 0 !== this.player_.options_.videoSnapUrl && "" !== this.player_.options_.videoSnapUrl && " " !== this.player_.options_.videoSnapUrl ? this.el_.innerHTML = '<div class="cue-point-preview-image"><img src="' + (s + t) + "&start_time=" + i + '"/></div><div class="cue-point-preview-title">' + n + '</div><div class="cue-point-preview-time" style="left:50px">' + r + "</div>" : this.el_.innerHTML = '<div class="cue-point-preview-image"><div class= "cue-point-preview-noimage"/></div><div class="cue-point-preview-title">' + n + '</div><div class="cue-point-preview-time" style="left:50px">' + r + "</div>"
  8774. }
  8775. ,
  8776. t.handleMouseDown = function(e) {}
  8777. ,
  8778. t.handlerMouseOver = function(e) {
  8779. this.player().log("[cue-point-preview] mouse over")
  8780. }
  8781. ,
  8782. t.handlerClick = function(e) {}
  8783. ,
  8784. t.handleMouseUp = function(e) {}
  8785. ,
  8786. t.handleMouseMove = function(e) {}
  8787. ,
  8788. t.update = function(e, t) {
  8789. var n = e.width * t + 10 - 73;
  8790. n < 10 ? n = 10 : n > e.width + 10 - 146 && (n = e.width + 10 - 146),
  8791. this.el_.style.left = n + "px"
  8792. }
  8793. ,
  8794. e
  8795. }(He);
  8796. As.prototype.options_ = {
  8797. children: []
  8798. },
  8799. He.registerComponent("CuePointPreview", As);
  8800. var Ps = function(i) {
  8801. function e(e, t) {
  8802. var n;
  8803. return (n = i.call(this, e, t) || this).handleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
  8804. n.throttledHandleMouseSeek = Ce(Te(Ve(n), n.handleMouseSeek), 30),
  8805. n.enable(),
  8806. n
  8807. }
  8808. We(e, i);
  8809. var t = e.prototype;
  8810. return t.createEl = function() {
  8811. return i.prototype.createEl.call(this, "div", {
  8812. className: "vjs-progress-control vjs-control"
  8813. })
  8814. }
  8815. ,
  8816. t.handleMouseMove = function(e) {
  8817. var t = this.getChild("seekBar");
  8818. if (t) {
  8819. var n = t.getChild("playProgressBar")
  8820. , i = t.getChild("mouseTimeDisplay");
  8821. if (n || i) {
  8822. var r = t.el()
  8823. , s = H(r)
  8824. , a = Q(r, e).x;
  8825. a = _s(0, 1, a),
  8826. i && i.update(s, a),
  8827. n && n.update(s, t.getProgress());
  8828. var o = this.getChild("cuePointPreview");
  8829. o && o.update(s, a)
  8830. }
  8831. }
  8832. }
  8833. ,
  8834. t.handleMouseSeek = function(e) {
  8835. var t = this.getChild("seekBar");
  8836. t && t.handleMouseMove(e)
  8837. }
  8838. ,
  8839. t.enabled = function() {
  8840. return this.enabled_
  8841. }
  8842. ,
  8843. t.disable = function() {
  8844. this.children().forEach(function(e) {
  8845. return e.disable && e.disable()
  8846. }),
  8847. this.enabled() && (this.off(["mousedown", "touchstart"], this.handleMouseDown),
  8848. this.off(this.el_, "mousemove", this.handleMouseMove),
  8849. this.handleMouseUp(),
  8850. this.addClass("disabled"),
  8851. this.enabled_ = !1)
  8852. }
  8853. ,
  8854. t.enable = function() {
  8855. this.children().forEach(function(e) {
  8856. return e.enable && e.enable()
  8857. }),
  8858. this.enabled() || (this.on(["mousedown", "touchstart"], this.handleMouseDown),
  8859. this.on(this.el_, "mousemove", this.handleMouseMove),
  8860. this.removeClass("disabled"),
  8861. this.enabled_ = !0)
  8862. }
  8863. ,
  8864. t.handleMouseDown = function(e) {
  8865. var t = this.el_.ownerDocument
  8866. , n = this.getChild("seekBar");
  8867. n && n.handleMouseDown(e),
  8868. this.on(t, "mousemove", this.throttledHandleMouseSeek),
  8869. this.on(t, "touchmove", this.throttledHandleMouseSeek),
  8870. this.on(t, "mouseup", this.handleMouseUp),
  8871. this.on(t, "touchend", this.handleMouseUp)
  8872. }
  8873. ,
  8874. t.handleMouseUp = function(e) {
  8875. var t = this.el_.ownerDocument
  8876. , n = this.getChild("seekBar");
  8877. n && n.handleMouseUp(e),
  8878. this.off(t, "mousemove", this.throttledHandleMouseSeek),
  8879. this.off(t, "touchmove", this.throttledHandleMouseSeek),
  8880. this.off(t, "mouseup", this.handleMouseUp),
  8881. this.off(t, "touchend", this.handleMouseUp)
  8882. }
  8883. ,
  8884. e
  8885. }(He);
  8886. Ps.prototype.options_ = {
  8887. children: ["seekBar", "cuePointPreview"]
  8888. },
  8889. He.registerComponent("ProgressControl", Ps);
  8890. var Ls = function(i) {
  8891. function e(e, t) {
  8892. var n;
  8893. return (n = i.call(this, e, t) || this).on(e, ["enterpictureinpicture", "leavepictureinpicture"], n.handlePictureInPictureChange),
  8894. f.pictureInPictureEnabled || n.disable(),
  8895. n
  8896. }
  8897. We(e, i);
  8898. var t = e.prototype;
  8899. return t.buildCSSClass = function() {
  8900. return "vjs-picture-in-picture-control " + i.prototype.buildCSSClass.call(this)
  8901. }
  8902. ,
  8903. t.handlePictureInPictureChange = function(e) {
  8904. this.player_.isInPictureInPicture() ? this.controlText("Exit Picture-in-Picture") : this.controlText("Picture-in-Picture")
  8905. }
  8906. ,
  8907. t.handleClick = function(e) {
  8908. this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture()
  8909. }
  8910. ,
  8911. e
  8912. }(Qt);
  8913. Ls.prototype.controlText_ = "Picture-in-Picture",
  8914. He.registerComponent("PictureInPictureToggle", Ls);
  8915. var Is = function(i) {
  8916. function e(e, t) {
  8917. var n;
  8918. return (n = i.call(this, e, t) || this).on(e, "fullscreenchange", n.handleFullscreenChange),
  8919. !1 === f[e.fsApi_.fullscreenEnabled] && n.disable(),
  8920. n
  8921. }
  8922. We(e, i);
  8923. var t = e.prototype;
  8924. return t.buildCSSClass = function() {
  8925. return "vjs-fullscreen-control " + i.prototype.buildCSSClass.call(this)
  8926. }
  8927. ,
  8928. t.handleFullscreenChange = function(e) {
  8929. this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen")
  8930. }
  8931. ,
  8932. t.handleClick = function(e) {
  8933. this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen()
  8934. }
  8935. ,
  8936. e
  8937. }(Qt);
  8938. Is.prototype.controlText_ = "Fullscreen",
  8939. He.registerComponent("FullscreenToggle", Is);
  8940. var Ms = function(e) {
  8941. function t() {
  8942. return e.apply(this, arguments) || this
  8943. }
  8944. return We(t, e),
  8945. t.prototype.createEl = function() {
  8946. return e.prototype.createEl.call(this, "div", {
  8947. className: "vjs-volume-level",
  8948. innerHTML: '<span class="vjs-control-text"></span>'
  8949. })
  8950. }
  8951. ,
  8952. t
  8953. }(He);
  8954. He.registerComponent("VolumeLevel", Ms);
  8955. var js = function(i) {
  8956. function e(e, t) {
  8957. var n;
  8958. return (n = i.call(this, e, t) || this).on("slideractive", n.updateLastVolume_),
  8959. n.on(e, "volumechange", n.updateARIAAttributes),
  8960. e.ready(function() {
  8961. return n.updateARIAAttributes()
  8962. }),
  8963. n
  8964. }
  8965. We(e, i);
  8966. var t = e.prototype;
  8967. return t.createEl = function() {
  8968. return i.prototype.createEl.call(this, "div", {
  8969. className: "vjs-volume-bar vjs-slider-bar"
  8970. }, {
  8971. "aria-label": this.localize("Volume Level"),
  8972. "aria-live": "polite"
  8973. })
  8974. }
  8975. ,
  8976. t.handleMouseDown = function(e) {
  8977. X(e) && i.prototype.handleMouseDown.call(this, e)
  8978. }
  8979. ,
  8980. t.handleMouseMove = function(e) {
  8981. X(e) && (this.checkMuted(),
  8982. this.player_.volume(this.calculateDistance(e)))
  8983. }
  8984. ,
  8985. t.checkMuted = function() {
  8986. this.player_.muted() && this.player_.muted(!1)
  8987. }
  8988. ,
  8989. t.getPercent = function() {
  8990. return this.player_.muted() ? 0 : this.player_.volume()
  8991. }
  8992. ,
  8993. t.stepForward = function() {
  8994. this.checkMuted(),
  8995. this.player_.volume(this.player_.volume() + .1)
  8996. }
  8997. ,
  8998. t.stepBack = function() {
  8999. this.checkMuted(),
  9000. this.player_.volume(this.player_.volume() - .1)
  9001. }
  9002. ,
  9003. t.updateARIAAttributes = function(e) {
  9004. var t = this.player_.muted() ? 0 : this.volumeAsPercentage_();
  9005. this.el_.setAttribute("aria-valuenow", t),
  9006. this.el_.setAttribute("aria-valuetext", t + "%")
  9007. }
  9008. ,
  9009. t.volumeAsPercentage_ = function() {
  9010. return Math.round(100 * this.player_.volume())
  9011. }
  9012. ,
  9013. t.updateLastVolume_ = function() {
  9014. var e = this
  9015. , t = this.player_.volume();
  9016. this.one("sliderinactive", function() {
  9017. 0 === e.player_.volume() && e.player_.lastVolume_(t)
  9018. })
  9019. }
  9020. ,
  9021. e
  9022. }(bs);
  9023. js.prototype.options_ = {
  9024. children: ["volumeLevel"],
  9025. barName: "volumeLevel"
  9026. },
  9027. js.prototype.playerEvent = "volumechange",
  9028. He.registerComponent("VolumeBar", js);
  9029. var Os = function(i) {
  9030. function e(e, t) {
  9031. var n;
  9032. return void 0 === t && (t = {}),
  9033. t.vertical = t.vertical || !1,
  9034. "undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
  9035. t.volumeBar.vertical = t.vertical),
  9036. n = i.call(this, e, t) || this,
  9037. function(e, t) {
  9038. t.tech_ && !t.tech_.featuresVolumeControl && e.addClass("vjs-hidden"),
  9039. e.on(t, "loadstart", function() {
  9040. t.tech_.featuresVolumeControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden")
  9041. })
  9042. }(Ve(n), e),
  9043. n.throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
  9044. n.on("mousedown", n.handleMouseDown),
  9045. n.on("touchstart", n.handleMouseDown),
  9046. n.on(n.volumeBar, ["focus", "slideractive"], function() {
  9047. n.volumeBar.addClass("vjs-slider-active"),
  9048. n.addClass("vjs-slider-active"),
  9049. n.trigger("slideractive")
  9050. }),
  9051. n.on(n.volumeBar, ["blur", "sliderinactive"], function() {
  9052. n.volumeBar.removeClass("vjs-slider-active"),
  9053. n.removeClass("vjs-slider-active"),
  9054. n.trigger("sliderinactive")
  9055. }),
  9056. n
  9057. }
  9058. We(e, i);
  9059. var t = e.prototype;
  9060. return t.createEl = function() {
  9061. var e = "vjs-volume-horizontal";
  9062. return this.options_.vertical && (e = "vjs-volume-vertical"),
  9063. i.prototype.createEl.call(this, "div", {
  9064. className: "vjs-volume-control vjs-control " + e
  9065. })
  9066. }
  9067. ,
  9068. t.handleMouseDown = function(e) {
  9069. var t = this.el_.ownerDocument;
  9070. this.on(t, "mousemove", this.throttledHandleMouseMove),
  9071. this.on(t, "touchmove", this.throttledHandleMouseMove),
  9072. this.on(t, "mouseup", this.handleMouseUp),
  9073. this.on(t, "touchend", this.handleMouseUp)
  9074. }
  9075. ,
  9076. t.handleMouseUp = function(e) {
  9077. var t = this.el_.ownerDocument;
  9078. this.off(t, "mousemove", this.throttledHandleMouseMove),
  9079. this.off(t, "touchmove", this.throttledHandleMouseMove),
  9080. this.off(t, "mouseup", this.handleMouseUp),
  9081. this.off(t, "touchend", this.handleMouseUp)
  9082. }
  9083. ,
  9084. t.handleMouseMove = function(e) {
  9085. this.volumeBar.handleMouseMove(e)
  9086. }
  9087. ,
  9088. e
  9089. }(He);
  9090. Os.prototype.options_ = {
  9091. children: ["volumeBar"]
  9092. },
  9093. He.registerComponent("VolumeControl", Os);
  9094. var Ns = function(i) {
  9095. function e(e, t) {
  9096. var n;
  9097. return n = i.call(this, e, t) || this,
  9098. Ut(Ve(n), e),
  9099. n.on(e, ["loadstart", "volumechange"], n.update),
  9100. n
  9101. }
  9102. We(e, i);
  9103. var t = e.prototype;
  9104. return t.buildCSSClass = function() {
  9105. return "vjs-mute-control " + i.prototype.buildCSSClass.call(this)
  9106. }
  9107. ,
  9108. t.handleClick = function(e) {
  9109. var t = this.player_.volume()
  9110. , n = this.player_.lastVolume_();
  9111. if (0 === t) {
  9112. var i = n < .1 ? .1 : n;
  9113. this.player_.volume(i),
  9114. this.player_.muted(!1)
  9115. } else
  9116. this.player_.muted(!this.player_.muted())
  9117. }
  9118. ,
  9119. t.update = function(e) {
  9120. this.updateIcon_(),
  9121. this.updateControlText_()
  9122. }
  9123. ,
  9124. t.updateIcon_ = function() {
  9125. var e = this.player_.volume()
  9126. , t = 3;
  9127. ht && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted),
  9128. 0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2);
  9129. for (var n = 0; n < 4; n++)
  9130. I(this.el_, "vjs-vol-" + n);
  9131. L(this.el_, "vjs-vol-" + t)
  9132. }
  9133. ,
  9134. t.updateControlText_ = function() {
  9135. var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute";
  9136. this.controlText() !== e && this.controlText(e)
  9137. }
  9138. ,
  9139. e
  9140. }(Qt);
  9141. Ns.prototype.controlText_ = "Mute",
  9142. He.registerComponent("MuteToggle", Ns);
  9143. var Ds = function(i) {
  9144. function e(e, t) {
  9145. var n;
  9146. return void 0 === t && (t = {}),
  9147. "undefined" != typeof t.inline ? t.inline = t.inline : t.inline = !0,
  9148. "undefined" != typeof t.volumeControl && !c(t.volumeControl) || (t.volumeControl = t.volumeControl || {},
  9149. t.volumeControl.vertical = !t.inline),
  9150. (n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
  9151. n.on(n.muteToggle, "keyup", n.handleKeyPress),
  9152. n.on(n.volumeControl, "keyup", n.handleVolumeControlKeyUp),
  9153. n.on("keydown", n.handleKeyPress),
  9154. n.on("mouseover", n.handleMouseOver),
  9155. n.on("mouseout", n.handleMouseOut),
  9156. n.on(n.volumeControl, ["slideractive"], n.sliderActive_),
  9157. n.on(n.volumeControl, ["sliderinactive"], n.sliderInactive_),
  9158. n
  9159. }
  9160. We(e, i);
  9161. var t = e.prototype;
  9162. return t.sliderActive_ = function() {
  9163. this.addClass("vjs-slider-active")
  9164. }
  9165. ,
  9166. t.sliderInactive_ = function() {
  9167. this.removeClass("vjs-slider-active")
  9168. }
  9169. ,
  9170. t.volumePanelState_ = function() {
  9171. this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-hidden"),
  9172. this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-mute-toggle-only")
  9173. }
  9174. ,
  9175. t.createEl = function() {
  9176. var e = "vjs-volume-panel-horizontal";
  9177. return this.options_.inline || (e = "vjs-volume-panel-vertical"),
  9178. i.prototype.createEl.call(this, "div", {
  9179. className: "vjs-volume-panel vjs-control " + e
  9180. })
  9181. }
  9182. ,
  9183. t.dispose = function() {
  9184. this.handleMouseOut(),
  9185. i.prototype.dispose.call(this)
  9186. }
  9187. ,
  9188. t.handleVolumeControlKeyUp = function(e) {
  9189. Mt.isEventKey(e, "Esc") && this.muteToggle.focus()
  9190. }
  9191. ,
  9192. t.handleMouseOver = function(e) {
  9193. this.addClass("vjs-hover"),
  9194. ge(f, "keyup", Te(this, this.handleKeyPress))
  9195. }
  9196. ,
  9197. t.handleMouseOut = function(e) {
  9198. this.removeClass("vjs-hover"),
  9199. ye(f, "keyup", Te(this, this.handleKeyPress))
  9200. }
  9201. ,
  9202. t.handleKeyPress = function(e) {
  9203. Mt.isEventKey(e, "Esc") && this.handleMouseOut()
  9204. }
  9205. ,
  9206. e
  9207. }(He);
  9208. Ds.prototype.options_ = {
  9209. children: ["muteToggle", "volumeControl"]
  9210. },
  9211. He.registerComponent("VolumePanel", Ds);
  9212. var Bs = function(l) {
  9213. function e(e, t) {
  9214. var i, n = t.track, r = e.textTracks();
  9215. t.label = n.label || n.language || "Unknown",
  9216. t.selected = "showing" === n.mode,
  9217. (i = l.call(this, e, t) || this).track = n,
  9218. i.kinds = (t.kinds || [t.kind || i.track.kind]).filter(Boolean);
  9219. function s() {
  9220. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  9221. t[n] = arguments[n];
  9222. i.handleTracksChange.apply(Ve(i), t)
  9223. }
  9224. function a() {
  9225. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  9226. t[n] = arguments[n];
  9227. i.handleSelectedLanguageChange.apply(Ve(i), t)
  9228. }
  9229. var o;
  9230. e.on(["loadstart", "texttrackchange"], s),
  9231. r.addEventListener("change", s),
  9232. r.addEventListener("selectedlanguagechange", a),
  9233. i.on("dispose", function() {
  9234. e.off(["loadstart", "texttrackchange"], s),
  9235. r.removeEventListener("change", s),
  9236. r.removeEventListener("selectedlanguagechange", a)
  9237. }),
  9238. void 0 === r.onchange && i.on(["tap", "click"], function() {
  9239. if ("object" != typeof p.Event)
  9240. try {
  9241. o = new p.Event("change")
  9242. } catch (e) {}
  9243. o || (o = f.createEvent("Event")).initEvent("change", !0, !0),
  9244. r.dispatchEvent(o)
  9245. });
  9246. return i.handleTracksChange(),
  9247. i
  9248. }
  9249. We(e, l);
  9250. var t = e.prototype;
  9251. return t.handleClick = function(e) {
  9252. var t = this.track
  9253. , n = this.player_.textTracks();
  9254. if (l.prototype.handleClick.call(this, e),
  9255. n)
  9256. for (var i = 0; i < n.length; i++) {
  9257. var r = n[i];
  9258. -1 !== this.kinds.indexOf(r.kind) && (r === t ? "showing" !== r.mode && (r.mode = "showing") : "disabled" !== r.mode && (r.mode = "disabled"))
  9259. }
  9260. }
  9261. ,
  9262. t.handleTracksChange = function(e) {
  9263. var t = "showing" === this.track.mode;
  9264. t !== this.isSelected_ && this.selected(t)
  9265. }
  9266. ,
  9267. t.handleSelectedLanguageChange = function(e) {
  9268. if ("showing" === this.track.mode) {
  9269. var t = this.player_.cache_.selectedLanguage;
  9270. if (t && t.enabled && t.language === this.track.language && t.kind !== this.track.kind)
  9271. return;
  9272. this.player_.cache_.selectedLanguage = {
  9273. enabled: !0,
  9274. language: this.track.language,
  9275. kind: this.track.kind
  9276. }
  9277. }
  9278. }
  9279. ,
  9280. t.dispose = function() {
  9281. this.track = null,
  9282. l.prototype.dispose.call(this)
  9283. }
  9284. ,
  9285. e
  9286. }(Qr);
  9287. He.registerComponent("TextTrackMenuItem", Bs);
  9288. var Rs = function(n) {
  9289. function e(e, t) {
  9290. return t.track = {
  9291. player: e,
  9292. kind: t.kind,
  9293. kinds: t.kinds,
  9294. default: !1,
  9295. mode: "disabled"
  9296. },
  9297. t.kinds || (t.kinds = [t.kind]),
  9298. t.label ? t.track.label = t.label : t.track.label = t.kinds.join(" and ") + " off",
  9299. t.selectable = !0,
  9300. t.multiSelectable = !1,
  9301. n.call(this, e, t) || this
  9302. }
  9303. We(e, n);
  9304. var t = e.prototype;
  9305. return t.handleTracksChange = function(e) {
  9306. for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
  9307. var s = t[i];
  9308. if (-1 < this.options_.kinds.indexOf(s.kind) && "showing" === s.mode) {
  9309. n = !1;
  9310. break
  9311. }
  9312. }
  9313. n !== this.isSelected_ && this.selected(n)
  9314. }
  9315. ,
  9316. t.handleSelectedLanguageChange = function(e) {
  9317. for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
  9318. var s = t[i];
  9319. if (-1 < ["captions", "descriptions", "subtitles"].indexOf(s.kind) && "showing" === s.mode) {
  9320. n = !1;
  9321. break
  9322. }
  9323. }
  9324. n && (this.player_.cache_.selectedLanguage = {
  9325. enabled: !1
  9326. })
  9327. }
  9328. ,
  9329. e
  9330. }(Bs);
  9331. He.registerComponent("OffTextTrackMenuItem", Rs);
  9332. var Fs = function(n) {
  9333. function e(e, t) {
  9334. return void 0 === t && (t = {}),
  9335. t.tracks = e.textTracks(),
  9336. n.call(this, e, t) || this
  9337. }
  9338. return We(e, n),
  9339. e.prototype.createItems = function(e, t) {
  9340. var n;
  9341. void 0 === e && (e = []),
  9342. void 0 === t && (t = Bs),
  9343. this.label_ && (n = this.label_ + " off"),
  9344. e.push(new Rs(this.player_,{
  9345. kinds: this.kinds_,
  9346. kind: this.kind_,
  9347. label: n
  9348. })),
  9349. this.hideThreshold_ += 1;
  9350. var i = this.player_.textTracks();
  9351. Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]);
  9352. for (var r = 0; r < i.length; r++) {
  9353. var s = i[r];
  9354. if (-1 < this.kinds_.indexOf(s.kind)) {
  9355. var a = new t(this.player_,{
  9356. track: s,
  9357. kinds: this.kinds_,
  9358. kind: this.kind_,
  9359. selectable: !0,
  9360. multiSelectable: !1
  9361. });
  9362. a.addClass("vjs-" + s.kind + "-menu-item"),
  9363. e.push(a)
  9364. }
  9365. }
  9366. return e
  9367. }
  9368. ,
  9369. e
  9370. }(ss);
  9371. He.registerComponent("TextTrackButton", Fs);
  9372. var Hs = function(a) {
  9373. function e(e, t) {
  9374. var n, i = t.track, r = t.cue, s = e.currentTime();
  9375. return t.selectable = !0,
  9376. t.multiSelectable = !1,
  9377. t.label = r.text,
  9378. t.selected = r.startTime <= s && s < r.endTime,
  9379. (n = a.call(this, e, t) || this).track = i,
  9380. n.cue = r,
  9381. i.addEventListener("cuechange", Te(Ve(n), n.update)),
  9382. n
  9383. }
  9384. We(e, a);
  9385. var t = e.prototype;
  9386. return t.handleClick = function(e) {
  9387. a.prototype.handleClick.call(this),
  9388. this.player_.currentTime(this.cue.startTime),
  9389. this.update(this.cue.startTime)
  9390. }
  9391. ,
  9392. t.update = function(e) {
  9393. var t = this.cue
  9394. , n = this.player_.currentTime();
  9395. this.selected(t.startTime <= n && n < t.endTime)
  9396. }
  9397. ,
  9398. e
  9399. }(Qr);
  9400. He.registerComponent("ChaptersTrackMenuItem", Hs);
  9401. var Vs = function(i) {
  9402. function e(e, t, n) {
  9403. return i.call(this, e, t, n) || this
  9404. }
  9405. We(e, i);
  9406. var t = e.prototype;
  9407. return t.buildCSSClass = function() {
  9408. return "vjs-chapters-button " + i.prototype.buildCSSClass.call(this)
  9409. }
  9410. ,
  9411. t.buildWrapperCSSClass = function() {
  9412. return "vjs-chapters-button " + i.prototype.buildWrapperCSSClass.call(this)
  9413. }
  9414. ,
  9415. t.update = function(e) {
  9416. this.track_ && (!e || "addtrack" !== e.type && "removetrack" !== e.type) || this.setTrack(this.findChaptersTrack()),
  9417. i.prototype.update.call(this)
  9418. }
  9419. ,
  9420. t.setTrack = function(e) {
  9421. if (this.track_ !== e) {
  9422. if (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)),
  9423. this.track_) {
  9424. var t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  9425. t && t.removeEventListener("load", this.updateHandler_),
  9426. this.track_ = null
  9427. }
  9428. if (this.track_ = e,
  9429. this.track_) {
  9430. this.track_.mode = "hidden";
  9431. var n = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
  9432. n && n.addEventListener("load", this.updateHandler_)
  9433. }
  9434. }
  9435. }
  9436. ,
  9437. t.findChaptersTrack = function() {
  9438. for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) {
  9439. var n = e[t];
  9440. if (n.kind === this.kind_)
  9441. return n
  9442. }
  9443. }
  9444. ,
  9445. t.getMenuCaption = function() {
  9446. return this.track_ && this.track_.label ? this.track_.label : this.localize(Re(this.kind_))
  9447. }
  9448. ,
  9449. t.createMenu = function() {
  9450. return this.options_.title = this.getMenuCaption(),
  9451. i.prototype.createMenu.call(this)
  9452. }
  9453. ,
  9454. t.createItems = function() {
  9455. var e = [];
  9456. if (!this.track_)
  9457. return e;
  9458. var t = this.track_.cues;
  9459. if (!t)
  9460. return e;
  9461. for (var n = 0, i = t.length; n < i; n++) {
  9462. var r = t[n]
  9463. , s = new Hs(this.player_,{
  9464. track: this.track_,
  9465. cue: r
  9466. });
  9467. e.push(s)
  9468. }
  9469. return e
  9470. }
  9471. ,
  9472. e
  9473. }(Fs);
  9474. Vs.prototype.kind_ = "chapters",
  9475. Vs.prototype.controlText_ = "Chapters",
  9476. He.registerComponent("ChaptersButton", Vs);
  9477. var Qs = function(a) {
  9478. function e(e, t, n) {
  9479. var i;
  9480. i = a.call(this, e, t, n) || this;
  9481. var r = e.textTracks()
  9482. , s = Te(Ve(i), i.handleTracksChange);
  9483. return r.addEventListener("change", s),
  9484. i.on("dispose", function() {
  9485. r.removeEventListener("change", s)
  9486. }),
  9487. i
  9488. }
  9489. We(e, a);
  9490. var t = e.prototype;
  9491. return t.handleTracksChange = function(e) {
  9492. for (var t = this.player().textTracks(), n = !1, i = 0, r = t.length; i < r; i++) {
  9493. var s = t[i];
  9494. if (s.kind !== this.kind_ && "showing" === s.mode) {
  9495. n = !0;
  9496. break
  9497. }
  9498. }
  9499. n ? this.disable() : this.enable()
  9500. }
  9501. ,
  9502. t.buildCSSClass = function() {
  9503. return "vjs-descriptions-button " + a.prototype.buildCSSClass.call(this)
  9504. }
  9505. ,
  9506. t.buildWrapperCSSClass = function() {
  9507. return "vjs-descriptions-button " + a.prototype.buildWrapperCSSClass.call(this)
  9508. }
  9509. ,
  9510. e
  9511. }(Fs);
  9512. Qs.prototype.kind_ = "descriptions",
  9513. Qs.prototype.controlText_ = "Descriptions",
  9514. He.registerComponent("DescriptionsButton", Qs);
  9515. var Us = function(i) {
  9516. function e(e, t, n) {
  9517. return i.call(this, e, t, n) || this
  9518. }
  9519. We(e, i);
  9520. var t = e.prototype;
  9521. return t.buildCSSClass = function() {
  9522. return "vjs-subtitles-button " + i.prototype.buildCSSClass.call(this)
  9523. }
  9524. ,
  9525. t.buildWrapperCSSClass = function() {
  9526. return "vjs-subtitles-button " + i.prototype.buildWrapperCSSClass.call(this)
  9527. }
  9528. ,
  9529. e
  9530. }(Fs);
  9531. Us.prototype.kind_ = "subtitles",
  9532. Us.prototype.controlText_ = "Subtitles",
  9533. He.registerComponent("SubtitlesButton", Us);
  9534. var qs = function(i) {
  9535. function e(e, t) {
  9536. var n;
  9537. return t.track = {
  9538. player: e,
  9539. kind: t.kind,
  9540. label: t.kind + " settings",
  9541. selectable: !1,
  9542. default: !1,
  9543. mode: "disabled"
  9544. },
  9545. t.selectable = !1,
  9546. t.name = "CaptionSettingsMenuItem",
  9547. (n = i.call(this, e, t) || this).addClass("vjs-texttrack-settings"),
  9548. n.controlText(", opens " + t.kind + " settings dialog"),
  9549. n
  9550. }
  9551. return We(e, i),
  9552. e.prototype.handleClick = function(e) {
  9553. this.player().getChild("textTrackSettings").open()
  9554. }
  9555. ,
  9556. e
  9557. }(Bs);
  9558. He.registerComponent("CaptionSettingsMenuItem", qs);
  9559. var zs = function(i) {
  9560. function e(e, t, n) {
  9561. return i.call(this, e, t, n) || this
  9562. }
  9563. We(e, i);
  9564. var t = e.prototype;
  9565. return t.buildCSSClass = function() {
  9566. return "vjs-captions-button " + i.prototype.buildCSSClass.call(this)
  9567. }
  9568. ,
  9569. t.buildWrapperCSSClass = function() {
  9570. return "vjs-captions-button " + i.prototype.buildWrapperCSSClass.call(this)
  9571. }
  9572. ,
  9573. t.createItems = function() {
  9574. var e = [];
  9575. return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
  9576. kind: this.kind_
  9577. })),
  9578. this.hideThreshold_ += 1),
  9579. i.prototype.createItems.call(this, e)
  9580. }
  9581. ,
  9582. e
  9583. }(Fs);
  9584. zs.prototype.kind_ = "captions",
  9585. zs.prototype.controlText_ = "Captions",
  9586. He.registerComponent("CaptionsButton", zs);
  9587. var Ws = function(r) {
  9588. function e() {
  9589. return r.apply(this, arguments) || this
  9590. }
  9591. return We(e, r),
  9592. e.prototype.createEl = function(e, t, n) {
  9593. var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label);
  9594. return "captions" === this.options_.track.kind && (i += '\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> ' + this.localize("Captions") + "</span>\n "),
  9595. i += "</span>",
  9596. r.prototype.createEl.call(this, e, b({
  9597. innerHTML: i
  9598. }, t), n)
  9599. }
  9600. ,
  9601. e
  9602. }(Bs);
  9603. He.registerComponent("SubsCapsMenuItem", Ws);
  9604. var Ks = function(i) {
  9605. function e(e, t) {
  9606. var n;
  9607. return void 0 === t && (t = {}),
  9608. (n = i.call(this, e, t) || this).label_ = "subtitles",
  9609. -1 < ["en", "en-us", "en-ca", "fr-ca"].indexOf(n.player_.language_) && (n.label_ = "captions"),
  9610. n.menuButton_.controlText(Re(n.label_)),
  9611. n
  9612. }
  9613. We(e, i);
  9614. var t = e.prototype;
  9615. return t.buildCSSClass = function() {
  9616. return "vjs-subs-caps-button " + i.prototype.buildCSSClass.call(this)
  9617. }
  9618. ,
  9619. t.buildWrapperCSSClass = function() {
  9620. return "vjs-subs-caps-button " + i.prototype.buildWrapperCSSClass.call(this)
  9621. }
  9622. ,
  9623. t.createItems = function() {
  9624. var e = [];
  9625. return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
  9626. kind: this.label_
  9627. })),
  9628. this.hideThreshold_ += 1),
  9629. e = i.prototype.createItems.call(this, e, Ws)
  9630. }
  9631. ,
  9632. e
  9633. }(Fs);
  9634. Ks.prototype.kinds_ = ["captions", "subtitles"],
  9635. Ks.prototype.controlText_ = "Subtitles",
  9636. He.registerComponent("SubsCapsButton", Ks);
  9637. var Xs = function(a) {
  9638. function e(e, t) {
  9639. var i, n = t.track, r = e.audioTracks();
  9640. t.label = n.label || n.language || "Unknown",
  9641. t.selected = n.enabled,
  9642. (i = a.call(this, e, t) || this).track = n,
  9643. i.addClass("vjs-" + n.kind + "-menu-item");
  9644. function s() {
  9645. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  9646. t[n] = arguments[n];
  9647. i.handleTracksChange.apply(Ve(i), t)
  9648. }
  9649. return r.addEventListener("change", s),
  9650. i.on("dispose", function() {
  9651. r.removeEventListener("change", s)
  9652. }),
  9653. i
  9654. }
  9655. We(e, a);
  9656. var t = e.prototype;
  9657. return t.createEl = function(e, t, n) {
  9658. var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label);
  9659. return "main-desc" === this.options_.track.kind && (i += '\n <span aria-hidden="true" class="vjs-icon-placeholder"></span>\n <span class="vjs-control-text"> ' + this.localize("Descriptions") + "</span>\n "),
  9660. i += "</span>",
  9661. a.prototype.createEl.call(this, e, b({
  9662. innerHTML: i
  9663. }, t), n)
  9664. }
  9665. ,
  9666. t.handleClick = function(e) {
  9667. var t = this.player_.audioTracks();
  9668. a.prototype.handleClick.call(this, e);
  9669. for (var n = 0; n < t.length; n++) {
  9670. var i = t[n];
  9671. i.enabled = i === this.track
  9672. }
  9673. }
  9674. ,
  9675. t.handleTracksChange = function(e) {
  9676. this.selected(this.track.enabled)
  9677. }
  9678. ,
  9679. e
  9680. }(Qr);
  9681. He.registerComponent("AudioTrackMenuItem", Xs);
  9682. var Gs = function(n) {
  9683. function e(e, t) {
  9684. return void 0 === t && (t = {}),
  9685. t.tracks = e.audioTracks(),
  9686. n.call(this, e, t) || this
  9687. }
  9688. We(e, n);
  9689. var t = e.prototype;
  9690. return t.buildCSSClass = function() {
  9691. return "vjs-audio-button " + n.prototype.buildCSSClass.call(this)
  9692. }
  9693. ,
  9694. t.buildWrapperCSSClass = function() {
  9695. return "vjs-audio-button " + n.prototype.buildWrapperCSSClass.call(this)
  9696. }
  9697. ,
  9698. t.createItems = function(e) {
  9699. void 0 === e && (e = []),
  9700. this.hideThreshold_ = 1;
  9701. for (var t = this.player_.audioTracks(), n = 0; n < t.length; n++) {
  9702. var i = t[n];
  9703. e.push(new Xs(this.player_,{
  9704. track: i,
  9705. selectable: !0,
  9706. multiSelectable: !1
  9707. }))
  9708. }
  9709. return e
  9710. }
  9711. ,
  9712. e
  9713. }(ss);
  9714. Gs.prototype.controlText_ = "Audio Track",
  9715. He.registerComponent("AudioTrackButton", Gs);
  9716. var Ys = function(s) {
  9717. function e(e, t) {
  9718. var n, i = t.rate, r = parseFloat(i, 10);
  9719. return t.label = i,
  9720. t.selected = 1 === r,
  9721. t.selectable = !0,
  9722. t.multiSelectable = !1,
  9723. (n = s.call(this, e, t) || this).label = i,
  9724. n.rate = r,
  9725. n.on(e, "ratechange", n.update),
  9726. n
  9727. }
  9728. We(e, s);
  9729. var t = e.prototype;
  9730. return t.handleClick = function(e) {
  9731. s.prototype.handleClick.call(this),
  9732. this.player().playbackRate(this.rate)
  9733. }
  9734. ,
  9735. t.update = function(e) {
  9736. this.selected(this.player().playbackRate() === this.rate)
  9737. }
  9738. ,
  9739. e
  9740. }(Qr);
  9741. Ys.prototype.contentElType = "button",
  9742. He.registerComponent("PlaybackRateMenuItem", Ys);
  9743. var $s = function(i) {
  9744. function e(e, t) {
  9745. var n;
  9746. return (n = i.call(this, e, t) || this).updateVisibility(),
  9747. n.updateLabel(),
  9748. n.on(e, "loadstart", n.updateVisibility),
  9749. n.on(e, "ratechange", n.updateLabel),
  9750. n
  9751. }
  9752. We(e, i);
  9753. var t = e.prototype;
  9754. return t.createEl = function() {
  9755. var e = i.prototype.createEl.call(this);
  9756. return "en" === this.player().language() ? this.labelEl_ = w("div", {
  9757. className: "vjs-playback-rate-value",
  9758. innerHTML: "1x"
  9759. }) : (this.player().language(),
  9760. this.labelEl_ = w("div", {
  9761. className: "vjs-playback-rate-value",
  9762. innerHTML: "倍速"
  9763. })),
  9764. e.appendChild(this.labelEl_),
  9765. e
  9766. }
  9767. ,
  9768. t.dispose = function() {
  9769. this.labelEl_ = null,
  9770. i.prototype.dispose.call(this)
  9771. }
  9772. ,
  9773. t.buildCSSClass = function() {
  9774. return "vjs-playback-rate " + i.prototype.buildCSSClass.call(this)
  9775. }
  9776. ,
  9777. t.buildWrapperCSSClass = function() {
  9778. return "vjs-playback-rate " + i.prototype.buildWrapperCSSClass.call(this)
  9779. }
  9780. ,
  9781. t.createMenu = function() {
  9782. var e = new Fr(this.player())
  9783. , t = this.playbackRates();
  9784. if (t)
  9785. for (var n = t.length - 1; 0 <= n; n--)
  9786. e.addChild(new Ys(this.player(),{
  9787. rate: t[n] + "x"
  9788. }));
  9789. return e
  9790. }
  9791. ,
  9792. t.updateARIAAttributes = function() {
  9793. this.el().setAttribute("aria-valuenow", this.player().playbackRate())
  9794. }
  9795. ,
  9796. t.handleClick = function(e) {}
  9797. ,
  9798. t.playbackRates = function() {
  9799. return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates
  9800. }
  9801. ,
  9802. t.playbackRateSupported = function() {
  9803. return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length
  9804. }
  9805. ,
  9806. t.updateVisibility = function(e) {
  9807. this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
  9808. }
  9809. ,
  9810. t.updateLabel = function(e) {
  9811. this.playbackRateSupported() && ("en" === this.player().language() ? this.labelEl_.innerHTML = this.player().playbackRate() + "x" : this.labelEl_.innerHTML = "倍速")
  9812. }
  9813. ,
  9814. e
  9815. }(Hr);
  9816. $s.prototype.controlText_ = "Playback Rate",
  9817. He.registerComponent("PlaybackRateMenuButton", $s);
  9818. var Js = function(e) {
  9819. function t() {
  9820. return e.apply(this, arguments) || this
  9821. }
  9822. We(t, e);
  9823. var n = t.prototype;
  9824. return n.buildCSSClass = function() {
  9825. return "vjs-spacer " + e.prototype.buildCSSClass.call(this)
  9826. }
  9827. ,
  9828. n.createEl = function() {
  9829. return e.prototype.createEl.call(this, "div", {
  9830. className: this.buildCSSClass()
  9831. })
  9832. }
  9833. ,
  9834. t
  9835. }(He);
  9836. He.registerComponent("Spacer", Js);
  9837. var Zs = function(t) {
  9838. function e() {
  9839. return t.apply(this, arguments) || this
  9840. }
  9841. We(e, t);
  9842. var n = e.prototype;
  9843. return n.buildCSSClass = function() {
  9844. return "vjs-custom-control-spacer " + t.prototype.buildCSSClass.call(this)
  9845. }
  9846. ,
  9847. n.createEl = function() {
  9848. var e = t.prototype.createEl.call(this, {
  9849. className: this.buildCSSClass()
  9850. });
  9851. return e.innerHTML = " ",
  9852. e
  9853. }
  9854. ,
  9855. e
  9856. }(Js);
  9857. He.registerComponent("CustomControlSpacer", Zs);
  9858. var ea = function(e) {
  9859. function t() {
  9860. return e.apply(this, arguments) || this
  9861. }
  9862. return We(t, e),
  9863. t.prototype.createEl = function() {
  9864. return e.prototype.createEl.call(this, "div", {
  9865. className: "vjs-control-bar",
  9866. dir: "ltr"
  9867. })
  9868. }
  9869. ,
  9870. t
  9871. }(He);
  9872. ea.prototype.options_ = {
  9873. children: ["playToggle", "nextPanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "chooseVideoButton", "audioModeButton", "playbackRateMenuButton", "playbackQualityMenuButton", "playbackQualityMenuButton3", "descriptionsButton", "subsCapsButton", "audioTrackButton", "setupMenuButton", "volumePanel", "webfullscreenToggle", "fullscreenToggle", "progressControl"]
  9874. },
  9875. He.registerComponent("ControlBar", ea);
  9876. var ta = function(r) {
  9877. function e(e, t) {
  9878. var n;
  9879. (n = r.call(this, e, t) || this).on(e, "error", n.open);
  9880. var i = e;
  9881. return n.el().oncontextmenu = function(e) {
  9882. return !0 === e.ctrlKey && e.altKey ? i.showContextMenu(e, !0) : !0 === e.ctrlKey && i.showContextMenu(e, !1),
  9883. !1
  9884. }
  9885. ,
  9886. n
  9887. }
  9888. We(e, r);
  9889. var t = e.prototype;
  9890. return t.buildCSSClass = function() {
  9891. return "vjs-error-display " + r.prototype.buildCSSClass.call(this)
  9892. }
  9893. ,
  9894. t.content = function() {
  9895. var e = this.player().error();
  9896. return e ? "" + this.localize(e.message) : "无法继续播放"
  9897. }
  9898. ,
  9899. t.fill = function() {
  9900. r.prototype.fill.call(this)
  9901. }
  9902. ,
  9903. t.description = function() {
  9904. return ""
  9905. }
  9906. ,
  9907. e
  9908. }(Ot);
  9909. ta.prototype.options_ = r({}, Ot.prototype.options_, {
  9910. pauseOnOpen: !0,
  9911. fillAlways: !0,
  9912. temporary: !1,
  9913. uncloseable: !0
  9914. }),
  9915. He.registerComponent("ErrorDisplay", ta);
  9916. var na = "vjs-text-track-settings"
  9917. , ia = ["#000", "Black"]
  9918. , ra = ["#00F", "Blue"]
  9919. , sa = ["#0FF", "Cyan"]
  9920. , aa = ["#0F0", "Green"]
  9921. , oa = ["#F0F", "Magenta"]
  9922. , la = ["#F00", "Red"]
  9923. , ua = ["#FFF", "White"]
  9924. , ca = ["#FF0", "Yellow"]
  9925. , ha = ["1", "Opaque"]
  9926. , da = ["0.5", "Semi-Transparent"]
  9927. , pa = ["0", "Transparent"]
  9928. , fa = {
  9929. backgroundColor: {
  9930. selector: ".vjs-bg-color > select",
  9931. id: "captions-background-color-%s",
  9932. label: "Color",
  9933. options: [ia, ua, la, aa, ra, ca, oa, sa]
  9934. },
  9935. backgroundOpacity: {
  9936. selector: ".vjs-bg-opacity > select",
  9937. id: "captions-background-opacity-%s",
  9938. label: "Transparency",
  9939. options: [ha, da, pa]
  9940. },
  9941. color: {
  9942. selector: ".vjs-fg-color > select",
  9943. id: "captions-foreground-color-%s",
  9944. label: "Color",
  9945. options: [ua, ia, la, aa, ra, ca, oa, sa]
  9946. },
  9947. edgeStyle: {
  9948. selector: ".vjs-edge-style > select",
  9949. id: "%s",
  9950. label: "Text Edge Style",
  9951. options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
  9952. },
  9953. fontFamily: {
  9954. selector: ".vjs-font-family > select",
  9955. id: "captions-font-family-%s",
  9956. label: "Font Family",
  9957. options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
  9958. },
  9959. fontPercent: {
  9960. selector: ".vjs-font-percent > select",
  9961. id: "captions-font-size-%s",
  9962. label: "Font Size",
  9963. options: [["0.50", "50%"], ["0.75", "75%"], ["1.00", "100%"], ["1.25", "125%"], ["1.50", "150%"], ["1.75", "175%"], ["2.00", "200%"], ["3.00", "300%"], ["4.00", "400%"]],
  9964. default: 2,
  9965. parser: function(e) {
  9966. return "1.00" === e ? null : Number(e)
  9967. }
  9968. },
  9969. textOpacity: {
  9970. selector: ".vjs-text-opacity > select",
  9971. id: "captions-foreground-opacity-%s",
  9972. label: "Transparency",
  9973. options: [ha, da]
  9974. },
  9975. windowColor: {
  9976. selector: ".vjs-window-color > select",
  9977. id: "captions-window-color-%s",
  9978. label: "Color"
  9979. },
  9980. windowOpacity: {
  9981. selector: ".vjs-window-opacity > select",
  9982. id: "captions-window-opacity-%s",
  9983. label: "Transparency",
  9984. options: [pa, da, ha]
  9985. }
  9986. };
  9987. function va(e, t) {
  9988. if (t && (e = t(e)),
  9989. e && "none" !== e)
  9990. return e
  9991. }
  9992. fa.windowColor.options = fa.backgroundColor.options;
  9993. var ga = function(i) {
  9994. function e(e, t) {
  9995. var n;
  9996. return t.temporary = !1,
  9997. (n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
  9998. n.fill(),
  9999. n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
  10000. n.endDialog = w("p", {
  10001. className: "vjs-control-text",
  10002. textContent: n.localize("End of dialog window.")
  10003. }),
  10004. n.el().appendChild(n.endDialog),
  10005. n.setDefaults(),
  10006. void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
  10007. n.on(n.$(".vjs-done-button"), "click", function() {
  10008. n.saveSettings(),
  10009. n.close()
  10010. }),
  10011. n.on(n.$(".vjs-default-button"), "click", function() {
  10012. n.setDefaults(),
  10013. n.updateDisplay()
  10014. }),
  10015. a(fa, function(e) {
  10016. n.on(n.$(e.selector), "change", n.updateDisplay)
  10017. }),
  10018. n.options_.persistTextTrackSettings && n.restoreSettings(),
  10019. n
  10020. }
  10021. We(e, i);
  10022. var t = e.prototype;
  10023. return t.dispose = function() {
  10024. this.endDialog = null,
  10025. i.prototype.dispose.call(this)
  10026. }
  10027. ,
  10028. t.createElSelect_ = function(e, t, n) {
  10029. var i = this;
  10030. void 0 === t && (t = ""),
  10031. void 0 === n && (n = "label");
  10032. var r = fa[e]
  10033. , s = r.id.replace("%s", this.id_)
  10034. , a = [t, s].join(" ").trim();
  10035. return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "</" + n + ">", '<select aria-labelledby="' + a + '">'].concat(r.options.map(function(e) {
  10036. var t = s + "-" + e[1].replace(/\W+/g, "");
  10037. return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + " " + t + '">', i.localize(e[1]), "</option>"].join("")
  10038. })).concat("</select>").join("")
  10039. }
  10040. ,
  10041. t.createElFgColor_ = function() {
  10042. var e = "captions-text-legend-" + this.id_;
  10043. return ['<fieldset class="vjs-fg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Text"), "</legend>", this.createElSelect_("color", e), '<span class="vjs-text-opacity vjs-opacity">', this.createElSelect_("textOpacity", e), "</span>", "</fieldset>"].join("")
  10044. }
  10045. ,
  10046. t.createElBgColor_ = function() {
  10047. var e = "captions-background-" + this.id_;
  10048. return ['<fieldset class="vjs-bg-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Background"), "</legend>", this.createElSelect_("backgroundColor", e), '<span class="vjs-bg-opacity vjs-opacity">', this.createElSelect_("backgroundOpacity", e), "</span>", "</fieldset>"].join("")
  10049. }
  10050. ,
  10051. t.createElWinColor_ = function() {
  10052. var e = "captions-window-" + this.id_;
  10053. return ['<fieldset class="vjs-window-color vjs-track-setting">', '<legend id="' + e + '">', this.localize("Window"), "</legend>", this.createElSelect_("windowColor", e), '<span class="vjs-window-opacity vjs-opacity">', this.createElSelect_("windowOpacity", e), "</span>", "</fieldset>"].join("")
  10054. }
  10055. ,
  10056. t.createElColors_ = function() {
  10057. return w("div", {
  10058. className: "vjs-track-settings-colors",
  10059. innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
  10060. })
  10061. }
  10062. ,
  10063. t.createElFont_ = function() {
  10064. return w("div", {
  10065. className: "vjs-track-settings-font",
  10066. innerHTML: ['<fieldset class="vjs-font-percent vjs-track-setting">', this.createElSelect_("fontPercent", "", "legend"), "</fieldset>", '<fieldset class="vjs-edge-style vjs-track-setting">', this.createElSelect_("edgeStyle", "", "legend"), "</fieldset>", '<fieldset class="vjs-font-family vjs-track-setting">', this.createElSelect_("fontFamily", "", "legend"), "</fieldset>"].join("")
  10067. })
  10068. }
  10069. ,
  10070. t.createElControls_ = function() {
  10071. var e = this.localize("restore all settings to the default values");
  10072. return w("div", {
  10073. className: "vjs-track-settings-controls",
  10074. innerHTML: ['<button type="button" class="vjs-default-button" title="' + e + '">', this.localize("Reset"), '<span class="vjs-control-text"> ' + e + "</span>", "</button>", '<button type="button" class="vjs-done-button">' + this.localize("Done") + "</button>"].join("")
  10075. })
  10076. }
  10077. ,
  10078. t.content = function() {
  10079. return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
  10080. }
  10081. ,
  10082. t.label = function() {
  10083. return this.localize("Caption Settings Dialog")
  10084. }
  10085. ,
  10086. t.description = function() {
  10087. return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
  10088. }
  10089. ,
  10090. t.buildCSSClass = function() {
  10091. return i.prototype.buildCSSClass.call(this) + " vjs-text-track-settings"
  10092. }
  10093. ,
  10094. t.getValues = function() {
  10095. var r = this;
  10096. return o(fa, function(e, t, n) {
  10097. var i = function(e, t) {
  10098. return va(e.options[e.options.selectedIndex].value, t)
  10099. }(r.$(t.selector), t.parser);
  10100. return void 0 !== i && (e[n] = i),
  10101. e
  10102. }, {})
  10103. }
  10104. ,
  10105. t.setValues = function(n) {
  10106. var i = this;
  10107. a(fa, function(e, t) {
  10108. !function(e, t, n) {
  10109. if (t)
  10110. for (var i = 0; i < e.options.length; i++)
  10111. if (va(e.options[i].value, n) === t) {
  10112. e.selectedIndex = i;
  10113. break
  10114. }
  10115. }(i.$(e.selector), n[t], e.parser)
  10116. })
  10117. }
  10118. ,
  10119. t.setDefaults = function() {
  10120. var n = this;
  10121. a(fa, function(e) {
  10122. var t = e.hasOwnProperty("default") ? e.default : 0;
  10123. n.$(e.selector).selectedIndex = t
  10124. })
  10125. }
  10126. ,
  10127. t.restoreSettings = function() {
  10128. var e;
  10129. try {
  10130. e = JSON.parse(p.localStorage.getItem(na))
  10131. } catch (e) {
  10132. m.warn(e)
  10133. }
  10134. e && this.setValues(e)
  10135. }
  10136. ,
  10137. t.saveSettings = function() {
  10138. if (this.options_.persistTextTrackSettings) {
  10139. var e = this.getValues();
  10140. try {
  10141. Object.keys(e).length ? p.localStorage.setItem(na, JSON.stringify(e)) : p.localStorage.removeItem(na)
  10142. } catch (e) {
  10143. m.warn(e)
  10144. }
  10145. }
  10146. }
  10147. ,
  10148. t.updateDisplay = function() {
  10149. var e = this.player_.getChild("textTrackDisplay");
  10150. e && e.updateDisplay()
  10151. }
  10152. ,
  10153. t.conditionalBlur_ = function() {
  10154. this.previouslyActiveEl_ = null;
  10155. var e = this.player_.controlBar
  10156. , t = e && e.subsCapsButton
  10157. , n = e && e.captionsButton;
  10158. t ? t.focus() : n && n.focus()
  10159. }
  10160. ,
  10161. e
  10162. }(Ot);
  10163. He.registerComponent("TextTrackSettings", ga);
  10164. var ya = function(s) {
  10165. function e(e, t) {
  10166. var n, i = t.ResizeObserver || p.ResizeObserver;
  10167. null === t.ResizeObserver && (i = !1);
  10168. var r = Fe({
  10169. createEl: !i,
  10170. reportTouchActivity: !1
  10171. }, t);
  10172. return (n = s.call(this, e, r) || this).ResizeObserver = t.ResizeObserver || p.ResizeObserver,
  10173. n.loadListener_ = null,
  10174. n.resizeObserver_ = null,
  10175. n.debouncedHandler_ = function(i, r, s, a) {
  10176. var o;
  10177. void 0 === a && (a = p);
  10178. function e() {
  10179. var e = this
  10180. , t = arguments
  10181. , n = function() {
  10182. n = o = null,
  10183. s || i.apply(e, t)
  10184. };
  10185. !o && s && i.apply(e, t),
  10186. a.clearTimeout(o),
  10187. o = a.setTimeout(n, r)
  10188. }
  10189. return e.cancel = function() {
  10190. a.clearTimeout(o),
  10191. o = null
  10192. }
  10193. ,
  10194. e
  10195. }(function() {
  10196. n.resizeHandler()
  10197. }, 100, !1, Ve(n)),
  10198. i ? (n.resizeObserver_ = new n.ResizeObserver(n.debouncedHandler_),
  10199. n.resizeObserver_.observe(e.el())) : (n.loadListener_ = function() {
  10200. if (n.el_ && n.el_.contentWindow) {
  10201. var e = n.debouncedHandler_
  10202. , t = n.unloadListener_ = function() {
  10203. ye(this, "resize", e),
  10204. ye(this, "unload", t),
  10205. t = null
  10206. }
  10207. ;
  10208. ge(n.el_.contentWindow, "unload", t),
  10209. ge(n.el_.contentWindow, "resize", e)
  10210. }
  10211. }
  10212. ,
  10213. n.one("load", n.loadListener_)),
  10214. n
  10215. }
  10216. We(e, s);
  10217. var t = e.prototype;
  10218. return t.createEl = function() {
  10219. return s.prototype.createEl.call(this, "iframe", {
  10220. className: "vjs-resize-manager",
  10221. tabIndex: -1
  10222. }, {
  10223. "aria-hidden": "true"
  10224. })
  10225. }
  10226. ,
  10227. t.resizeHandler = function() {
  10228. this.player_ && this.player_.trigger && this.player_.trigger("playerresize")
  10229. }
  10230. ,
  10231. t.dispose = function() {
  10232. this.debouncedHandler_ && this.debouncedHandler_.cancel(),
  10233. this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()),
  10234. this.resizeObserver_.disconnect()),
  10235. this.loadListener_ && this.off("load", this.loadListener_),
  10236. this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow),
  10237. this.ResizeObserver = null,
  10238. this.resizeObserver = null,
  10239. this.debouncedHandler_ = null,
  10240. this.loadListener_ = null,
  10241. s.prototype.dispose.call(this)
  10242. }
  10243. ,
  10244. e
  10245. }(He);
  10246. He.registerComponent("ResizeManager", ya);
  10247. var ma = {
  10248. trackingThreshold: 30,
  10249. liveTolerance: 15
  10250. }
  10251. , _a = function(r) {
  10252. function e(e, t) {
  10253. var n, i = Fe(ma, t, {
  10254. createEl: !1
  10255. });
  10256. return (n = r.call(this, e, i) || this).reset_(),
  10257. n.on(n.player_, "durationchange", n.handleDurationchange),
  10258. st && "hidden"in f && "visibilityState"in f && n.on(f, "visibilitychange", n.handleVisibilityChange),
  10259. n
  10260. }
  10261. We(e, r);
  10262. var t = e.prototype;
  10263. return t.handleVisibilityChange = function() {
  10264. this.player_.duration() === 1 / 0 && (f.hidden ? this.stopTracking() : this.startTracking())
  10265. }
  10266. ,
  10267. t.trackLive_ = function() {
  10268. var e = this.player_.seekable();
  10269. if (e && e.length) {
  10270. var t = Number(p.performance.now().toFixed(4))
  10271. , n = -1 === this.lastTime_ ? 0 : (t - this.lastTime_) / 1e3;
  10272. this.lastTime_ = t,
  10273. this.pastSeekEnd_ = this.pastSeekEnd() + n;
  10274. var i = this.liveCurrentTime()
  10275. , r = this.player_.currentTime()
  10276. , s = this.player_.paused() || this.seekedBehindLive_ || Math.abs(i - r) > this.options_.liveTolerance;
  10277. this.timeupdateSeen_ && i !== 1 / 0 || (s = !1),
  10278. s !== this.behindLiveEdge_ && (this.behindLiveEdge_ = s,
  10279. this.trigger("liveedgechange"))
  10280. }
  10281. }
  10282. ,
  10283. t.handleDurationchange = function() {
  10284. this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold ? (this.player_.options_.liveui && this.player_.addClass("vjs-liveui"),
  10285. this.startTracking()) : (this.player_.removeClass("vjs-liveui"),
  10286. this.stopTracking())
  10287. }
  10288. ,
  10289. t.startTracking = function() {
  10290. this.isTracking() || (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()),
  10291. this.trackingInterval_ = this.setInterval(this.trackLive_, 30),
  10292. this.trackLive_(),
  10293. this.on(this.player_, ["play", "pause"], this.trackLive_),
  10294. this.timeupdateSeen_ ? this.on(this.player_, "seeked", this.handleSeeked) : (this.one(this.player_, "play", this.handlePlay),
  10295. this.one(this.player_, "timeupdate", this.handleFirstTimeupdate)))
  10296. }
  10297. ,
  10298. t.handleFirstTimeupdate = function() {
  10299. this.timeupdateSeen_ = !0,
  10300. this.on(this.player_, "seeked", this.handleSeeked)
  10301. }
  10302. ,
  10303. t.handleSeeked = function() {
  10304. var e = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
  10305. this.seekedBehindLive_ = !this.skipNextSeeked_ && 2 < e,
  10306. this.skipNextSeeked_ = !1,
  10307. this.trackLive_()
  10308. }
  10309. ,
  10310. t.handlePlay = function() {
  10311. this.one(this.player_, "timeupdate", this.seekToLiveEdge)
  10312. }
  10313. ,
  10314. t.reset_ = function() {
  10315. this.lastTime_ = -1,
  10316. this.pastSeekEnd_ = 0,
  10317. this.lastSeekEnd_ = -1,
  10318. this.behindLiveEdge_ = !0,
  10319. this.timeupdateSeen_ = !1,
  10320. this.seekedBehindLive_ = !1,
  10321. this.skipNextSeeked_ = !1,
  10322. this.clearInterval(this.trackingInterval_),
  10323. this.trackingInterval_ = null,
  10324. this.off(this.player_, ["play", "pause"], this.trackLive_),
  10325. this.off(this.player_, "seeked", this.handleSeeked),
  10326. this.off(this.player_, "play", this.handlePlay),
  10327. this.off(this.player_, "timeupdate", this.handleFirstTimeupdate),
  10328. this.off(this.player_, "timeupdate", this.seekToLiveEdge)
  10329. }
  10330. ,
  10331. t.stopTracking = function() {
  10332. this.isTracking() && (this.reset_(),
  10333. this.trigger("liveedgechange"))
  10334. }
  10335. ,
  10336. t.seekableEnd = function() {
  10337. for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
  10338. t.push(e.end(n));
  10339. return t.length ? t.sort()[t.length - 1] : 1 / 0
  10340. }
  10341. ,
  10342. t.seekableStart = function() {
  10343. for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
  10344. t.push(e.start(n));
  10345. return t.length ? t.sort()[0] : 0
  10346. }
  10347. ,
  10348. t.liveWindow = function() {
  10349. var e = this.liveCurrentTime();
  10350. return e === 1 / 0 ? 1 / 0 : e - this.seekableStart()
  10351. }
  10352. ,
  10353. t.isLive = function() {
  10354. return this.isTracking()
  10355. }
  10356. ,
  10357. t.atLiveEdge = function() {
  10358. return !this.behindLiveEdge()
  10359. }
  10360. ,
  10361. t.liveCurrentTime = function() {
  10362. return this.pastSeekEnd() + this.seekableEnd()
  10363. }
  10364. ,
  10365. t.pastSeekEnd = function() {
  10366. var e = this.seekableEnd();
  10367. return -1 !== this.lastSeekEnd_ && e !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0),
  10368. this.lastSeekEnd_ = e,
  10369. this.pastSeekEnd_
  10370. }
  10371. ,
  10372. t.behindLiveEdge = function() {
  10373. return this.behindLiveEdge_
  10374. }
  10375. ,
  10376. t.isTracking = function() {
  10377. return "number" == typeof this.trackingInterval_
  10378. }
  10379. ,
  10380. t.seekToLiveEdge = function() {
  10381. this.seekedBehindLive_ = !1,
  10382. this.atLiveEdge() || (this.skipNextSeeked_ = !0,
  10383. this.player_.currentTime(this.liveCurrentTime()))
  10384. }
  10385. ,
  10386. t.dispose = function() {
  10387. this.off(f, "visibilitychange", this.handleVisibilityChange),
  10388. this.stopTracking(),
  10389. r.prototype.dispose.call(this)
  10390. }
  10391. ,
  10392. e
  10393. }(He);
  10394. He.registerComponent("LiveTracker", _a);
  10395. function ba(e) {
  10396. var t = e.el();
  10397. if (t.hasAttribute("src"))
  10398. return e.triggerSourceset(t.src),
  10399. !0;
  10400. var n = e.$$("source")
  10401. , i = []
  10402. , r = "";
  10403. if (!n.length)
  10404. return !1;
  10405. for (var s = 0; s < n.length; s++) {
  10406. var a = n[s].src;
  10407. a && -1 === i.indexOf(a) && i.push(a)
  10408. }
  10409. return !!i.length && (1 === i.length && (r = i[0]),
  10410. e.triggerSourceset(r),
  10411. !0)
  10412. }
  10413. function Ta(e, t) {
  10414. for (var n = {}, i = 0; i < e.length && !((n = Object.getOwnPropertyDescriptor(e[i], t)) && n.set && n.get); i++)
  10415. ;
  10416. return n.enumerable = !0,
  10417. n.configurable = !0,
  10418. n
  10419. }
  10420. function Ca(s) {
  10421. var a = s.el();
  10422. if (!a.resetSourceWatch_) {
  10423. var t = {}
  10424. , e = function(e) {
  10425. return Ta([e.el(), p.HTMLMediaElement.prototype, p.Element.prototype, wa], "innerHTML")
  10426. }(s)
  10427. , n = function(r) {
  10428. return function() {
  10429. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  10430. t[n] = arguments[n];
  10431. var i = r.apply(a, t);
  10432. return ba(s),
  10433. i
  10434. }
  10435. };
  10436. ["append", "appendChild", "insertAdjacentHTML"].forEach(function(e) {
  10437. a[e] && (t[e] = a[e],
  10438. a[e] = n(t[e]))
  10439. }),
  10440. Object.defineProperty(a, "innerHTML", Fe(e, {
  10441. set: n(e.set)
  10442. })),
  10443. a.resetSourceWatch_ = function() {
  10444. a.resetSourceWatch_ = null,
  10445. Object.keys(t).forEach(function(e) {
  10446. a[e] = t[e]
  10447. }),
  10448. Object.defineProperty(a, "innerHTML", e)
  10449. }
  10450. ,
  10451. s.one("sourceset", a.resetSourceWatch_)
  10452. }
  10453. }
  10454. function ka(i) {
  10455. if (i.featuresSourceset) {
  10456. var r = i.el();
  10457. if (!r.resetSourceset_) {
  10458. var n = function(e) {
  10459. return Ta([e.el(), p.HTMLMediaElement.prototype, xa], "src")
  10460. }(i)
  10461. , s = r.setAttribute
  10462. , t = r.load;
  10463. Object.defineProperty(r, "src", Fe(n, {
  10464. set: function(e) {
  10465. var t = n.set.call(r, e);
  10466. return i.triggerSourceset(r.src),
  10467. t
  10468. }
  10469. })),
  10470. r.setAttribute = function(e, t) {
  10471. var n = s.call(r, e, t);
  10472. return /src/i.test(e) && i.triggerSourceset(r.src),
  10473. n
  10474. }
  10475. ,
  10476. r.load = function() {
  10477. var e = t.call(r);
  10478. return ba(i) || (i.triggerSourceset(""),
  10479. Ca(i)),
  10480. e
  10481. }
  10482. ,
  10483. r.currentSrc ? i.triggerSourceset(r.currentSrc) : ba(i) || Ca(i),
  10484. r.resetSourceset_ = function() {
  10485. r.resetSourceset_ = null,
  10486. r.load = t,
  10487. r.setAttribute = s,
  10488. Object.defineProperty(r, "src", n),
  10489. r.resetSourceWatch_ && r.resetSourceWatch_()
  10490. }
  10491. }
  10492. }
  10493. }
  10494. function Ea(t, n, i, e) {
  10495. function r(e) {
  10496. return Object.defineProperty(t, n, {
  10497. value: e,
  10498. enumerable: !0,
  10499. writable: !0
  10500. })
  10501. }
  10502. void 0 === e && (e = !0);
  10503. var s = {
  10504. configurable: !0,
  10505. enumerable: !0,
  10506. get: function() {
  10507. var e = i();
  10508. return r(e),
  10509. e
  10510. }
  10511. };
  10512. return e && (s.set = r),
  10513. Object.defineProperty(t, n, s)
  10514. }
  10515. var Sa, wa = Object.defineProperty({}, "innerHTML", {
  10516. get: function() {
  10517. return this.cloneNode(!0).innerHTML
  10518. },
  10519. set: function(e) {
  10520. var t = f.createElement(this.nodeName.toLowerCase());
  10521. t.innerHTML = e;
  10522. for (var n = f.createDocumentFragment(); t.childNodes.length; )
  10523. n.appendChild(t.childNodes[0]);
  10524. return this.innerText = "",
  10525. p.Element.prototype.appendChild.call(this, n),
  10526. this.innerHTML
  10527. }
  10528. }), xa = Object.defineProperty({}, "src", {
  10529. get: function() {
  10530. return this.hasAttribute("src") ? an(p.Element.prototype.getAttribute.call(this, "src")) : ""
  10531. },
  10532. set: function(e) {
  10533. return p.Element.prototype.setAttribute.call(this, "src", e),
  10534. e
  10535. }
  10536. }), Aa = function(c) {
  10537. function o(e, t) {
  10538. var n;
  10539. n = c.call(this, e, t) || this;
  10540. var i = e.source
  10541. , r = !1;
  10542. if (i && (n.el_.currentSrc !== i.src || e.tag && 3 === e.tag.initNetworkState_) ? n.setSource(i) : n.handleLateInit_(n.el_),
  10543. e.enableSourceset && n.setupSourcesetHandling_(),
  10544. n.el_.hasChildNodes()) {
  10545. for (var s = n.el_.childNodes, a = s.length, o = []; a--; ) {
  10546. var l = s[a];
  10547. "track" === l.nodeName.toLowerCase() && (n.featuresNativeTextTracks ? (n.remoteTextTrackEls().addTrackElement_(l),
  10548. n.remoteTextTracks().addTrack(l.track),
  10549. n.textTracks().addTrack(l.track),
  10550. r || n.el_.hasAttribute("crossorigin") || !ln(l.src) || (r = !0)) : o.push(l))
  10551. }
  10552. for (var u = 0; u < o.length; u++)
  10553. n.el_.removeChild(o[u])
  10554. }
  10555. return n.proxyNativeTracks_(),
  10556. n.featuresNativeTextTracks && r && m.warn("Text Tracks are being loaded from another origin but the crossorigin attribute isn't used.\nThis may prevent text tracks from loading."),
  10557. n.restoreMetadataTracksInIOSNativePlayer_(),
  10558. (lt || ct || et) && !0 === e.nativeControlsForTouch && n.setControls(!0),
  10559. n.proxyWebkitFullscreen_(),
  10560. n.triggerReady(),
  10561. n
  10562. }
  10563. We(o, c);
  10564. var e = o.prototype;
  10565. return e.dispose = function() {
  10566. this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(),
  10567. o.disposeMediaElement(this.el_),
  10568. this.options_ = null,
  10569. c.prototype.dispose.call(this)
  10570. }
  10571. ,
  10572. e.setupSourcesetHandling_ = function() {
  10573. ka(this)
  10574. }
  10575. ,
  10576. e.restoreMetadataTracksInIOSNativePlayer_ = function() {
  10577. function e() {
  10578. n = [];
  10579. for (var e = 0; e < i.length; e++) {
  10580. var t = i[e];
  10581. "metadata" === t.kind && n.push({
  10582. track: t,
  10583. storedMode: t.mode
  10584. })
  10585. }
  10586. }
  10587. var n, i = this.textTracks();
  10588. e(),
  10589. i.addEventListener("change", e),
  10590. this.on("dispose", function() {
  10591. return i.removeEventListener("change", e)
  10592. });
  10593. function r() {
  10594. for (var e = 0; e < n.length; e++) {
  10595. var t = n[e];
  10596. "disabled" === t.track.mode && t.track.mode !== t.storedMode && (t.track.mode = t.storedMode)
  10597. }
  10598. i.removeEventListener("change", r)
  10599. }
  10600. this.on("webkitbeginfullscreen", function() {
  10601. i.removeEventListener("change", e),
  10602. i.removeEventListener("change", r),
  10603. i.addEventListener("change", r)
  10604. }),
  10605. this.on("webkitendfullscreen", function() {
  10606. i.removeEventListener("change", e),
  10607. i.addEventListener("change", e),
  10608. i.removeEventListener("change", r)
  10609. })
  10610. }
  10611. ,
  10612. e.overrideNative_ = function(e, t) {
  10613. var n = this;
  10614. if (t === this["featuresNative" + e + "Tracks"]) {
  10615. var i = e.toLowerCase();
  10616. this[i + "TracksListeners_"] && Object.keys(this[i + "TracksListeners_"]).forEach(function(e) {
  10617. n.el()[i + "Tracks"].removeEventListener(e, n[i + "TracksListeners_"][e])
  10618. }),
  10619. this["featuresNative" + e + "Tracks"] = !t,
  10620. this[i + "TracksListeners_"] = null,
  10621. this.proxyNativeTracksForType_(i)
  10622. }
  10623. }
  10624. ,
  10625. e.overrideNativeAudioTracks = function(e) {
  10626. this.overrideNative_("Audio", e)
  10627. }
  10628. ,
  10629. e.overrideNativeVideoTracks = function(e) {
  10630. this.overrideNative_("Video", e)
  10631. }
  10632. ,
  10633. e.proxyNativeTracksForType_ = function(n) {
  10634. var i = this
  10635. , e = On[n]
  10636. , r = this.el()[e.getterName]
  10637. , s = this[e.getterName]();
  10638. if (this["featuresNative" + e.capitalName + "Tracks"] && r && r.addEventListener) {
  10639. var a = {
  10640. change: function(e) {
  10641. var t = {
  10642. type: "change",
  10643. target: s,
  10644. currentTarget: s,
  10645. srcElement: s
  10646. };
  10647. s.trigger(t),
  10648. "text" === n && i[Nn.remoteText.getterName]().trigger(t)
  10649. },
  10650. addtrack: function(e) {
  10651. s.addTrack(e.track)
  10652. },
  10653. removetrack: function(e) {
  10654. s.removeTrack(e.track)
  10655. }
  10656. }
  10657. , t = function() {
  10658. for (var e = [], t = 0; t < s.length; t++) {
  10659. for (var n = !1, i = 0; i < r.length; i++)
  10660. if (r[i] === s[t]) {
  10661. n = !0;
  10662. break
  10663. }
  10664. n || e.push(s[t])
  10665. }
  10666. for (; e.length; )
  10667. s.removeTrack(e.shift())
  10668. };
  10669. this[e.getterName + "Listeners_"] = a,
  10670. Object.keys(a).forEach(function(t) {
  10671. var n = a[t];
  10672. r.addEventListener(t, n),
  10673. i.on("dispose", function(e) {
  10674. return r.removeEventListener(t, n)
  10675. })
  10676. }),
  10677. this.on("loadstart", t),
  10678. this.on("dispose", function(e) {
  10679. return i.off("loadstart", t)
  10680. })
  10681. }
  10682. }
  10683. ,
  10684. e.proxyNativeTracks_ = function() {
  10685. var t = this;
  10686. On.names.forEach(function(e) {
  10687. t.proxyNativeTracksForType_(e)
  10688. })
  10689. }
  10690. ,
  10691. e.createEl = function() {
  10692. var e = this.options_.tag;
  10693. if (!e || !this.options_.playerElIngest && !this.movingMediaElementInDOM) {
  10694. if (e) {
  10695. var t = e.cloneNode(!0);
  10696. e.parentNode && e.parentNode.insertBefore(t, e),
  10697. o.disposeMediaElement(e),
  10698. e = t
  10699. } else {
  10700. e = f.createElement("video");
  10701. var n = Fe({}, this.options_.tag && O(this.options_.tag));
  10702. lt && !0 === this.options_.nativeControlsForTouch || delete n.controls,
  10703. j(e, b(n, {
  10704. id: this.options_.techId,
  10705. class: "vjs-tech"
  10706. }))
  10707. }
  10708. e.playerId = this.options_.playerId
  10709. }
  10710. "undefined" != typeof this.options_.preload && D(e, "preload", this.options_.preload);
  10711. for (var i = ["loop", "muted", "playsinline", "autoplay"], r = 0; r < i.length; r++) {
  10712. var s = i[r]
  10713. , a = this.options_[s];
  10714. "undefined" != typeof a && (a ? D(e, s, s) : B(e, s),
  10715. e[s] = a)
  10716. }
  10717. return e
  10718. }
  10719. ,
  10720. e.handleLateInit_ = function(e) {
  10721. if (0 !== e.networkState && 3 !== e.networkState) {
  10722. if (0 === e.readyState) {
  10723. var t = !1
  10724. , n = function() {
  10725. t = !0
  10726. };
  10727. this.on("loadstart", n);
  10728. var i = function() {
  10729. t || this.trigger("loadstart")
  10730. };
  10731. return this.on("loadedmetadata", i),
  10732. void this.ready(function() {
  10733. this.off("loadstart", n),
  10734. this.off("loadedmetadata", i),
  10735. t || this.trigger("loadstart")
  10736. })
  10737. }
  10738. var r = ["loadstart"];
  10739. r.push("loadedmetadata"),
  10740. 2 <= e.readyState && r.push("loadeddata"),
  10741. 3 <= e.readyState && r.push("canplay"),
  10742. 4 <= e.readyState && r.push("canplaythrough"),
  10743. this.ready(function() {
  10744. r.forEach(function(e) {
  10745. this.trigger(e)
  10746. }, this)
  10747. })
  10748. }
  10749. }
  10750. ,
  10751. e.setCurrentTime = function(e) {
  10752. try {
  10753. this.el_.currentTime = e
  10754. } catch (e) {
  10755. m(e, "Video is not ready. (Video.js)")
  10756. }
  10757. }
  10758. ,
  10759. e.duration = function() {
  10760. var t = this;
  10761. if (this.el_.duration === 1 / 0 && Je && it && 0 === this.el_.currentTime) {
  10762. return this.on("timeupdate", function e() {
  10763. 0 < t.el_.currentTime && (t.el_.duration === 1 / 0 && t.trigger("durationchange"),
  10764. t.off("timeupdate", e))
  10765. }),
  10766. NaN
  10767. }
  10768. return this.el_.duration || NaN
  10769. }
  10770. ,
  10771. e.width = function() {
  10772. return this.el_.offsetWidth
  10773. }
  10774. ,
  10775. e.height = function() {
  10776. return this.el_.offsetHeight
  10777. }
  10778. ,
  10779. e.proxyWebkitFullscreen_ = function() {
  10780. var e = this;
  10781. if ("webkitDisplayingFullscreen"in this.el_) {
  10782. var t = function() {
  10783. this.trigger("fullscreenchange", {
  10784. isFullscreen: !1
  10785. })
  10786. }
  10787. , n = function() {
  10788. "webkitPresentationMode"in this.el_ && "picture-in-picture" !== this.el_.webkitPresentationMode && (this.one("webkitendfullscreen", t),
  10789. this.trigger("fullscreenchange", {
  10790. isFullscreen: !0
  10791. }))
  10792. };
  10793. this.on("webkitbeginfullscreen", n),
  10794. this.on("dispose", function() {
  10795. e.off("webkitbeginfullscreen", n),
  10796. e.off("webkitendfullscreen", t)
  10797. })
  10798. }
  10799. }
  10800. ,
  10801. e.supportsFullScreen = function() {
  10802. if ("function" == typeof this.el_.webkitEnterFullScreen) {
  10803. var e = p.navigator && p.navigator.userAgent || "";
  10804. if (/Android/.test(e) || !/Chrome|Mac OS X 10.5/.test(e))
  10805. return !0
  10806. }
  10807. return !1
  10808. }
  10809. ,
  10810. e.enterFullScreen = function() {
  10811. var e = this.el_;
  10812. if (e.paused && e.networkState <= e.HAVE_METADATA)
  10813. At(this.el_.play()),
  10814. this.setTimeout(function() {
  10815. e.pause();
  10816. try {
  10817. e.webkitEnterFullScreen()
  10818. } catch (e) {
  10819. this.trigger("fullscreenerror", e)
  10820. }
  10821. }, 0);
  10822. else
  10823. try {
  10824. e.webkitEnterFullScreen()
  10825. } catch (e) {
  10826. this.trigger("fullscreenerror", e)
  10827. }
  10828. }
  10829. ,
  10830. e.exitFullScreen = function() {
  10831. this.el_.webkitDisplayingFullscreen ? this.el_.webkitExitFullScreen() : this.trigger("fullscreenerror", new Error("The video is not fullscreen"))
  10832. }
  10833. ,
  10834. e.requestPictureInPicture = function() {
  10835. return this.el_.requestPictureInPicture()
  10836. }
  10837. ,
  10838. e.src = function(e) {
  10839. if (void 0 === e)
  10840. return this.el_.src;
  10841. this.setSrc(e)
  10842. }
  10843. ,
  10844. e.reset = function() {
  10845. o.resetMediaElement(this.el_)
  10846. }
  10847. ,
  10848. e.currentSrc = function() {
  10849. return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc
  10850. }
  10851. ,
  10852. e.setControls = function(e) {
  10853. this.el_.controls = !!e
  10854. }
  10855. ,
  10856. e.addTextTrack = function(e, t, n) {
  10857. return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, n) : c.prototype.addTextTrack.call(this, e, t, n)
  10858. }
  10859. ,
  10860. e.createRemoteTextTrack = function(e) {
  10861. if (!this.featuresNativeTextTracks)
  10862. return c.prototype.createRemoteTextTrack.call(this, e);
  10863. var t = f.createElement("track");
  10864. return e.kind && (t.kind = e.kind),
  10865. e.label && (t.label = e.label),
  10866. (e.language || e.srclang) && (t.srclang = e.language || e.srclang),
  10867. e.default && (t.default = e.default),
  10868. e.id && (t.id = e.id),
  10869. e.src && (t.src = e.src),
  10870. t
  10871. }
  10872. ,
  10873. e.addRemoteTextTrack = function(e, t) {
  10874. var n = c.prototype.addRemoteTextTrack.call(this, e, t);
  10875. return this.featuresNativeTextTracks && this.el().appendChild(n),
  10876. n
  10877. }
  10878. ,
  10879. e.removeRemoteTextTrack = function(e) {
  10880. if (c.prototype.removeRemoteTextTrack.call(this, e),
  10881. this.featuresNativeTextTracks)
  10882. for (var t = this.$$("track"), n = t.length; n--; )
  10883. e !== t[n] && e !== t[n].track || this.el().removeChild(t[n])
  10884. }
  10885. ,
  10886. e.getVideoPlaybackQuality = function() {
  10887. if ("function" == typeof this.el().getVideoPlaybackQuality)
  10888. return this.el().getVideoPlaybackQuality();
  10889. var e = {};
  10890. return "undefined" != typeof this.el().webkitDroppedFrameCount && "undefined" != typeof this.el().webkitDecodedFrameCount && (e.droppedVideoFrames = this.el().webkitDroppedFrameCount,
  10891. e.totalVideoFrames = this.el().webkitDecodedFrameCount),
  10892. p.performance && "function" == typeof p.performance.now ? e.creationTime = p.performance.now() : p.performance && p.performance.timing && "number" == typeof p.performance.timing.navigationStart && (e.creationTime = p.Date.now() - p.performance.timing.navigationStart),
  10893. e
  10894. }
  10895. ,
  10896. o
  10897. }(pi);
  10898. Ea(Aa, "TEST_VID", function() {
  10899. if (C()) {
  10900. var e = f.createElement("video")
  10901. , t = f.createElement("track");
  10902. return t.kind = "captions",
  10903. t.srclang = "en",
  10904. t.label = "English",
  10905. e.appendChild(t),
  10906. e
  10907. }
  10908. }),
  10909. Aa.isSupported = function() {
  10910. try {
  10911. Aa.TEST_VID.volume = .5
  10912. } catch (e) {
  10913. return !1
  10914. }
  10915. return !(!Aa.TEST_VID || !Aa.TEST_VID.canPlayType)
  10916. }
  10917. ,
  10918. Aa.canPlayType = function(e) {
  10919. return Aa.TEST_VID.canPlayType(e)
  10920. }
  10921. ,
  10922. Aa.canPlaySource = function(e, t) {
  10923. return Aa.canPlayType(e.type)
  10924. }
  10925. ,
  10926. Aa.canControlVolume = function() {
  10927. try {
  10928. var e = Aa.TEST_VID.volume;
  10929. return Aa.TEST_VID.volume = e / 2 + .1,
  10930. e !== Aa.TEST_VID.volume
  10931. } catch (e) {
  10932. return !1
  10933. }
  10934. }
  10935. ,
  10936. Aa.canMuteVolume = function() {
  10937. try {
  10938. var e = Aa.TEST_VID.muted;
  10939. return Aa.TEST_VID.muted = !e,
  10940. Aa.TEST_VID.muted ? D(Aa.TEST_VID, "muted", "muted") : B(Aa.TEST_VID, "muted"),
  10941. e !== Aa.TEST_VID.muted
  10942. } catch (e) {
  10943. return !1
  10944. }
  10945. }
  10946. ,
  10947. Aa.canControlPlaybackRate = function() {
  10948. if (Je && it && rt < 58)
  10949. return !1;
  10950. try {
  10951. var e = Aa.TEST_VID.playbackRate;
  10952. return Aa.TEST_VID.playbackRate = e / 2 + .1,
  10953. e !== Aa.TEST_VID.playbackRate
  10954. } catch (e) {
  10955. return !1
  10956. }
  10957. }
  10958. ,
  10959. Aa.canOverrideAttributes = function() {
  10960. try {
  10961. var e = function() {};
  10962. Object.defineProperty(f.createElement("video"), "src", {
  10963. get: e,
  10964. set: e
  10965. }),
  10966. Object.defineProperty(f.createElement("audio"), "src", {
  10967. get: e,
  10968. set: e
  10969. }),
  10970. Object.defineProperty(f.createElement("video"), "innerHTML", {
  10971. get: e,
  10972. set: e
  10973. }),
  10974. Object.defineProperty(f.createElement("audio"), "innerHTML", {
  10975. get: e,
  10976. set: e
  10977. })
  10978. } catch (e) {
  10979. return !1
  10980. }
  10981. return !0
  10982. }
  10983. ,
  10984. Aa.supportsNativeTextTracks = function() {
  10985. return dt || ht && it
  10986. }
  10987. ,
  10988. Aa.supportsNativeVideoTracks = function() {
  10989. return !(!Aa.TEST_VID || !Aa.TEST_VID.videoTracks)
  10990. }
  10991. ,
  10992. Aa.supportsNativeAudioTracks = function() {
  10993. return !(!Aa.TEST_VID || !Aa.TEST_VID.audioTracks)
  10994. }
  10995. ,
  10996. Aa.Events = ["loadstart", "suspend", "abort", "error", "emptied", "stalled", "loadedmetadata", "loadeddata", "canplay", "canplaythrough", "playing", "waiting", "seeking", "seeked", "ended", "durationchange", "timeupdate", "progress", "play", "pause", "ratechange", "qualitychange", "resize", "volumechange"],
  10997. [["featuresVolumeControl", "canControlVolume"], ["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(e) {
  10998. var t = e[0]
  10999. , n = e[1];
  11000. Ea(Aa.prototype, t, function() {
  11001. return Aa[n]()
  11002. }, !0)
  11003. }),
  11004. Aa.prototype.movingMediaElementInDOM = !ht,
  11005. Aa.prototype.featuresFullscreenResize = !0,
  11006. Aa.prototype.featuresProgressEvents = !0,
  11007. Aa.prototype.featuresTimeupdateEvents = !0,
  11008. Aa.patchCanPlayType = function() {
  11009. 4 <= Ze && !tt && !it && (Sa = Aa.TEST_VID && Aa.TEST_VID.constructor.prototype.canPlayType,
  11010. Aa.TEST_VID.constructor.prototype.canPlayType = function(e) {
  11011. return e && /^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e) ? "maybe" : Sa.call(this, e)
  11012. }
  11013. )
  11014. }
  11015. ,
  11016. Aa.unpatchCanPlayType = function() {
  11017. var e = Aa.TEST_VID.constructor.prototype.canPlayType;
  11018. return Sa && (Aa.TEST_VID.constructor.prototype.canPlayType = Sa),
  11019. e
  11020. }
  11021. ,
  11022. Aa.patchCanPlayType(),
  11023. Aa.disposeMediaElement = function(e) {
  11024. if (e) {
  11025. for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes(); )
  11026. e.removeChild(e.firstChild);
  11027. e.removeAttribute("src"),
  11028. "function" == typeof e.load && function() {
  11029. try {
  11030. e.load()
  11031. } catch (e) {}
  11032. }()
  11033. }
  11034. }
  11035. ,
  11036. Aa.resetMediaElement = function(e) {
  11037. if (e) {
  11038. for (var t = e.querySelectorAll("source"), n = t.length; n--; )
  11039. e.removeChild(t[n]);
  11040. e.removeAttribute("src"),
  11041. "function" == typeof e.load && function() {
  11042. try {
  11043. e.load()
  11044. } catch (e) {}
  11045. }()
  11046. }
  11047. }
  11048. ,
  11049. ["muted", "defaultMuted", "autoplay", "controls", "loop", "playsinline"].forEach(function(e) {
  11050. Aa.prototype[e] = function() {
  11051. return this.el_[e] || this.el_.hasAttribute(e)
  11052. }
  11053. }),
  11054. ["muted", "defaultMuted", "autoplay", "loop", "playsinline"].forEach(function(t) {
  11055. Aa.prototype["set" + Re(t)] = function(e) {
  11056. (this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t)
  11057. }
  11058. }),
  11059. ["paused", "currentTime", "buffered", "volume", "poster", "preload", "error", "seeking", "seekable", "ended", "playbackRate", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "played", "networkState", "readyState", "videoWidth", "videoHeight", "crossOrigin"].forEach(function(e) {
  11060. Aa.prototype[e] = function() {
  11061. return this.el_[e]
  11062. }
  11063. }),
  11064. ["volume", "src", "poster", "preload", "playbackRate", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "crossOrigin"].forEach(function(t) {
  11065. Aa.prototype["set" + Re(t)] = function(e) {
  11066. this.el_[t] = e
  11067. }
  11068. }),
  11069. ["pause", "load", "play"].forEach(function(e) {
  11070. Aa.prototype[e] = function() {
  11071. return this.el_[e]()
  11072. }
  11073. }),
  11074. pi.withSourceHandlers(Aa),
  11075. Aa.nativeSourceHandler = {},
  11076. Aa.nativeSourceHandler.canPlayType = function(e) {
  11077. try {
  11078. return Aa.TEST_VID.canPlayType(e)
  11079. } catch (e) {
  11080. return ""
  11081. }
  11082. }
  11083. ,
  11084. Aa.nativeSourceHandler.canHandleSource = function(e, t) {
  11085. if (e.type)
  11086. return Aa.nativeSourceHandler.canPlayType(e.type);
  11087. if (e.src) {
  11088. var n = on(e.src);
  11089. return Aa.nativeSourceHandler.canPlayType("video/" + n)
  11090. }
  11091. return ""
  11092. }
  11093. ,
  11094. Aa.nativeSourceHandler.handleSource = function(e, t, n) {
  11095. t.setSrc(e.src)
  11096. }
  11097. ,
  11098. Aa.nativeSourceHandler.dispose = function() {}
  11099. ,
  11100. Aa.registerSourceHandler(Aa.nativeSourceHandler),
  11101. pi.registerTech("Html5", Aa);
  11102. var Pa = ["progress", "abort", "suspend", "emptied", "stalled", "loadedmetadata", "loadeddata", "timeupdate", "resize", "volumechange", "texttrackchange"]
  11103. , La = {
  11104. canplay: "CanPlay",
  11105. canplaythrough: "CanPlayThrough",
  11106. playing: "Playing",
  11107. seeked: "Seeked"
  11108. }
  11109. , Ia = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"]
  11110. , Ma = {};
  11111. Ia.forEach(function(e) {
  11112. var t = "x" === e.charAt(0) ? "x-" + e.substring(1) : e;
  11113. Ma[e] = "vjs-layout-" + t
  11114. });
  11115. var ja = {
  11116. tiny: 210,
  11117. xsmall: 320,
  11118. small: 425,
  11119. medium: 768,
  11120. large: 1440,
  11121. xlarge: 2560,
  11122. huge: 1 / 0
  11123. }
  11124. , Oa = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
  11125. , Na = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
  11126. , Da = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
  11127. , Ba = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
  11128. , Ra = function(h) {
  11129. function d(e, t, n) {
  11130. var i;
  11131. if (e.id = e.id || t.id || "vjs_video_" + le(),
  11132. (t = b(d.getTagSettings(e), t)).initChildren = !1,
  11133. t.createEl = !1,
  11134. t.evented = !1,
  11135. t.reportTouchActivity = !1,
  11136. !t.language)
  11137. if ("function" == typeof e.closest) {
  11138. var r = e.closest("[lang]");
  11139. r && r.getAttribute && (t.language = r.getAttribute("lang"))
  11140. } else
  11141. for (var s = e; s && 1 === s.nodeType; ) {
  11142. if (O(s).hasOwnProperty("lang")) {
  11143. t.language = s.getAttribute("lang");
  11144. break
  11145. }
  11146. s = s.parentNode
  11147. }
  11148. if ((i = h.call(this, null, t, n) || this).boundDocumentFullscreenChange_ = Te(Ve(i), i.documentFullscreenChange_),
  11149. i.boundFullWindowOnEscKey_ = Te(Ve(i), i.fullWindowOnEscKey),
  11150. i.isFullscreen_ = !1,
  11151. i.isWebFullscreen_ = !1,
  11152. i.log = _(i.id_),
  11153. i.fsApi_ = _t,
  11154. i.isPosterFromTech_ = !1,
  11155. i.queuedCallbacks_ = [],
  11156. i.isReady_ = !1,
  11157. i.hasStarted_ = !1,
  11158. i.userActive_ = !1,
  11159. !i.options_ || !i.options_.techOrder || !i.options_.techOrder.length)
  11160. throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
  11161. if (i.tag = e,
  11162. i.tagAttributes = e && O(e),
  11163. i.language(i.options_.language),
  11164. t.languages) {
  11165. var a = {};
  11166. Object.getOwnPropertyNames(t.languages).forEach(function(e) {
  11167. a[e.toLowerCase()] = t.languages[e]
  11168. }),
  11169. i.languages_ = a
  11170. } else
  11171. i.languages_ = d.prototype.options_.languages;
  11172. i.resetCache_();
  11173. var o = cr.get("h5vodlocaldata");
  11174. if (void 0 !== o && void 0 !== o.lastVolume && i.volume(Number(o.lastVolume)),
  11175. i.poster_ = t.poster || "",
  11176. void 0 !== i.options_.controlBar.playbackQualityLabels && 5 <= i.options_.controlBar.playbackQualityLabels.length && i.options_.controlBar.playbackQualityLabels.length <= 10)
  11177. for (var l = 0; l < i.options_.controlBar.playbackQualityLabels.length; l++)
  11178. Na[l] = i.options_.controlBar.playbackQualityLabels[l];
  11179. i.options_.playbackQualities = ["EMP"],
  11180. i.options_.playbackQualityIndex = [],
  11181. i.controls_ = !!t.controls,
  11182. i.mini_ = !!t.mini,
  11183. void 0 !== t.isHttps ? !0 === t.isHttps ? i.httpPre_ = "https://" : i.httpPre_ = "http://" : i.httpPre_ = "https://",
  11184. e.controls = !1,
  11185. e.removeAttribute("controls"),
  11186. i.changingSrc_ = !1,
  11187. i.playCallbacks_ = [],
  11188. i.playTerminatedQueue_ = [],
  11189. e.hasAttribute("autoplay") ? i.autoplay(!0) : i.autoplay(i.options_.autoplay),
  11190. t.plugins && Object.keys(t.plugins).forEach(function(e) {
  11191. if ("function" != typeof i[e])
  11192. throw new Error('plugin "' + e + '" does not exist')
  11193. }),
  11194. i.scrubbing_ = !1,
  11195. i.el_ = i.createEl(),
  11196. Oe(Ve(i), {
  11197. eventBusKey: "el_"
  11198. }),
  11199. i.fsApi_.requestFullscreen && (ge(f, i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_),
  11200. i.on(i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_)),
  11201. i.fluid_ && i.on("playerreset", i.updateStyleEl_);
  11202. var u = Fe(i.options_);
  11203. t.plugins && Object.keys(t.plugins).forEach(function(e) {
  11204. i[e](t.plugins[e])
  11205. }),
  11206. i.options_.playerOptions = u,
  11207. i.middleware_ = [],
  11208. i.initChildren(),
  11209. i.player().options().qualityPermitMode ? i.getChild("controlBar").removeChild("PlaybackQualityMenuButton3") : i.getChild("controlBar").removeChild("PlaybackQualityMenuButton"),
  11210. i.isAudio("audio" === e.nodeName.toLowerCase()),
  11211. i.controls() ? i.addClass("vjs-controls-enabled") : i.addClass("vjs-controls-disabled"),
  11212. i.el_.setAttribute("role", "region"),
  11213. i.isAudio() ? i.el_.setAttribute("aria-label", i.localize("Audio Player")) : i.el_.setAttribute("aria-label", i.localize("Video Player")),
  11214. i.isAudio() && i.addClass("vjs-audio"),
  11215. i.flexNotSupported_() && i.addClass("vjs-no-flex"),
  11216. lt && i.addClass("vjs-touch-enabled"),
  11217. ht || i.addClass("vjs-workinghover"),
  11218. d.players[i.id_] = Ve(i);
  11219. var c = y.split(".")[0];
  11220. return i.version = y,
  11221. i.playerversion = v + (i.player().options_.drmLabel ? "d" : ""),
  11222. 1 !== i.options_.logicIndex || i.options_.enableVip || (i.playerversion += " 4k"),
  11223. i.updatedate = g,
  11224. i.addClass("vjs-v" + c),
  11225. i.userActive(!0),
  11226. i.reportUserActivity(),
  11227. i.one("play", i.listenForUserActivity_),
  11228. i.on("stageclick", i.handleStageClick_),
  11229. i.on("keydown", i.handleKeyDown),
  11230. i.breakpoints(i.options_.breakpoints),
  11231. i.responsive(i.options_.responsive),
  11232. i
  11233. }
  11234. We(d, h);
  11235. var e = d.prototype;
  11236. return e.GET_DEFAULT_QUALITY_LABELS = function() {
  11237. return Na
  11238. }
  11239. ,
  11240. e.GET_CUSTOM_QUALITY_LABELS = function() {
  11241. return Ba
  11242. }
  11243. ,
  11244. e.GET_CUSTOM_QUALITIES_DIVIDE = function() {
  11245. return Da
  11246. }
  11247. ,
  11248. e.dispose = function() {
  11249. this.player_.paused()
  11250. var i = this;
  11251. this.trigger("dispose"),
  11252. this.off("dispose"),
  11253. ye(f, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_),
  11254. ye(f, "keydown", this.boundFullWindowOnEscKey_),
  11255. this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_),
  11256. this.styleEl_ = null),
  11257. d.players[this.id_] = null,
  11258. this.tag && this.tag.player && (this.tag.player = null),
  11259. this.el_ && this.el_.player && (this.el_.player = null),
  11260. this.tech_ && (this.tech_.dispose(),
  11261. this.isPosterFromTech_ = !1,
  11262. this.poster_ = ""),
  11263. this.playerElIngest_ && (this.playerElIngest_ = null),
  11264. this.tag && (this.tag = null),
  11265. function(e) {
  11266. vi[e.id()] = null
  11267. }(this),
  11268. Dn.names.forEach(function(e) {
  11269. var t = Dn[e]
  11270. , n = i[t.getterName]();
  11271. n && n.off && n.off()
  11272. }),
  11273. h.prototype.dispose.call(this)
  11274. }
  11275. ,
  11276. e.createEl = function() {
  11277. var t, n = this.tag, e = this.playerElIngest_ = n.parentNode && n.parentNode.hasAttribute && n.parentNode.hasAttribute("data-vjs-player"), i = "video-js" === this.tag.tagName.toLowerCase();
  11278. e ? t = this.el_ = n.parentNode : i || (t = this.el_ = h.prototype.createEl.call(this, "div"));
  11279. var r = O(n);
  11280. if (i) {
  11281. for (t = this.el_ = n,
  11282. n = this.tag = f.createElement("video"); t.children.length; )
  11283. n.appendChild(t.firstChild);
  11284. P(t, "video-js") || L(t, "video-js"),
  11285. t.appendChild(n),
  11286. e = this.playerElIngest_ = t,
  11287. Object.keys(t).forEach(function(e) {
  11288. try {
  11289. n[e] = t[e]
  11290. } catch (e) {}
  11291. })
  11292. }
  11293. if (n.setAttribute("tabindex", "-1"),
  11294. r.tabindex = "-1",
  11295. (st || it && ot) && (n.setAttribute("role", "application"),
  11296. r.role = "application"),
  11297. n.removeAttribute("width"),
  11298. n.removeAttribute("height"),
  11299. "width"in r && delete r.width,
  11300. "height"in r && delete r.height,
  11301. Object.getOwnPropertyNames(r).forEach(function(e) {
  11302. i && "class" === e || t.setAttribute(e, r[e]),
  11303. i && n.setAttribute(e, r[e])
  11304. }),
  11305. n.playerId = n.id,
  11306. n.id += "_html5_api",
  11307. n.className = "vjs-tech",
  11308. n.player = t.player = this,
  11309. this.addClass("vjs-paused"),
  11310. !0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
  11311. this.styleEl_ = re("vjs-styles-dimensions");
  11312. var s = $(".vjs-styles-defaults")
  11313. , a = $("head");
  11314. a.insertBefore(this.styleEl_, s ? s.nextSibling : a.firstChild)
  11315. }
  11316. this.fill_ = !1,
  11317. this.fluid_ = !1,
  11318. this.width(this.options_.width),
  11319. this.height(this.options_.height),
  11320. this.fill(this.options_.fill),
  11321. this.fluid(this.options_.fluid),
  11322. this.aspectRatio(this.options_.aspectRatio),
  11323. this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
  11324. for (var o = n.getElementsByTagName("a"), l = 0; l < o.length; l++) {
  11325. var u = o.item(l);
  11326. L(u, "vjs-hidden"),
  11327. u.setAttribute("hidden", "hidden")
  11328. }
  11329. n.initNetworkState_ = n.networkState,
  11330. n.parentNode && !e && n.parentNode.insertBefore(t, n),
  11331. A(n, t),
  11332. this.children_.unshift(n);
  11333. var c = this;
  11334. return n.oncontextmenu = function(e) {
  11335. return !0 === e.ctrlKey && e.altKey ? c.showContextMenu(e, !0) : c.showContextMenu(e, !1),
  11336. !1
  11337. }
  11338. ,
  11339. this.el_.setAttribute("lang", this.language_),
  11340. this.el_ = t
  11341. }
  11342. ,
  11343. e.crossOrigin = function(e) {
  11344. if (!e)
  11345. return this.techGet_("crossOrigin");
  11346. "anonymous" === e || "use-credentials" === e ? this.techCall_("setCrossOrigin", e) : m.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + e + '"')
  11347. }
  11348. ,
  11349. e.showContextMenu = function(e, t) {
  11350. this.getChild("contextMenuButton").moveAndShow(e, t)
  11351. }
  11352. ,
  11353. e.getDebugInfo = function() {
  11354. var e = "";
  11355. e += "WH DEBUG:";
  11356. var t, n = JSON.parse('{"DEBUG_INFO":"aaa1"}');
  11357. for (t in this.options_)
  11358. "playerOptions" !== t && (n[t] = this.options_[t]);
  11359. return delete n.controlBar.playerOptions,
  11360. n.tech = this.tech_.debugInfo,
  11361. e += JSON.stringify(n)
  11362. }
  11363. ,
  11364. e.width = function(e) {
  11365. return this.dimension("width", e)
  11366. }
  11367. ,
  11368. e.height = function(e) {
  11369. return this.dimension("height", e)
  11370. }
  11371. ,
  11372. e.dimension = function(e, t) {
  11373. var n = e + "_";
  11374. if (void 0 === t)
  11375. return this[n] || 0;
  11376. if ("" === t || "auto" === t)
  11377. return this[n] = void 0,
  11378. void this.updateStyleEl_();
  11379. var i = parseFloat(t);
  11380. isNaN(i) ? m.error('Improper value "' + t + '" supplied for for ' + e) : (this[n] = i,
  11381. this.updateStyleEl_())
  11382. }
  11383. ,
  11384. e.fluid = function(e) {
  11385. if (void 0 === e)
  11386. return !!this.fluid_;
  11387. this.fluid_ = !!e,
  11388. Me(this) && this.off("playerreset", this.updateStyleEl_),
  11389. e ? (this.addClass("vjs-fluid"),
  11390. this.fill(!1),
  11391. function(e, t) {
  11392. Me(e) ? t() : (e.eventedCallbacks || (e.eventedCallbacks = []),
  11393. e.eventedCallbacks.push(t))
  11394. }(function() {
  11395. this.on("playerreset", this.updateStyleEl_)
  11396. })) : this.removeClass("vjs-fluid"),
  11397. this.updateStyleEl_()
  11398. }
  11399. ,
  11400. e.fill = function(e) {
  11401. if (void 0 === e)
  11402. return !!this.fill_;
  11403. this.fill_ = !!e,
  11404. e ? (this.addClass("vjs-fill"),
  11405. this.fluid(!1)) : this.removeClass("vjs-fill")
  11406. }
  11407. ,
  11408. e.aspectRatio = function(e) {
  11409. if (void 0 === e)
  11410. return this.aspectRatio_;
  11411. if (!/^\d+\:\d+$/.test(e))
  11412. throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
  11413. this.aspectRatio_ = e,
  11414. this.fluid(!0),
  11415. this.updateStyleEl_()
  11416. }
  11417. ,
  11418. e.updateStyleEl_ = function() {
  11419. if (!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
  11420. var e, t, n, i = (void 0 !== this.aspectRatio_ && "auto" !== this.aspectRatio_ ? this.aspectRatio_ : 0 < this.videoWidth() ? this.videoWidth() + ":" + this.videoHeight() : "16:9").split(":"), r = i[1] / i[0];
  11421. e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / r : this.videoWidth() || 300,
  11422. t = void 0 !== this.height_ ? this.height_ : e * r,
  11423. n = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions",
  11424. this.addClass(n),
  11425. se(this.styleEl_, "\n ." + n + " {\n width: " + e + "px;\n height: " + t + "px;\n }\n\n ." + n + ".vjs-fluid {\n padding-top: " + 100 * r + "%;\n }\n ")
  11426. } else {
  11427. var s = "number" == typeof this.width_ ? this.width_ : this.options_.width
  11428. , a = "number" == typeof this.height_ ? this.height_ : this.options_.height
  11429. , o = this.tech_ && this.tech_.el();
  11430. o && (0 <= s && (o.width = s),
  11431. 0 <= a && (o.height = a))
  11432. }
  11433. }
  11434. ,
  11435. e.loadTech_ = function(e, t) {
  11436. var n = this;
  11437. this.tech_ && this.unloadTech_();
  11438. var i = Re(e)
  11439. , r = e.charAt(0).toLowerCase() + e.slice(1);
  11440. "Html5" !== i && this.tag && (pi.getTech("Html5").disposeMediaElement(this.tag),
  11441. this.tag.player = null,
  11442. this.tag = null),
  11443. this.techName_ = i,
  11444. this.isReady_ = !1;
  11445. var s = {
  11446. source: t,
  11447. autoplay: "string" != typeof this.autoplay() && this.autoplay(),
  11448. nativeControlsForTouch: this.options_.nativeControlsForTouch,
  11449. playerId: this.id(),
  11450. techId: this.id() + "_" + r + "_api",
  11451. playsinline: this.options_.playsinline,
  11452. preload: this.options_.preload,
  11453. loop: this.options_.loop,
  11454. autoNext: this.options_.autoNext,
  11455. muted: this.options_.muted,
  11456. poster: this.poster(),
  11457. language: this.language(),
  11458. playerElIngest: this.playerElIngest_ || !1,
  11459. "vtt.js": this.options_["vtt.js"],
  11460. canOverridePoster: !!this.options_.techCanOverridePoster,
  11461. enableSourceset: this.options_.enableSourceset,
  11462. Promise: this.options_.Promise
  11463. };
  11464. Dn.names.forEach(function(e) {
  11465. var t = Dn[e];
  11466. s[t.getterName] = n[t.privateName]
  11467. }),
  11468. b(s, this.options_[i]),
  11469. b(s, this.options_[r]),
  11470. b(s, this.options_[e.toLowerCase()]),
  11471. this.tag && (s.tag = this.tag),
  11472. t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (s.startTime = this.cache_.currentTime);
  11473. var a = pi.getTech(e);
  11474. if (!a)
  11475. throw new Error("No Tech named '" + i + "' exists! '" + i + "' should be registered using videojs.registerTech()'");
  11476. this.tech_ = new a(s),
  11477. this.tech_.ready(Te(this, this.handleTechReady_), !0),
  11478. It(this.textTracksJson_ || [], this.tech_),
  11479. Pa.forEach(function(e) {
  11480. n.on(n.tech_, e, n["handleTech" + Re(e) + "_"])
  11481. }),
  11482. Object.keys(La).forEach(function(t) {
  11483. n.on(n.tech_, t, function(e) {
  11484. 0 === n.tech_.playbackRate() && n.tech_.seeking() ? n.queuedCallbacks_.push({
  11485. callback: n["handleTech" + La[t] + "_"].bind(n),
  11486. event: e
  11487. }) : n["handleTech" + La[t] + "_"](e)
  11488. })
  11489. }),
  11490. this.on("loadedmetadata", this.initPlaybackQualityLevelDirect),
  11491. this.on("adended", this.handleADSEnded_),
  11492. this.on(this.tech_, "loadstart", this.handleTechLoadStart_),
  11493. this.on(this.tech_, "sourceset", this.handleTechSourceset_),
  11494. this.on(this.tech_, "waiting", this.handleTechWaiting_),
  11495. this.on(this.tech_, "ended", this.handleTechEnded_),
  11496. this.on(this.tech_, "seeking", this.handleTechSeeking_),
  11497. this.on(this.tech_, "play", this.handleTechPlay_),
  11498. this.on(this.tech_, "firstplay", this.handleTechFirstPlay_),
  11499. this.on(this.tech_, "pause", this.handleTechPause_),
  11500. this.on(this.tech_, "durationchange", this.handleTechDurationChange_),
  11501. this.on(this.tech_, "fullscreenchange", this.handleTechFullscreenChange_),
  11502. this.on(this.tech_, "fullscreenerror", this.handleTechFullscreenError_),
  11503. this.on(this.tech_, "enterpictureinpicture", this.handleTechEnterPictureInPicture_),
  11504. this.on(this.tech_, "leavepictureinpicture", this.handleTechLeavePictureInPicture_),
  11505. this.on(this.tech_, "error", this.handleTechError_),
  11506. this.on(this.tech_, "loadedmetadata", this.updateStyleEl_),
  11507. this.on(this.tech_, "posterchange", this.handleTechPosterChange_),
  11508. this.on(this.tech_, "textdata", this.handleTechTextData_),
  11509. this.on(this.tech_, "ratechange", this.handleTechRateChange_),
  11510. this.on(this.tech_, "qualitychange", this.handleTechQualityChange_),
  11511. this.usingNativeControls(this.techGet_("controls")),
  11512. this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(),
  11513. this.tech_.el().parentNode === this.el() || "Html5" === i && this.tag || A(this.tech_.el(), this.el()),
  11514. this.autoNext(this.options_.setup_autoNext),
  11515. this.loop2(this.options_.setup_loop),
  11516. this.tag && (this.tag.player = null,
  11517. this.tag = null)
  11518. }
  11519. ,
  11520. e.unloadTech_ = function() {
  11521. var n = this;
  11522. Dn.names.forEach(function(e) {
  11523. var t = Dn[e];
  11524. n[t.privateName] = n[t.getterName]()
  11525. }),
  11526. this.textTracksJson_ = Lt(this.tech_),
  11527. this.isReady_ = !1,
  11528. this.tech_.dispose(),
  11529. this.tech_ = !1,
  11530. this.isPosterFromTech_ && (this.poster_ = "",
  11531. this.trigger("posterchange")),
  11532. this.isPosterFromTech_ = !1
  11533. }
  11534. ,
  11535. e.tech = function(e) {
  11536. return void 0 === e && m.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"),
  11537. this.tech_
  11538. }
  11539. ,
  11540. e.addTechControlsListeners_ = function() {
  11541. this.removeTechControlsListeners_(),
  11542. this.on(this.tech_, "mouseup", this.handleTechClick_),
  11543. this.on(this.tech_, "dblclick", this.handleTechDoubleClick_),
  11544. this.on(this.tech_, "touchstart", this.handleTechTouchStart_),
  11545. this.on(this.tech_, "touchmove", this.handleTechTouchMove_),
  11546. this.on(this.tech_, "touchend", this.handleTechTouchEnd_),
  11547. this.on(this.tech_, "tap", this.handleTechTap_)
  11548. }
  11549. ,
  11550. e.removeTechControlsListeners_ = function() {
  11551. this.off(this.tech_, "tap", this.handleTechTap_),
  11552. this.off(this.tech_, "touchstart", this.handleTechTouchStart_),
  11553. this.off(this.tech_, "touchmove", this.handleTechTouchMove_),
  11554. this.off(this.tech_, "touchend", this.handleTechTouchEnd_),
  11555. this.off(this.tech_, "mouseup", this.handleTechClick_),
  11556. this.off(this.tech_, "dblclick", this.handleTechDoubleClick_)
  11557. }
  11558. ,
  11559. e.handleTechReady_ = function() {
  11560. this.triggerReady(),
  11561. this.cache_.volume && this.techCall_("setVolume", this.cache_.volume),
  11562. this.handleTechPosterChange_(),
  11563. this.handleTechDurationChange_()
  11564. }
  11565. ,
  11566. e.handleTechLoadStart_ = function() {
  11567. this.removeClass("vjs-ended"),
  11568. this.removeClass("vjs-seeking"),
  11569. this.error(null),
  11570. this.handleTechDurationChange_(),
  11571. this.paused() ? (this.hasStarted(!1),
  11572. this.trigger("loadstart")) : (this.trigger("loadstart"),
  11573. this.trigger("firstplay")),
  11574. this.manualAutoplay_(this.autoplay())
  11575. }
  11576. ,
  11577. e.manualAutoplay_ = function(t) {
  11578. var i = this;
  11579. if (this.tech_ && "string" == typeof t) {
  11580. var e, n = function() {
  11581. var e = i.muted();
  11582. i.muted(!0);
  11583. function t() {
  11584. i.muted(e)
  11585. }
  11586. i.playTerminatedQueue_.push(t);
  11587. var n = i.play();
  11588. if (xt(n))
  11589. return n.catch(t)
  11590. };
  11591. if ("any" === t && !0 !== this.muted() ? xt(e = this.play()) && (e = e.catch(n)) : e = "muted" === t && !0 !== this.muted() ? n() : this.play(),
  11592. xt(e))
  11593. return e.then(function() {
  11594. i.trigger({
  11595. type: "autoplay-success",
  11596. autoplay: t
  11597. })
  11598. }).catch(function(e) {
  11599. i.trigger({
  11600. type: "autoplay-failure",
  11601. autoplay: t
  11602. })
  11603. })
  11604. }
  11605. }
  11606. ,
  11607. e.updateSourceCaches_ = function(e) {
  11608. void 0 === e && (e = "");
  11609. var t = e
  11610. , n = "";
  11611. "string" != typeof t && (t = e.src,
  11612. n = e.type),
  11613. this.cache_.source = this.cache_.source || {},
  11614. this.cache_.sources = this.cache_.sources || [],
  11615. t && !n && (n = function(e, t) {
  11616. if (!t)
  11617. return "";
  11618. if (e.cache_.source.src === t && e.cache_.source.type)
  11619. return e.cache_.source.type;
  11620. var n = e.cache_.sources.filter(function(e) {
  11621. return e.src === t
  11622. });
  11623. if (n.length)
  11624. return n[0].type;
  11625. for (var i = e.$$("source"), r = 0; r < i.length; r++) {
  11626. var s = i[r];
  11627. if (s.type && s.src && s.src === t)
  11628. return s.type
  11629. }
  11630. return Ei(t)
  11631. }(this, t)),
  11632. this.cache_.source = Fe({}, e, {
  11633. src: t,
  11634. type: n
  11635. });
  11636. for (var i = this.cache_.sources.filter(function(e) {
  11637. return e.src && e.src === t
  11638. }), r = [], s = this.$$("source"), a = [], o = 0; o < s.length; o++) {
  11639. var l = O(s[o]);
  11640. r.push(l),
  11641. l.src && l.src === t && a.push(l.src)
  11642. }
  11643. a.length && !i.length ? this.cache_.sources = r : i.length || (this.cache_.sources = [this.cache_.source]),
  11644. this.cache_.src = t
  11645. }
  11646. ,
  11647. e.handleTechSourceset_ = function(e) {
  11648. var n = this;
  11649. if (!this.changingSrc_) {
  11650. var t = function(e) {
  11651. return n.updateSourceCaches_(e)
  11652. }
  11653. , i = this.currentSource().src
  11654. , r = e.src;
  11655. i && !/^blob:/.test(i) && /^blob:/.test(r) && (this.lastSource_ && (this.lastSource_.tech === r || this.lastSource_.player === i) || (t = function() {}
  11656. )),
  11657. t(r),
  11658. e.src || this.tech_.any(["sourceset", "loadstart"], function(e) {
  11659. if ("sourceset" !== e.type) {
  11660. var t = n.techGet("currentSrc");
  11661. n.lastSource_.tech = t,
  11662. n.updateSourceCaches_(t)
  11663. }
  11664. })
  11665. }
  11666. this.lastSource_ = {
  11667. player: this.currentSource().src,
  11668. tech: e.src
  11669. },
  11670. this.trigger({
  11671. src: e.src,
  11672. type: "sourceset"
  11673. })
  11674. }
  11675. ,
  11676. e.hasStarted = function(e) {
  11677. if (void 0 === e)
  11678. return this.hasStarted_;
  11679. e !== this.hasStarted_ && (this.hasStarted_ = e,
  11680. this.hasStarted_ ? (this.addClass("vjs-has-started"),
  11681. this.trigger("firstplay")) : this.removeClass("vjs-has-started"))
  11682. }
  11683. ,
  11684. e.handleTechPlay_ = function() {
  11685. this.removeClass("vjs-ended"),
  11686. this.removeClass("vjs-paused"),
  11687. this.addClass("vjs-playing"),
  11688. this.hasStarted(!0),
  11689. this.trigger("play")
  11690. }
  11691. ,
  11692. e.handleTechRateChange_ = function() {
  11693. 0 < this.tech_.playbackRate() && 0 === this.cache_.lastPlaybackRate && (this.queuedCallbacks_.forEach(function(e) {
  11694. return e.callback(e.event)
  11695. }),
  11696. this.queuedCallbacks_ = []),
  11697. this.cache_.lastPlaybackRate = this.tech_.playbackRate(),
  11698. this.trigger("ratechange")
  11699. }
  11700. ,
  11701. e.handleTechQualityChange_ = function() {
  11702. this.cache_.lastPlaybackQuality = this.tech_.playbackQuality(),
  11703. this.trigger("qualitychange")
  11704. }
  11705. ,
  11706. e.handleTechWaiting_ = function() {
  11707. var t = this;
  11708. this.addClass("vjs-waiting"),
  11709. this.trigger("waiting");
  11710. var n = this.currentTime();
  11711. this.on("timeupdate", function e() {
  11712. n !== t.currentTime() && (t.removeClass("vjs-waiting"),
  11713. t.off("timeupdate", e))
  11714. })
  11715. }
  11716. ,
  11717. e.handleTechCanPlay_ = function() {
  11718. this.removeClass("vjs-waiting"),
  11719. this.trigger("canplay")
  11720. }
  11721. ,
  11722. e.handleTechCanPlayThrough_ = function() {
  11723. this.removeClass("vjs-waiting"),
  11724. this.trigger("canplaythrough")
  11725. }
  11726. ,
  11727. e.handleTechPlaying_ = function() {
  11728. this.removeClass("vjs-waiting"),
  11729. this.trigger("playing")
  11730. }
  11731. ,
  11732. e.handleTechSeeking_ = function() {
  11733. this.addClass("vjs-seeking"),
  11734. this.trigger("seeking")
  11735. }
  11736. ,
  11737. e.handleTechSeeked_ = function() {
  11738. this.removeClass("vjs-seeking"),
  11739. this.removeClass("vjs-ended"),
  11740. this.trigger("seeked")
  11741. }
  11742. ,
  11743. e.handleTechFirstPlay_ = function() {
  11744. this.options_.starttime && (m.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),
  11745. this.currentTime(this.options_.starttime)),
  11746. this.addClass("vjs-has-started"),
  11747. this.trigger("firstplay")
  11748. }
  11749. ,
  11750. e.handleTechPause_ = function() {
  11751. this.removeClass("vjs-playing"),
  11752. this.addClass("vjs-paused"),
  11753. this.trigger("pause")
  11754. }
  11755. ,
  11756. e.isPlaying = function() {
  11757. return this.hasClass("vjs-playing")
  11758. }
  11759. ,
  11760. e.handleTechEnded_ = function() {
  11761. this.addClass("vjs-ended"),
  11762. this.trigger("ended")
  11763. }
  11764. ,
  11765. e.handleTechDurationChange_ = function() {
  11766. this.duration(this.techGet_("duration")),
  11767. void 0 !== this.mainContentDuration_ || isNaN(this.duration()) || 0 === this.duration() || (this.mainContentDuration_ = this.duration())
  11768. }
  11769. ,
  11770. e.handleTechClick_ = function(e) {
  11771. X(e) ? this.controls_ && (this.mini_ || (this.paused() ? At(this.play()) : this.pause())) : e.button
  11772. }
  11773. ,
  11774. e.handleTechDoubleClick_ = function(t) {
  11775. this.controls_ && (this.mini_ || Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(e) {
  11776. return e.contains(t.target)
  11777. }) || void 0 !== this.options_ && void 0 !== this.options_.userActions && void 0 !== this.options_.userActions.doubleClick && !1 === this.options_.userActions.doubleClick || (void 0 !== this.options_ && void 0 !== this.options_.userActions && "function" == typeof this.options_.userActions.doubleClick ? this.options_.userActions.doubleClick.call(this, t) : this.isFullscreen() ? this.exitFullscreen() : this.requestFullscreen()))
  11778. }
  11779. ,
  11780. e.handleTechTap_ = function() {
  11781. this.userActive(!this.userActive())
  11782. }
  11783. ,
  11784. e.handleTechTouchStart_ = function() {
  11785. this.userWasActive = this.userActive()
  11786. }
  11787. ,
  11788. e.handleTechTouchMove_ = function() {
  11789. this.userWasActive && this.reportUserActivity()
  11790. }
  11791. ,
  11792. e.handleTechTouchEnd_ = function(e) {
  11793. e.preventDefault()
  11794. }
  11795. ,
  11796. e.handleStageClick_ = function() {
  11797. this.reportUserActivity()
  11798. }
  11799. ,
  11800. e.toggleFullscreenClass_ = function() {
  11801. this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen")
  11802. }
  11803. ,
  11804. e.toggleWebFullscreenClass_ = function() {
  11805. this.isWebFullscreen() ? this.addClass("vjs-webfullscreen") : this.removeClass("vjs-webfullscreen")
  11806. }
  11807. ,
  11808. e.documentFullscreenChange_ = function(e) {
  11809. var t = e.target.player;
  11810. if (!t || t === this) {
  11811. var n = this.el()
  11812. , i = f[this.fsApi_.fullscreenElement] === n;
  11813. !i && n.matches ? i = n.matches(":" + this.fsApi_.fullscreen) : !i && n.msMatchesSelector && (i = n.msMatchesSelector(":" + this.fsApi_.fullscreen)),
  11814. this.isFullscreen(i)
  11815. }
  11816. }
  11817. ,
  11818. e.handleTechFullscreenChange_ = function(e, t) {
  11819. t && this.isFullscreen(t.isFullscreen)
  11820. }
  11821. ,
  11822. e.handleTechFullscreenError_ = function(e, t) {
  11823. this.trigger("fullscreenerror", t)
  11824. }
  11825. ,
  11826. e.togglePictureInPictureClass_ = function() {
  11827. this.isInPictureInPicture() ? this.addClass("vjs-picture-in-picture") : this.removeClass("vjs-picture-in-picture")
  11828. }
  11829. ,
  11830. e.handleTechEnterPictureInPicture_ = function(e) {
  11831. this.isInPictureInPicture(!0)
  11832. }
  11833. ,
  11834. e.handleTechLeavePictureInPicture_ = function(e) {
  11835. this.isInPictureInPicture(!1)
  11836. }
  11837. ,
  11838. e.handleTechError_ = function() {
  11839. var e = this.tech_.error();
  11840. this.error(e)
  11841. }
  11842. ,
  11843. e.handleTechTextData_ = function(e, t) {
  11844. var n = null;
  11845. 1 < arguments.length && (n = t),
  11846. this.trigger("textdata", n)
  11847. }
  11848. ,
  11849. e.getCache = function() {
  11850. return this.cache_
  11851. }
  11852. ,
  11853. e.resetCache_ = function() {
  11854. this.cache_ = {
  11855. currentTime: 0,
  11856. initTime: 0,
  11857. inactivityTimeout: this.options_.inactivityTimeout,
  11858. duration: NaN,
  11859. lastVolume: 1,
  11860. lastPlaybackRate: this.defaultPlaybackRate(),
  11861. lastPlaybackQuality: this.defaultPlaybackQuality(),
  11862. media: null,
  11863. src: "",
  11864. source: {},
  11865. sources: [],
  11866. volume: 1
  11867. }
  11868. }
  11869. ,
  11870. e.techCall_ = function(e, t) {
  11871. this.ready(function() {
  11872. if (e in bi)
  11873. return function(e, t, n, i) {
  11874. return t[n](e.reduce(Ci(n), i))
  11875. }(this.middleware_, this.tech_, e, t);
  11876. if (e in Ti)
  11877. return mi(this.middleware_, this.tech_, e, t);
  11878. try {
  11879. this.tech_ && this.tech_[e](t)
  11880. } catch (e) {
  11881. throw m(e),
  11882. e
  11883. }
  11884. }, !0)
  11885. }
  11886. ,
  11887. e.techGet_ = function(t) {
  11888. if (this.tech_ && this.tech_.isReady_) {
  11889. if (t in _i)
  11890. return function(e, t, n) {
  11891. return e.reduceRight(Ci(n), t[n]())
  11892. }(this.middleware_, this.tech_, t);
  11893. if (t in Ti)
  11894. return mi(this.middleware_, this.tech_, t);
  11895. try {
  11896. return this.tech_[t]()
  11897. } catch (e) {
  11898. if (void 0 === this.tech_[t])
  11899. throw m("Video.js: " + t + " method not defined for " + this.techName_ + " playback technology.", e),
  11900. e;
  11901. if ("TypeError" === e.name)
  11902. throw m("Video.js: " + t + " unavailable on " + this.techName_ + " playback technology element.", e),
  11903. this.tech_.isReady_ = !1,
  11904. e;
  11905. throw m(e),
  11906. e
  11907. }
  11908. }
  11909. }
  11910. ,
  11911. e.play = function() {
  11912. var t = this
  11913. , e = this.options_.Promise || p.Promise;
  11914. return e ? new e(function(e) {
  11915. t.play_(e)
  11916. }
  11917. ) : this.play_()
  11918. }
  11919. ,
  11920. e.play_ = function(e) {
  11921. var t = this;
  11922. void 0 === e && (e = At),
  11923. this.playCallbacks_.push(e);
  11924. var n = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
  11925. if (this.waitToPlay_ && (this.off(["ready", "loadstart"], this.waitToPlay_),
  11926. this.waitToPlay_ = null),
  11927. !this.isReady_ || !n)
  11928. return this.waitToPlay_ = function(e) {
  11929. t.play_()
  11930. }
  11931. ,
  11932. this.one(["ready", "loadstart"], this.waitToPlay_),
  11933. void (n || !dt && !ht || this.load());
  11934. var i = this.techGet_("play");
  11935. null === i ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(i)
  11936. }
  11937. ,
  11938. e.runPlayTerminatedQueue_ = function() {
  11939. var e = this.playTerminatedQueue_.slice(0);
  11940. this.playTerminatedQueue_ = [],
  11941. e.forEach(function(e) {
  11942. e()
  11943. })
  11944. }
  11945. ,
  11946. e.runPlayCallbacks_ = function(t) {
  11947. var e = this.playCallbacks_.slice(0);
  11948. this.playCallbacks_ = [],
  11949. this.playTerminatedQueue_ = [],
  11950. e.forEach(function(e) {
  11951. e(t)
  11952. })
  11953. }
  11954. ,
  11955. e.pause = function() {
  11956. this.techCall_("pause")
  11957. }
  11958. ,
  11959. e.paused = function() {
  11960. return !1 !== this.techGet_("paused")
  11961. }
  11962. ,
  11963. e.played = function() {
  11964. return this.techGet_("played") || gt(0, 0)
  11965. }
  11966. ,
  11967. e.scrubbing = function(e) {
  11968. if ("undefined" == typeof e)
  11969. return this.scrubbing_;
  11970. this.scrubbing_ = !!e,
  11971. e ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing")
  11972. }
  11973. ,
  11974. e.currentTime = function(e) {
  11975. return "undefined" != typeof e ? (e < 0 && (e = 0),
  11976. this.isReady_ && !this.changingSrc_ && this.tech_ && this.tech_.isReady_ ? (this.techCall_("setCurrentTime", e),
  11977. void (this.cache_.initTime = 0)) : (this.cache_.initTime = e,
  11978. this.off("canplay", this.applyInitTime_),
  11979. void this.one("canplay", this.applyInitTime_))) : (this.cache_.currentTime = this.techGet_("currentTime") || 0,
  11980. this.cache_.currentTime)
  11981. }
  11982. ,
  11983. e.applyInitTime_ = function() {
  11984. this.currentTime(this.cache_.initTime)
  11985. }
  11986. ,
  11987. e.duration = function(e) {
  11988. if (void 0 === e)
  11989. return void 0 !== this.cache_.duration ? this.cache_.duration : NaN;
  11990. (e = parseFloat(e)) < 0 && (e = 1 / 0),
  11991. e !== this.cache_.duration && ((this.cache_.duration = e) === 1 / 0 ? this.addClass("vjs-live") : this.removeClass("vjs-live"),
  11992. isNaN(e) || this.trigger("durationchange"))
  11993. }
  11994. ,
  11995. e.remainingTime = function() {
  11996. return this.duration() - this.currentTime()
  11997. }
  11998. ,
  11999. e.remainingTimeDisplay = function() {
  12000. return Math.floor(this.duration()) - Math.floor(this.currentTime())
  12001. }
  12002. ,
  12003. e.buffered = function() {
  12004. var e = this.techGet_("buffered");
  12005. return e && e.length || (e = gt(0, 0)),
  12006. e
  12007. }
  12008. ,
  12009. e.bufferedPercent = function() {
  12010. return yt(this.buffered(), this.duration())
  12011. }
  12012. ,
  12013. e.bufferedEnd = function() {
  12014. var e = this.buffered()
  12015. , t = this.duration()
  12016. , n = e.end(e.length - 1);
  12017. return t < n && (n = t),
  12018. n
  12019. }
  12020. ,
  12021. e.volume = function(e) {
  12022. var t;
  12023. if (void 0 === e)
  12024. return t = parseFloat(this.techGet_("volume")),
  12025. isNaN(t) ? 1 : t;
  12026. if (t = Math.max(0, Math.min(1, parseFloat(e))),
  12027. this.cache_.volume = t,
  12028. this.techCall_("setVolume", t),
  12029. 0 < t) {
  12030. this.lastVolume_(t);
  12031. var n = cr.get("h5vodlocaldata");
  12032. void 0 !== n ? cr.set("h5vodlocaldata", {
  12033. lastQuality: n.lastQuality,
  12034. lastVolume: this.lastVolume_()
  12035. }) : cr.set("h5vodlocaldata", {
  12036. lastQuality: null,
  12037. lastVolume: this.lastVolume_()
  12038. })
  12039. }
  12040. }
  12041. ,
  12042. e.muted = function(e) {
  12043. if (void 0 === e)
  12044. return this.techGet_("muted") || !1;
  12045. this.techCall_("setMuted", e)
  12046. }
  12047. ,
  12048. e.defaultMuted = function(e) {
  12049. return void 0 !== e ? this.techCall_("setDefaultMuted", e) : this.techGet_("defaultMuted") || !1
  12050. }
  12051. ,
  12052. e.lastVolume_ = function(e) {
  12053. if (void 0 === e || 0 === e)
  12054. return this.cache_.lastVolume;
  12055. this.cache_.lastVolume = e
  12056. }
  12057. ,
  12058. e.supportsFullScreen = function() {
  12059. return this.techGet_("supportsFullScreen") || !1
  12060. }
  12061. ,
  12062. e.supportsWebFullScreen = function() {
  12063. return !0
  12064. }
  12065. ,
  12066. e.isFullscreen = function(e) {
  12067. if (void 0 === e)
  12068. return this.isFullscreen_;
  12069. var t = this.isFullscreen_;
  12070. return this.isFullscreen_ = Boolean(e),
  12071. this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger("fullscreenchange"),
  12072. void this.toggleFullscreenClass_()
  12073. }
  12074. ,
  12075. e.isWebFullscreen = function(e) {
  12076. if (void 0 === e)
  12077. return this.isWebFullscreen_;
  12078. var t = this.isWebFullscreen_;
  12079. return this.isWebFullscreen_ = Boolean(e),
  12080. this.isWebFullscreen_ !== t && this.trigger("webfullscreenchange"),
  12081. void this.toggleWebFullscreenClass_()
  12082. }
  12083. ,
  12084. e.requestFullscreen = function(a) {
  12085. var e = this.options_.Promise || p.Promise;
  12086. if (e) {
  12087. var o = this;
  12088. return new e(function(e, n) {
  12089. function i() {
  12090. o.off(o.fsApi_.fullscreenerror, r),
  12091. o.off(o.fsApi_.fullscreenchange, t)
  12092. }
  12093. function t() {
  12094. i(),
  12095. e()
  12096. }
  12097. function r(e, t) {
  12098. i(),
  12099. n(t)
  12100. }
  12101. o.one("fullscreenchange", t),
  12102. o.one("fullscreenerror", r);
  12103. var s = o.requestFullscreenHelper_(a);
  12104. if (s)
  12105. return s.then(i, i),
  12106. s
  12107. }
  12108. )
  12109. }
  12110. return this.requestFullscreenHelper_()
  12111. }
  12112. ,
  12113. e.requestFullscreenHelper_ = function(e) {
  12114. var t, n = this;
  12115. if (this.fsApi_.prefixed || (t = this.options_.fullscreen && this.options_.fullscreen.options || {},
  12116. void 0 !== e && (t = e)),
  12117. this.isWebFullscreen() && this.exitFullWindow(),
  12118. this.fsApi_.requestFullscreen) {
  12119. var i = this.el_[this.fsApi_.requestFullscreen](t);
  12120. return i && i.then(function() {
  12121. return n.isFullscreen(!0)
  12122. }, function() {
  12123. return n.isFullscreen(!1)
  12124. }),
  12125. i
  12126. }
  12127. this.tech_.supportsFullScreen() ? this.techCall_("enterFullScreen") : this.enterFullWindow()
  12128. }
  12129. ,
  12130. e.requestFullWindow = function(e) {}
  12131. ,
  12132. e.exitFullscreen = function() {
  12133. var e = this.options_.Promise || p.Promise;
  12134. if (e) {
  12135. var a = this;
  12136. return new e(function(e, n) {
  12137. function i() {
  12138. a.off(a.fsApi_.fullscreenerror, r),
  12139. a.off(a.fsApi_.fullscreenchange, t)
  12140. }
  12141. function t() {
  12142. i(),
  12143. e()
  12144. }
  12145. function r(e, t) {
  12146. i(),
  12147. n(t)
  12148. }
  12149. a.one("fullscreenchange", t),
  12150. a.one("fullscreenerror", r);
  12151. var s = a.exitFullscreenHelper_();
  12152. if (s)
  12153. return s.then(i, i),
  12154. s
  12155. }
  12156. )
  12157. }
  12158. return this.exitFullscreenHelper_()
  12159. }
  12160. ,
  12161. e.exitFullscreenHelper_ = function() {
  12162. var e = this;
  12163. if (this.fsApi_.requestFullscreen) {
  12164. var t = f[this.fsApi_.exitFullscreen]();
  12165. return t && t.then(function() {
  12166. return e.isFullscreen(!1)
  12167. }),
  12168. t
  12169. }
  12170. this.tech_.supportsFullScreen() ? this.techCall_("exitFullScreen") : this.exitFullWindow()
  12171. }
  12172. ,
  12173. e.enterFullWindow = function() {
  12174. this.isFullscreen() && this.exitFullscreen(),
  12175. this.isWebFullscreen(!0),
  12176. this.isFullWindow = !0,
  12177. this.docOrigOverflow = f.documentElement.style.overflow,
  12178. ge(f, "keydown", this.boundFullWindowOnEscKey_),
  12179. f.documentElement.style.overflow = "hidden",
  12180. L(f.body, "vjs-webfull-window"),
  12181. this.trigger("enterFullWindow")
  12182. }
  12183. ,
  12184. e.fullWindowOnEscKey = function(e) {
  12185. Mt.isEventKey(e, "Esc") && (!0 === this.isFullscreen() ? this.exitFullscreen() : this.exitFullWindow(),
  12186. !0 === this.isWebFullscreen() && this.exitFullWindow())
  12187. }
  12188. ,
  12189. e.exitFullWindow = function() {
  12190. this.isWebFullscreen(!1),
  12191. this.isFullWindow = !1,
  12192. ye(f, "keydown", this.boundFullWindowOnEscKey_),
  12193. f.documentElement.style.overflow = this.docOrigOverflow,
  12194. I(f.body, "vjs-webfull-window"),
  12195. this.trigger("exitFullWindow")
  12196. }
  12197. ,
  12198. e.isInPictureInPicture = function(e) {
  12199. return void 0 !== e ? (this.isInPictureInPicture_ = !!e,
  12200. void this.togglePictureInPictureClass_()) : !!this.isInPictureInPicture_
  12201. }
  12202. ,
  12203. e.requestPictureInPicture = function() {
  12204. if ("pictureInPictureEnabled"in f)
  12205. return this.techGet_("requestPictureInPicture")
  12206. }
  12207. ,
  12208. e.exitPictureInPicture = function() {
  12209. if ("pictureInPictureEnabled"in f)
  12210. return f.exitPictureInPicture()
  12211. }
  12212. ,
  12213. e.showBarrage = function(e) {
  12214. var t = this.getChild("BarrageLayer");
  12215. t && t.showBarrage(e)
  12216. }
  12217. ,
  12218. e.barrageToggle = function(e) {
  12219. var t = this.getChild("BarrageLayer");
  12220. if (t)
  12221. return !0 === e ? t.show() : !1 === e && t.hide(),
  12222. !t.hasClass("vjs-hidden")
  12223. }
  12224. ,
  12225. e.handleKeyDown = function(e) {
  12226. var t = this.options_.userActions;
  12227. if (t && t.hotkeys) {
  12228. !function(e) {
  12229. var t = e.tagName.toLowerCase();
  12230. if (e.isContentEditable)
  12231. return !0;
  12232. if ("input" === t)
  12233. return -1 === ["button", "checkbox", "hidden", "radio", "reset", "submit"].indexOf(e.type);
  12234. return -1 !== ["textarea"].indexOf(t)
  12235. }(this.el_.ownerDocument.activeElement) && ("function" == typeof t.hotkeys ? t.hotkeys.call(this, e) : this.handleHotkeys(e))
  12236. }
  12237. }
  12238. ,
  12239. e.handleHotkeys = function(e) {
  12240. var t = this.options_.userActions ? this.options_.userActions.hotkeys : {}
  12241. , n = t.stepForward
  12242. , i = void 0 === n ? function(e) {
  12243. return Mt.isEventKey(e, "right")
  12244. }
  12245. : n
  12246. , r = t.stepBack
  12247. , s = void 0 === r ? function(e) {
  12248. return Mt.isEventKey(e, "left")
  12249. }
  12250. : r
  12251. , a = t.fullscreenKey
  12252. , o = void 0 === a ? function(e) {
  12253. return Mt.isEventKey(e, "f")
  12254. }
  12255. : a
  12256. , l = t.muteKey
  12257. , u = void 0 === l ? function(e) {
  12258. return Mt.isEventKey(e, "m")
  12259. }
  12260. : l
  12261. , c = t.playPauseKey
  12262. , h = void 0 === c ? function(e) {
  12263. return Mt.isEventKey(e, "k") || Mt.isEventKey(e, "Space")
  12264. }
  12265. : c;
  12266. if (o.call(this, e)) {
  12267. e.preventDefault(),
  12268. e.stopPropagation();
  12269. var d = He.getComponent("FullscreenToggle");
  12270. !1 !== f[this.fsApi_.fullscreenEnabled] && d.prototype.handleClick.call(this, e)
  12271. } else if (u.call(this, e)) {
  12272. e.preventDefault(),
  12273. e.stopPropagation(),
  12274. He.getComponent("MuteToggle").prototype.handleClick.call(this, e)
  12275. } else if (h.call(this, e)) {
  12276. if (e.preventDefault(),
  12277. e.stopPropagation(),
  12278. this.ads && !1 === this.ads.isInAdMode())
  12279. He.getComponent("PlayToggle").prototype.handleClick.call(this, e)
  12280. } else
  12281. s.call(this, e) ? (e.preventDefault(),
  12282. e.stopPropagation(),
  12283. this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() - 20)) : i.call(this, e) && (e.preventDefault(),
  12284. e.stopPropagation(),
  12285. this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() + 20))
  12286. }
  12287. ,
  12288. e.canPlayType = function(e) {
  12289. for (var t, n = 0, i = this.options_.techOrder; n < i.length; n++) {
  12290. var r = i[n]
  12291. , s = pi.getTech(r);
  12292. if (s = s || He.getComponent(r)) {
  12293. if (s.isSupported() && (t = s.canPlayType(e)))
  12294. return t
  12295. } else
  12296. m.error('The "' + r + '" tech is undefined. Skipped browser support check for that tech.')
  12297. }
  12298. return ""
  12299. }
  12300. ,
  12301. e.selectSource = function(e) {
  12302. function t(e, n, i) {
  12303. var r;
  12304. return e.some(function(t) {
  12305. return n.some(function(e) {
  12306. if (r = i(t, e))
  12307. return !0
  12308. })
  12309. }),
  12310. r
  12311. }
  12312. function n(e, t) {
  12313. var n = e[0];
  12314. if (e[1].canPlaySource(t, r.options_[n.toLowerCase()]))
  12315. return {
  12316. source: t,
  12317. tech: n
  12318. }
  12319. }
  12320. var i, r = this, s = this.options_.techOrder.map(function(e) {
  12321. return [e, pi.getTech(e)]
  12322. }).filter(function(e) {
  12323. var t = e[0]
  12324. , n = e[1];
  12325. return n ? n.isSupported() : (m.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'),
  12326. !1)
  12327. });
  12328. return (this.options_.sourceOrder ? t(e, s, (i = n,
  12329. function(e, t) {
  12330. return i(t, e)
  12331. }
  12332. )) : t(s, e, n)) || !1
  12333. }
  12334. ,
  12335. e.src = function(e) {
  12336. var n = this;
  12337. if ("undefined" == typeof e)
  12338. return this.cache_.src || "";
  12339. var i = function t(e) {
  12340. if (Array.isArray(e)) {
  12341. var n = [];
  12342. e.forEach(function(e) {
  12343. e = t(e),
  12344. Array.isArray(e) ? n = n.concat(e) : l(e) && n.push(e)
  12345. }),
  12346. e = n
  12347. } else
  12348. e = "string" == typeof e && e.trim() ? [wi({
  12349. src: e
  12350. })] : l(e) && "string" == typeof e.src && e.src && e.src.trim() ? [wi(e)] : [];
  12351. return e
  12352. }(e);
  12353. i.length ? (this.changingSrc_ = !0,
  12354. this.cache_.sources = i,
  12355. this.updateSourceCaches_(i[0]),
  12356. yi(this, i[0], function(e, t) {
  12357. if (n.middleware_ = t,
  12358. n.cache_.sources = i,
  12359. n.updateSourceCaches_(e),
  12360. n.src_(e))
  12361. return 1 < i.length ? n.src(i.slice(1)) : (n.changingSrc_ = !1,
  12362. n.setTimeout(function() {
  12363. this.error({
  12364. code: 4,
  12365. message: this.localize(this.options_.notSupportedMessage)
  12366. })
  12367. }, 0),
  12368. void n.triggerReady());
  12369. !function(e, t) {
  12370. e.forEach(function(e) {
  12371. return e.setTech && e.setTech(t)
  12372. })
  12373. }(t, n.tech_)
  12374. })) : this.setTimeout(function() {
  12375. this.error({
  12376. code: 4,
  12377. message: this.localize(this.options_.notSupportedMessage)
  12378. })
  12379. }, 0)
  12380. }
  12381. ,
  12382. e.src_ = function(e) {
  12383. var t = this
  12384. , n = this.selectSource([e]);
  12385. return !n || (function(e, t) {
  12386. return Re(e) === Re(t)
  12387. }(n.tech, this.techName_) ? this.ready(function() {
  12388. this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", e) : this.techCall_("src", e.src),
  12389. this.changingSrc_ = !1
  12390. }, !0) : (this.changingSrc_ = !0,
  12391. this.loadTech_(n.tech, n.source),
  12392. this.tech_.ready(function() {
  12393. t.changingSrc_ = !1
  12394. })),
  12395. !1)
  12396. }
  12397. ,
  12398. e.load = function() {
  12399. this.techCall_("load")
  12400. }
  12401. ,
  12402. e.reset = function() {
  12403. var e = this
  12404. , t = this.options_.Promise || p.Promise;
  12405. this.paused() || !t ? this.doReset_() : At(this.play().then(function() {
  12406. return e.doReset_()
  12407. }))
  12408. }
  12409. ,
  12410. e.doReset_ = function() {
  12411. this.tech_ && this.tech_.clearTracks("text"),
  12412. this.resetCache_(),
  12413. this.poster(""),
  12414. this.loadTech_(this.options_.techOrder[0], null),
  12415. this.techCall_("reset"),
  12416. this.resetControlBarUI_(),
  12417. Me(this) && this.trigger("playerreset")
  12418. }
  12419. ,
  12420. e.resetControlBarUI_ = function() {
  12421. this.resetProgressBar_(),
  12422. this.resetPlaybackRate_(),
  12423. this.resetPlaybackQuality_(),
  12424. this.resetVolumeBar_()
  12425. }
  12426. ,
  12427. e.resetProgressBar_ = function() {
  12428. this.currentTime(0);
  12429. var e = this.controlBar
  12430. , t = e.durationDisplay
  12431. , n = e.remainingTimeDisplay;
  12432. t && t.updateContent(),
  12433. n && n.updateContent()
  12434. }
  12435. ,
  12436. e.resetPlaybackRate_ = function() {
  12437. this.playbackRate(this.defaultPlaybackRate()),
  12438. this.handleTechRateChange_()
  12439. }
  12440. ,
  12441. e.resetPlaybackQuality_ = function() {
  12442. this.playbackQuality(this.defaultPlaybackQuality()),
  12443. this.handleTechQualityChange_()
  12444. }
  12445. ,
  12446. e.resetVolumeBar_ = function() {
  12447. this.volume(1),
  12448. this.trigger("volumechange")
  12449. }
  12450. ,
  12451. e.currentSources = function() {
  12452. var e = this.currentSource()
  12453. , t = [];
  12454. return 0 !== Object.keys(e).length && t.push(e),
  12455. this.cache_.sources || t
  12456. }
  12457. ,
  12458. e.currentSource = function() {
  12459. return this.cache_.source || {}
  12460. }
  12461. ,
  12462. e.currentSrc = function() {
  12463. return this.currentSource() && this.currentSource().src || ""
  12464. }
  12465. ,
  12466. e.currentType = function() {
  12467. return this.currentSource() && this.currentSource().type || ""
  12468. }
  12469. ,
  12470. e.preload = function(e) {
  12471. return void 0 !== e ? (this.techCall_("setPreload", e),
  12472. void (this.options_.preload = e)) : this.techGet_("preload")
  12473. }
  12474. ,
  12475. e.autoplay = function(e) {
  12476. if (void 0 === e)
  12477. return this.options_.autoplay || !1;
  12478. var t;
  12479. "string" == typeof e && /(any|play|muted)/.test(e) ? (this.options_.autoplay = e,
  12480. this.manualAutoplay_(e),
  12481. t = !1) : this.options_.autoplay = !!e,
  12482. t = "undefined" == typeof t ? this.options_.autoplay : t,
  12483. this.tech_ && this.techCall_("setAutoplay", t)
  12484. }
  12485. ,
  12486. e.playsinline = function(e) {
  12487. return void 0 !== e ? (this.techCall_("setPlaysinline", e),
  12488. this.options_.playsinline = e,
  12489. this) : this.techGet_("playsinline")
  12490. }
  12491. ,
  12492. e.loop = function(e) {
  12493. return void 0 !== e && (this.techCall_("setLoop", e),
  12494. this.options_.loop !== e && (this.options_.loop = e,
  12495. this.trigger("loopchange"))),
  12496. this.techGet_("loop")
  12497. }
  12498. ,
  12499. e.loop2 = function(e) {
  12500. return void 0 !== e && this.options_.loop2 !== e && (this.options_.loop2 = e,
  12501. this.trigger("loop2change")),
  12502. this.options_.loop2
  12503. }
  12504. ,
  12505. e.autoNext = function(e) {
  12506. return void 0 !== e && this.options_.autoNext !== e && (this.options_.autoNext = e,
  12507. this.trigger("autonextchange")),
  12508. this.options_.autoNext
  12509. }
  12510. ,
  12511. e.poster = function(e) {
  12512. if (void 0 === e)
  12513. return this.poster_;
  12514. (e = e || "") !== this.poster_ && (this.poster_ = e,
  12515. this.techCall_("setPoster", e),
  12516. this.isPosterFromTech_ = !1,
  12517. this.trigger("posterchange"))
  12518. }
  12519. ,
  12520. e.handleTechPosterChange_ = function() {
  12521. if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
  12522. var e = this.tech_.poster() || "";
  12523. e !== this.poster_ && (this.poster_ = e,
  12524. this.isPosterFromTech_ = !0,
  12525. this.trigger("posterchange"))
  12526. }
  12527. }
  12528. ,
  12529. e.controls = function(e) {
  12530. if (void 0 === e)
  12531. return !!this.controls_;
  12532. e = !!e,
  12533. this.controls_ !== e && (this.controls_ = e,
  12534. this.usingNativeControls() && this.techCall_("setControls", e),
  12535. this.controls_ ? (this.removeClass("vjs-controls-disabled"),
  12536. this.addClass("vjs-controls-enabled"),
  12537. this.trigger("controlsenabled"),
  12538. this.usingNativeControls() || this.addTechControlsListeners_()) : (this.removeClass("vjs-controls-enabled"),
  12539. this.addClass("vjs-controls-disabled"),
  12540. this.trigger("controlsdisabled"),
  12541. this.usingNativeControls() || this.removeTechControlsListeners_()))
  12542. }
  12543. ,
  12544. e.miniPlayer = function(e) {
  12545. if (void 0 === e)
  12546. return !!this.mini_;
  12547. e = !!e,
  12548. this.mini_ !== e && (this.mini_ = e,
  12549. this.mini_ ? (this.addClass("mini-controls"),
  12550. this.controls(!1)) : (this.removeClass("mini-controls"),
  12551. this.controls(!0)))
  12552. }
  12553. ,
  12554. e.usingNativeControls = function(e) {
  12555. if (void 0 === e)
  12556. return !!this.usingNativeControls_;
  12557. e = !!e,
  12558. this.usingNativeControls_ !== e && (this.usingNativeControls_ = e,
  12559. this.usingNativeControls_ ? (this.addClass("vjs-using-native-controls"),
  12560. this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"),
  12561. this.trigger("usingcustomcontrols")))
  12562. }
  12563. ,
  12564. e.error = function(e) {
  12565. if (void 0 === e)
  12566. return this.error_ || null;
  12567. if (this.options_.suppressNotSupportedError && e && 4 === e.code) {
  12568. var t = function() {
  12569. this.error(e)
  12570. };
  12571. return this.options_.suppressNotSupportedError = !1,
  12572. this.any(["click", "touchstart"], t),
  12573. void this.one("loadstart", function() {
  12574. this.off(["click", "touchstart"], t)
  12575. })
  12576. }
  12577. if (null === e)
  12578. return this.error_ = e,
  12579. this.removeClass("vjs-error"),
  12580. void (this.errorDisplay && this.errorDisplay.close());
  12581. this.error_ = new Et(e),
  12582. this.addClass("vjs-error"),
  12583. m.error("(CODE:" + this.error_.code + " " + Et.errorTypes[this.error_.code] + ")", this.error_.message, this.error_),
  12584. this.trigger("error", this.error_)
  12585. }
  12586. ,
  12587. e.reportUserActivity = function(e) {
  12588. this.userActivity_ = !0
  12589. }
  12590. ,
  12591. e.userActive = function(e) {
  12592. if (void 0 === e)
  12593. return this.userActive_;
  12594. if ((e = !!e) !== this.userActive_) {
  12595. if (this.userActive_ = e,
  12596. this.userActive_)
  12597. return this.userActivity_ = !0,
  12598. this.removeClass("vjs-user-inactive"),
  12599. this.addClass("vjs-user-active"),
  12600. void this.trigger("useractive");
  12601. this.tech_ && this.tech_.one("mousemove", function(e) {
  12602. e.stopPropagation(),
  12603. e.preventDefault()
  12604. }),
  12605. this.userActivity_ = !1,
  12606. this.removeClass("vjs-user-active"),
  12607. this.addClass("vjs-user-inactive"),
  12608. this.trigger("userinactive")
  12609. }
  12610. }
  12611. ,
  12612. e.listenForUserActivity_ = function() {
  12613. function e(e) {
  12614. r(),
  12615. this.clearInterval(t)
  12616. }
  12617. var t, n, i, r = Te(this, this.reportUserActivity);
  12618. this.on("mousedown", function() {
  12619. r(),
  12620. this.clearInterval(t),
  12621. t = this.setInterval(r, 250)
  12622. }),
  12623. this.on("mousemove", function(e) {
  12624. e.screenX === n && e.screenY === i || (n = e.screenX,
  12625. i = e.screenY,
  12626. r())
  12627. }),
  12628. this.on("mouseup", e),
  12629. this.on("mouseleave", e);
  12630. var s, a = this.getChild("controlBar");
  12631. !a || ht || Je || (a.on("mouseenter", function(e) {
  12632. this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout,
  12633. this.player().options_.inactivityTimeout = 0
  12634. }),
  12635. a.on("mouseleave", function(e) {
  12636. this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout
  12637. }),
  12638. G(a.el())),
  12639. this.on("keydown", r),
  12640. this.on("keyup", r),
  12641. this.setInterval(function() {
  12642. if (this.userActivity_) {
  12643. this.userActivity_ = !1,
  12644. this.userActive(!0),
  12645. this.clearTimeout(s);
  12646. var e = this.options_.inactivityTimeout;
  12647. e <= 0 || (s = this.setTimeout(function() {
  12648. this.userActivity_ || this.userActive(!1)
  12649. }, e))
  12650. }
  12651. }, 250)
  12652. }
  12653. ,
  12654. e.playbackRate = function(e) {
  12655. if (void 0 === e)
  12656. return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1;
  12657. this.techCall_("setPlaybackRate", e)
  12658. }
  12659. ,
  12660. e.playbackQuality = function(e) {
  12661. if (void 0 === e)
  12662. return this.tech_ && this.tech_.featuresPlaybackQuality ? this.cache_.lastPlaybackQuality || this.techGet_("playbackQuality") : 1;
  12663. this.techCall_("setPlaybackQuality", e)
  12664. }
  12665. ,
  12666. e.clearPlaybackQualityLevel = function() {
  12667. this.options_.playbackQualities.length = 0,
  12668. this.options_.playbackQualityIndex.length = 0
  12669. }
  12670. ,
  12671. e.addPlaybackQualityLevel = function(e, t) {
  12672. var n;
  12673. "EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
  12674. 1 === this.player_.options_.logicIndex ? (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
  12675. n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
  12676. n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
  12677. n = Na[3]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
  12678. n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
  12679. n = Na[7]) : e.enabled = !1,
  12680. void 0 !== n ? (this.options_.playbackQualities.push(n),
  12681. this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
  12682. this.error(null))) : 0 === this.player_.options_.logicIndex && (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
  12683. n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
  12684. n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
  12685. n = Na[3]) : e.bitrate <= Oa[5] ? (e.enabled = !0,
  12686. n = Na[4]) : e.bitrate <= Oa[6] ? (e.enabled = !0,
  12687. n = Na[5]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
  12688. n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
  12689. n = Na[7]) : e.enabled = !1,
  12690. void 0 !== n ? (this.options_.playbackQualities.push(n),
  12691. this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
  12692. this.error(null)))
  12693. }
  12694. ,
  12695. e.initPlaybackQualityLevelDirect = function() {
  12696. if (this.options().debug && this.log("[player] initPlaybackQualityLevelDirect() "),
  12697. !!this.options_.qualityPermitMode) {
  12698. "EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
  12699. this.options().debug && this.log(this.options_.playbackQualities),
  12700. this.clearPlaybackQualityLevel();
  12701. for (var e = this.options_.customQualityList, t = this.options_.customDefaultQuality, n = 0; n < e.length; n++)
  12702. this.options_.playbackQualities.push(e[n].label),
  12703. this.options_.playbackQualityIndex.push(e[n].masterIndex),
  12704. e[n].label === t && e[n].enabled ? this.qualityLevels()[n].enabled = !0 : this.qualityLevels()[n].enabled = !1;
  12705. var i = this.options_.playbackQualities
  12706. , r = this.options_.playbackQualityIndex[i.lastIndexOf(t)];
  12707. this.options().debug && this.log("qualityLevels().selectedIndex:" + this.qualityLevels().selectedIndex),
  12708. this.trigger("qualitychange"),
  12709. this.trigger({
  12710. level: this.player_.qualityLevels()[r],
  12711. type: "changeHLSP2P"
  12712. }),
  12713. this.mainContentQuality_ = t
  12714. }
  12715. }
  12716. ,
  12717. e.getMainContentQuality = function() {
  12718. return this.mainContentQuality_
  12719. }
  12720. ,
  12721. e.getMainContentQuality = function() {
  12722. return this.mainContentQuality_
  12723. }
  12724. ,
  12725. e.durationChange_ = function() {
  12726. this.log("durationChange_"),
  12727. this.log(this.ads.isInAdMode())
  12728. }
  12729. ,
  12730. e.handleADSEnded_ = function() {
  12731. this.log("handleADSEnded_"),
  12732. this.log(this.ads.isInAdMode())
  12733. }
  12734. ,
  12735. e.switchQuality = function(e, t) {
  12736. this.options().debug && this.log("[player]switchQuality()" + this.getCurentQuality() + " switchQuality to:" + e);
  12737. var n = this.options_.playbackQualities
  12738. , i = this.options_.playbackQualityIndex[n.indexOf(e)]
  12739. , r = this.player_.qualityLevels().length;
  12740. this.options().debug && this.log("[player] switchQuality to index:" + i);
  12741. for (var s = 0; s < r; s++)
  12742. i === s ? (this.player_.qualityLevels()[s].enabled = !0,
  12743. this.options().debug && this.log("[player] switchQuality() currentIndexInlevels i:" + s),
  12744. this.trigger({
  12745. level: this.player_.qualityLevels()[s],
  12746. type: "changeHLSP2P"
  12747. })) : this.player_.qualityLevels()[s].enabled = !1,
  12748. this.options().debug && this.log("[player]switchQuality() i:" + s + ":" + this.player_.qualityLevels()[s].enabled);
  12749. if (this.options().debug && this.log("enableQualityLock:" + this.options().enableQualityLock),
  12750. this.options().enableQualityLock || "undefined" == typeof this.options().enableQualityLock) {
  12751. if (!0 === t)
  12752. return;
  12753. this.options().debug && this.log("[player] hls-select-index-change :" + Na.indexOf(e)),
  12754. this.trigger({
  12755. type: "hls-select-index-change",
  12756. data: Na.indexOf(e)
  12757. })
  12758. }
  12759. this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
  12760. lastQuality: e,
  12761. lastVolume: this.volume()
  12762. })
  12763. }
  12764. ,
  12765. e.switchQualityDirect = function(e) {
  12766. this.options().debug && this.log("[player]switchQualityDirect()" + this.getCurentQualityLabel() + " switchQuality to:" + e);
  12767. var t = this.options_.playbackQualities
  12768. , n = this.options_.playbackQualityIndex[t.lastIndexOf(e)];
  12769. this.options().debug && this.log("[player] switchQualityDirect() to lastLevelIndex:" + this.qualityLevels().selectedIndex + "to false"),
  12770. this.qualityLevels()[this.qualityLevels().selectedIndex].enabled = !1,
  12771. this.options().debug && this.log("[player] switchQualityDirect() to newLevelIndex:" + n + "to true"),
  12772. this.qualityLevels()[n].enabled = !0,
  12773. this.mainContentQuality_ = e,
  12774. this.trigger({
  12775. level: this.player_.qualityLevels()[n],
  12776. type: "changeHLSP2P"
  12777. }),
  12778. this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
  12779. lastQuality: e,
  12780. lastVolume: this.volume()
  12781. })
  12782. }
  12783. ,
  12784. e.getCurentQuality = function() {
  12785. return (this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities)[(this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex).lastIndexOf(this.qualityLevels().selectedIndex)]
  12786. }
  12787. ,
  12788. e.getCurentQualityLabel = function() {
  12789. return this.options_.playbackQualities[this.qualityLevels().selectedIndex]
  12790. }
  12791. ,
  12792. e.selectedQuality = function(e) {
  12793. null !== (this.selectedQuality_ = e) && this.selectedQuality_ !== e && (this.selectedQuality_ = e,
  12794. this.trigger({
  12795. type: "qualityselected",
  12796. quality: e
  12797. }))
  12798. }
  12799. ,
  12800. e.getSelectedQuality = function() {
  12801. return this.selectedQuality_
  12802. }
  12803. ,
  12804. e.getCurentBitrate = function() {
  12805. var e = (this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex).indexOf(this.qualityLevels().selectedIndex);
  12806. return this.player_.qualityLevels()[e] ? this.player_.qualityLevels()[e].bitrate : null
  12807. }
  12808. ,
  12809. e.getQualityLevels = function() {
  12810. return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
  12811. }
  12812. ,
  12813. e.defaultPlaybackRate = function(e) {
  12814. return void 0 !== e ? this.techCall_("setDefaultPlaybackRate", e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1
  12815. }
  12816. ,
  12817. e.defaultPlaybackQuality = function(e) {
  12818. return void 0 !== e ? this.techCall_("setDefaultPlaybackQuality", e) : this.tech_ && this.tech_.featuresPlaybackQuality ? this.techGet_("defaultPlaybackQuality") : 1
  12819. }
  12820. ,
  12821. e.changeAudioMode = function(e) {
  12822. this.trigger({
  12823. type: "changeAudioMode",
  12824. audioMode: e
  12825. })
  12826. }
  12827. ,
  12828. e.isAudio = function(e) {
  12829. if (void 0 === e)
  12830. return !!this.isAudio_;
  12831. this.isAudio_ = !!e
  12832. }
  12833. ,
  12834. e.addTextTrack = function(e, t, n) {
  12835. if (this.tech_)
  12836. return this.tech_.addTextTrack(e, t, n)
  12837. }
  12838. ,
  12839. e.addRemoteTextTrack = function(e, t) {
  12840. if (this.tech_)
  12841. return this.tech_.addRemoteTextTrack(e, t)
  12842. }
  12843. ,
  12844. e.removeRemoteTextTrack = function(e) {
  12845. void 0 === e && (e = {});
  12846. var t = e.track;
  12847. if (t = t || e,
  12848. this.tech_)
  12849. return this.tech_.removeRemoteTextTrack(t)
  12850. }
  12851. ,
  12852. e.getVideoPlaybackQuality = function() {
  12853. return this.techGet_("getVideoPlaybackQuality")
  12854. }
  12855. ,
  12856. e.videoWidth = function() {
  12857. return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0
  12858. }
  12859. ,
  12860. e.videoHeight = function() {
  12861. return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0
  12862. }
  12863. ,
  12864. e.language = function(e) {
  12865. if (void 0 === e)
  12866. return this.language_;
  12867. this.language_ = String(e).toLowerCase()
  12868. }
  12869. ,
  12870. e.languages = function() {
  12871. return Fe(d.prototype.options_.languages, this.languages_)
  12872. }
  12873. ,
  12874. e.toJSON = function() {
  12875. var e = Fe(this.options_)
  12876. , t = e.tracks;
  12877. e.tracks = [];
  12878. for (var n = 0; n < t.length; n++) {
  12879. var i = t[n];
  12880. (i = Fe(i)).player = void 0,
  12881. e.tracks[n] = i
  12882. }
  12883. return e
  12884. }
  12885. ,
  12886. e.createModal = function(e, t) {
  12887. var n = this;
  12888. (t = t || {}).content = e || "";
  12889. var i = new Ot(this,t);
  12890. return this.addChild(i),
  12891. i.on("dispose", function() {
  12892. n.removeChild(i)
  12893. }),
  12894. i.open(),
  12895. i
  12896. }
  12897. ,
  12898. e.updateCurrentBreakpoint_ = function() {
  12899. if (this.responsive())
  12900. for (var e = this.currentBreakpoint(), t = this.currentWidth(), n = 0; n < Ia.length; n++) {
  12901. var i = Ia[n];
  12902. if (t <= this.breakpoints_[i]) {
  12903. if (e === i)
  12904. return;
  12905. e && this.removeClass(Ma[e]),
  12906. this.addClass(Ma[i]),
  12907. this.breakpoint_ = i;
  12908. break
  12909. }
  12910. }
  12911. }
  12912. ,
  12913. e.removeCurrentBreakpoint_ = function() {
  12914. var e = this.currentBreakpointClass();
  12915. this.breakpoint_ = "",
  12916. e && this.removeClass(e)
  12917. }
  12918. ,
  12919. e.breakpoints = function(e) {
  12920. return void 0 === e || (this.breakpoint_ = "",
  12921. this.breakpoints_ = b({}, ja, e),
  12922. this.updateCurrentBreakpoint_()),
  12923. b(this.breakpoints_)
  12924. }
  12925. ,
  12926. e.responsive = function(e) {
  12927. return void 0 === e ? this.responsive_ : (e = Boolean(e)) !== this.responsive_ ? ((this.responsive_ = e) ? (this.on("playerresize", this.updateCurrentBreakpoint_),
  12928. this.updateCurrentBreakpoint_()) : (this.off("playerresize", this.updateCurrentBreakpoint_),
  12929. this.removeCurrentBreakpoint_()),
  12930. e) : void 0
  12931. }
  12932. ,
  12933. e.currentBreakpoint = function() {
  12934. return this.breakpoint_
  12935. }
  12936. ,
  12937. e.currentBreakpointClass = function() {
  12938. return Ma[this.breakpoint_] || ""
  12939. }
  12940. ,
  12941. e.loadMedia = function(e, t) {
  12942. var n = this;
  12943. if (e && "object" == typeof e) {
  12944. this.reset(),
  12945. this.cache_.media = Fe(e);
  12946. var i = this.cache_.media
  12947. , r = i.artwork
  12948. , s = i.poster
  12949. , a = i.src
  12950. , o = i.textTracks;
  12951. !r && s && (this.cache_.media.artwork = [{
  12952. src: s,
  12953. type: Ei(s)
  12954. }]),
  12955. a && this.src(a),
  12956. s && this.poster(s),
  12957. Array.isArray(o) && o.forEach(function(e) {
  12958. return n.addRemoteTextTrack(e, !1)
  12959. }),
  12960. this.ready(t)
  12961. }
  12962. }
  12963. ,
  12964. e.getMedia = function() {
  12965. if (this.cache_.media)
  12966. return Fe(this.cache_.media);
  12967. var e = this.poster()
  12968. , t = {
  12969. src: this.currentSources(),
  12970. textTracks: Array.prototype.map.call(this.remoteTextTracks(), function(e) {
  12971. return {
  12972. kind: e.kind,
  12973. label: e.label,
  12974. language: e.language,
  12975. src: e.src
  12976. }
  12977. })
  12978. };
  12979. return e && (t.poster = e,
  12980. t.artwork = [{
  12981. src: t.poster,
  12982. type: Ei(t.poster)
  12983. }]),
  12984. t
  12985. }
  12986. ,
  12987. e.setAdsLabel = function(e, t, n) {
  12988. void 0 === e ? (this.getChild("adsOverLay").hide(),
  12989. this.changingToMainContent_ = !0) : (this.changingToMainContent_ = !1,
  12990. this.getChild("adsOverLay").show(),
  12991. this.getChild("adsOverLay").updateTextNode(e, t, n))
  12992. }
  12993. ,
  12994. e.changingToMainContent = function() {
  12995. return this.changingToMainContent_
  12996. }
  12997. ,
  12998. e.getSavedPosition = function(e) {
  12999. var t = 0
  13000. , n = cr.get("h5vodLastPostion")
  13001. , i = (new Date).getTime() / 1e3;
  13002. return void 0 !== n && e === n.videoid && n.timestamp < i && n.timestamp + 604800 > i && void 0 !== n.position && (t = n.position),
  13003. t
  13004. }
  13005. ,
  13006. e.saveVideoPosition = function(e) {
  13007. if (!this.ads || !0 !== this.ads.isInAdMode()) {
  13008. var t = this.currentTime();
  13009. if (!(t < 5))
  13010. if (t < 30 || t + 30 > this.duration())
  13011. cr.remove("h5vodLastPostion");
  13012. else {
  13013. var n = (new Date).getTime() / 1e3;
  13014. cr.set("h5vodLastPostion", {
  13015. videoid: e,
  13016. timestamp: n,
  13017. position: t
  13018. })
  13019. }
  13020. }
  13021. }
  13022. ,
  13023. d.getTagSettings = function(e) {
  13024. var t = {
  13025. sources: [],
  13026. tracks: []
  13027. }
  13028. , n = O(e)
  13029. , i = n["data-setup"];
  13030. if (P(e, "vjs-fill") && (n.fill = !0),
  13031. P(e, "vjs-fluid") && (n.fluid = !0),
  13032. null !== i) {
  13033. var r = wt(i || "{}")
  13034. , s = r[0]
  13035. , a = r[1];
  13036. s && m.error(s),
  13037. b(n, a)
  13038. }
  13039. if (b(t, n),
  13040. e.hasChildNodes())
  13041. for (var o = e.childNodes, l = 0, u = o.length; l < u; l++) {
  13042. var c = o[l]
  13043. , h = c.nodeName.toLowerCase();
  13044. "source" === h ? t.sources.push(O(c)) : "track" === h && t.tracks.push(O(c))
  13045. }
  13046. return t
  13047. }
  13048. ,
  13049. e.flexNotSupported_ = function() {
  13050. var e = f.createElement("i");
  13051. return !("flexBasis"in e.style || "webkitFlexBasis"in e.style || "mozFlexBasis"in e.style || "msFlexBasis"in e.style || "msFlexOrder"in e.style)
  13052. }
  13053. ,
  13054. d
  13055. }(He);
  13056. Dn.names.forEach(function(e) {
  13057. var t = Dn[e];
  13058. Ra.prototype[t.getterName] = function() {
  13059. return this.tech_ ? this.tech_[t.getterName]() : (this[t.privateName] = this[t.privateName] || new t.ListClass,
  13060. this[t.privateName])
  13061. }
  13062. }),
  13063. Ra.prototype.crossorigin = Ra.prototype.crossOrigin,
  13064. Ra.players = {};
  13065. var Fa = p.navigator;
  13066. Ra.prototype.options_ = {
  13067. techOrder: pi.defaultTechOrder_,
  13068. html5: {},
  13069. flash: {},
  13070. inactivityTimeout: 1e3,
  13071. playbackRates: [],
  13072. liveui: !1,
  13073. children: ["mediaLoader", "adsOverLay", "pauseAdOverLay", "bannerAdOverLay", "posterImage", "VipSkipAdTip", "barrageLayer", "chooseVideoPanel", "loadingSpinner", "switchBezel", "playToggleMini", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "contextMenuButton", "resizeManager"],
  13074. language: Fa && (Fa.languages && Fa.languages[0] || Fa.userLanguage || Fa.language) || "en",
  13075. languages: {},
  13076. notSupportedMessage: "No compatible source was found for this media.",
  13077. fullscreen: {
  13078. options: {
  13079. navigationUI: "hide"
  13080. }
  13081. },
  13082. breakpoints: {},
  13083. responsive: !1
  13084. },
  13085. "pictureInPictureEnabled"in f && Ra.prototype.options_.children.push("pictureInPictureToggle"),
  13086. ["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function(e) {
  13087. Ra.prototype[e] = function() {
  13088. return this.techGet_(e)
  13089. }
  13090. }),
  13091. Pa.forEach(function(e) {
  13092. Ra.prototype["handleTech" + Re(e) + "_"] = function() {
  13093. return this.trigger(e)
  13094. }
  13095. }),
  13096. He.registerComponent("Player", Ra);
  13097. var Ha = n(function(n) {
  13098. function i(e, t) {
  13099. return n.exports = i = Object.setPrototypeOf || function(e, t) {
  13100. return e.__proto__ = t,
  13101. e
  13102. }
  13103. ,
  13104. i(e, t)
  13105. }
  13106. n.exports = i
  13107. });
  13108. function Va(e) {
  13109. return Ya.hasOwnProperty(e)
  13110. }
  13111. function Qa(e) {
  13112. return Va(e) ? Ya[e] : void 0
  13113. }
  13114. function Ua(e, t) {
  13115. e[Ga] = e[Ga] || {},
  13116. e[Ga][t] = !0
  13117. }
  13118. function qa(e, t, n) {
  13119. var i = (n ? "before" : "") + "pluginsetup";
  13120. e.trigger(i, t),
  13121. e.trigger(i + ":" + t.name, t)
  13122. }
  13123. function za(r, s) {
  13124. return s.prototype.name = r,
  13125. function() {
  13126. qa(this, {
  13127. name: r,
  13128. plugin: s,
  13129. instance: null
  13130. }, !0);
  13131. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  13132. t[n] = arguments[n];
  13133. var i = Ka(s, [this].concat(t));
  13134. return this[r] = function() {
  13135. return i
  13136. }
  13137. ,
  13138. qa(this, i.getEventHash()),
  13139. i
  13140. }
  13141. }
  13142. var Wa = function() {
  13143. if ("undefined" == typeof Reflect || !Reflect.construct)
  13144. return !1;
  13145. if (Reflect.construct.sham)
  13146. return !1;
  13147. if ("function" == typeof Proxy)
  13148. return !0;
  13149. try {
  13150. return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})),
  13151. !0
  13152. } catch (e) {
  13153. return !1
  13154. }
  13155. }
  13156. , Ka = n(function(i) {
  13157. function r(e, t, n) {
  13158. return Wa() ? i.exports = r = Reflect.construct : i.exports = r = function(e, t, n) {
  13159. var i = [null];
  13160. i.push.apply(i, t);
  13161. var r = new (Function.bind.apply(e, i));
  13162. return n && Ha(r, n.prototype),
  13163. r
  13164. }
  13165. ,
  13166. r.apply(null, arguments)
  13167. }
  13168. i.exports = r
  13169. })
  13170. , Xa = "plugin"
  13171. , Ga = "activePlugins_"
  13172. , Ya = {}
  13173. , $a = function() {
  13174. function n(e) {
  13175. if (this.constructor === n)
  13176. throw new Error("Plugin must be sub-classed; not directly instantiated.");
  13177. this.player = e,
  13178. Oe(this),
  13179. delete this.trigger,
  13180. De(this, this.constructor.defaultState),
  13181. Ua(e, this.name),
  13182. this.dispose = Te(this, this.dispose),
  13183. e.on("dispose", this.dispose)
  13184. }
  13185. var e = n.prototype;
  13186. return e.version = function() {
  13187. return this.constructor.VERSION
  13188. }
  13189. ,
  13190. e.getEventHash = function(e) {
  13191. return void 0 === e && (e = {}),
  13192. e.name = this.name,
  13193. e.plugin = this.constructor,
  13194. e.instance = this,
  13195. e
  13196. }
  13197. ,
  13198. e.trigger = function(e, t) {
  13199. return void 0 === t && (t = {}),
  13200. me(this.eventBusEl_, e, this.getEventHash(t))
  13201. }
  13202. ,
  13203. e.handleStateChanged = function(e) {}
  13204. ,
  13205. e.dispose = function() {
  13206. var e = this.name
  13207. , t = this.player;
  13208. this.trigger("dispose"),
  13209. this.off(),
  13210. t.off("dispose", this.dispose),
  13211. t[Ga][e] = !1,
  13212. this.player = this.state = null,
  13213. t[e] = za(e, Ya[e])
  13214. }
  13215. ,
  13216. n.isBasic = function(e) {
  13217. var t = "string" == typeof e ? Qa(e) : e;
  13218. return "function" == typeof t && !n.prototype.isPrototypeOf(t.prototype)
  13219. }
  13220. ,
  13221. n.registerPlugin = function(e, t) {
  13222. if ("string" != typeof e)
  13223. throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + typeof e + ".");
  13224. if (Va(e))
  13225. m.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!');
  13226. else if (Ra.prototype.hasOwnProperty(e))
  13227. throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!');
  13228. if ("function" != typeof t)
  13229. throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + typeof t + ".");
  13230. return Ya[e] = t,
  13231. e !== Xa && (n.isBasic(t) ? Ra.prototype[e] = function(t, n) {
  13232. function i() {
  13233. qa(this, {
  13234. name: t,
  13235. plugin: n,
  13236. instance: null
  13237. }, !0);
  13238. var e = n.apply(this, arguments);
  13239. return Ua(this, t),
  13240. qa(this, {
  13241. name: t,
  13242. plugin: n,
  13243. instance: e
  13244. }),
  13245. e
  13246. }
  13247. return Object.keys(n).forEach(function(e) {
  13248. i[e] = n[e]
  13249. }),
  13250. i
  13251. }(e, t) : Ra.prototype[e] = za(e, t)),
  13252. t
  13253. }
  13254. ,
  13255. n.deregisterPlugin = function(e) {
  13256. if (e === Xa)
  13257. throw new Error("Cannot de-register base plugin.");
  13258. Va(e) && (delete Ya[e],
  13259. delete Ra.prototype[e])
  13260. }
  13261. ,
  13262. n.getPlugins = function(e) {
  13263. var n;
  13264. return void 0 === e && (e = Object.keys(Ya)),
  13265. e.forEach(function(e) {
  13266. var t = Qa(e);
  13267. t && ((n = n || {})[e] = t)
  13268. }),
  13269. n
  13270. }
  13271. ,
  13272. n.getPluginVersion = function(e) {
  13273. var t = Qa(e);
  13274. return t && t.VERSION || ""
  13275. }
  13276. ,
  13277. n
  13278. }();
  13279. $a.getPlugin = Qa,
  13280. $a.BASE_PLUGIN_NAME = Xa,
  13281. $a.registerPlugin(Xa, $a),
  13282. Ra.prototype.usingPlugin = function(e) {
  13283. return !!this[Ga] && !0 === this[Ga][e]
  13284. }
  13285. ,
  13286. Ra.prototype.hasPlugin = function(e) {
  13287. return !!Va(e)
  13288. }
  13289. ;
  13290. var Ja = function(e, t) {
  13291. if ("function" != typeof t && null !== t)
  13292. throw new TypeError("Super expression must either be null or a function");
  13293. e.prototype = Object.create(t && t.prototype, {
  13294. constructor: {
  13295. value: e,
  13296. writable: !0,
  13297. configurable: !0
  13298. }
  13299. }),
  13300. t && Ha(e, t)
  13301. };
  13302. /*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */
  13303. function Za() {
  13304. return (Za = Object.assign || function(e) {
  13305. for (var t = 1; t < arguments.length; t++) {
  13306. var n = arguments[t];
  13307. for (var i in n)
  13308. Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
  13309. }
  13310. return e
  13311. }
  13312. ).apply(this, arguments)
  13313. }
  13314. function eo(e, t) {
  13315. e.prototype = Object.create(t.prototype),
  13316. (e.prototype.constructor = e).__proto__ = t
  13317. }
  13318. function to(e) {
  13319. for (var t, n = e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')), i = {}, r = n.length; r--; )
  13320. "" !== n[r] && ((t = /([^=]*)=(.*)/.exec(n[r]).slice(1))[0] = t[0].replace(/^\s+|\s+$/g, ""),
  13321. t[1] = t[1].replace(/^\s+|\s+$/g, ""),
  13322. t[1] = t[1].replace(/^['"](.*)['"]$/g, "$1"),
  13323. i[t[0]] = t[1]);
  13324. return i
  13325. }
  13326. var no = function() {
  13327. function e() {
  13328. this.listeners = {}
  13329. }
  13330. var t = e.prototype;
  13331. return t.on = function(e, t) {
  13332. this.listeners[e] || (this.listeners[e] = []),
  13333. this.listeners[e].push(t)
  13334. }
  13335. ,
  13336. t.off = function(e, t) {
  13337. if (!this.listeners[e])
  13338. return !1;
  13339. var n = this.listeners[e].indexOf(t);
  13340. return this.listeners[e].splice(n, 1),
  13341. -1 < n
  13342. }
  13343. ,
  13344. t.trigger = function(e, t) {
  13345. var n, i, r, s = this.listeners[e];
  13346. if (s)
  13347. if (2 === arguments.length)
  13348. for (i = s.length,
  13349. n = 0; n < i; ++n)
  13350. s[n].call(this, t);
  13351. else
  13352. for (r = Array.prototype.slice.call(arguments, 1),
  13353. i = s.length,
  13354. n = 0; n < i; ++n)
  13355. s[n].apply(this, r)
  13356. }
  13357. ,
  13358. t.dispose = function() {
  13359. this.listeners = {}
  13360. }
  13361. ,
  13362. t.pipe = function(t) {
  13363. this.on("data", function(e) {
  13364. t.push(e)
  13365. })
  13366. }
  13367. ,
  13368. e
  13369. }()
  13370. , io = function(t) {
  13371. function e() {
  13372. var e;
  13373. return (e = t.call(this) || this).buffer = "",
  13374. e
  13375. }
  13376. return eo(e, t),
  13377. e.prototype.push = function(e) {
  13378. var t;
  13379. for (this.buffer += e,
  13380. t = this.buffer.indexOf("\n"); -1 < t; t = this.buffer.indexOf("\n"))
  13381. this.trigger("data", this.buffer.substring(0, t)),
  13382. this.buffer = this.buffer.substring(t + 1)
  13383. }
  13384. ,
  13385. e
  13386. }(no)
  13387. , ro = function(t) {
  13388. function e() {
  13389. var e;
  13390. return (e = t.call(this) || this).customParsers = [],
  13391. e.tagMappers = [],
  13392. e
  13393. }
  13394. eo(e, t);
  13395. var n = e.prototype;
  13396. return n.push = function(i) {
  13397. var l, u, c = this;
  13398. 0 !== (i = i.trim()).length && ("#" === i[0] ? this.tagMappers.reduce(function(e, t) {
  13399. var n = t(i);
  13400. return n === i ? e : e.concat([n])
  13401. }, [i]).forEach(function(e) {
  13402. for (var t = 0; t < c.customParsers.length; t++)
  13403. if (c.customParsers[t].call(c, e))
  13404. return;
  13405. if (0 === e.indexOf("#EXT"))
  13406. if (e = e.replace("\r", ""),
  13407. l = /^#EXTM3U/.exec(e))
  13408. c.trigger("data", {
  13409. type: "tag",
  13410. tagType: "m3u"
  13411. });
  13412. else {
  13413. if (l = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))
  13414. return u = {
  13415. type: "tag",
  13416. tagType: "inf"
  13417. },
  13418. l[1] && (u.duration = parseFloat(l[1])),
  13419. l[2] && (u.title = l[2]),
  13420. void c.trigger("data", u);
  13421. if (l = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))
  13422. return u = {
  13423. type: "tag",
  13424. tagType: "targetduration"
  13425. },
  13426. l[1] && (u.duration = parseInt(l[1], 10)),
  13427. void c.trigger("data", u);
  13428. if (l = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))
  13429. return u = {
  13430. type: "tag",
  13431. tagType: "totalduration"
  13432. },
  13433. l[1] && (u.duration = parseInt(l[1], 10)),
  13434. void c.trigger("data", u);
  13435. if (l = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))
  13436. return u = {
  13437. type: "tag",
  13438. tagType: "version"
  13439. },
  13440. l[1] && (u.version = parseInt(l[1], 10)),
  13441. void c.trigger("data", u);
  13442. if (l = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
  13443. return u = {
  13444. type: "tag",
  13445. tagType: "media-sequence"
  13446. },
  13447. l[1] && (u.number = parseInt(l[1], 10)),
  13448. void c.trigger("data", u);
  13449. if (l = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
  13450. return u = {
  13451. type: "tag",
  13452. tagType: "discontinuity-sequence"
  13453. },
  13454. l[1] && (u.number = parseInt(l[1], 10)),
  13455. void c.trigger("data", u);
  13456. if (l = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))
  13457. return u = {
  13458. type: "tag",
  13459. tagType: "playlist-type"
  13460. },
  13461. l[1] && (u.playlistType = l[1]),
  13462. void c.trigger("data", u);
  13463. if (l = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))
  13464. return u = {
  13465. type: "tag",
  13466. tagType: "byterange"
  13467. },
  13468. l[1] && (u.length = parseInt(l[1], 10)),
  13469. l[2] && (u.offset = parseInt(l[2], 10)),
  13470. void c.trigger("data", u);
  13471. if (l = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))
  13472. return u = {
  13473. type: "tag",
  13474. tagType: "allow-cache"
  13475. },
  13476. l[1] && (u.allowed = !/NO/.test(l[1])),
  13477. void c.trigger("data", u);
  13478. if (l = /^#EXT-X-MAP:?(.*)$/.exec(e)) {
  13479. if (u = {
  13480. type: "tag",
  13481. tagType: "map"
  13482. },
  13483. l[1]) {
  13484. var n = to(l[1]);
  13485. if (n.URI && (u.uri = n.URI),
  13486. n.BYTERANGE) {
  13487. var i = n.BYTERANGE.split("@")
  13488. , r = i[0]
  13489. , s = i[1];
  13490. u.byterange = {},
  13491. r && (u.byterange.length = parseInt(r, 10)),
  13492. s && (u.byterange.offset = parseInt(s, 10))
  13493. }
  13494. }
  13495. c.trigger("data", u)
  13496. } else if (l = /^#EXT-X-STREAM-INF:?(.*)$/.exec(e)) {
  13497. if (u = {
  13498. type: "tag",
  13499. tagType: "stream-inf"
  13500. },
  13501. l[1]) {
  13502. if (u.attributes = to(l[1]),
  13503. u.attributes.RESOLUTION) {
  13504. var a = u.attributes.RESOLUTION.split("x")
  13505. , o = {};
  13506. a[0] && (o.width = parseInt(a[0], 10)),
  13507. a[1] && (o.height = parseInt(a[1], 10)),
  13508. u.attributes.RESOLUTION = o
  13509. }
  13510. u.attributes.BANDWIDTH && (u.attributes.BANDWIDTH = parseInt(u.attributes.BANDWIDTH, 10)),
  13511. u.attributes["PROGRAM-ID"] && (u.attributes["PROGRAM-ID"] = parseInt(u.attributes["PROGRAM-ID"], 10))
  13512. }
  13513. c.trigger("data", u)
  13514. } else {
  13515. if (l = /^#EXT-X-MEDIA:?(.*)$/.exec(e))
  13516. return u = {
  13517. type: "tag",
  13518. tagType: "media"
  13519. },
  13520. l[1] && (u.attributes = to(l[1])),
  13521. void c.trigger("data", u);
  13522. if (l = /^#EXT-X-ENDLIST/.exec(e))
  13523. c.trigger("data", {
  13524. type: "tag",
  13525. tagType: "endlist"
  13526. });
  13527. else if (l = /^#EXT-X-DISCONTINUITY/.exec(e))
  13528. c.trigger("data", {
  13529. type: "tag",
  13530. tagType: "discontinuity"
  13531. });
  13532. else {
  13533. if (l = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))
  13534. return u = {
  13535. type: "tag",
  13536. tagType: "program-date-time"
  13537. },
  13538. l[1] && (u.dateTimeString = l[1],
  13539. u.dateTimeObject = new Date(l[1])),
  13540. void c.trigger("data", u);
  13541. if (l = /^#EXT-X-KEY:?(.*)$/.exec(e))
  13542. return u = {
  13543. type: "tag",
  13544. tagType: "key"
  13545. },
  13546. l[1] && (u.attributes = to(l[1]),
  13547. u.attributes.IV && ("0x" === u.attributes.IV.substring(0, 2).toLowerCase() && (u.attributes.IV = u.attributes.IV.substring(2)),
  13548. u.attributes.IV = u.attributes.IV.match(/.{8}/g),
  13549. u.attributes.IV[0] = parseInt(u.attributes.IV[0], 16),
  13550. u.attributes.IV[1] = parseInt(u.attributes.IV[1], 16),
  13551. u.attributes.IV[2] = parseInt(u.attributes.IV[2], 16),
  13552. u.attributes.IV[3] = parseInt(u.attributes.IV[3], 16),
  13553. u.attributes.IV = new Uint32Array(u.attributes.IV))),
  13554. void c.trigger("data", u);
  13555. if (l = /^#EXT-X-START:?(.*)$/.exec(e))
  13556. return u = {
  13557. type: "tag",
  13558. tagType: "start"
  13559. },
  13560. l[1] && (u.attributes = to(l[1]),
  13561. u.attributes["TIME-OFFSET"] = parseFloat(u.attributes["TIME-OFFSET"]),
  13562. u.attributes.PRECISE = /YES/.test(u.attributes.PRECISE)),
  13563. void c.trigger("data", u);
  13564. if (l = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))
  13565. return u = {
  13566. type: "tag",
  13567. tagType: "cue-out-cont"
  13568. },
  13569. l[1] ? u.data = l[1] : u.data = "",
  13570. void c.trigger("data", u);
  13571. if (l = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))
  13572. return u = {
  13573. type: "tag",
  13574. tagType: "cue-out"
  13575. },
  13576. l[1] ? u.data = l[1] : u.data = "",
  13577. void c.trigger("data", u);
  13578. if (l = /^#EXT-X-CUE-IN:?(.*)?$/.exec(e))
  13579. return u = {
  13580. type: "tag",
  13581. tagType: "cue-in"
  13582. },
  13583. l[1] ? u.data = l[1] : u.data = "",
  13584. void c.trigger("data", u);
  13585. c.trigger("data", {
  13586. type: "tag",
  13587. data: e.slice(4)
  13588. })
  13589. }
  13590. }
  13591. }
  13592. else
  13593. c.trigger("data", {
  13594. type: "comment",
  13595. text: e.slice(1)
  13596. })
  13597. }) : this.trigger("data", {
  13598. type: "uri",
  13599. uri: i
  13600. }))
  13601. }
  13602. ,
  13603. n.addParser = function(e) {
  13604. var t = this
  13605. , n = e.expression
  13606. , i = e.customType
  13607. , r = e.dataParser
  13608. , s = e.segment;
  13609. "function" != typeof r && (r = function(e) {
  13610. return e
  13611. }
  13612. ),
  13613. this.customParsers.push(function(e) {
  13614. if (n.exec(e))
  13615. return t.trigger("data", {
  13616. type: "custom",
  13617. data: r(e),
  13618. customType: i,
  13619. segment: s
  13620. }),
  13621. !0
  13622. })
  13623. }
  13624. ,
  13625. n.addTagMapper = function(e) {
  13626. var t = e.expression
  13627. , n = e.map;
  13628. this.tagMappers.push(function(e) {
  13629. return t.test(e) ? n(e) : e
  13630. })
  13631. }
  13632. ,
  13633. e
  13634. }(no);
  13635. var so = function(t) {
  13636. function e() {
  13637. var e;
  13638. (e = t.call(this) || this).lineStream = new io,
  13639. e.parseStream = new ro,
  13640. e.lineStream.pipe(e.parseStream);
  13641. var r, s, a = function(e) {
  13642. if (void 0 === e)
  13643. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  13644. return e
  13645. }(e), o = [], l = {}, u = {
  13646. AUDIO: {},
  13647. VIDEO: {},
  13648. "CLOSED-CAPTIONS": {},
  13649. SUBTITLES: {}
  13650. }, c = 0;
  13651. return e.manifest = {
  13652. allowCache: !0,
  13653. discontinuityStarts: [],
  13654. segments: []
  13655. },
  13656. e.parseStream.on("data", function(t) {
  13657. var n, i;
  13658. ({
  13659. tag: function() {
  13660. ({
  13661. "allow-cache": function() {
  13662. this.manifest.allowCache = t.allowed,
  13663. "allowed"in t || (this.trigger("info", {
  13664. message: "defaulting allowCache to YES"
  13665. }),
  13666. this.manifest.allowCache = !0)
  13667. },
  13668. byterange: function() {
  13669. var e = {};
  13670. "length"in t && ((l.byterange = e).length = t.length,
  13671. "offset"in t || (this.trigger("info", {
  13672. message: "defaulting offset to zero"
  13673. }),
  13674. t.offset = 0)),
  13675. "offset"in t && ((l.byterange = e).offset = t.offset)
  13676. },
  13677. endlist: function() {
  13678. this.manifest.endList = !0
  13679. },
  13680. inf: function() {
  13681. "mediaSequence"in this.manifest || (this.manifest.mediaSequence = 0,
  13682. this.trigger("info", {
  13683. message: "defaulting media sequence to zero"
  13684. })),
  13685. "discontinuitySequence"in this.manifest || (this.manifest.discontinuitySequence = 0,
  13686. this.trigger("info", {
  13687. message: "defaulting discontinuity sequence to zero"
  13688. })),
  13689. 0 < t.duration && (l.duration = t.duration),
  13690. 0 === t.duration && (l.duration = .01,
  13691. this.trigger("info", {
  13692. message: "updating zero segment duration to a small value"
  13693. })),
  13694. this.manifest.segments = o
  13695. },
  13696. key: function() {
  13697. if (t.attributes)
  13698. if ("NONE" !== t.attributes.METHOD)
  13699. if (t.attributes.URI) {
  13700. if ("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" === t.attributes.KEYFORMAT) {
  13701. return -1 === ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD) ? void this.trigger("warn", {
  13702. message: "invalid key method provided for Widevine"
  13703. }) : ("SAMPLE-AES-CENC" === t.attributes.METHOD && this.trigger("warn", {
  13704. message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
  13705. }),
  13706. "data:text/plain;base64," !== t.attributes.URI.substring(0, 23) ? void this.trigger("warn", {
  13707. message: "invalid key URI provided for Widevine"
  13708. }) : t.attributes.KEYID && "0x" === t.attributes.KEYID.substring(0, 2) ? void (this.manifest.contentProtection = {
  13709. "com.widevine.alpha": {
  13710. attributes: {
  13711. schemeIdUri: t.attributes.KEYFORMAT,
  13712. keyId: t.attributes.KEYID.substring(2)
  13713. },
  13714. pssh: function(e) {
  13715. for (var t = p.atob(e || ""), n = new Uint8Array(t.length), i = 0; i < t.length; i++)
  13716. n[i] = t.charCodeAt(i);
  13717. return n
  13718. }(t.attributes.URI.split(",")[1])
  13719. }
  13720. }) : void this.trigger("warn", {
  13721. message: "invalid key ID provided for Widevine"
  13722. }))
  13723. }
  13724. t.attributes.METHOD || this.trigger("warn", {
  13725. message: "defaulting key method to AES-128"
  13726. }),
  13727. s = {
  13728. method: t.attributes.METHOD || "AES-128",
  13729. uri: t.attributes.URI
  13730. },
  13731. "undefined" != typeof t.attributes.IV && (s.iv = t.attributes.IV)
  13732. } else
  13733. this.trigger("warn", {
  13734. message: "ignoring key declaration without URI"
  13735. });
  13736. else
  13737. s = null;
  13738. else
  13739. this.trigger("warn", {
  13740. message: "ignoring key declaration without attribute list"
  13741. })
  13742. },
  13743. "media-sequence": function() {
  13744. isFinite(t.number) ? this.manifest.mediaSequence = t.number : this.trigger("warn", {
  13745. message: "ignoring invalid media sequence: " + t.number
  13746. })
  13747. },
  13748. "discontinuity-sequence": function() {
  13749. isFinite(t.number) ? (this.manifest.discontinuitySequence = t.number,
  13750. c = t.number) : this.trigger("warn", {
  13751. message: "ignoring invalid discontinuity sequence: " + t.number
  13752. })
  13753. },
  13754. "playlist-type": function() {
  13755. /VOD|EVENT/.test(t.playlistType) ? this.manifest.playlistType = t.playlistType : this.trigger("warn", {
  13756. message: "ignoring unknown playlist type: " + t.playlist
  13757. })
  13758. },
  13759. map: function() {
  13760. r = {},
  13761. t.uri && (r.uri = t.uri),
  13762. t.byterange && (r.byterange = t.byterange)
  13763. },
  13764. "stream-inf": function() {
  13765. this.manifest.playlists = o,
  13766. this.manifest.mediaGroups = this.manifest.mediaGroups || u,
  13767. t.attributes ? (l.attributes || (l.attributes = {}),
  13768. Za(l.attributes, t.attributes)) : this.trigger("warn", {
  13769. message: "ignoring empty stream-inf attributes"
  13770. })
  13771. },
  13772. media: function() {
  13773. if (this.manifest.mediaGroups = this.manifest.mediaGroups || u,
  13774. t.attributes && t.attributes.TYPE && t.attributes["GROUP-ID"] && t.attributes.NAME) {
  13775. var e = this.manifest.mediaGroups[t.attributes.TYPE];
  13776. e[t.attributes["GROUP-ID"]] = e[t.attributes["GROUP-ID"]] || {},
  13777. n = e[t.attributes["GROUP-ID"]],
  13778. (i = {
  13779. default: /yes/i.test(t.attributes.DEFAULT)
  13780. }).default ? i.autoselect = !0 : i.autoselect = /yes/i.test(t.attributes.AUTOSELECT),
  13781. t.attributes.LANGUAGE && (i.language = t.attributes.LANGUAGE),
  13782. t.attributes.URI && (i.uri = t.attributes.URI),
  13783. t.attributes["INSTREAM-ID"] && (i.instreamId = t.attributes["INSTREAM-ID"]),
  13784. t.attributes.CHARACTERISTICS && (i.characteristics = t.attributes.CHARACTERISTICS),
  13785. t.attributes.FORCED && (i.forced = /yes/i.test(t.attributes.FORCED)),
  13786. n[t.attributes.NAME] = i
  13787. } else
  13788. this.trigger("warn", {
  13789. message: "ignoring incomplete or missing media group"
  13790. })
  13791. },
  13792. discontinuity: function() {
  13793. c += 1,
  13794. l.discontinuity = !0,
  13795. this.manifest.discontinuityStarts.push(o.length)
  13796. },
  13797. "program-date-time": function() {
  13798. "undefined" == typeof this.manifest.dateTimeString && (this.manifest.dateTimeString = t.dateTimeString,
  13799. this.manifest.dateTimeObject = t.dateTimeObject),
  13800. l.dateTimeString = t.dateTimeString,
  13801. l.dateTimeObject = t.dateTimeObject
  13802. },
  13803. targetduration: function() {
  13804. !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
  13805. message: "ignoring invalid target duration: " + t.duration
  13806. }) : this.manifest.targetDuration = t.duration
  13807. },
  13808. totalduration: function() {
  13809. !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
  13810. message: "ignoring invalid total duration: " + t.duration
  13811. }) : this.manifest.totalDuration = t.duration
  13812. },
  13813. start: function() {
  13814. t.attributes && !isNaN(t.attributes["TIME-OFFSET"]) ? this.manifest.start = {
  13815. timeOffset: t.attributes["TIME-OFFSET"],
  13816. precise: t.attributes.PRECISE
  13817. } : this.trigger("warn", {
  13818. message: "ignoring start declaration without appropriate attribute list"
  13819. })
  13820. },
  13821. "cue-out": function() {
  13822. l.cueOut = t.data
  13823. },
  13824. "cue-out-cont": function() {
  13825. l.cueOutCont = t.data
  13826. },
  13827. "cue-in": function() {
  13828. l.cueIn = t.data
  13829. }
  13830. }[t.tagType] || function() {}
  13831. ).call(a)
  13832. },
  13833. uri: function() {
  13834. l.uri = t.uri,
  13835. o.push(l),
  13836. !this.manifest.targetDuration || "duration"in l || (this.trigger("warn", {
  13837. message: "defaulting segment duration to the target duration"
  13838. }),
  13839. l.duration = this.manifest.targetDuration),
  13840. s && (l.key = s),
  13841. l.timeline = c,
  13842. r && (l.map = r),
  13843. l = {}
  13844. },
  13845. comment: function() {},
  13846. custom: function() {
  13847. t.segment ? (l.custom = l.custom || {},
  13848. l.custom[t.customType] = t.data) : (this.manifest.custom = this.manifest.custom || {},
  13849. this.manifest.custom[t.customType] = t.data)
  13850. }
  13851. })[t.type].call(a)
  13852. }),
  13853. e
  13854. }
  13855. eo(e, t);
  13856. var n = e.prototype;
  13857. return n.push = function(e) {
  13858. this.lineStream.push(e)
  13859. }
  13860. ,
  13861. n.end = function() {
  13862. this.lineStream.push("\n")
  13863. }
  13864. ,
  13865. n.addParser = function(e) {
  13866. this.parseStream.addParser(e)
  13867. }
  13868. ,
  13869. n.addTagMapper = function(e) {
  13870. this.parseStream.addTagMapper(e)
  13871. }
  13872. ,
  13873. e
  13874. }(no)
  13875. , ao = function(e) {
  13876. return 0 === e.indexOf("#") ? e.slice(1) : e
  13877. };
  13878. function oo(e, n, t) {
  13879. var i = oo.getPlayer(e);
  13880. if (i)
  13881. return n && m.warn('Player "' + e + '" is already initialised. Options will not be applied.'),
  13882. t && i.ready(t),
  13883. i;
  13884. var r = "string" == typeof e ? $("#" + ao(e)) : e;
  13885. if (!k(r))
  13886. throw new TypeError("The element or ID supplied is not valid. (videojs)");
  13887. r.ownerDocument.defaultView && r.ownerDocument.body.contains(r) || m.warn("The element supplied is not included in the DOM"),
  13888. n = n || {},
  13889. oo.hooks("beforesetup").forEach(function(e) {
  13890. var t = e(r, Fe(n));
  13891. l(t) && !Array.isArray(t) ? n = Fe(n, t) : m.error("please return an object in beforesetup hooks")
  13892. });
  13893. var s = He.getComponent("Player");
  13894. return i = new s(r,n,t),
  13895. oo.hooks("setup").forEach(function(e) {
  13896. return e(i)
  13897. }),
  13898. !0 === n.debug && (i.log("ads plugin init, version:" + i.ads.VERSION),
  13899. i.log("qualityLevel plugin init, version:"),
  13900. i.log(i.qualityLevels())),
  13901. i.ads({
  13902. debug: !!n.debug,
  13903. timeout: 6e3
  13904. }),
  13905. i
  13906. }
  13907. if (oo.hooks_ = {},
  13908. oo.hooks = function(e, t) {
  13909. return oo.hooks_[e] = oo.hooks_[e] || [],
  13910. t && (oo.hooks_[e] = oo.hooks_[e].concat(t)),
  13911. oo.hooks_[e]
  13912. }
  13913. ,
  13914. oo.hook = function(e, t) {
  13915. oo.hooks(e, t)
  13916. }
  13917. ,
  13918. oo.hookOnce = function(n, e) {
  13919. oo.hooks(n, [].concat(e).map(function(t) {
  13920. return function e() {
  13921. return oo.removeHook(n, e),
  13922. t.apply(void 0, arguments)
  13923. }
  13924. }))
  13925. }
  13926. ,
  13927. oo.removeHook = function(e, t) {
  13928. var n = oo.hooks(e).indexOf(t);
  13929. return !(n <= -1) && (oo.hooks_[e] = oo.hooks_[e].slice(),
  13930. oo.hooks_[e].splice(n, 1),
  13931. !0)
  13932. }
  13933. ,
  13934. !0 !== p.VIDEOJS_NO_DYNAMIC_STYLE && C()) {
  13935. var lo = $(".vjs-styles-defaults");
  13936. if (!lo) {
  13937. lo = re("vjs-styles-defaults");
  13938. var uo = $("head");
  13939. uo && uo.insertBefore(lo, uo.firstChild),
  13940. se(lo, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")
  13941. }
  13942. }
  13943. ne(1, oo),
  13944. oo.VERSION = y,
  13945. oo.PLAYER_VERSION = v,
  13946. oo.UPDATE_DATE = g,
  13947. oo.options = Ra.prototype.options_,
  13948. oo.getPlayers = function() {
  13949. return Ra.players
  13950. }
  13951. ,
  13952. oo.getPlayer = function(e) {
  13953. var t, n = Ra.players;
  13954. if ("string" == typeof e) {
  13955. var i = ao(e)
  13956. , r = n[i];
  13957. if (r)
  13958. return r;
  13959. t = $("#" + i)
  13960. } else
  13961. t = e;
  13962. if (k(t)) {
  13963. var s = t
  13964. , a = s.player
  13965. , o = s.playerId;
  13966. if (a || n[o])
  13967. return a || n[o]
  13968. }
  13969. }
  13970. ,
  13971. oo.getAllPlayers = function() {
  13972. return Object.keys(Ra.players).map(function(e) {
  13973. return Ra.players[e]
  13974. }).filter(Boolean)
  13975. }
  13976. ,
  13977. oo.players = Ra.players,
  13978. oo.getComponent = He.getComponent,
  13979. oo.registerComponent = function(e, t) {
  13980. pi.isTech(t) && m.warn("The " + e + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),
  13981. He.registerComponent.call(He, e, t)
  13982. }
  13983. ,
  13984. oo.getTech = pi.getTech,
  13985. oo.registerTech = pi.registerTech,
  13986. oo.use = function(e, t) {
  13987. fi[e] = fi[e] || [],
  13988. fi[e].push(t)
  13989. }
  13990. ,
  13991. Object.defineProperty(oo, "middleware", {
  13992. value: {},
  13993. writeable: !1,
  13994. enumerable: !0
  13995. }),
  13996. Object.defineProperty(oo.middleware, "TERMINATOR", {
  13997. value: gi,
  13998. writeable: !1,
  13999. enumerable: !0
  14000. }),
  14001. oo.browser = pt,
  14002. oo.TOUCH_ENABLED = lt,
  14003. oo.extend = function(e, t) {
  14004. void 0 === t && (t = {});
  14005. var n = function() {
  14006. e.apply(this, arguments)
  14007. }
  14008. , i = {};
  14009. for (var r in "object" == typeof t ? (t.constructor !== Object.prototype.constructor && (n = t.constructor),
  14010. i = t) : "function" == typeof t && (n = t),
  14011. Ja(n, e),
  14012. e && (n.super_ = e),
  14013. i)
  14014. i.hasOwnProperty(r) && (n.prototype[r] = i[r]);
  14015. return n
  14016. }
  14017. ,
  14018. oo.mergeOptions = Fe,
  14019. oo.bind = Te,
  14020. oo.registerPlugin = $a.registerPlugin,
  14021. oo.deregisterPlugin = $a.deregisterPlugin,
  14022. oo.plugin = function(e, t) {
  14023. return m.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),
  14024. $a.registerPlugin(e, t)
  14025. }
  14026. ,
  14027. oo.getPlugins = $a.getPlugins,
  14028. oo.getPlugin = $a.getPlugin,
  14029. oo.getPluginVersion = $a.getPluginVersion,
  14030. oo.addLanguage = function(e, t) {
  14031. var n;
  14032. return e = ("" + e).toLowerCase(),
  14033. oo.options.languages = Fe(oo.options.languages, ((n = {})[e] = t,
  14034. n)),
  14035. oo.options.languages[e]
  14036. }
  14037. ,
  14038. oo.log = m,
  14039. oo.createLogger = _,
  14040. oo.createTimeRange = oo.createTimeRanges = gt,
  14041. oo.formatTime = Bt,
  14042. oo.setFormatTime = function(e) {
  14043. Dt = e
  14044. }
  14045. ,
  14046. oo.resetFormatTime = function() {
  14047. Dt = Nt
  14048. }
  14049. ,
  14050. oo.parseUrl = sn,
  14051. oo.isCrossOrigin = ln,
  14052. oo.EventTarget = ke,
  14053. oo.on = ge,
  14054. oo.one = _e,
  14055. oo.off = ye,
  14056. oo.trigger = me,
  14057. oo.xhr = Zt,
  14058. oo.TextTrack = Ln,
  14059. oo.AudioTrack = In,
  14060. oo.VideoTrack = Mn,
  14061. oo.storePub = cr,
  14062. oo.M3u8Parser = so,
  14063. ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(e) {
  14064. oo[e] = function() {
  14065. return m.warn("videojs." + e + "() is deprecated; use videojs.dom." + e + "() instead"),
  14066. Z[e].apply(null, arguments)
  14067. }
  14068. }),
  14069. oo.computedStyle = h,
  14070. oo.dom = Z,
  14071. oo.url = un,
  14072. oo.defineLazyProperty = Ea;
  14073. function co(e, t) {
  14074. t.isImmediatePropagationStopped = function() {
  14075. return !0
  14076. }
  14077. ,
  14078. t.cancelBubble = !0,
  14079. t.isPropagationStopped = function() {
  14080. return !0
  14081. }
  14082. }
  14083. function ho(e, t, n) {
  14084. co(0, n),
  14085. e.trigger({
  14086. type: t + n.type,
  14087. originalEvent: n
  14088. })
  14089. }
  14090. function po(e) {
  14091. "playing" === e.type ? function(e, t) {
  14092. e.ads.isInAdMode() && (e.ads.isContentResuming() ? e.ads._contentEnding && ho(e, "content", t) : ho(e, "ad", t))
  14093. }(this, e) : "ended" === e.type ? function(e, t) {
  14094. e.ads.isInAdMode() ? e.ads.isContentResuming() ? (co(0, t),
  14095. e.trigger("resumeended")) : ho(e, "ad", t) : e.ads._contentHasEnded || e.ads.stitchedAds() || (ho(e, "content", t),
  14096. e.trigger("readyforpostroll"))
  14097. }(this, e) : "loadstart" === e.type || "loadeddata" === e.type || "loadedmetadata" === e.type ? function(e, t) {
  14098. if (!("loadstart" === t.type && !e.ads._hasThereBeenALoadStartDuringPlayerLife || "loadeddata" === t.type && !e.ads._hasThereBeenALoadedData || "loadedmetadata" === t.type && !e.ads._hasThereBeenALoadedMetaData))
  14099. if (e.ads.inAdBreak())
  14100. ho(e, "ad", t);
  14101. else {
  14102. if (e.currentSrc() !== e.ads.contentSrc)
  14103. return;
  14104. ho(e, "content", t)
  14105. }
  14106. }(this, e) : "play" === e.type ? function(e, t) {
  14107. e.ads.inAdBreak() ? ho(e, "ad", t) : e.ads.isContentResuming() && ho(e, "content", t)
  14108. }(this, e) : this.ads.isInAdMode() && (this.ads.isContentResuming() ? ho(this, "content", e) : ho(this, "ad", e))
  14109. }
  14110. function fo() {
  14111. !function() {
  14112. if (oo.dom.isInFrame() && "function" != typeof p.__tcfapi) {
  14113. for (var a, e = p, o = {}; e; ) {
  14114. try {
  14115. if (e.frames.__tcfapiLocator) {
  14116. a = e;
  14117. break
  14118. }
  14119. } catch (e) {}
  14120. if (e === p.top)
  14121. break;
  14122. e = e.parent
  14123. }
  14124. if (!a)
  14125. return;
  14126. p.__tcfapi = function(e, t, n, i) {
  14127. var r = Math.random() + ""
  14128. , s = {
  14129. __tcfapiCall: {
  14130. command: e,
  14131. parameter: i,
  14132. version: t,
  14133. callId: r
  14134. }
  14135. };
  14136. o[r] = n,
  14137. a.postMessage(s, "*")
  14138. }
  14139. ,
  14140. p.addEventListener("message", function(e) {
  14141. var t = {};
  14142. try {
  14143. t = "string" == typeof e.data ? JSON.parse(e.data) : e.data
  14144. } catch (e) {}
  14145. var n = t.__tcfapiReturn;
  14146. n && "function" == typeof o[n.callId] && (o[n.callId](n.returnValue, n.success),
  14147. o[n.callId] = null)
  14148. }, !1)
  14149. }
  14150. }(),
  14151. "function" == typeof p.__tcfapi && p.__tcfapi("addEventListener", 2, function(e, t) {
  14152. t && (yo = e)
  14153. })
  14154. }
  14155. function vo(e, t) {
  14156. return t ? encodeURIComponent(e) : e
  14157. }
  14158. function go(e, t, n) {
  14159. if (e && e[n])
  14160. for (var i = e[n], r = Object.keys(i), s = 0; s < r.length; s++) {
  14161. t["{mediainfo." + n + "." + r[s] + "}"] = i[r[s]]
  14162. }
  14163. }
  14164. var yo = {};
  14165. var mo = {
  14166. processMetadataTracks: function(t, n) {
  14167. for (var e = t.textTracks(), i = function(e) {
  14168. "metadata" === e.kind && (t.ads.cueTextTracks.setMetadataTrackMode(e),
  14169. n(t, e))
  14170. }, r = 0; r < e.length; r++)
  14171. i(e[r]);
  14172. e.addEventListener("addtrack", function(e) {
  14173. i(e.track)
  14174. })
  14175. },
  14176. setMetadataTrackMode: function(e) {},
  14177. getSupportedAdCue: function(e, t) {
  14178. return t
  14179. },
  14180. isSupportedAdCue: function(e, t) {
  14181. return !0
  14182. },
  14183. getCueId: function(e, t) {
  14184. return t.id
  14185. }
  14186. };
  14187. function _o() {
  14188. !1 !== this.ads._shouldBlockPlay && (this.paused() || (this.ads.debug("Playback was canceled by cancelContentPlay"),
  14189. this.pause()),
  14190. this.ads._cancelledPlay = !0)
  14191. }
  14192. mo.processAdTrack = function(e, t, n, i) {
  14193. e.ads.includedCues = {};
  14194. for (var r = 0; r < t.length; r++) {
  14195. var s = t[r]
  14196. , a = this.getSupportedAdCue(e, s);
  14197. if (!this.isSupportedAdCue(e, s))
  14198. return void oo.log.warn("Skipping as this is not a supported ad cue.", s);
  14199. var o = this.getCueId(e, s)
  14200. , l = s.startTime;
  14201. if (h = e,
  14202. void 0 !== (d = o) && h.ads.includedCues[d])
  14203. return void oo.log("Skipping ad already seen with ID " + o);
  14204. i && i(e, a, o, l),
  14205. n(e, a, o, l),
  14206. u = e,
  14207. void 0 !== (c = o) && "" !== c && (u.ads.includedCues[c] = !0)
  14208. }
  14209. var u, c, h, d
  14210. }
  14211. ;
  14212. var bo = {}
  14213. , To = oo;
  14214. bo.isMiddlewareMediatorSupported = function() {
  14215. return !To.browser.IS_IOS && !To.browser.IS_ANDROID && !!(To.use && To.middleware && To.middleware.TERMINATOR)
  14216. }
  14217. ,
  14218. bo.playMiddleware = function(n) {
  14219. return {
  14220. setSource: function(e, t) {
  14221. t(null, e)
  14222. },
  14223. callPlay: function() {
  14224. if (n.ads && !0 === n.ads._shouldBlockPlay)
  14225. return n.ads.debug("Using playMiddleware to block content playback"),
  14226. n.ads._playBlocked = !0,
  14227. To.middleware.TERMINATOR
  14228. },
  14229. play: function(e, t) {
  14230. n.ads && n.ads._playBlocked && e ? (n.ads.debug("Play call to Tech was terminated."),
  14231. n.trigger("play"),
  14232. n.addClass("vjs-has-started"),
  14233. n.ads._playBlocked = !1) : t && t.catch && t.catch(function(e) {
  14234. "NotAllowedError" !== e.name || oo.browser.IS_SAFARI || n.trigger("pause")
  14235. })
  14236. }
  14237. }
  14238. }
  14239. ,
  14240. bo.testHook = function(e) {
  14241. To = e
  14242. }
  14243. ;
  14244. var Co = bo.playMiddleware
  14245. , ko = bo.isMiddlewareMediatorSupported;
  14246. var Eo = function() {
  14247. function n() {}
  14248. return n.getState = function(e) {
  14249. if (e)
  14250. return n.states_ && n.states_[e] ? n.states_[e] : void 0
  14251. }
  14252. ,
  14253. n.registerState = function(e, t) {
  14254. if ("string" != typeof e || !e)
  14255. throw new Error('Illegal state name, "' + e + '"; must be a non-empty string.');
  14256. return n.states_ || (n.states_ = {}),
  14257. n.states_[e] = t
  14258. }
  14259. ,
  14260. n
  14261. }()
  14262. , So = function() {
  14263. function e(e) {
  14264. this.player = e
  14265. }
  14266. e._getName = function() {
  14267. return "Anonymous State"
  14268. }
  14269. ;
  14270. var t = e.prototype;
  14271. return t.transitionTo = function(e) {
  14272. var t = this.player;
  14273. this.cleanup(t);
  14274. var n = new e(t);
  14275. t.ads._state = n,
  14276. t.ads.debug(this.constructor._getName() + " -> " + n.constructor._getName());
  14277. for (var i = arguments.length, r = new Array(1 < i ? i - 1 : 0), s = 1; s < i; s++)
  14278. r[s - 1] = arguments[s];
  14279. n.init.apply(n, [t].concat(r))
  14280. }
  14281. ,
  14282. t.init = function() {}
  14283. ,
  14284. t.cleanup = function() {}
  14285. ,
  14286. t.onPlay = function() {}
  14287. ,
  14288. t.onPlaying = function() {}
  14289. ,
  14290. t.onEnded = function() {}
  14291. ,
  14292. t.onAdEnded = function() {}
  14293. ,
  14294. t.onAdsReady = function() {
  14295. oo.log.warn("Unexpected adsready event")
  14296. }
  14297. ,
  14298. t.onAdsError = function() {}
  14299. ,
  14300. t.onAdsCanceled = function() {}
  14301. ,
  14302. t.onAdTimeout = function() {}
  14303. ,
  14304. t.onAdStarted = function() {}
  14305. ,
  14306. t.onContentChanged = function() {}
  14307. ,
  14308. t.onContentResumed = function() {}
  14309. ,
  14310. t.onReadyForPostroll = function() {
  14311. oo.log.warn("Unexpected readyforpostroll event")
  14312. }
  14313. ,
  14314. t.onNoPreroll = function() {}
  14315. ,
  14316. t.onNoPostroll = function() {}
  14317. ,
  14318. t.startLinearAdMode = function() {
  14319. oo.log.warn("Unexpected startLinearAdMode invocation (State via " + this.constructor._getName() + ")")
  14320. }
  14321. ,
  14322. t.endLinearAdMode = function() {
  14323. oo.log.warn("Unexpected endLinearAdMode invocation (State via " + this.constructor._getName() + ")")
  14324. }
  14325. ,
  14326. t.skipLinearAdMode = function() {
  14327. oo.log.warn("Unexpected skipLinearAdMode invocation (State via " + this.constructor._getName() + ")")
  14328. }
  14329. ,
  14330. t.isAdState = function() {
  14331. throw new Error("isAdState unimplemented for " + this.constructor._getName())
  14332. }
  14333. ,
  14334. t.isWaitingForAdBreak = function() {
  14335. return !1
  14336. }
  14337. ,
  14338. t.isContentResuming = function() {
  14339. return !1
  14340. }
  14341. ,
  14342. t.inAdBreak = function() {
  14343. return !1
  14344. }
  14345. ,
  14346. t.handleEvent = function(e) {
  14347. var t = this.player;
  14348. "play" === e ? this.onPlay(t) : "adsready" === e ? this.onAdsReady(t) : "adserror" === e ? this.onAdsError(t) : "adscanceled" === e ? this.onAdsCanceled(t) : "adtimeout" === e ? this.onAdTimeout(t) : "ads-ad-started" === e ? this.onAdStarted(t) : "contentchanged" === e ? this.onContentChanged(t) : "contentresumed" === e ? this.onContentResumed(t) : "readyforpostroll" === e ? this.onReadyForPostroll(t) : "playing" === e ? this.onPlaying(t) : "ended" === e ? this.onEnded(t) : "nopreroll" === e ? this.onNoPreroll(t) : "nopostroll" === e ? this.onNoPostroll(t) : "adended" === e && this.onAdEnded(t)
  14349. }
  14350. ,
  14351. e
  14352. }();
  14353. function wo(e, t) {
  14354. e.prototype = Object.create(t.prototype),
  14355. (e.prototype.constructor = e).__proto__ = t
  14356. }
  14357. Eo.registerState("State", So);
  14358. var xo = function(n) {
  14359. function e(e) {
  14360. var t;
  14361. return (t = n.call(this, e) || this).contentResuming = !1,
  14362. t.waitingForAdBreak = !1,
  14363. t
  14364. }
  14365. wo(e, n);
  14366. var t = e.prototype;
  14367. return t.isAdState = function() {
  14368. return !0
  14369. }
  14370. ,
  14371. t.onPlaying = function() {
  14372. var e = Eo.getState("ContentPlayback");
  14373. this.contentResuming && this.transitionTo(e)
  14374. }
  14375. ,
  14376. t.onContentResumed = function() {
  14377. var e = Eo.getState("ContentPlayback");
  14378. this.contentResuming && this.transitionTo(e)
  14379. }
  14380. ,
  14381. t.isWaitingForAdBreak = function() {
  14382. return this.waitingForAdBreak
  14383. }
  14384. ,
  14385. t.isContentResuming = function() {
  14386. return this.contentResuming
  14387. }
  14388. ,
  14389. t.inAdBreak = function() {
  14390. return !0 === this.player.ads._inLinearAdMode
  14391. }
  14392. ,
  14393. e
  14394. }(So);
  14395. Eo.registerState("AdState", xo);
  14396. var Ao = function(e) {
  14397. function t() {
  14398. return e.apply(this, arguments) || this
  14399. }
  14400. wo(t, e);
  14401. var n = t.prototype;
  14402. return n.isAdState = function() {
  14403. return !1
  14404. }
  14405. ,
  14406. n.onContentChanged = function(e) {
  14407. var t = Eo.getState("BeforePreroll")
  14408. , n = Eo.getState("Preroll");
  14409. e.ads.debug("Received contentchanged event (ContentState)"),
  14410. e.paused() ? this.transitionTo(t) : (this.transitionTo(n, !1),
  14411. e.pause(),
  14412. e.ads._pausedOnContentupdate = !0)
  14413. }
  14414. ,
  14415. t
  14416. }(So);
  14417. Eo.registerState("ContentState", Ao);
  14418. var Po, Lo = function(e) {
  14419. function t() {
  14420. return e.apply(this, arguments) || this
  14421. }
  14422. wo(t, e),
  14423. t._getName = function() {
  14424. return "AdsDone"
  14425. }
  14426. ;
  14427. var n = t.prototype;
  14428. return n.init = function(e) {
  14429. e.ads._contentHasEnded = !0,
  14430. e.trigger("ended")
  14431. }
  14432. ,
  14433. n.startLinearAdMode = function() {
  14434. oo.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")
  14435. }
  14436. ,
  14437. t
  14438. }(Eo.getState("ContentState"));
  14439. Eo.registerState("AdsDone", Lo);
  14440. var Io = {
  14441. start: function(e) {
  14442. e.ads.debug("Starting ad break"),
  14443. e.ads._inLinearAdMode = !0,
  14444. e.trigger("adstart"),
  14445. e.ads.shouldTakeSnapshots() && (e.ads.snapshot = function(e) {
  14446. var t;
  14447. t = oo.browser.IS_IOS && e.ads.isLive(e) && 0 < e.seekable().length ? e.currentTime() - e.seekable().end(0) : e.currentTime();
  14448. var n = e.$(".vjs-tech")
  14449. , i = e.textTracks ? e.textTracks() : []
  14450. , r = []
  14451. , s = {
  14452. ended: e.ended(),
  14453. currentSrc: e.currentSrc(),
  14454. sources: e.currentSources(),
  14455. src: e.tech_.src(),
  14456. currentTime: t,
  14457. type: e.currentType()
  14458. };
  14459. n && (s.style = n.getAttribute("style"));
  14460. for (var a = 0; a < i.length; a++) {
  14461. var o = i[a];
  14462. r.push({
  14463. track: o,
  14464. mode: o.mode
  14465. }),
  14466. o.mode = "disabled"
  14467. }
  14468. return s.suppressedTracks = r,
  14469. s
  14470. }(e)),
  14471. e.ads.shouldPlayContentBehindAd(e) && (e.ads.preAdVolume_ = e.volume(),
  14472. e.volume(0)),
  14473. e.addClass("vjs-ad-playing"),
  14474. e.hasClass("vjs-live") && e.removeClass("vjs-live"),
  14475. e.ads.removeNativePoster()
  14476. },
  14477. end: function(e, t) {
  14478. e.ads.debug("Ending ad break"),
  14479. void 0 === t && (t = function() {}
  14480. ),
  14481. e.ads.adType = null,
  14482. e.ads._inLinearAdMode = !1,
  14483. e.trigger("adend"),
  14484. e.removeClass("vjs-ad-playing"),
  14485. e.ads.isLive(e) && e.addClass("vjs-live"),
  14486. e.ads.shouldTakeSnapshots() ? function(i, e) {
  14487. var r = i.ads.snapshot;
  14488. if (void 0 === e && (e = function() {}
  14489. ),
  14490. !0 === i.ads.disableNextSnapshotRestore)
  14491. return i.ads.disableNextSnapshotRestore = !1,
  14492. delete i.ads.snapshot,
  14493. e();
  14494. function t() {
  14495. for (var e = 0; e < u.length; e++)
  14496. (a = u[e]).track.mode = a.mode
  14497. }
  14498. function n() {
  14499. var e;
  14500. if (oo.browser.IS_IOS && i.ads.isLive(i)) {
  14501. if (r.currentTime < 0 && (e = 0 < i.seekable().length ? i.seekable().end(0) + r.currentTime : i.currentTime(),
  14502. i.currentTime(e)),
  14503. i.paused()) {
  14504. var t = i.play();
  14505. t && t.catch && t.catch(function(e) {
  14506. oo.log.warn("Play promise rejected in IOS snapshot resume", e)
  14507. })
  14508. }
  14509. } else if (r.ended)
  14510. i.currentTime(i.duration());
  14511. else {
  14512. i.currentTime(r.currentTime);
  14513. var n = i.play();
  14514. n && n.catch && n.catch(function(e) {
  14515. oo.log.warn("Play promise rejected in snapshot resume", e)
  14516. })
  14517. }
  14518. i.ads.shouldRemoveAutoplay_ && (i.autoplay(!1),
  14519. i.ads.shouldRemoveAutoplay_ = !1)
  14520. }
  14521. function s() {
  14522. if (i.off("contentcanplay", s),
  14523. Po && i.clearTimeout(Po),
  14524. 1 < (o = i.el().querySelector(".vjs-tech")).readyState)
  14525. return n();
  14526. if (void 0 === o.seekable)
  14527. return n();
  14528. if (0 < o.seekable.length)
  14529. return n();
  14530. if (l--)
  14531. i.setTimeout(s, 50);
  14532. else
  14533. try {
  14534. n()
  14535. } catch (e) {
  14536. oo.log.warn("Failed to resume the content after an advertisement", e)
  14537. }
  14538. }
  14539. var a, o = i.$(".vjs-tech"), l = 20, u = r.suppressedTracks;
  14540. if ("style"in r && o.setAttribute("style", r.style || ""),
  14541. i.ads.videoElementRecycled())
  14542. i.one("resumeended", function() {
  14543. delete i.ads.snapshot,
  14544. e()
  14545. }),
  14546. i.one("contentloadedmetadata", t),
  14547. oo.browser.IS_IOS && !i.autoplay() && (i.autoplay(!0),
  14548. i.ads.shouldRemoveAutoplay_ = !0),
  14549. i.src(r.sources),
  14550. i.one("contentcanplay", s),
  14551. Po = i.setTimeout(s, 2e3);
  14552. else {
  14553. if (t(),
  14554. !i.ended()) {
  14555. var c = i.play();
  14556. c && c.catch && c.catch(function(e) {
  14557. oo.log.warn("Play promise rejected in snapshot restore", e)
  14558. })
  14559. }
  14560. delete i.ads.snapshot,
  14561. e()
  14562. }
  14563. }(e, t) : (e.volume(e.ads.preAdVolume_),
  14564. t())
  14565. }
  14566. }
  14567. , Mo = function(e) {
  14568. function t() {
  14569. return e.apply(this, arguments) || this
  14570. }
  14571. wo(t, e),
  14572. t._getName = function() {
  14573. return "Preroll"
  14574. }
  14575. ;
  14576. var n = t.prototype;
  14577. return n.init = function(e, t, n) {
  14578. if (this.waitingForAdBreak = !0,
  14579. e.addClass("vjs-ad-loading"),
  14580. n || e.ads.nopreroll_)
  14581. return this.resumeAfterNoPreroll(e);
  14582. var i = e.ads.settings.timeout;
  14583. "number" == typeof e.ads.settings.prerollTimeout && (i = e.ads.settings.prerollTimeout),
  14584. this._timeout = e.setTimeout(function() {
  14585. e.trigger("adtimeout")
  14586. }, i),
  14587. t ? this.handleAdsReady() : this.adsReady = !1
  14588. }
  14589. ,
  14590. n.onAdsReady = function(e) {
  14591. e.ads.inAdBreak() ? oo.log.warn("Unexpected adsready event (Preroll)") : (e.ads.debug("Received adsready event (Preroll)"),
  14592. this.handleAdsReady())
  14593. }
  14594. ,
  14595. n.handleAdsReady = function() {
  14596. this.adsReady = !0,
  14597. this.readyForPreroll()
  14598. }
  14599. ,
  14600. n.afterLoadStart = function(e) {
  14601. var t = this.player;
  14602. t.ads._hasThereBeenALoadStartDuringPlayerLife ? e() : (t.ads.debug("Waiting for loadstart..."),
  14603. t.one("loadstart", function() {
  14604. t.ads.debug("Received loadstart event"),
  14605. e()
  14606. }))
  14607. }
  14608. ,
  14609. n.noPreroll = function() {
  14610. var e = this;
  14611. this.afterLoadStart(function() {
  14612. e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),
  14613. e.resumeAfterNoPreroll(e.player)
  14614. })
  14615. }
  14616. ,
  14617. n.readyForPreroll = function() {
  14618. var e = this.player;
  14619. this.afterLoadStart(function() {
  14620. e.ads.debug("Triggered readyforpreroll event (Preroll)"),
  14621. e.trigger("readyforpreroll")
  14622. })
  14623. }
  14624. ,
  14625. n.onAdsCanceled = function(e) {
  14626. var t = this;
  14627. e.ads.debug("adscanceled (Preroll)"),
  14628. this.afterLoadStart(function() {
  14629. t.resumeAfterNoPreroll(e)
  14630. })
  14631. }
  14632. ,
  14633. n.onAdsError = function(e) {
  14634. var t = this;
  14635. oo.log("adserror (Preroll)"),
  14636. this.inAdBreak() ? e.ads.endLinearAdMode() : this.afterLoadStart(function() {
  14637. t.resumeAfterNoPreroll(e)
  14638. })
  14639. }
  14640. ,
  14641. n.startLinearAdMode = function() {
  14642. var e = this.player;
  14643. !this.adsReady || e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Preroll)") : (this.clearTimeout(e),
  14644. e.ads.adType = "preroll",
  14645. this.waitingForAdBreak = !1,
  14646. Io.start(e),
  14647. e.ads._shouldBlockPlay = !1)
  14648. }
  14649. ,
  14650. n.onAdStarted = function(e) {
  14651. e.removeClass("vjs-ad-loading")
  14652. }
  14653. ,
  14654. n.endLinearAdMode = function() {
  14655. var e = this.player;
  14656. this.inAdBreak() && (e.removeClass("vjs-ad-loading"),
  14657. e.addClass("vjs-ad-content-resuming"),
  14658. this.contentResuming = !0,
  14659. Io.end(e))
  14660. }
  14661. ,
  14662. n.skipLinearAdMode = function() {
  14663. var e = this
  14664. , t = this.player;
  14665. t.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : this.afterLoadStart(function() {
  14666. t.trigger("adskip"),
  14667. t.ads.debug("skipLinearAdMode (Preroll)"),
  14668. e.resumeAfterNoPreroll(t)
  14669. })
  14670. }
  14671. ,
  14672. n.onAdTimeout = function(e) {
  14673. var t = this;
  14674. this.afterLoadStart(function() {
  14675. e.ads.debug("adtimeout (Preroll)"),
  14676. t.resumeAfterNoPreroll(e)
  14677. })
  14678. }
  14679. ,
  14680. n.onNoPreroll = function(e) {
  14681. e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected nopreroll event (Preroll)") : this.noPreroll()
  14682. }
  14683. ,
  14684. n.resumeAfterNoPreroll = function(e) {
  14685. if (this.contentResuming = !0,
  14686. e.ads._shouldBlockPlay = !1,
  14687. this.cleanupPartial(e),
  14688. e.ads._playRequested || e.ads._pausedOnContentupdate)
  14689. if (e.paused()) {
  14690. e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");
  14691. var t = e.play();
  14692. t && t.then && t.then(null, function(e) {})
  14693. } else
  14694. e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),
  14695. e.trigger("play"),
  14696. e.trigger("playing")
  14697. }
  14698. ,
  14699. n.cleanup = function(e) {
  14700. e.ads._hasThereBeenALoadStartDuringPlayerLife || oo.log.warn("Leaving Preroll state before loadstart event can cause issues."),
  14701. this.cleanupPartial(e)
  14702. }
  14703. ,
  14704. n.cleanupPartial = function(e) {
  14705. e.removeClass("vjs-ad-loading"),
  14706. e.removeClass("vjs-ad-content-resuming"),
  14707. this.clearTimeout(e)
  14708. }
  14709. ,
  14710. n.clearTimeout = function(e) {
  14711. e.clearTimeout(this._timeout),
  14712. this._timeout = null
  14713. }
  14714. ,
  14715. t
  14716. }(Eo.getState("AdState"));
  14717. Eo.registerState("Preroll", Mo);
  14718. var jo = function(e) {
  14719. function t() {
  14720. return e.apply(this, arguments) || this
  14721. }
  14722. wo(t, e),
  14723. t._getName = function() {
  14724. return "BeforePreroll"
  14725. }
  14726. ;
  14727. var n = t.prototype;
  14728. return n.init = function(e) {
  14729. this.adsReady = !1,
  14730. this.shouldResumeToContent = !1,
  14731. e.ads._shouldBlockPlay = !e.ads.settings.allowVjsAutoplay || !e.autoplay()
  14732. }
  14733. ,
  14734. n.onAdsReady = function(e) {
  14735. e.ads.debug("Received adsready event (BeforePreroll)"),
  14736. this.adsReady = !0
  14737. }
  14738. ,
  14739. n.onPlay = function(e) {
  14740. var t = Eo.getState("Preroll");
  14741. e.ads.debug("Received play event (BeforePreroll)"),
  14742. this.transitionTo(t, this.adsReady, this.shouldResumeToContent)
  14743. }
  14744. ,
  14745. n.onAdsCanceled = function(e) {
  14746. e.ads.debug("adscanceled (BeforePreroll)"),
  14747. this.shouldResumeToContent = !0
  14748. }
  14749. ,
  14750. n.onAdsError = function() {
  14751. this.player.ads.debug("adserror (BeforePreroll)"),
  14752. this.shouldResumeToContent = !0
  14753. }
  14754. ,
  14755. n.onNoPreroll = function() {
  14756. this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),
  14757. this.shouldResumeToContent = !0
  14758. }
  14759. ,
  14760. n.skipLinearAdMode = function() {
  14761. var e = this.player;
  14762. e.trigger("adskip"),
  14763. e.ads.debug("skipLinearAdMode (BeforePreroll)"),
  14764. this.shouldResumeToContent = !0
  14765. }
  14766. ,
  14767. n.onContentChanged = function() {
  14768. this.init(this.player)
  14769. }
  14770. ,
  14771. t
  14772. }(Eo.getState("ContentState"));
  14773. Eo.registerState("BeforePreroll", jo);
  14774. var Oo = function(e) {
  14775. function t() {
  14776. return e.apply(this, arguments) || this
  14777. }
  14778. wo(t, e),
  14779. t._getName = function() {
  14780. return "Midroll"
  14781. }
  14782. ;
  14783. var n = t.prototype;
  14784. return n.init = function(e) {
  14785. e.ads.adType = "midroll",
  14786. Io.start(e),
  14787. e.addClass("vjs-ad-loading")
  14788. }
  14789. ,
  14790. n.onAdStarted = function(e) {
  14791. e.removeClass("vjs-ad-loading")
  14792. }
  14793. ,
  14794. n.endLinearAdMode = function() {
  14795. var e = this.player;
  14796. this.inAdBreak() && (this.contentResuming = !0,
  14797. e.addClass("vjs-ad-content-resuming"),
  14798. e.removeClass("vjs-ad-loading"),
  14799. Io.end(e))
  14800. }
  14801. ,
  14802. n.onAdsError = function(e) {
  14803. this.inAdBreak() && e.ads.endLinearAdMode()
  14804. }
  14805. ,
  14806. n.cleanup = function(e) {
  14807. e.removeClass("vjs-ad-loading"),
  14808. e.removeClass("vjs-ad-content-resuming")
  14809. }
  14810. ,
  14811. t
  14812. }(Eo.getState("AdState"));
  14813. Eo.registerState("Midroll", Oo);
  14814. var No = function(e) {
  14815. function t() {
  14816. return e.apply(this, arguments) || this
  14817. }
  14818. wo(t, e),
  14819. t._getName = function() {
  14820. return "Postroll"
  14821. }
  14822. ;
  14823. var n = t.prototype;
  14824. return n.init = function(e) {
  14825. if (this.waitingForAdBreak = !0,
  14826. e.ads._contentEnding = !0,
  14827. e.ads.nopostroll_) {
  14828. this.resumeContent(e);
  14829. var t = Eo.getState("AdsDone");
  14830. this.transitionTo(t)
  14831. } else {
  14832. e.addClass("vjs-ad-loading");
  14833. var n = e.ads.settings.timeout;
  14834. "number" == typeof e.ads.settings.postrollTimeout && (n = e.ads.settings.postrollTimeout),
  14835. this._postrollTimeout = e.setTimeout(function() {
  14836. e.trigger("adtimeout")
  14837. }, n)
  14838. }
  14839. }
  14840. ,
  14841. n.startLinearAdMode = function() {
  14842. var e = this.player;
  14843. e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Postroll)") : (e.ads.adType = "postroll",
  14844. e.clearTimeout(this._postrollTimeout),
  14845. this.waitingForAdBreak = !1,
  14846. Io.start(e))
  14847. }
  14848. ,
  14849. n.onAdStarted = function(e) {
  14850. e.removeClass("vjs-ad-loading")
  14851. }
  14852. ,
  14853. n.endLinearAdMode = function() {
  14854. var e = this
  14855. , t = this.player
  14856. , n = Eo.getState("AdsDone");
  14857. this.inAdBreak() && (t.removeClass("vjs-ad-loading"),
  14858. this.resumeContent(t),
  14859. Io.end(t, function() {
  14860. e.transitionTo(n)
  14861. }))
  14862. }
  14863. ,
  14864. n.skipLinearAdMode = function() {
  14865. var e = this.player;
  14866. e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : (e.ads.debug("Postroll abort (skipLinearAdMode)"),
  14867. e.trigger("adskip"),
  14868. this.abort(e))
  14869. }
  14870. ,
  14871. n.onAdTimeout = function(e) {
  14872. e.ads.debug("Postroll abort (adtimeout)"),
  14873. this.abort(e)
  14874. }
  14875. ,
  14876. n.onAdsError = function(e) {
  14877. e.ads.debug("Postroll abort (adserror)"),
  14878. e.ads.inAdBreak() ? e.ads.endLinearAdMode() : this.abort(e)
  14879. }
  14880. ,
  14881. n.onContentChanged = function(e) {
  14882. if (this.isContentResuming()) {
  14883. var t = Eo.getState("BeforePreroll");
  14884. this.transitionTo(t)
  14885. } else if (!this.inAdBreak()) {
  14886. var n = Eo.getState("Preroll");
  14887. this.transitionTo(n)
  14888. }
  14889. }
  14890. ,
  14891. n.onNoPostroll = function(e) {
  14892. this.isContentResuming() || this.inAdBreak() ? oo.log.warn("Unexpected nopostroll event (Postroll)") : this.abort(e)
  14893. }
  14894. ,
  14895. n.resumeContent = function(e) {
  14896. this.contentResuming = !0,
  14897. e.addClass("vjs-ad-content-resuming")
  14898. }
  14899. ,
  14900. n.abort = function(e) {
  14901. var t = Eo.getState("AdsDone");
  14902. this.resumeContent(e),
  14903. e.removeClass("vjs-ad-loading"),
  14904. this.transitionTo(t)
  14905. }
  14906. ,
  14907. n.cleanup = function(e) {
  14908. e.removeClass("vjs-ad-content-resuming"),
  14909. e.clearTimeout(this._postrollTimeout),
  14910. e.ads._contentEnding = !1
  14911. }
  14912. ,
  14913. t
  14914. }(Eo.getState("AdState"));
  14915. Eo.registerState("Postroll", No);
  14916. var Do = function(e) {
  14917. function t() {
  14918. return e.apply(this, arguments) || this
  14919. }
  14920. wo(t, e),
  14921. t._getName = function() {
  14922. return "ContentPlayback"
  14923. }
  14924. ;
  14925. var n = t.prototype;
  14926. return n.init = function(e) {
  14927. e.ads._shouldBlockPlay = !1
  14928. }
  14929. ,
  14930. n.onAdsReady = function(e) {
  14931. e.ads.debug("Received adsready event (ContentPlayback)"),
  14932. e.ads.nopreroll_ || (e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),
  14933. e.trigger("readyforpreroll"))
  14934. }
  14935. ,
  14936. n.onReadyForPostroll = function(e) {
  14937. var t = Eo.getState("Postroll");
  14938. e.ads.debug("Received readyforpostroll event"),
  14939. this.transitionTo(t)
  14940. }
  14941. ,
  14942. n.startLinearAdMode = function() {
  14943. var e = Eo.getState("Midroll");
  14944. this.transitionTo(e)
  14945. }
  14946. ,
  14947. t
  14948. }(Eo.getState("ContentState"));
  14949. Eo.registerState("ContentPlayback", Do);
  14950. var Bo = function(e) {
  14951. function t() {
  14952. return e.apply(this, arguments) || this
  14953. }
  14954. wo(t, e),
  14955. t._getName = function() {
  14956. return "StitchedContentPlayback"
  14957. }
  14958. ;
  14959. var n = t.prototype;
  14960. return n.init = function() {
  14961. this.player.ads._shouldBlockPlay = !1
  14962. }
  14963. ,
  14964. n.onContentChanged = function() {
  14965. this.player.ads.debug("Received contentchanged event (" + this.constructor._getName() + ")")
  14966. }
  14967. ,
  14968. n.startLinearAdMode = function() {
  14969. var e = Eo.getState("StitchedAdRoll");
  14970. this.transitionTo(e)
  14971. }
  14972. ,
  14973. t
  14974. }(Eo.getState("ContentState"));
  14975. Eo.registerState("StitchedContentPlayback", Bo);
  14976. var Ro = function(e) {
  14977. function t() {
  14978. return e.apply(this, arguments) || this
  14979. }
  14980. wo(t, e),
  14981. t._getName = function() {
  14982. return "StitchedAdRoll"
  14983. }
  14984. ;
  14985. var n = t.prototype;
  14986. return n.init = function() {
  14987. this.waitingForAdBreak = !1,
  14988. this.contentResuming = !1,
  14989. this.player.ads.adType = "stitched",
  14990. Io.start(this.player)
  14991. }
  14992. ,
  14993. n.onPlaying = function() {}
  14994. ,
  14995. n.onContentResumed = function() {}
  14996. ,
  14997. n.onAdEnded = function() {
  14998. this.endLinearAdMode(),
  14999. this.player.trigger("ended")
  15000. }
  15001. ,
  15002. n.endLinearAdMode = function() {
  15003. var e = Eo.getState("StitchedContentPlayback");
  15004. Io.end(this.player),
  15005. this.transitionTo(e)
  15006. }
  15007. ,
  15008. t
  15009. }(Eo.getState("AdState"));
  15010. Eo.registerState("StitchedAdRoll", Ro);
  15011. function Fo(e) {
  15012. var i = this
  15013. , t = oo.mergeOptions(Uo, e)
  15014. , n = [];
  15015. function r() {
  15016. var e = i.textTracks();
  15017. if (!i.ads.shouldPlayContentBehindAd(i) && i.ads.inAdBreak() && i.tech_.featuresNativeTextTracks && oo.browser.IS_IOS && !Array.isArray(i.textTracks()))
  15018. for (var t = 0; t < e.length; t++) {
  15019. var n = e[t];
  15020. "showing" === n.mode && (n.mode = "disabled")
  15021. }
  15022. }
  15023. Qo.concat(["firstplay", "loadedalldata"]).forEach(function(e) {
  15024. -1 === n.indexOf(e) && n.push(e)
  15025. }),
  15026. i.on(n, po),
  15027. Vo() || function(e, t) {
  15028. t && oo.log("Using cancelContentPlay to block content playback"),
  15029. e.on("play", _o)
  15030. }(i, t.debug),
  15031. i.setTimeout(function() {
  15032. i.ads._hasThereBeenALoadStartDuringPlayerLife || "" === i.src() || oo.log.error("videojs-contrib-ads has not seen a loadstart event 5 seconds after being initialized, but a source is present. This indicates that videojs-contrib-ads was initialized too late. It must be initialized immediately after video.js in the same tick. As a result, some ads will not play and some media events will be incorrect. For more information, see http://videojs.github.io/videojs-contrib-ads/integrator/getting-started.html")
  15033. }, 5e3),
  15034. i.on("ended", function() {
  15035. i.hasClass("vjs-has-started") || i.addClass("vjs-has-started")
  15036. }),
  15037. i.on("contenttimeupdate", function() {
  15038. i.removeClass("vjs-waiting")
  15039. }),
  15040. i.on(["addurationchange", "adcanplay"], function() {
  15041. if (!i.ads.settings.stitchedAds && !i.hasStarted() && (!i.ads.snapshot || i.currentSrc() !== i.ads.snapshot.currentSrc) && i.ads.inAdBreak()) {
  15042. var e = i.play();
  15043. e && e.catch && e.catch(function(e) {
  15044. oo.log.warn("Play promise rejected when playing ad", e)
  15045. })
  15046. }
  15047. }),
  15048. i.on("nopreroll", function() {
  15049. i.ads.debug("Received nopreroll event"),
  15050. i.ads.nopreroll_ = !0
  15051. }),
  15052. i.on("nopostroll", function() {
  15053. i.ads.debug("Received nopostroll event"),
  15054. i.ads.nopostroll_ = !0
  15055. }),
  15056. i.on("playing", function() {
  15057. i.ads._cancelledPlay = !1,
  15058. i.ads._pausedOnContentupdate = !1
  15059. }),
  15060. i.on("play", function() {
  15061. i.ads._playRequested = !0
  15062. }),
  15063. i.one("loadstart", function() {
  15064. i.ads._hasThereBeenALoadStartDuringPlayerLife = !0
  15065. }),
  15066. i.on("loadeddata", function() {
  15067. i.ads._hasThereBeenALoadedData = !0
  15068. }),
  15069. i.on("loadedmetadata", function() {
  15070. i.ads._hasThereBeenALoadedMetaData = !0
  15071. }),
  15072. i.ads = function(n) {
  15073. return {
  15074. disableNextSnapshotRestore: !1,
  15075. _contentEnding: !1,
  15076. _contentHasEnded: !1,
  15077. _hasThereBeenALoadStartDuringPlayerLife: !1,
  15078. _hasThereBeenALoadedData: !1,
  15079. _hasThereBeenALoadedMetaData: !1,
  15080. _inLinearAdMode: !1,
  15081. _shouldBlockPlay: !1,
  15082. _playBlocked: !1,
  15083. _playRequested: !1,
  15084. adType: null,
  15085. VERSION: "6.9.0",
  15086. reset: function() {
  15087. n.ads.disableNextSnapshotRestore = !1,
  15088. n.ads._contentEnding = !1,
  15089. n.ads._contentHasEnded = !1,
  15090. n.ads.snapshot = null,
  15091. n.ads.adType = null,
  15092. n.ads._hasThereBeenALoadedData = !1,
  15093. n.ads._hasThereBeenALoadedMetaData = !1,
  15094. n.ads._cancelledPlay = !1,
  15095. n.ads._shouldBlockPlay = !1,
  15096. n.ads._playBlocked = !1,
  15097. n.ads.nopreroll_ = !1,
  15098. n.ads.nopostroll_ = !1,
  15099. n.ads._playRequested = !1
  15100. },
  15101. startLinearAdMode: function() {
  15102. n.ads._state.startLinearAdMode()
  15103. },
  15104. endLinearAdMode: function() {
  15105. n.ads._state.endLinearAdMode()
  15106. },
  15107. skipLinearAdMode: function() {
  15108. n.ads._state.skipLinearAdMode()
  15109. },
  15110. stitchedAds: function(e) {
  15111. return void 0 !== e && (oo.log.warn("Using player.ads.stitchedAds() as a setter is deprecated, it should be set as an option upon initialization of contrib-ads."),
  15112. this.settings.stitchedAds = !!e),
  15113. this.settings.stitchedAds
  15114. },
  15115. videoElementRecycled: function() {
  15116. if (n.ads.shouldPlayContentBehindAd(n))
  15117. return !1;
  15118. if (!this.snapshot)
  15119. throw new Error("You cannot use videoElementRecycled while there is no snapshot.");
  15120. var e = n.tech_.src() !== this.snapshot.src
  15121. , t = n.currentSrc() !== this.snapshot.currentSrc;
  15122. return e || t
  15123. },
  15124. isLive: function(e) {
  15125. return void 0 === e && (e = n),
  15126. "boolean" == typeof e.ads.settings.contentIsLive ? e.ads.settings.contentIsLive : e.duration() === 1 / 0 || "8" === oo.browser.IOS_VERSION && 0 === e.duration()
  15127. },
  15128. shouldPlayContentBehindAd: function(e) {
  15129. if (void 0 === e && (e = n),
  15130. e)
  15131. return !!e.ads.settings.liveCuePoints && (!oo.browser.IS_IOS && !oo.browser.IS_ANDROID && e.duration() === 1 / 0);
  15132. throw new Error("shouldPlayContentBehindAd requires a player as a param")
  15133. },
  15134. shouldTakeSnapshots: function(e) {
  15135. return void 0 === e && (e = n),
  15136. !this.shouldPlayContentBehindAd(e) && !this.stitchedAds()
  15137. },
  15138. isInAdMode: function() {
  15139. return this._state.isAdState()
  15140. },
  15141. isWaitingForAdBreak: function() {
  15142. return this._state.isWaitingForAdBreak()
  15143. },
  15144. isContentResuming: function() {
  15145. return this._state.isContentResuming()
  15146. },
  15147. isAdPlaying: function() {
  15148. return this._state.inAdBreak()
  15149. },
  15150. inAdBreak: function() {
  15151. return this._state.inAdBreak()
  15152. },
  15153. removeNativePoster: function() {
  15154. var e = n.$(".vjs-tech");
  15155. e && e.removeAttribute("poster")
  15156. },
  15157. debug: function() {
  15158. if (this.settings.debug) {
  15159. for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
  15160. t[n] = arguments[n];
  15161. 1 === t.length && "string" == typeof t[0] ? oo.log("ADS: " + t[0]) : oo.log.apply(oo, ["ADS:"].concat(t))
  15162. }
  15163. }
  15164. }
  15165. }(i),
  15166. (i.ads.settings = t).stitchedAds = !!t.stitchedAds,
  15167. t.stitchedAds ? i.ads._state = new (Eo.getState("StitchedContentPlayback"))(i) : i.ads._state = new (Eo.getState("BeforePreroll"))(i),
  15168. i.ads._state.init(i),
  15169. i.ads.cueTextTracks = mo,
  15170. i.ads.adMacroReplacement = function(e, o, t) {
  15171. var n = this
  15172. , l = {};
  15173. e = e.replace(/{([^}=]+)=([^}]+)}/g, function(e, t, n) {
  15174. return l["{" + t + "}"] = n,
  15175. "{" + t + "}"
  15176. }),
  15177. void 0 === o && (o = !1);
  15178. var i = {};
  15179. for (var r in void 0 !== t && (i = t),
  15180. i["{player.id}"] = this.options_["data-player"] || this.id_,
  15181. i["{player.height}"] = this.currentHeight(),
  15182. i["{player.width}"] = this.currentWidth(),
  15183. i["{mediainfo.id}"] = this.mediainfo ? this.mediainfo.id : "",
  15184. i["{mediainfo.name}"] = this.mediainfo ? this.mediainfo.name : "",
  15185. i["{mediainfo.duration}"] = this.mediainfo ? this.mediainfo.duration : "",
  15186. i["{player.duration}"] = this.duration(),
  15187. i["{player.pageUrl}"] = oo.dom.isInFrame() ? f.referrer : p.location.href,
  15188. i["{playlistinfo.id}"] = this.playlistinfo ? this.playlistinfo.id : "",
  15189. i["{playlistinfo.name}"] = this.playlistinfo ? this.playlistinfo.name : "",
  15190. i["{timestamp}"] = (new Date).getTime(),
  15191. i["{document.referrer}"] = f.referrer,
  15192. i["{window.location.href}"] = p.location.href,
  15193. i["{random}"] = Math.floor(1e12 * Math.random()),
  15194. ["description", "tags", "reference_id", "ad_keys"].forEach(function(e) {
  15195. n.mediainfo && n.mediainfo[e] ? i["{mediainfo." + e + "}"] = n.mediainfo[e] : l["{mediainfo." + e + "}"] ? i["{mediainfo." + e + "}"] = l["{mediainfo." + e + "}"] : i["{mediainfo." + e + "}"] = ""
  15196. }),
  15197. go(this.mediainfo, i, "custom_fields"),
  15198. go(this.mediainfo, i, "customFields"),
  15199. Object.keys(yo).forEach(function(e) {
  15200. i["{tcf." + e + "}"] = yo[e]
  15201. }),
  15202. i["{tcf.gdprAppliesInt}"] = yo.gdprApplies ? 1 : 0,
  15203. i)
  15204. e = e.split(r).join(vo(i[r], o));
  15205. for (var s in e = e.replace(/{pageVariable\.([^}]+)}/g, function(e, t) {
  15206. for (var n, i = p, r = t.split("."), s = 0; s < r.length; s++)
  15207. s === r.length - 1 ? n = i[r[s]] : i = i[r[s]];
  15208. var a = typeof n;
  15209. return null === n ? "null" : void 0 === n ? l["{pageVariable." + t + "}"] ? l["{pageVariable." + t + "}"] : (oo.log.warn('Page variable "' + t + '" not found'),
  15210. "") : "string" != a && "number" != a && "boolean" != a ? (oo.log.warn('Page variable "' + t + '" is not a supported type'),
  15211. "") : vo(String(n), o)
  15212. }),
  15213. l)
  15214. e = e.replace(s, l[s]);
  15215. return e
  15216. }
  15217. .bind(i),
  15218. function(t) {
  15219. t.ads.contentSrc = t.currentSrc(),
  15220. t.ads._seenInitialLoadstart = !1,
  15221. t.on("loadstart", function() {
  15222. if (!t.ads.inAdBreak()) {
  15223. var e = t.currentSrc();
  15224. e !== t.ads.contentSrc && (t.ads._seenInitialLoadstart && t.trigger({
  15225. type: "contentchanged"
  15226. }),
  15227. t.trigger({
  15228. type: "contentupdate",
  15229. oldValue: t.ads.contentSrc,
  15230. newValue: e
  15231. }),
  15232. t.ads.contentSrc = e),
  15233. t.ads._seenInitialLoadstart = !0
  15234. }
  15235. })
  15236. }(i),
  15237. i.on("contentchanged", i.ads.reset),
  15238. i.ready(function() {
  15239. i.textTracks().addEventListener("change", r)
  15240. }),
  15241. i.on(["play", "playing", "ended", "adsready", "adscanceled", "adskip", "adserror", "adtimeout", "adended", "ads-ad-started", "contentchanged", "dispose", "contentresumed", "readyforpostroll", "nopreroll", "nopostroll"], function(e) {
  15242. i.ads._state.handleEvent(e.type)
  15243. }),
  15244. i.on("dispose", function() {
  15245. i.ads.reset(),
  15246. i.textTracks().removeEventListener("change", r)
  15247. }),
  15248. fo(),
  15249. i.ads.listenToTcf = fo
  15250. }
  15251. var Ho, Vo = bo.isMiddlewareMediatorSupported, Qo = oo.getTech("Html5").Events, Uo = {
  15252. timeout: 5e3,
  15253. prerollTimeout: void 0,
  15254. postrollTimeout: void 0,
  15255. debug: !1,
  15256. stitchedAds: !1,
  15257. contentIsLive: void 0,
  15258. liveCuePoints: !0,
  15259. allowVjsAutoplay: oo.options.normalizeAutoplay || !1
  15260. };
  15261. function qo(e) {
  15262. if (void 0 === e)
  15263. throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
  15264. return e
  15265. }
  15266. Fo.VERSION = "6.9.0",
  15267. Ho = Fo,
  15268. function() {
  15269. if (oo.getPlugin)
  15270. return Boolean(oo.getPlugin("ads"));
  15271. var e = oo.getComponent("Player");
  15272. return Boolean(e && e.prototype.ads)
  15273. }() || ((oo.registerPlugin || oo.plugin)("ads", Ho),
  15274. ko() && !oo.usingContribAdsMiddleware_ && (oo.use("*", Co),
  15275. oo.usingContribAdsMiddleware_ = !0,
  15276. oo.log.debug("Play middleware has been registered with videojs")));
  15277. function zo(e) {
  15278. var t = this;
  15279. if (oo.browser.IS_IE8)
  15280. for (var n in t = f.createElement("custom"),
  15281. zo.prototype)
  15282. "constructor" !== n && (t[n] = zo.prototype[n]);
  15283. return t.id = e.id,
  15284. t.label = t.id,
  15285. t.width = e.width,
  15286. t.height = e.height,
  15287. t.bitrate = e.bandwidth,
  15288. t.enabled_ = e.enabled,
  15289. Object.defineProperty(t, "enabled", {
  15290. get: function() {
  15291. return t.enabled_()
  15292. },
  15293. set: function(e) {
  15294. t.enabled_(e)
  15295. }
  15296. }),
  15297. t
  15298. }
  15299. var Wo = function(i) {
  15300. function r() {
  15301. var e, t = qo(qo(e = i.call(this) || this));
  15302. if (oo.browser.IS_IE8)
  15303. for (var n in t = f.createElement("custom"),
  15304. r.prototype)
  15305. "constructor" !== n && (t[n] = r.prototype[n]);
  15306. return t.levels_ = [],
  15307. t.selectedIndex_ = -1,
  15308. Object.defineProperty(t, "selectedIndex", {
  15309. get: function() {
  15310. return t.selectedIndex_
  15311. }
  15312. }),
  15313. Object.defineProperty(t, "length", {
  15314. get: function() {
  15315. return t.levels_.length
  15316. }
  15317. }),
  15318. t || qo(e)
  15319. }
  15320. !/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */
  15321. function(e, t) {
  15322. e.prototype = Object.create(t.prototype),
  15323. (e.prototype.constructor = e).__proto__ = t
  15324. }(r, i);
  15325. var e = r.prototype;
  15326. return e.addQualityLevel = function(e) {
  15327. var t = this.getQualityLevelById(e.id);
  15328. if (t)
  15329. return t;
  15330. var n = this.levels_.length;
  15331. return t = new zo(e),
  15332. "" + n in this || Object.defineProperty(this, n, {
  15333. get: function() {
  15334. return this.levels_[n]
  15335. }
  15336. }),
  15337. this.levels_.push(t),
  15338. this.trigger({
  15339. qualityLevel: t,
  15340. type: "addqualitylevel"
  15341. }),
  15342. t
  15343. }
  15344. ,
  15345. e.removeQualityLevel = function(e) {
  15346. for (var t = null, n = 0, i = this.length; n < i; n++)
  15347. if (this[n] === e) {
  15348. t = this.levels_.splice(n, 1)[0],
  15349. this.selectedIndex_ === n ? this.selectedIndex_ = -1 : this.selectedIndex_ > n && this.selectedIndex_--;
  15350. break
  15351. }
  15352. return t && this.trigger({
  15353. qualityLevel: e,
  15354. type: "removequalitylevel"
  15355. }),
  15356. t
  15357. }
  15358. ,
  15359. e.getQualityLevelById = function(e) {
  15360. for (var t = 0, n = this.length; t < n; t++) {
  15361. var i = this[t];
  15362. if (i.id === e)
  15363. return i
  15364. }
  15365. return null
  15366. }
  15367. ,
  15368. e.dispose = function() {
  15369. this.selectedIndex_ = -1,
  15370. this.levels_.length = 0
  15371. }
  15372. ,
  15373. r
  15374. }(oo.EventTarget);
  15375. for (var Ko in Wo.prototype.allowedEvents_ = {
  15376. change: "change",
  15377. addqualitylevel: "addqualitylevel",
  15378. removequalitylevel: "removequalitylevel"
  15379. },
  15380. Wo.prototype.allowedEvents_)
  15381. Wo.prototype["on" + Ko] = null;
  15382. function Xo(e) {
  15383. return function(t) {
  15384. var n = t.qualityLevels
  15385. , i = new Wo;
  15386. return t.on("dispose", function e() {
  15387. i.dispose(),
  15388. t.qualityLevels = n,
  15389. t.off("dispose", e)
  15390. }),
  15391. t.qualityLevels = function() {
  15392. return i
  15393. }
  15394. ,
  15395. t.qualityLevels.VERSION = "2.1.0",
  15396. i
  15397. }(this, oo.mergeOptions({}, e))
  15398. }
  15399. return (oo.registerPlugin || oo.plugin)("qualityLevels", Xo),
  15400. Xo.VERSION = "2.1.0",
  15401. oo
  15402. });