123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402 |
- /**
- * @license
- * Video.js 7.8.0 <http://videojs.com/>
- * Copyright Brightcove, Inc. <https://www.brightcove.com/>
- * Available under Apache License Version 2.0
- * <https://github.com/videojs/video.js/blob/master/LICENSE>
- *
- * Includes vtt.js <https://github.com/mozilla/vtt.js>
- * Available under Apache License Version 2.0
- * <https://github.com/mozilla/vtt.js/blob/master/LICENSE>
- */
- !function(e, t) {
- "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)
- }(this, function(p, f) {
- "use strict";
- p = p && Object.prototype.hasOwnProperty.call(p, "default") ? p.default : p,
- f = f && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
- var v = "1.12.7"
- , g = "22-7-25"
- , y = "7.8.0"
- , u = []
- , e = function(o, l) {
- return function(e, t, n) {
- var i = l.levels[t]
- , r = new RegExp("^(" + i + ")$");
- if ("log" !== e && n.unshift(e.toUpperCase() + ":"),
- n.unshift(o + ":"),
- u) {
- u.push([].concat(n));
- var s = u.length - 1e3;
- u.splice(0, 0 < s ? s : 0)
- }
- if (p.console) {
- var a = p.console[e];
- a || "debug" !== e || (a = p.console.info || p.console.log),
- a && i && r.test(e) && a[Array.isArray(n) ? "apply" : "call"](p.console, n)
- }
- }
- };
- var m = function t(n) {
- function i() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- r("log", s, t)
- }
- var r, s = "info";
- return r = e(n, i),
- i.createLogger = function(e) {
- return t(n + ": " + e)
- }
- ,
- i.levels = {
- all: "debug|log|warn|error",
- off: "",
- debug: "debug|log|warn|error",
- info: "log|warn|error",
- warn: "warn|error",
- error: "error",
- DEFAULT: s
- },
- i.level = function(e) {
- if ("string" == typeof e) {
- if (!i.levels.hasOwnProperty(e))
- throw new Error('"' + e + '" in not a valid log level');
- s = e
- }
- return s
- }
- ,
- (i.history = function() {
- return u ? [].concat(u) : []
- }
- ).filter = function(t) {
- return (u || []).filter(function(e) {
- return new RegExp(".*" + t + ".*").test(e[0])
- })
- }
- ,
- i.history.clear = function() {
- u && (u.length = 0)
- }
- ,
- i.history.disable = function() {
- null !== u && (u.length = 0,
- u = null)
- }
- ,
- i.history.enable = function() {
- null === u && (u = [])
- }
- ,
- i.error = function() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- return r("error", s, t)
- }
- ,
- i.warn = function() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- return r("warn", s, t)
- }
- ,
- i.debug = function() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- return r("debug", s, t)
- }
- ,
- i
- }("VJS")
- , _ = m.createLogger
- , t = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
- function n(e, t) {
- return e(t = {
- exports: {}
- }, t.exports),
- t.exports
- }
- var r = n(function(e) {
- function t() {
- return e.exports = t = Object.assign || function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var i in n)
- Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
- }
- return e
- }
- ,
- t.apply(this, arguments)
- }
- e.exports = t
- })
- , i = Object.prototype.toString
- , s = function(e) {
- return l(e) ? Object.keys(e) : []
- };
- function a(t, n) {
- s(t).forEach(function(e) {
- return n(t[e], e)
- })
- }
- function o(n, i, e) {
- return void 0 === e && (e = 0),
- s(n).reduce(function(e, t) {
- return i(e, n[t], t)
- }, e)
- }
- function b(n) {
- for (var e = arguments.length, t = new Array(1 < e ? e - 1 : 0), i = 1; i < e; i++)
- t[i - 1] = arguments[i];
- return Object.assign ? r.apply(void 0, [n].concat(t)) : (t.forEach(function(e) {
- e && a(e, function(e, t) {
- n[t] = e
- })
- }),
- n)
- }
- function l(e) {
- return !!e && "object" == typeof e
- }
- function c(e) {
- return l(e) && "[object Object]" === i.call(e) && e.constructor === Object
- }
- function h(e, t) {
- if (!e || !t)
- return "";
- if ("function" != typeof p.getComputedStyle)
- return "";
- var n = p.getComputedStyle(e);
- return n ? n.getPropertyValue(t) || n[t] : ""
- }
- function d(e) {
- return "string" == typeof e && Boolean(e.trim())
- }
- function T(e) {
- if (0 <= e.indexOf(" "))
- throw new Error("class has illegal whitespace characters")
- }
- function C() {
- return f === p.document
- }
- function k(e) {
- return l(e) && 1 === e.nodeType
- }
- function E() {
- try {
- return p.parent !== p.self
- } catch (e) {
- return !0
- }
- }
- function S(i) {
- return function(e, t) {
- if (!d(e))
- return f[i](null);
- d(t) && (t = f.querySelector(t));
- var n = k(t) ? t : f;
- return n[i] && n[i](e)
- }
- }
- function w(e, n, t, i) {
- void 0 === e && (e = "div"),
- void 0 === n && (n = {}),
- void 0 === t && (t = {});
- var r = f.createElement(e);
- return Object.getOwnPropertyNames(n).forEach(function(e) {
- var t = n[e];
- -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 + "."),
- r.setAttribute(e, t)) : "textContent" === e ? x(r, t) : r[e] !== t && (r[e] = t)
- }),
- Object.getOwnPropertyNames(t).forEach(function(e) {
- r.setAttribute(e, t[e])
- }),
- i && W(r, i),
- r
- }
- function x(e, t) {
- return "undefined" == typeof e.textContent ? e.innerText = t : e.textContent = t,
- e
- }
- function A(e, t) {
- t.firstChild ? t.insertBefore(e, t.firstChild) : t.appendChild(e)
- }
- function P(e, t) {
- return T(t),
- e.classList ? e.classList.contains(t) : function(e) {
- return new RegExp("(^|\\s)" + e + "($|\\s)")
- }(t).test(e.className)
- }
- function L(e, t) {
- return e.classList ? e.classList.add(t) : P(e, t) || (e.className = (e.className + " " + t).trim()),
- e
- }
- function I(e, t) {
- return e.classList ? e.classList.remove(t) : (T(t),
- e.className = e.className.split(/\s+/).filter(function(e) {
- return e !== t
- }).join(" ")),
- e
- }
- function M(e, t, n) {
- var i = P(e, t);
- if ("function" == typeof n && (n = n(e, t)),
- "boolean" != typeof n && (n = !i),
- n !== i)
- return n ? L(e, t) : I(e, t),
- e
- }
- function j(n, i) {
- Object.getOwnPropertyNames(i).forEach(function(e) {
- var t = i[e];
- null === t || "undefined" == typeof t || !1 === t ? n.removeAttribute(e) : n.setAttribute(e, !0 === t ? "" : t)
- })
- }
- function O(e) {
- var t = {}
- , n = ",autoplay,controls,playsinline,loop,muted,default,defaultMuted,";
- if (e && e.attributes && 0 < e.attributes.length)
- for (var i = e.attributes, r = i.length - 1; 0 <= r; r--) {
- var s = i[r].name
- , a = i[r].value;
- "boolean" != typeof e[s] && -1 === n.indexOf("," + s + ",") || (a = null !== a),
- t[s] = a
- }
- return t
- }
- function N(e, t) {
- return e.getAttribute(t)
- }
- function D(e, t, n) {
- e.setAttribute(t, n)
- }
- function B(e, t) {
- e.removeAttribute(t)
- }
- function R() {
- f.body.focus(),
- f.onselectstart = function() {
- return !1
- }
- }
- function F() {
- f.onselectstart = function() {
- return !0
- }
- }
- function H(e) {
- if (e && e.getBoundingClientRect && e.parentNode) {
- var t = e.getBoundingClientRect()
- , n = {};
- return ["bottom", "height", "left", "right", "top", "width"].forEach(function(e) {
- void 0 !== t[e] && (n[e] = t[e])
- }),
- n.height || (n.height = parseFloat(h(e, "height"))),
- n.width || (n.width = parseFloat(h(e, "width"))),
- n
- }
- }
- function V(e) {
- var t;
- if (e.getBoundingClientRect && e.parentNode && (t = e.getBoundingClientRect()),
- !t)
- return {
- left: 0,
- top: 0
- };
- var n = f.documentElement
- , i = f.body
- , r = n.clientLeft || i.clientLeft || 0
- , s = p.pageXOffset || i.scrollLeft
- , a = t.left + s - r
- , o = n.clientTop || i.clientTop || 0
- , l = p.pageYOffset || i.scrollTop
- , u = t.top + l - o;
- return {
- left: Math.round(a),
- top: Math.round(u)
- }
- }
- function Q(e, t) {
- var n = {}
- , i = V(e)
- , r = e.offsetWidth
- , s = e.offsetHeight
- , a = i.top
- , o = i.left
- , l = t.pageY
- , u = t.pageX;
- return t.changedTouches && (u = t.changedTouches[0].pageX,
- l = t.changedTouches[0].pageY),
- n.y = Math.max(0, Math.min(1, (a - l + s) / s)),
- n.x = Math.max(0, Math.min(1, (u - o) / r)),
- n
- }
- function U(e) {
- return l(e) && 3 === e.nodeType
- }
- function q(e) {
- for (; e.firstChild; )
- e.removeChild(e.firstChild);
- return e
- }
- function z(e) {
- return "function" == typeof e && (e = e()),
- (Array.isArray(e) ? e : [e]).map(function(e) {
- return "function" == typeof e && (e = e()),
- k(e) || U(e) ? e : "string" == typeof e && /\S/.test(e) ? f.createTextNode(e) : void 0
- }).filter(function(e) {
- return e
- })
- }
- function W(t, e) {
- return z(e).forEach(function(e) {
- return t.appendChild(e)
- }),
- t
- }
- function K(e, t) {
- return W(q(e), t)
- }
- function X(e) {
- 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))
- }
- function G(e) {
- e.oncontextmenu = function() {
- return !1
- }
- }
- var Y, $ = S("querySelector"), J = S("querySelectorAll"), Z = Object.freeze({
- __proto__: null,
- isReal: C,
- isEl: k,
- isInFrame: E,
- createEl: w,
- textContent: x,
- prependTo: A,
- hasClass: P,
- addClass: L,
- removeClass: I,
- toggleClass: M,
- setAttributes: j,
- getAttributes: O,
- getAttribute: N,
- setAttribute: D,
- removeAttribute: B,
- blockTextSelection: R,
- unblockTextSelection: F,
- getBoundingClientRect: H,
- findPosition: V,
- getPointerPosition: Q,
- isTextNode: U,
- emptyEl: q,
- normalizeContent: z,
- appendContent: W,
- insertContent: K,
- isSingleLeftClick: X,
- isSingleRightClick: function(e) {
- 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)
- },
- blockContextMenu: G,
- $: $,
- $$: J
- }), ee = !1, te = function() {
- if (C() && !1 !== Y.options.autoSetup) {
- var e = Array.prototype.slice.call(f.getElementsByTagName("video"))
- , t = Array.prototype.slice.call(f.getElementsByTagName("audio"))
- , n = Array.prototype.slice.call(f.getElementsByTagName("video-js"))
- , i = e.concat(t, n);
- if (i && 0 < i.length)
- for (var r = 0, s = i.length; r < s; r++) {
- var a = i[r];
- if (!a || !a.getAttribute) {
- ne(1);
- break
- }
- void 0 === a.player && null !== a.getAttribute("data-setup") && Y(a)
- }
- else
- ee || ne(1)
- }
- };
- function ne(e, t) {
- t && (Y = t),
- p.setTimeout(te, e)
- }
- function ie() {
- ee = !0,
- p.removeEventListener("load", ie)
- }
- C() && ("complete" === f.readyState ? ie() : p.addEventListener("load", ie));
- function re(e) {
- var t = f.createElement("style");
- return t.className = e,
- t
- }
- function se(e, t) {
- e.styleSheet ? e.styleSheet.cssText = t : e.textContent = t
- }
- var ae, oe = 3;
- function le() {
- return oe++
- }
- p.WeakMap || (ae = function() {
- function e() {
- this.vdata = "vdata" + Math.floor(p.performance && p.performance.now() || Date.now()),
- this.data = {}
- }
- var t = e.prototype;
- return t.set = function(e, t) {
- var n = e[this.vdata] || le();
- return e[this.vdata] || (e[this.vdata] = n),
- this.data[n] = t,
- this
- }
- ,
- t.get = function(e) {
- var t = e[this.vdata];
- if (t)
- return this.data[t];
- m("We have no data for this element", e)
- }
- ,
- t.has = function(e) {
- return e[this.vdata]in this.data
- }
- ,
- t.delete = function(e) {
- var t = e[this.vdata];
- t && (delete this.data[t],
- delete e[this.vdata])
- }
- ,
- e
- }());
- var ue, ce = p.WeakMap ? new WeakMap : new ae;
- function he(e, t) {
- if (ce.has(e)) {
- var n = ce.get(e);
- 0 === n.handlers[t].length && (delete n.handlers[t],
- e.removeEventListener ? e.removeEventListener(t, n.dispatcher, !1) : e.detachEvent && e.detachEvent("on" + t, n.dispatcher)),
- Object.getOwnPropertyNames(n.handlers).length <= 0 && (delete n.handlers,
- delete n.dispatcher,
- delete n.disabled),
- 0 === Object.getOwnPropertyNames(n).length && ce.delete(e)
- }
- }
- function de(t, n, e, i) {
- e.forEach(function(e) {
- t(n, e, i)
- })
- }
- function pe(e) {
- if (e.fixed_)
- return e;
- function t() {
- return !0
- }
- function n() {
- return !1
- }
- if (!e || !e.isPropagationStopped) {
- var i = e || p.event;
- for (var r in e = {},
- i)
- "layerX" !== r && "layerY" !== r && "keyLocation" !== r && "webkitMovementX" !== r && "webkitMovementY" !== r && ("returnValue" === r && i.preventDefault || (e[r] = i[r]));
- if (e.target || (e.target = e.srcElement || f),
- e.relatedTarget || (e.relatedTarget = e.fromElement === e.target ? e.toElement : e.fromElement),
- e.preventDefault = function() {
- i.preventDefault && i.preventDefault(),
- e.returnValue = !1,
- i.returnValue = !1,
- e.defaultPrevented = !0
- }
- ,
- e.defaultPrevented = !1,
- e.stopPropagation = function() {
- i.stopPropagation && i.stopPropagation(),
- e.cancelBubble = !0,
- i.cancelBubble = !0,
- e.isPropagationStopped = t
- }
- ,
- e.isPropagationStopped = n,
- e.stopImmediatePropagation = function() {
- i.stopImmediatePropagation && i.stopImmediatePropagation(),
- e.isImmediatePropagationStopped = t,
- e.stopPropagation()
- }
- ,
- e.isImmediatePropagationStopped = n,
- null !== e.clientX && void 0 !== e.clientX) {
- var s = f.documentElement
- , a = f.body;
- e.pageX = e.clientX + (s && s.scrollLeft || a && a.scrollLeft || 0) - (s && s.clientLeft || a && a.clientLeft || 0),
- e.pageY = e.clientY + (s && s.scrollTop || a && a.scrollTop || 0) - (s && s.clientTop || a && a.clientTop || 0)
- }
- e.which = e.charCode || e.keyCode,
- null !== e.button && void 0 !== e.button && (e.button = 1 & e.button ? 0 : 4 & e.button ? 1 : 2 & e.button ? 2 : 0)
- }
- return e.fixed_ = !0,
- e
- }
- var fe = function() {
- if ("boolean" != typeof ue) {
- ue = !1;
- try {
- var e = Object.defineProperty({}, "passive", {
- get: function() {
- ue = !0
- }
- });
- p.addEventListener("test", null, e),
- p.removeEventListener("test", null, e)
- } catch (e) {}
- }
- return ue
- }
- , ve = ["touchstart", "touchmove"];
- function ge(a, e, t) {
- if (Array.isArray(e))
- return de(ge, a, e, t);
- ce.has(a) || ce.set(a, {});
- var o = ce.get(a);
- if (o.handlers || (o.handlers = {}),
- o.handlers[e] || (o.handlers[e] = []),
- t.guid || (t.guid = le()),
- o.handlers[e].push(t),
- o.dispatcher || (o.disabled = !1,
- o.dispatcher = function(e, t) {
- if (!o.disabled) {
- e = pe(e);
- var n = o.handlers[e.type];
- if (n)
- for (var i = n.slice(0), r = 0, s = i.length; r < s && !e.isImmediatePropagationStopped(); r++)
- try {
- i[r].call(a, e, t)
- } catch (e) {
- m.error(e)
- }
- }
- }
- ),
- 1 === o.handlers[e].length)
- if (a.addEventListener) {
- var n = !1;
- fe() && -1 < ve.indexOf(e) && (n = {
- passive: !0
- }),
- a.addEventListener(e, o.dispatcher, n)
- } else
- a.attachEvent && a.attachEvent("on" + e, o.dispatcher)
- }
- function ye(e, t, n) {
- if (ce.has(e)) {
- var i = ce.get(e);
- if (i.handlers) {
- if (Array.isArray(t))
- return de(ye, e, t, n);
- var r = function(e, t) {
- i.handlers[t] = [],
- he(e, t)
- };
- if (void 0 !== t) {
- var s = i.handlers[t];
- if (s)
- if (n) {
- if (n.guid)
- for (var a = 0; a < s.length; a++)
- s[a].guid === n.guid && s.splice(a--, 1);
- he(e, t)
- } else
- r(e, t)
- } else
- for (var o in i.handlers)
- Object.prototype.hasOwnProperty.call(i.handlers || {}, o) && r(e, o)
- }
- }
- }
- function me(e, t, n) {
- var i = ce.has(e) ? ce.get(e) : {}
- , r = e.parentNode || e.ownerDocument;
- if ("string" == typeof t ? t = {
- type: t,
- target: e
- } : t.target || (t.target = e),
- t = pe(t),
- i.dispatcher && i.dispatcher.call(e, t, n),
- r && !t.isPropagationStopped() && !0 === t.bubbles)
- me.call(null, r, t, n);
- else if (!r && !t.defaultPrevented && t.target && t.target[t.type]) {
- ce.has(t.target) || ce.set(t.target, {});
- var s = ce.get(t.target);
- t.target[t.type] && (s.disabled = !0,
- "function" == typeof t.target[t.type] && t.target[t.type](),
- s.disabled = !1)
- }
- return !t.defaultPrevented
- }
- function _e(e, t, n) {
- if (Array.isArray(t))
- return de(_e, e, t, n);
- function i() {
- ye(e, t, i),
- n.apply(this, arguments)
- }
- i.guid = n.guid = n.guid || le(),
- ge(e, t, i)
- }
- function be(e, t, n) {
- function i() {
- ye(e, t, i),
- n.apply(this, arguments)
- }
- i.guid = n.guid = n.guid || le(),
- ge(e, t, i)
- }
- function Te(e, t, n) {
- t.guid || (t.guid = le());
- var i = t.bind(e);
- return i.guid = n ? n + "_" + t.guid : t.guid,
- i
- }
- function Ce(t, n) {
- var i = p.performance.now();
- return function() {
- var e = p.performance.now();
- n <= e - i && (t.apply(void 0, arguments),
- i = e)
- }
- }
- function ke() {}
- var Ee, Se = Object.freeze({
- __proto__: null,
- fixEvent: pe,
- on: ge,
- off: ye,
- trigger: me,
- one: _e,
- any: be
- });
- ke.prototype.allowedEvents_ = {},
- ke.prototype.addEventListener = ke.prototype.on = function(e, t) {
- var n = this.addEventListener;
- this.addEventListener = function() {}
- ,
- ge(this, e, t),
- this.addEventListener = n
- }
- ,
- ke.prototype.removeEventListener = ke.prototype.off = function(e, t) {
- ye(this, e, t)
- }
- ,
- ke.prototype.one = function(e, t) {
- var n = this.addEventListener;
- this.addEventListener = function() {}
- ,
- _e(this, e, t),
- this.addEventListener = n
- }
- ,
- ke.prototype.any = function(e, t) {
- var n = this.addEventListener;
- this.addEventListener = function() {}
- ,
- be(this, e, t),
- this.addEventListener = n
- }
- ,
- ke.prototype.dispatchEvent = ke.prototype.trigger = function(e) {
- var t = e.type || e;
- "string" == typeof e && (e = {
- type: t
- }),
- e = pe(e),
- this.allowedEvents_[t] && this["on" + t] && this["on" + t](e),
- me(this, e)
- }
- ,
- ke.prototype.queueTrigger = function(e) {
- var t = this;
- Ee = Ee || new Map;
- var n = e.type || e
- , i = Ee.get(this);
- i || (i = new Map,
- Ee.set(this, i));
- var r = i.get(n);
- i.delete(n),
- p.clearTimeout(r);
- var s = p.setTimeout(function() {
- 0 === i.size && (i = null,
- Ee.delete(t)),
- t.trigger(e)
- }, 0);
- i.set(n, s)
- }
- ;
- function we(e) {
- return "string" == typeof e && /\S/.test(e) || Array.isArray(e) && !!e.length
- }
- function xe(e) {
- if (!e.nodeName && !Me(e))
- throw new Error("Invalid target; must be a DOM node or evented object.")
- }
- function Ae(e) {
- if (!we(e))
- throw new Error("Invalid event type; must be a non-empty string or array.")
- }
- function Pe(e) {
- if ("function" != typeof e)
- throw new Error("Invalid listener; must be a function.")
- }
- function Le(e, t) {
- var n, i, r, s = t.length < 3 || t[0] === e || t[0] === e.eventBusEl_;
- return r = s ? (n = e.eventBusEl_,
- 3 <= t.length && t.shift(),
- i = t[0],
- t[1]) : (n = t[0],
- i = t[1],
- t[2]),
- xe(n),
- Ae(i),
- Pe(r),
- {
- isTargetingSelf: s,
- target: n,
- type: i,
- listener: r = Te(e, r)
- }
- }
- function Ie(e, t, n, i) {
- xe(e),
- e.nodeName ? Se[t](e, n, i) : e[t](n, i)
- }
- var Me = function(t) {
- return t instanceof ke || !!t.eventBusEl_ && ["on", "one", "off", "trigger"].every(function(e) {
- return "function" == typeof t[e]
- })
- }
- , je = {
- on: function() {
- for (var e = this, t = arguments.length, n = new Array(t), i = 0; i < t; i++)
- n[i] = arguments[i];
- var r = Le(this, n)
- , s = r.isTargetingSelf
- , a = r.target
- , o = r.type
- , l = r.listener;
- if (Ie(a, "on", o, l),
- !s) {
- var u = function() {
- return e.off(a, o, l)
- };
- u.guid = l.guid;
- var c = function() {
- return e.off("dispose", u)
- };
- c.guid = l.guid,
- Ie(this, "on", "dispose", u),
- Ie(a, "on", "dispose", c)
- }
- },
- one: function() {
- for (var r = this, e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- var i = Le(this, t)
- , s = i.isTargetingSelf
- , a = i.target
- , o = i.type
- , l = i.listener;
- if (s)
- Ie(a, "one", o, l);
- else {
- var u = function e() {
- r.off(a, o, e);
- for (var t = arguments.length, n = new Array(t), i = 0; i < t; i++)
- n[i] = arguments[i];
- l.apply(null, n)
- };
- u.guid = l.guid,
- Ie(a, "one", o, u)
- }
- },
- any: function() {
- for (var r = this, e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- var i = Le(this, t)
- , s = i.isTargetingSelf
- , a = i.target
- , o = i.type
- , l = i.listener;
- if (s)
- Ie(a, "any", o, l);
- else {
- var u = function e() {
- r.off(a, o, e);
- for (var t = arguments.length, n = new Array(t), i = 0; i < t; i++)
- n[i] = arguments[i];
- l.apply(null, n)
- };
- u.guid = l.guid,
- Ie(a, "any", o, u)
- }
- },
- off: function(e, t, n) {
- if (!e || we(e))
- ye(this.eventBusEl_, e, t);
- else {
- var i = e
- , r = t;
- xe(i),
- Ae(r),
- Pe(n),
- n = Te(this, n),
- this.off("dispose", n),
- i.nodeName ? (ye(i, r, n),
- ye(i, "dispose", n)) : Me(i) && (i.off(r, n),
- i.off("dispose", n))
- }
- },
- trigger: function(e, t) {
- return me(this.eventBusEl_, e, t)
- }
- };
- function Oe(e, t) {
- void 0 === t && (t = {});
- var n = t.eventBusKey;
- if (n) {
- if (!e[n].nodeName)
- throw new Error('The eventBusKey "' + n + '" does not refer to an element.');
- e.eventBusEl_ = e[n]
- } else
- e.eventBusEl_ = w("span", {
- className: "vjs-event-bus"
- });
- return b(e, je),
- e.eventedCallbacks && e.eventedCallbacks.forEach(function(e) {
- e()
- }),
- e.on("dispose", function() {
- e.off(),
- p.setTimeout(function() {
- e.eventBusEl_ = null
- }, 0)
- }),
- e
- }
- var Ne = {
- state: {},
- setState: function(e) {
- var n, i = this;
- return "function" == typeof e && (e = e()),
- a(e, function(e, t) {
- i.state[t] !== e && ((n = n || {})[t] = {
- from: i.state[t],
- to: e
- }),
- i.state[t] = e
- }),
- n && Me(this) && this.trigger({
- changes: n,
- type: "statechanged"
- }),
- n
- }
- };
- function De(e, t) {
- return b(e, Ne),
- e.state = b({}, e.state, t),
- "function" == typeof e.handleStateChanged && Me(e) && e.on("statechanged", e.handleStateChanged),
- e
- }
- function Be(e) {
- return "string" != typeof e ? e : e.replace(/./, function(e) {
- return e.toLowerCase()
- })
- }
- function Re(e) {
- return "string" != typeof e ? e : e.replace(/./, function(e) {
- return e.toUpperCase()
- })
- }
- function Fe() {
- for (var n = {}, e = arguments.length, t = new Array(e), i = 0; i < e; i++)
- t[i] = arguments[i];
- return t.forEach(function(e) {
- e && a(e, function(e, t) {
- c(e) ? (c(n[t]) || (n[t] = {}),
- n[t] = Fe(n[t], e)) : n[t] = e
- })
- }),
- n
- }
- var He = function() {
- function u(e, t, n) {
- if (!e && this.play ? this.player_ = e = this : this.player_ = e,
- this.isDisposed_ = !1,
- this.parentComponent_ = null,
- this.options_ = Fe({}, this.options_),
- t = this.options_ = Fe(this.options_, t),
- this.id_ = t.id || t.el && t.el.id,
- !this.id_) {
- var i = e && e.id && e.id() || "no_player";
- this.id_ = i + "_component_" + le()
- }
- var r;
- this.name_ = t.name || null,
- t.el ? this.el_ = t.el : !1 !== t.createEl && (this.el_ = this.createEl()),
- !1 !== t.evented && Oe(this, {
- eventBusKey: this.el_ ? "el_" : null
- }),
- De(this, this.constructor.defaultState),
- this.children_ = [],
- this.childIndex_ = {},
- this.childNameIndex_ = {},
- p.Set || (r = function() {
- function e() {
- this.set_ = {}
- }
- var t = e.prototype;
- return t.has = function(e) {
- return e in this.set_
- }
- ,
- t.delete = function(e) {
- var t = this.has(e);
- return delete this.set_[e],
- t
- }
- ,
- t.add = function(e) {
- return this.set_[e] = 1,
- this
- }
- ,
- t.forEach = function(e, t) {
- for (var n in this.set_)
- e.call(t, n, n, this)
- }
- ,
- e
- }()),
- this.setTimeoutIds_ = p.Set ? new Set : new r,
- this.setIntervalIds_ = p.Set ? new Set : new r,
- this.rafIds_ = p.Set ? new Set : new r,
- (this.clearingTimersOnDispose_ = !1) !== t.initChildren && this.initChildren(),
- this.ready(n),
- !1 !== t.reportTouchActivity && this.enableTouchActivity()
- }
- var e = u.prototype;
- return e.dispose = function() {
- if (!this.isDisposed_) {
- if (this.trigger({
- type: "dispose",
- bubbles: !1
- }),
- this.isDisposed_ = !0,
- this.children_)
- for (var e = this.children_.length - 1; 0 <= e; e--)
- this.children_[e].dispose && this.children_[e].dispose();
- this.children_ = null,
- this.childIndex_ = null,
- this.childNameIndex_ = null,
- this.parentComponent_ = null,
- this.el_ && (this.el_.parentNode && this.el_.parentNode.removeChild(this.el_),
- ce.has(this.el_) && ce.delete(this.el_),
- this.el_ = null),
- this.player_ = null
- }
- }
- ,
- e.isDisposed = function() {
- return Boolean(this.isDisposed_)
- }
- ,
- e.player = function() {
- return this.player_
- }
- ,
- e.options = function(e) {
- return e && (this.options_ = Fe(this.options_, e)),
- this.options_
- }
- ,
- e.el = function() {
- return this.el_
- }
- ,
- e.createEl = function(e, t, n) {
- return w(e, t, n)
- }
- ,
- e.localize = function(e, r, t) {
- void 0 === t && (t = e);
- var n = this.player_.language && this.player_.language()
- , i = this.player_.languages && this.player_.languages()
- , s = i && i[n]
- , a = n && n.split("-")[0]
- , o = i && i[a]
- , l = t;
- return s && s[e] ? l = s[e] : o && o[e] && (l = o[e]),
- r && (l = l.replace(/\{(\d+)\}/g, function(e, t) {
- var n = r[t - 1]
- , i = n;
- return "undefined" == typeof n && (i = e),
- i
- })),
- l
- }
- ,
- e.contentEl = function() {
- return this.contentEl_ || this.el_
- }
- ,
- e.id = function() {
- return this.id_
- }
- ,
- e.name = function() {
- return this.name_
- }
- ,
- e.children = function() {
- return this.children_
- }
- ,
- e.getChildById = function(e) {
- return this.childIndex_[e]
- }
- ,
- e.getChild = function(e) {
- if (e)
- return this.childNameIndex_[e]
- }
- ,
- e.getDescendant = function() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- t = t.reduce(function(e, t) {
- return e.concat(t)
- }, []);
- for (var i = this, r = 0; r < t.length; r++)
- if (!(i = i.getChild(t[r])) || !i.getChild)
- return;
- return i
- }
- ,
- e.addChild = function(e, t, n) {
- var i, r;
- if (void 0 === t && (t = {}),
- void 0 === n && (n = this.children_.length),
- "string" == typeof e) {
- r = Re(e);
- var s = t.componentClass || r;
- t.name = r;
- var a = u.getComponent(s);
- if (!a)
- throw new Error("Component " + s + " does not exist");
- if ("function" != typeof a)
- return null;
- i = new a(this.player_ || this,t)
- } else
- i = e;
- if (i.parentComponent_ && i.parentComponent_.removeChild(i),
- this.children_.splice(n, 0, i),
- i.parentComponent_ = this,
- "function" == typeof i.id && (this.childIndex_[i.id()] = i),
- (r = r || i.name && Re(i.name())) && (this.childNameIndex_[r] = i,
- this.childNameIndex_[Be(r)] = i),
- "function" == typeof i.el && i.el()) {
- var o = null;
- this.children_[n + 1] && this.children_[n + 1].el_ && (o = this.children_[n + 1].el_),
- this.contentEl().insertBefore(i.el(), o)
- }
- return i
- }
- ,
- e.removeChild = function(e) {
- if ("string" == typeof e && (e = this.getChild(e)),
- e && this.children_) {
- for (var t = !1, n = this.children_.length - 1; 0 <= n; n--)
- if (this.children_[n] === e) {
- t = !0,
- this.children_.splice(n, 1);
- break
- }
- if (t) {
- e.parentComponent_ = null,
- this.childIndex_[e.id()] = null,
- this.childNameIndex_[Re(e.name())] = null,
- this.childNameIndex_[Be(e.name())] = null;
- var i = e.el();
- i && i.parentNode === this.contentEl() && this.contentEl().removeChild(e.el())
- }
- }
- }
- ,
- e.initChildren = function() {
- var r = this
- , i = this.options_.children;
- if (i) {
- var e, s = this.options_, n = u.getComponent("Tech");
- (e = Array.isArray(i) ? i : Object.keys(i)).concat(Object.keys(this.options_).filter(function(t) {
- return !e.some(function(e) {
- return "string" == typeof e ? t === e : t === e.name
- })
- })).map(function(e) {
- var t, n;
- return n = "string" == typeof e ? i[t = e] || r.options_[t] || {} : (t = e.name,
- e),
- {
- name: t,
- opts: n
- }
- }).filter(function(e) {
- var t = u.getComponent(e.opts.componentClass || Re(e.name));
- return t && !n.isTech(t)
- }).forEach(function(e) {
- var t = e.name
- , n = e.opts;
- if (void 0 !== s[t] && (n = s[t]),
- !1 !== n) {
- !0 === n && (n = {}),
- n.playerOptions = r.options_.playerOptions;
- var i = r.addChild(t, n);
- i && (r[t] = i)
- }
- })
- }
- }
- ,
- e.buildCSSClass = function() {
- return ""
- }
- ,
- e.ready = function(e, t) {
- if (void 0 === t && (t = !1),
- e)
- return this.isReady_ ? void (t ? e.call(this) : this.setTimeout(e, 1)) : (this.readyQueue_ = this.readyQueue_ || [],
- void this.readyQueue_.push(e))
- }
- ,
- e.triggerReady = function() {
- this.isReady_ = !0,
- this.setTimeout(function() {
- var e = this.readyQueue_;
- this.readyQueue_ = [],
- e && 0 < e.length && e.forEach(function(e) {
- e.call(this)
- }, this),
- this.trigger("ready")
- }, 1)
- }
- ,
- e.$ = function(e, t) {
- return $(e, t || this.contentEl())
- }
- ,
- e.$$ = function(e, t) {
- return J(e, t || this.contentEl())
- }
- ,
- e.hasClass = function(e) {
- return P(this.el_, e)
- }
- ,
- e.addClass = function(e) {
- L(this.el_, e)
- }
- ,
- e.removeClass = function(e) {
- I(this.el_, e)
- }
- ,
- e.toggleClass = function(e, t) {
- M(this.el_, e, t)
- }
- ,
- e.show = function() {
- this.removeClass("vjs-hidden")
- }
- ,
- e.hide = function() {
- this.addClass("vjs-hidden")
- }
- ,
- e.lockShowing = function() {
- this.addClass("vjs-lock-showing")
- }
- ,
- e.unlockShowing = function() {
- this.removeClass("vjs-lock-showing")
- }
- ,
- e.getAttribute = function(e) {
- return N(this.el_, e)
- }
- ,
- e.setAttribute = function(e, t) {
- D(this.el_, e, t)
- }
- ,
- e.removeAttribute = function(e) {
- B(this.el_, e)
- }
- ,
- e.width = function(e, t) {
- return this.dimension("width", e, t)
- }
- ,
- e.height = function(e, t) {
- return this.dimension("height", e, t)
- }
- ,
- e.dimensions = function(e, t) {
- this.width(e, !0),
- this.height(t)
- }
- ,
- e.dimension = function(e, t, n) {
- if (void 0 !== t)
- return null !== t && t == t || (t = 0),
- -1 !== ("" + t).indexOf("%") || -1 !== ("" + t).indexOf("px") ? this.el_.style[e] = t : this.el_.style[e] = "auto" === t ? "" : t + "px",
- void (n || this.trigger("componentresize"));
- if (!this.el_)
- return 0;
- var i = this.el_.style[e]
- , r = i.indexOf("px");
- return -1 !== r ? parseInt(i.slice(0, r), 10) : parseInt(this.el_["offset" + Re(e)], 10)
- }
- ,
- e.currentDimension = function(e) {
- var t = 0;
- if ("width" !== e && "height" !== e)
- throw new Error("currentDimension only accepts width or height value");
- if (t = h(this.el_, e),
- 0 === (t = parseFloat(t)) || isNaN(t)) {
- var n = "offset" + Re(e);
- t = this.el_[n]
- }
- return t
- }
- ,
- e.currentDimensions = function() {
- return {
- width: this.currentDimension("width"),
- height: this.currentDimension("height")
- }
- }
- ,
- e.currentWidth = function() {
- return this.currentDimension("width")
- }
- ,
- e.currentHeight = function() {
- return this.currentDimension("height")
- }
- ,
- e.focus = function() {
- this.el_.focus()
- }
- ,
- e.blur = function() {
- this.el_.blur()
- }
- ,
- e.handleKeyDown = function(e) {
- this.player_ && (e.stopPropagation(),
- this.player_.handleKeyDown(e))
- }
- ,
- e.handleKeyPress = function(e) {
- this.handleKeyDown(e)
- }
- ,
- e.emitTapEvents = function() {
- var i, t = 0, r = null;
- this.on("touchstart", function(e) {
- 1 === e.touches.length && (r = {
- pageX: e.touches[0].pageX,
- pageY: e.touches[0].pageY
- },
- t = p.performance.now(),
- i = !0)
- }),
- this.on("touchmove", function(e) {
- if (1 < e.touches.length)
- i = !1;
- else if (r) {
- var t = e.touches[0].pageX - r.pageX
- , n = e.touches[0].pageY - r.pageY;
- 10 < Math.sqrt(t * t + n * n) && (i = !1)
- }
- });
- function e() {
- i = !1
- }
- this.on("touchleave", e),
- this.on("touchcancel", e),
- this.on("touchend", function(e) {
- !(r = null) === i && p.performance.now() - t < 200 && (e.preventDefault(),
- this.trigger("tap"))
- })
- }
- ,
- e.enableTouchActivity = function() {
- if (this.player() && this.player().reportUserActivity) {
- var t, n = Te(this.player(), this.player().reportUserActivity);
- this.on("touchstart", function() {
- n(),
- this.clearInterval(t),
- t = this.setInterval(n, 250)
- });
- var e = function(e) {
- n(),
- this.clearInterval(t)
- };
- this.on("touchmove", n),
- this.on("touchend", e),
- this.on("touchcancel", e)
- }
- }
- ,
- e.setTimeout = function(e, t) {
- var n, i = this;
- return e = Te(this, e),
- this.clearTimersOnDispose_(),
- n = p.setTimeout(function() {
- i.setTimeoutIds_.has(n) && i.setTimeoutIds_.delete(n),
- e()
- }, t),
- this.setTimeoutIds_.add(n),
- n
- }
- ,
- e.clearTimeout = function(e) {
- return this.setTimeoutIds_.has(e) && (this.setTimeoutIds_.delete(e),
- p.clearTimeout(e)),
- e
- }
- ,
- e.setInterval = function(e, t) {
- e = Te(this, e),
- this.clearTimersOnDispose_();
- var n = p.setInterval(e, t);
- return this.setIntervalIds_.add(n),
- n
- }
- ,
- e.clearInterval = function(e) {
- return this.setIntervalIds_.has(e) && (this.setIntervalIds_.delete(e),
- p.clearInterval(e)),
- e
- }
- ,
- e.requestAnimationFrame = function(e) {
- var t, n = this;
- return this.supportsRaf_ ? (this.clearTimersOnDispose_(),
- e = Te(this, e),
- t = p.requestAnimationFrame(function() {
- n.rafIds_.has(t) && n.rafIds_.delete(t),
- e()
- }),
- this.rafIds_.add(t),
- t) : this.setTimeout(e, 1e3 / 60)
- }
- ,
- e.cancelAnimationFrame = function(e) {
- return this.supportsRaf_ ? (this.rafIds_.has(e) && (this.rafIds_.delete(e),
- p.cancelAnimationFrame(e)),
- e) : this.clearTimeout(e)
- }
- ,
- e.clearTimersOnDispose_ = function() {
- var i = this;
- this.clearingTimersOnDispose_ || (this.clearingTimersOnDispose_ = !0,
- this.one("dispose", function() {
- [["rafIds_", "cancelAnimationFrame"], ["setTimeoutIds_", "clearTimeout"], ["setIntervalIds_", "clearInterval"]].forEach(function(e) {
- var t = e[0]
- , n = e[1];
- i[t].forEach(i[n], i)
- }),
- i.clearingTimersOnDispose_ = !1
- }))
- }
- ,
- u.registerComponent = function(e, t) {
- if ("string" != typeof e || !e)
- throw new Error('Illegal component name, "' + e + '"; must be a non-empty string.');
- var n, i = u.getComponent("Tech"), r = i && i.isTech(t), s = u === t || u.prototype.isPrototypeOf(t.prototype);
- if (r || !s)
- throw n = r ? "techs must be registered using Tech.registerTech()" : "must be a Component subclass",
- new Error('Illegal component, "' + e + '"; ' + n + ".");
- e = Re(e),
- u.components_ || (u.components_ = {});
- var a = u.getComponent("Player");
- if ("Player" === e && a && a.players) {
- var o = a.players
- , l = Object.keys(o);
- if (o && 0 < l.length && l.map(function(e) {
- return o[e]
- }).every(Boolean))
- throw new Error("Can not register Player component after player has been created.")
- }
- return u.components_[e] = t,
- u.components_[Be(e)] = t
- }
- ,
- u.getComponent = function(e) {
- if (e && u.components_)
- return u.components_[e]
- }
- ,
- u
- }();
- He.prototype.supportsRaf_ = "function" == typeof p.requestAnimationFrame && "function" == typeof p.cancelAnimationFrame,
- He.registerComponent("Component", He);
- var Ve = function(e) {
- if (void 0 === e)
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e
- };
- n(function(t) {
- function n(e) {
- return "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? t.exports = n = function(e) {
- return typeof e
- }
- : t.exports = n = function(e) {
- return e && "function" == typeof Symbol && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e
- }
- ,
- n(e)
- }
- t.exports = n
- }),
- n(function(t) {
- function n(e) {
- return t.exports = n = Object.setPrototypeOf ? Object.getPrototypeOf : function(e) {
- return e.__proto__ || Object.getPrototypeOf(e)
- }
- ,
- n(e)
- }
- t.exports = n
- });
- var Qe, Ue, qe, ze, We = function(e, t) {
- e.prototype = Object.create(t.prototype),
- (e.prototype.constructor = e).__proto__ = t
- }, 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() {
- var e = Ke.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);
- if (!e)
- return null;
- var t = e[1] && parseFloat(e[1])
- , n = e[2] && parseFloat(e[2]);
- return t && n ? parseFloat(e[1] + "." + e[2]) : t || null
- }(), 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),
- !(ze = qe && parseFloat(qe[1])) && /Trident\/7.0/i.test(Ke) && /rv:11.0/.test(Ke) && (ze = 11),
- 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({
- __proto__: null,
- IS_IPOD: Ye,
- IOS_VERSION: $e,
- IS_ANDROID: Je,
- ANDROID_VERSION: Ze,
- IS_NATIVE_ANDROID: et,
- IS_FIREFOX: tt,
- IS_EDGE: nt,
- IS_CHROME: it,
- CHROME_VERSION: rt,
- IE_VERSION: st,
- IS_SAFARI: at,
- IS_WINDOWS: ot,
- TOUCH_ENABLED: lt,
- IS_IPAD: ut,
- IS_IPHONE: ct,
- IS_IOS: ht,
- IS_ANY_SAFARI: dt
- });
- function ft(e, t, n, i) {
- return function(e, t, n) {
- if ("number" != typeof t || t < 0 || n < t)
- throw new Error("Failed to execute '" + e + "' on 'TimeRanges': The index provided (" + t + ") is non-numeric or out of bounds (0-" + n + ").")
- }(e, i, n.length - 1),
- n[i][t]
- }
- function vt(e) {
- return void 0 === e || 0 === e.length ? {
- length: 0,
- start: function() {
- throw new Error("This TimeRanges object is empty")
- },
- end: function() {
- throw new Error("This TimeRanges object is empty")
- }
- } : {
- length: e.length,
- start: ft.bind(null, "start", 0, e),
- end: ft.bind(null, "end", 1, e)
- }
- }
- function gt(e, t) {
- return Array.isArray(e) ? vt(e) : void 0 === e || void 0 === t ? vt() : vt([[e, t]])
- }
- function yt(e, t) {
- var n, i, r = 0;
- if (!t)
- return 0;
- e && e.length || (e = gt(0, 0));
- for (var s = 0; s < e.length; s++)
- n = e.start(s),
- t < (i = e.end(s)) && (i = t),
- r += i - n;
- return r / t
- }
- for (var mt, _t = {
- prefixed: !0
- }, 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++)
- if (bt[Ct][1]in f) {
- mt = bt[Ct];
- break
- }
- if (mt) {
- for (var kt = 0; kt < mt.length; kt++)
- _t[Tt[kt]] = mt[kt];
- _t.prefixed = mt[0] !== Tt[0]
- }
- function Et(e) {
- if (e instanceof Et)
- return e;
- "number" == typeof e ? this.code = e : "string" == typeof e ? this.message = e : l(e) && ("number" == typeof e.code && (this.code = e.code),
- b(this, e)),
- this.message || (this.message = Et.defaultMessages[this.code] || "")
- }
- Et.prototype.code = 0,
- Et.prototype.message = "",
- Et.prototype.status = null,
- Et.errorTypes = ["MEDIA_ERR_CUSTOM", "MEDIA_ERR_ABORTED", "MEDIA_ERR_NETWORK", "MEDIA_ERR_DECODE", "MEDIA_ERR_SRC_NOT_SUPPORTED", "MEDIA_ERR_ENCRYPTED"],
- Et.defaultMessages = {
- 1: "You aborted the media playback",
- 2: "A network error caused the media download to fail part-way.",
- 3: "The media playback was aborted due to a corruption problem or because the media used features your browser did not support.",
- 4: "The media could not be loaded, either because the server or network failed or because the format is not supported.",
- 5: "The media is encrypted and we do not have the keys to decrypt it."
- };
- for (var St = 0; St < Et.errorTypes.length; St++)
- Et[Et.errorTypes[St]] = St,
- Et.prototype[Et.errorTypes[St]] = St;
- var wt = function(e, t) {
- var n, i = null;
- try {
- n = JSON.parse(e, t)
- } catch (e) {
- i = e
- }
- return [i, n]
- };
- function xt(e) {
- return null != e && "function" == typeof e.then
- }
- function At(e) {
- xt(e) && e.then(null, function(e) {})
- }
- function Pt(i) {
- return ["kind", "label", "language", "id", "inBandMetadataTrackDispatchType", "mode", "src"].reduce(function(e, t, n) {
- return i[t] && (e[t] = i[t]),
- e
- }, {
- cues: i.cues && Array.prototype.map.call(i.cues, function(e) {
- return {
- startTime: e.startTime,
- endTime: e.endTime,
- text: e.text,
- id: e.id
- }
- })
- })
- }
- var Lt = function(e) {
- var t = e.$$("track")
- , n = Array.prototype.map.call(t, function(e) {
- return e.track
- });
- return Array.prototype.map.call(t, function(e) {
- var t = Pt(e.track);
- return e.src && (t.src = e.src),
- t
- }).concat(Array.prototype.filter.call(e.textTracks(), function(e) {
- return -1 === n.indexOf(e)
- }).map(Pt))
- }
- , It = function(e, n) {
- return e.forEach(function(e) {
- var t = n.addRemoteTextTrack(e).track;
- !e.src && e.cues && e.cues.forEach(function(e) {
- return t.addCue(e)
- })
- }),
- n.textTracks()
- }
- , Mt = n(function(e, t) {
- function n(e) {
- if (e && "object" == typeof e) {
- var t = e.which || e.keyCode || e.charCode;
- t && (e = t)
- }
- if ("number" == typeof e)
- return a[e];
- var n, i = String(e);
- return (n = r[i.toLowerCase()]) ? n : (n = s[i.toLowerCase()]) || (1 === i.length ? i.charCodeAt(0) : void 0)
- }
- n.isEventKey = function(e, t) {
- if (e && "object" == typeof e) {
- var n = e.which || e.keyCode || e.charCode;
- if (null == n)
- return !1;
- if ("string" == typeof t) {
- var i;
- if (i = r[t.toLowerCase()])
- return i === n;
- if (i = s[t.toLowerCase()])
- return i === n
- } else if ("number" == typeof t)
- return t === n;
- return !1
- }
- }
- ;
- var r = (t = e.exports = n).code = t.codes = {
- backspace: 8,
- tab: 9,
- enter: 13,
- shift: 16,
- ctrl: 17,
- alt: 18,
- "pause/break": 19,
- "caps lock": 20,
- esc: 27,
- space: 32,
- "page up": 33,
- "page down": 34,
- end: 35,
- home: 36,
- left: 37,
- up: 38,
- right: 39,
- down: 40,
- insert: 45,
- delete: 46,
- command: 91,
- "left command": 91,
- "right command": 93,
- "numpad *": 106,
- "numpad +": 107,
- "numpad -": 109,
- "numpad .": 110,
- "numpad /": 111,
- "num lock": 144,
- "scroll lock": 145,
- "my computer": 182,
- "my calculator": 183,
- ";": 186,
- "=": 187,
- ",": 188,
- "-": 189,
- ".": 190,
- "/": 191,
- "`": 192,
- "[": 219,
- "\\": 220,
- "]": 221,
- "'": 222
- }
- , s = t.aliases = {
- windows: 91,
- "⇧": 16,
- "⌥": 18,
- "⌃": 17,
- "⌘": 91,
- ctl: 17,
- control: 17,
- option: 18,
- pause: 19,
- break: 19,
- caps: 20,
- return: 13,
- escape: 27,
- spc: 32,
- spacebar: 32,
- pgup: 33,
- pgdn: 34,
- ins: 45,
- del: 46,
- cmd: 91
- };
- for (i = 97; i < 123; i++)
- r[String.fromCharCode(i)] = i - 32;
- for (var i = 48; i < 58; i++)
- r[i - 48] = i;
- for (i = 1; i < 13; i++)
- r["f" + i] = i + 111;
- for (i = 0; i < 10; i++)
- r["numpad " + i] = i + 96;
- var a = t.names = t.title = {};
- for (i in r)
- a[r[i]] = i;
- for (var o in s)
- r[o] = s[o]
- })
- , jt = (Mt.code,
- Mt.codes,
- Mt.aliases,
- Mt.names,
- Mt.title,
- "vjs-modal-dialog")
- , Ot = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).opened_ = n.hasBeenOpened_ = n.hasBeenFilled_ = !1,
- n.closeable(!n.options_.uncloseable),
- n.content(n.options_.content),
- n.contentEl_ = w("div", {
- className: jt + "-content"
- }, {
- role: "document"
- }),
- n.descEl_ = w("p", {
- className: jt + "-description vjs-control-text",
- id: n.el().getAttribute("aria-describedby")
- }),
- x(n.descEl_, n.description()),
- n.el_.appendChild(n.descEl_),
- n.el_.appendChild(n.contentEl_),
- G(n.el_),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: this.buildCSSClass(),
- tabIndex: -1
- }, {
- "aria-describedby": this.id() + "_description",
- "aria-hidden": "true",
- "aria-label": this.label(),
- role: "dialog"
- })
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- this.descEl_ = null,
- this.previouslyActiveEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return jt + " vjs-hidden " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.label = function() {
- return this.localize(this.options_.label || "Modal Window")
- }
- ,
- t.description = function() {
- var e = this.options_.description || this.localize("This is a modal window.");
- return this.closeable() && (e += " " + this.localize("This modal can be closed by pressing the Escape key or activating the close button.")),
- e
- }
- ,
- t.open = function() {
- if (!this.opened_) {
- var e = this.player();
- this.trigger("beforemodalopen"),
- this.opened_ = !0,
- !this.options_.fillAlways && (this.hasBeenOpened_ || this.hasBeenFilled_) || this.fill(),
- this.wasPlaying_ = !e.paused(),
- this.options_.pauseOnOpen && this.wasPlaying_ && e.pause(),
- this.on("keydown", this.handleKeyDown),
- this.hadControls_ = e.controls(),
- e.controls(!1),
- this.show(),
- this.conditionalFocus_(),
- this.el().setAttribute("aria-hidden", "false"),
- this.trigger("modalopen"),
- this.hasBeenOpened_ = !0
- }
- }
- ,
- t.opened = function(e) {
- return "boolean" == typeof e && this[e ? "open" : "close"](),
- this.player_.error(1),
- this.opened_
- }
- ,
- t.close = function() {
- if (this.opened_) {
- var e = this.player();
- this.trigger("beforemodalclose"),
- this.opened_ = !1,
- this.wasPlaying_ && this.options_.pauseOnOpen && e.play(),
- this.off("keydown", this.handleKeyDown),
- this.hadControls_ && e.controls(!0),
- this.hide(),
- this.el().setAttribute("aria-hidden", "true"),
- this.trigger("modalclose"),
- this.conditionalBlur_(),
- this.options_.temporary && this.dispose()
- }
- }
- ,
- t.refresh = function() {
- this.player_.log("[model-display] refresh()1"),
- p.location.reload(),
- this.player_.log("[model-display] refresh()2")
- }
- ,
- t.closeable = function(e) {
- if ("boolean" == typeof e) {
- var t = this.closeable_ = !!e
- , n = this.getChild("closeButton");
- if (t && !n) {
- var i = this.contentEl_;
- this.contentEl_ = this.el_,
- n = this.addChild("closeButton", {
- controlText: "Close Modal Dialog"
- }),
- this.contentEl_ = i,
- this.on(n, "close", this.close)
- }
- !t && n && (this.off(n, "close", this.close),
- this.removeChild(n),
- n.dispose())
- }
- return this.closeable_
- }
- ,
- t.refreshable = function(e) {
- if ("boolean" == typeof e) {
- var t = this.refreshable_ = !!e
- , n = this.getChild("refreshButton");
- if (t && !n) {
- var i = this.contentEl_;
- this.contentEl_ = this.el_,
- n = this.addChild("refreshButton", {
- controlText: "Refresh Page"
- }),
- this.contentEl_ = i,
- this.on(n, "refresh", this.refresh)
- }
- !t && n && (this.off(n, "refresh", this.refresh),
- this.removeChild(n),
- n.dispose())
- }
- return this.refreshable_
- }
- ,
- t.fill = function() {
- this.fillWith(this.content())
- }
- ,
- t.fillWith = function(e) {
- var t = this.contentEl()
- , n = t.parentNode
- , i = t.nextSibling;
- this.trigger("beforemodalfill"),
- this.hasBeenFilled_ = !0,
- n.removeChild(t),
- this.empty(),
- K(t, e),
- this.trigger("modalfill"),
- i ? n.insertBefore(t, i) : n.appendChild(t);
- var r = this.getChild("closeButton");
- r && n.appendChild(r.el_)
- }
- ,
- t.empty = function() {
- this.trigger("beforemodalempty"),
- q(this.contentEl()),
- this.trigger("modalempty")
- }
- ,
- t.content = function(e) {
- return "undefined" != typeof e && (this.content_ = e),
- this.content_
- }
- ,
- t.conditionalFocus_ = function() {
- var e = f.activeElement
- , t = this.player_.el_;
- this.previouslyActiveEl_ = null,
- !t.contains(e) && t !== e || (this.previouslyActiveEl_ = e,
- this.focus())
- }
- ,
- t.conditionalBlur_ = function() {
- this.previouslyActiveEl_ && (this.previouslyActiveEl_.focus(),
- this.previouslyActiveEl_ = null)
- }
- ,
- t.handleKeyDown = function(e) {
- if (e.stopPropagation(),
- Mt.isEventKey(e, "Escape") && this.closeable())
- return e.preventDefault(),
- void this.close();
- if (Mt.isEventKey(e, "Tab")) {
- for (var t, n = this.focusableEls_(), i = this.el_.querySelector(":focus"), r = 0; r < n.length; r++)
- if (i === n[r]) {
- t = r;
- break
- }
- f.activeElement === this.el_ && (t = 0),
- e.shiftKey && 0 === t ? (n[n.length - 1].focus(),
- e.preventDefault()) : e.shiftKey || t !== n.length - 1 || (n[0].focus(),
- e.preventDefault())
- }
- }
- ,
- t.focusableEls_ = function() {
- var e = this.el_.querySelectorAll("*");
- return Array.prototype.filter.call(e, function(e) {
- 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")
- })
- }
- ,
- e
- }(He);
- Ot.prototype.options_ = {
- pauseOnOpen: !0,
- temporary: !0
- },
- He.registerComponent("ModalDialog", Ot);
- function Nt(e, t) {
- e = e < 0 ? 0 : e;
- var n = Math.floor(e % 60)
- , i = Math.floor(e / 60 % 60)
- , r = Math.floor(e / 3600)
- , s = Math.floor(t / 60 % 60)
- , a = Math.floor(t / 3600);
- return !isNaN(e) && e !== 1 / 0 || (r = i = n = "-"),
- (r = 0 < r || 0 < a ? r + ":" : "") + (i = ((r || 10 <= s) && i < 10 ? "0" + i : i) + ":") + (n = n < 10 ? "0" + n : n)
- }
- var Dt = Nt;
- function Bt(e, t) {
- return void 0 === t && (t = e),
- Dt(e, t)
- }
- var Rt = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, ["timeupdate", "ended"], n.updateContent),
- n.updateTextNode_(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = this.buildCSSClass()
- , t = i.prototype.createEl.call(this, "div", {
- className: e + " vjs-time-control vjs-control",
- innerHTML: '<span class="vjs-control-text" role="presentation">' + this.localize(this.labelText_) + " </span>"
- });
- return this.contentEl_ = w("span", {
- className: e + "-display"
- }, {
- "aria-live": "off",
- role: "presentation"
- }),
- t.appendChild(this.contentEl_),
- t
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- this.textNode_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.updateTextNode_ = function(e) {
- var t = this;
- void 0 === e && (e = 0),
- e = Bt(e),
- this.formattedTime_ !== e && (this.formattedTime_ = e,
- this.requestAnimationFrame(function() {
- if (t.contentEl_) {
- var e = t.textNode_;
- t.textNode_ = f.createTextNode(t.formattedTime_),
- t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
- }
- }))
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- Rt.prototype.labelText_ = "Time",
- Rt.prototype.controlText_ = "Time",
- He.registerComponent("TimeDisplay", Rt);
- var Ft = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
- n.on("mousedown", n.handleMouseDown),
- n.on("click", n.handleClick),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.skipTime = function() {
- return 5
- }
- ,
- t.buildCSSClass = function() {
- return "ad-skip-time"
- }
- ,
- t.createEl = function() {
- return i.prototype.createEl.call(this)
- }
- ,
- t.updateContent = function(e) {
- var t, n, i;
- "number" == typeof this.player_.duration() && (this.player_.ended() ? t = 0 : n = this.player_.remainingTimeDisplay ? (t = this.player_.remainingTimeDisplay(),
- this.player_.remainingTimeDisplay() - this.skipTime()) : (t = this.player_.remainingTimeDisplay(),
- this.player_.remainingTime() - this.skipTime()),
- i = 180 < n ? "" : 0 < n ? (this.hasClass("ad-skip-btn") && this.removeClass("ad-skip-btn"),
- "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"),
- "" + t + this.localize("Sec") + " | " + this.localize("Skip This AD")),
- this.updateTextNodeNew_(i))
- }
- ,
- t.updateTextNodeNew_ = function(e) {
- var t = this;
- void 0 === e && (e = 0),
- this.formattedTime_ !== e && (this.formattedTime_ = e,
- this.requestAnimationFrame(function() {
- if (t.contentEl_) {
- var e = t.textNode_;
- t.textNode_ = f.createTextNode(t.formattedTime_),
- t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
- }
- }))
- }
- ,
- t.handleMouseDown = function(e) {
- X(e) && this.player_.ads && this.player_.remainingTimeDisplay() <= this.skipTime() && this.player_.currentTime(this.player_.duration() - .1),
- e.stopPropagation()
- }
- ,
- t.handleClick = function(e) {
- e.stopPropagation()
- }
- ,
- e
- }(Rt);
- Ft.prototype.labelText_ = "Skip Time",
- Ft.prototype.controlText_ = "Skip Time",
- He.registerComponent("SkipADDisplay", Ft);
- var Ht = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
- n.on("click", n.handleClick),
- n.remainAdTime_ = 60,
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "ad-countdown-time"
- }
- ,
- t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return e.appendChild(w("span", {
- className: "ad-vip-can-skip",
- innerHTML: " | " + this.localize("Activate Video Card to skip ADs")
- }), this.contentEl_),
- e.appendChild(w("span", {
- className: "ad-discount1",
- innerHTML: " "
- }), this.contentEl_),
- e
- }
- ,
- t.updateContent = function(e) {
- if ("number" == typeof this.player_.duration()) {
- var t, n = "" + ((t = this.player_.ended() ? 0 : (this.player_.remainingTimeDisplay,
- this.player_.remainingTimeDisplay())) + this.remainAdTime_);
- 90 < t ? this.updateTextNodeNew_(" ") : this.updateTextNodeNew_(n)
- }
- }
- ,
- t.updateRemainAdTime = function(e) {
- this.remainAdTime_ = e
- }
- ,
- t.updateTextNodeNew_ = function(e) {
- var t = this;
- void 0 === e && (e = 0),
- this.formattedTime_ !== e && (this.formattedTime_ = e,
- this.requestAnimationFrame(function() {
- if (t.contentEl_) {
- var e = t.textNode_;
- t.textNode_ = f.createTextNode(t.formattedTime_),
- t.textNode_ && (e ? t.contentEl_.replaceChild(t.textNode_, e) : t.contentEl_.appendChild(t.textNode_))
- }
- }))
- }
- ,
- t.handleClick = function(e) {
- this.player().trigger("vipstatus"),
- e.stopPropagation()
- }
- ,
- e
- }(Rt);
- Ht.prototype.labelText_ = "ADCountdown Time",
- Ht.prototype.controlText_ = "ADCountdown Time",
- He.registerComponent("ADCountdownDisplay", Ht);
- var Vt = function(r) {
- function e(e, t) {
- var n;
- return (n = r.call(this, e, t) || this).emitTapEvents(),
- n.enable(),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function(e, t, n) {
- void 0 === e && (e = "div"),
- void 0 === t && (t = {}),
- void 0 === n && (n = {}),
- t = b({
- innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
- className: this.buildCSSClass(),
- tabIndex: 0
- }, t),
- "button" === e && m.error("Creating a ClickableComponent with an HTML element of " + e + " is not supported; use a Button instead."),
- n = b({
- role: "button"
- }, n),
- this.tabIndex_ = t.tabIndex;
- var i = r.prototype.createEl.call(this, e, t, n);
- return this.createControlTextEl(i),
- i
- }
- ,
- t.dispose = function() {
- this.controlTextEl_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.createControlTextEl = function(e) {
- return this.controlTextEl_ = w("span", {
- className: "vjs-control-text"
- }, {
- "aria-live": "polite"
- }),
- e && e.appendChild(this.controlTextEl_),
- this.controlText(this.controlText_, e),
- this.controlTextEl_
- }
- ,
- t.controlText = function(e, t) {
- if (void 0 === t && (t = this.el()),
- void 0 === e)
- return this.controlText_ || "Need Text";
- var n = this.localize(e);
- this.controlText_ = e,
- x(this.controlTextEl_, n),
- this.nonIconControl || t.setAttribute("title", n)
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-control vjs-button " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.enable = function() {
- this.enabled_ || (this.enabled_ = !0,
- this.removeClass("vjs-disabled"),
- this.el_.setAttribute("aria-disabled", "false"),
- "undefined" != typeof this.tabIndex_ && this.el_.setAttribute("tabIndex", this.tabIndex_),
- this.on(["tap", "click"], this.handleClick),
- this.on("keydown", this.handleKeyDown))
- }
- ,
- t.disable = function() {
- this.enabled_ = !1,
- this.addClass("vjs-disabled"),
- this.el_.setAttribute("aria-disabled", "true"),
- "undefined" != typeof this.tabIndex_ && this.el_.removeAttribute("tabIndex"),
- this.off("mouseover", this.handleMouseOver),
- this.off("mouseout", this.handleMouseOut),
- this.off(["tap", "click"], this.handleClick),
- this.off("keydown", this.handleKeyDown)
- }
- ,
- t.handleClick = function(e) {
- this.options_.clickHandler && this.options_.clickHandler.call(this, arguments)
- }
- ,
- t.handleKeyDown = function(e) {
- Mt.isEventKey(e, "Space") || Mt.isEventKey(e, "Enter") ? (e.preventDefault(),
- e.stopPropagation()) : r.prototype.handleKeyDown.call(this, e)
- }
- ,
- e
- }(He);
- He.registerComponent("ClickableComponent", Vt);
- var Qt = function(t) {
- function e() {
- return t.apply(this, arguments) || this
- }
- We(e, t);
- var n = e.prototype;
- return n.createEl = function(e, t, n) {
- void 0 === t && (t = {}),
- void 0 === n && (n = {}),
- t = b({
- innerHTML: '<span aria-hidden="true" class="vjs-icon-placeholder"></span>',
- className: this.buildCSSClass()
- }, t),
- n = b({
- type: "button"
- }, n);
- var i = He.prototype.createEl.call(this, "button", t, n);
- return this.createControlTextEl(i),
- i
- }
- ,
- n.addChild = function(e, t) {
- void 0 === t && (t = {});
- var n = this.constructor.name;
- return m.warn("Adding an actionable (user controllable) child to a Button (" + n + ") is not supported; use a ClickableComponent instead."),
- He.prototype.addChild.call(this, e, t)
- }
- ,
- n.enable = function() {
- t.prototype.enable.call(this),
- this.el_.removeAttribute("disabled")
- }
- ,
- n.disable = function() {
- t.prototype.disable.call(this),
- this.el_.setAttribute("disabled", "disabled")
- }
- ,
- n.handleKeyDown = function(e) {
- t.prototype.handleKeyDown.call(this, e)
- }
- ,
- e
- }(Vt);
- He.registerComponent("Button", Qt);
- function Ut(e, t) {
- t.tech_ && !t.tech_.featuresMuteControl && e.addClass("vjs-hidden"),
- e.on(t, "loadstart", function() {
- t.tech_.featuresMuteControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden")
- })
- }
- var qt = function(i) {
- function e(e, t) {
- var n;
- return n = i.call(this, e, t) || this,
- Ut(Ve(n), e),
- G(n.el()),
- n.el().oncontextmenu = function(e) {
- return !0
- }
- ,
- n.on(e, ["loadstart", "volumechange"], n.update),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "ads-mute vjs-mute-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {
- var t = this.player_.volume()
- , n = this.player_.lastVolume_();
- if (0 === t) {
- var i = n < .1 ? .1 : n;
- this.player_.volume(i),
- this.player_.muted(!1)
- } else
- this.player_.muted(!this.player_.muted());
- e.stopPropagation()
- }
- ,
- t.update = function(e) {
- this.updateIcon_(),
- this.updateControlText_()
- }
- ,
- t.updateIcon_ = function() {
- var e = this.player_.volume()
- , t = 3;
- ht && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted),
- 0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2);
- for (var n = 0; n < 4; n++)
- I(this.el_, "vjs-vol-" + n);
- L(this.el_, "vjs-vol-" + t)
- }
- ,
- t.updateControlText_ = function() {
- var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute";
- this.controlText() !== e && this.controlText(e)
- }
- ,
- e
- }(Qt);
- qt.prototype.controlText_ = "Mute",
- He.registerComponent("AdsMuteToggle", qt);
- var zt = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "fullscreenchange", n.handleFullscreenChange),
- !1 === f[e.fsApi_.fullscreenEnabled] && n.disable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "ads-fullscreen-btn vjs-fullscreen-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleFullscreenChange = function(e) {
- this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen")
- }
- ,
- t.handleClick = function(e) {
- this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen(),
- e.stopPropagation()
- }
- ,
- e
- }(Qt);
- zt.prototype.controlText_ = "Fullscreen",
- He.registerComponent("AdsFullscreenToggle", zt);
- var Wt = function(s) {
- function e(e, t) {
- var n;
- if ((n = s.call(this, e, t) || this).adLink = "https://www.cctv.com",
- n.on("click", n.handleClick),
- !0 !== n.player().options().enableVip) {
- var i = new Ft(e,t);
- n.addChild(i)
- } else {
- var r = new Ht(e,t);
- n.addChild(r),
- n.adCountdownDisplay = r
- }
- return n
- }
- We(e, s);
- var t = e.prototype;
- return t.createEl = function() {
- var e = this.buildCSSClass()
- , t = s.prototype.createEl.call(this, "div", {
- className: e + "ads-overlay"
- });
- this.contentTextEl_ = w("span", {
- className: "ads-label-text",
- innerHTML: ""
- }, {
- "aria-live": "off",
- role: "presentation"
- }),
- t.appendChild(this.contentTextEl_),
- G(t);
- var n = this.player();
- return t.oncontextmenu = function(e) {
- return (null === e.target || P(e.target, "ads-overlay")) && (!0 === e.ctrlKey && e.altKey ? n.showContextMenu(e, !0) : n.showContextMenu(e, !1)),
- !1
- }
- ,
- t
- }
- ,
- t.dispose = function() {
- this.contentTextEl_ = null,
- this.contentEl_ = null,
- this.textNode_ = null,
- s.prototype.dispose.call(this)
- }
- ,
- t.updateTextNode = function(n, i, e) {
- var r = this;
- !0 === this.player().options().enableVip && this.adCountdownDisplay.updateRemainAdTime(e),
- this.requestAnimationFrame(function() {
- if (r.contentTextEl_ && (void 0 !== i && (r.adLink = i),
- !0 !== r.player().options().enableVip)) {
- var e = r.textNode_
- , t = n.split("/");
- "zh-cn" === r.player_.language() ? r.textNode_ = f.createTextNode("第 " + t[0] + " 个广告 • 共 " + t[1] + " 个") : r.textNode_ = f.createTextNode("AD: " + t[0] + " of " + t[1]),
- r.textNode_ && (e ? r.contentTextEl_.replaceChild(r.textNode_, e) : r.contentTextEl_.appendChild(r.textNode_))
- }
- })
- }
- ,
- t.handleClick = function() {
- void 0 !== p && p.open(this.adLink, "_blank")
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- Wt.prototype.labelText_ = "AD",
- Wt.prototype.controlText_ = "AD Label",
- Wt.prototype.options_ = {
- children: ["adsMuteToggle", "adsFullscreenToggle"]
- },
- He.registerComponent("adsOverLay", Wt);
- var Kt = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
- n.off(e, ["timeupdate", "ended"], n.updateContent),
- n.showActivity_ = !0,
- !(n.played_ = !1) === n.player().options().skipAdTip ? (n.hide(),
- n.on(e, "play", n.firstplay)) : n.addClass("ad-vip-skip-hint-hide"),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "ad-vip-skip-hint"
- }
- ,
- t.createEl = function() {
- return i.prototype.createEl.call(this)
- }
- ,
- t.updateContent = function(e) {
- this.updateTextNodeNew_()
- }
- ,
- t.firstplay = function(e) {
- var t;
- this.played_ || (this.played_ = !0,
- this.show(),
- this.setInterval(function() {
- if (this.showActivity_) {
- this.showActivity_ = !1,
- this.clearTimeout(t);
- t = this.setTimeout(function() {
- this.addClass("ad-vip-skip-hint-close")
- }, 3e3)
- }
- }, 250))
- }
- ,
- t.updateTextNodeNew_ = function() {
- if (this.label_ = this.localize("ADs have been skipped"),
- this.contentEl_) {
- var e = this.textNode_;
- this.textNode_ = f.createTextNode(this.label_),
- this.textNode_ && (e ? this.contentEl_.replaceChild(this.textNode_, e) : this.contentEl_.appendChild(this.textNode_))
- }
- }
- ,
- e
- }(Rt);
- Kt.prototype.labelText_ = "",
- Kt.prototype.controlText_ = "",
- He.registerComponent("VipSkipAdTip", Kt);
- var Xt = function(r) {
- function e(e, t, n) {
- var i;
- return (i = r.call(this, e, t) || this).on("click", i.handleClick),
- i
- }
- We(e, r);
- var t = e.prototype;
- return t.setAdData = function(e) {
- this.adLink = e.clickUrl,
- this.eventExposure = e.eventExposure,
- this.eventExposure1 = e.eventExposure1,
- this.imgUrl = e.url,
- this.imgWidth = e.width,
- this.imgHeight = e.height;
- var t = this.el().getElementsByTagName("img")[0];
- t.src = this.imgUrl,
- t.style.width = this.imgWidth + "px",
- t.style.height = this.imgHeight + "px",
- this.el().style.width = this.imgWidth + "px",
- this.el().style.height = this.imgHeight + "px"
- }
- ,
- t.createEl = function() {
- var e = this.buildCSSClass();
- return r.prototype.createEl.call(this, "div", {
- className: e + "pause-ad-content",
- innerHTML: '<img class="pause-ad-img" role="presentation" src="" onload=\'\'></img>'
- })
- }
- ,
- t.dispose = function() {
- this.contentTextEl_ = null,
- this.contentEl_ = null,
- this.textNode_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.showAd = function() {
- this.show()
- }
- ,
- t.hideAd = function() {
- this.hide()
- }
- ,
- t.handleClick = function(e) {
- void 0 !== p && void 0 !== this.adLink && p.open(this.adLink, "_blank")
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- Xt.prototype.options_ = {
- children: ["PauseAdCloseButton"]
- },
- He.registerComponent("pauseAdContent", Xt);
- var Gt = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "pause-ad-close " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {}
- ,
- t.playerResize = function() {}
- ,
- e
- }(Qt);
- He.registerComponent("PauseAdCloseButton", Gt);
- var Yt = function(e) {
- var t = $t.call(e);
- 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)
- }/**
- * @license
- * slighly modified parse-headers 2.0.2 <https://github.com/kesla/parse-headers/>
- * Copyright (c) 2014 David Björklund
- * Available under the MIT license
- * <https://github.com/kesla/parse-headers/blob/master/LICENCE>
- */
- , $t = Object.prototype.toString;
- var Jt = function(e) {
- var r = {};
- return e && e.trim().split("\n").forEach(function(e) {
- var t = e.indexOf(":")
- , n = e.slice(0, t).trim().toLowerCase()
- , i = e.slice(t + 1).trim();
- "undefined" == typeof r[n] ? r[n] = i : Array.isArray(r[n]) ? r[n].push(i) : r[n] = [r[n], i]
- }),
- r
- }
- , Zt = nn
- , en = nn;
- function tn(e, t, n) {
- var i = e;
- return Yt(t) ? (n = t,
- "string" == typeof e && (i = {
- uri: e
- })) : i = r({}, t, {
- uri: e
- }),
- i.callback = n,
- i
- }
- function nn(e, t, n) {
- return rn(t = tn(e, t, n))
- }
- function rn(i) {
- if ("undefined" == typeof i.callback)
- throw new Error("callback argument missing");
- var r = !1
- , s = function(e, t, n) {
- r || (r = !0,
- i.callback(e, t, n))
- };
- function t(e) {
- return clearTimeout(o),
- e instanceof Error || (e = new Error("" + (e || "Unknown XMLHttpRequest Error"))),
- e.statusCode = 0,
- s(e, v)
- }
- function e() {
- if (!a) {
- var e;
- clearTimeout(o),
- e = i.useXDR && void 0 === l.status ? 200 : 1223 === l.status ? 204 : l.status;
- var t = v
- , n = null;
- return 0 !== e ? (t = {
- body: function() {
- var e = void 0;
- if (e = l.response ? l.response : l.responseText || function(e) {
- try {
- if ("document" === e.responseType)
- return e.responseXML;
- var t = e.responseXML && "parsererror" === e.responseXML.documentElement.nodeName;
- if ("" === e.responseType && !t)
- return e.responseXML
- } catch (e) {}
- return null
- }(l),
- f)
- try {
- e = JSON.parse(e)
- } catch (e) {}
- return e
- }(),
- statusCode: e,
- method: c,
- headers: {},
- url: u,
- rawRequest: l
- },
- l.getAllResponseHeaders && (t.headers = Jt(l.getAllResponseHeaders()))) : n = new Error("Internal XMLHttpRequest Error"),
- s(n, t, t.body)
- }
- }
- 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 = {
- body: void 0,
- headers: {},
- statusCode: 0,
- method: c,
- url: u,
- rawRequest: l
- };
- if ("json"in i && !1 !== i.json && (f = !0,
- d.accept || d.Accept || (d.Accept = "application/json"),
- "GET" !== c && "HEAD" !== c && (d["content-type"] || d["Content-Type"] || (d["Content-Type"] = "application/json"),
- h = JSON.stringify(!0 === i.json ? h : i.json))),
- l.onreadystatechange = function() {
- 4 === l.readyState && setTimeout(e, 0)
- }
- ,
- l.onload = e,
- l.onerror = t,
- l.onprogress = function() {}
- ,
- l.onabort = function() {
- a = !0
- }
- ,
- l.ontimeout = t,
- l.open(c, u, !p, i.username, i.password),
- p || (l.withCredentials = !!i.withCredentials),
- !p && 0 < i.timeout && (o = setTimeout(function() {
- if (!a) {
- a = !0,
- l.abort("timeout");
- var e = new Error("XMLHttpRequest timeout");
- e.code = "ETIMEDOUT",
- t(e)
- }
- }, i.timeout)),
- l.setRequestHeader)
- for (n in d)
- d.hasOwnProperty(n) && l.setRequestHeader(n, d[n]);
- else if (i.headers && !function(e) {
- for (var t in e)
- if (e.hasOwnProperty(t))
- return !1;
- return !0
- }(i.headers))
- throw new Error("Headers cannot be set on an XDomainRequest object");
- return "responseType"in i && (l.responseType = i.responseType),
- "beforeSend"in i && "function" == typeof i.beforeSend && i.beforeSend(l),
- l.send(h || null),
- l
- }
- nn.XMLHttpRequest = p.XMLHttpRequest || function() {}
- ,
- nn.XDomainRequest = "withCredentials"in new nn.XMLHttpRequest ? nn.XMLHttpRequest : p.XDomainRequest,
- function(e, t) {
- for (var n = 0; n < e.length; n++)
- t(e[n])
- }(["get", "put", "post", "patch", "head", "delete"], function(i) {
- nn["delete" === i ? "del" : i] = function(e, t, n) {
- return (t = tn(e, t, n)).method = i.toUpperCase(),
- rn(t)
- }
- }),
- Zt.default = en;
- function sn(e) {
- var t = ["protocol", "hostname", "port", "pathname", "search", "hash", "host"]
- , n = f.createElement("a");
- n.href = e;
- var i, r = "" === n.host && "file:" !== n.protocol;
- r && ((i = f.createElement("div")).innerHTML = '<a href="' + e + '"></a>',
- n = i.firstChild,
- i.setAttribute("style", "display:none; position:absolute;"),
- f.body.appendChild(i));
- for (var s = {}, a = 0; a < t.length; a++)
- s[t[a]] = n[t[a]];
- return "http:" === s.protocol && (s.host = s.host.replace(/:80$/, "")),
- "https:" === s.protocol && (s.host = s.host.replace(/:443$/, "")),
- s.protocol || (s.protocol = p.location.protocol),
- r && f.body.removeChild(i),
- s
- }
- function an(e) {
- if (!e.match(/^https?:\/\//)) {
- var t = f.createElement("div");
- t.innerHTML = '<a href="' + e + '">x</a>',
- e = t.firstChild.href
- }
- return e
- }
- function on(e) {
- if ("string" == typeof e) {
- var t = /^(\/?)([\s\S]*?)((?:\.{1,2}|[^\/]+?)(\.([^\.\/\?]+)))(?:[\/]*|[\?].*)$/.exec(e);
- if (t)
- return t.pop().toLowerCase()
- }
- return ""
- }
- function ln(e, t) {
- void 0 === t && (t = p.location);
- var n = sn(e);
- return (":" === n.protocol ? t.protocol : n.protocol) + n.host !== t.protocol + t.host
- }
- var un = Object.freeze({
- __proto__: null,
- parseUrl: sn,
- getAbsoluteURL: an,
- getFileExtension: on,
- isCrossOrigin: ln
- })
- , cn = function(r) {
- function e(e, t) {
- var n;
- (n = r.call(this, e, t) || this).hide(),
- n.isPlaying_ = !1,
- n.on(e, "pause", n.onPause),
- n.on(e, "play", n.hideAd),
- n.on(e, "ended", n.onEnded);
- var i = n.getChild("pauseAdContent").getChild("PauseAdCloseButton");
- return n.on(i, "click", n.hideAd),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.imgLoaded = function() {}
- ,
- t.playerResize = function() {}
- ,
- t.createEl = function() {
- var e = this.buildCSSClass();
- return r.prototype.createEl.call(this, "div", {
- className: e + "pause-ad-overlay"
- })
- }
- ,
- t.dispose = function() {
- this.contentTextEl_ = null,
- this.contentEl_ = null,
- this.textNode_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.showAd = function(e) {
- var t = JSON.parse(e)
- , n = this.getChild("PauseAdContent");
- t[0] && (n.setAdData(t[0]),
- this.adWidth = t[0].width,
- this.adHeight = t[0].height,
- this.show())
- }
- ,
- t.hideAd = function(e) {
- this.isPlaying_ = !0,
- this.hide(),
- e.stopPropagation()
- }
- ,
- t.onPause = function() {
- this.isPlaying_ = !1;
- setTimeout(this.getAdData, 300, this)
- }
- ,
- t.onEnded = function() {
- this.isPlaying_ = !0
- }
- ,
- t.getAdData = function(i) {
- 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) {
- var e = {
- uri: i.player_.options().pauseAdUrl
- }
- , t = ln(i.player_.options().pauseAdUrl);
- t && (e.cors = t),
- Zt(e, Te(i, function(e, t, n) {
- if (e)
- return !1;
- null != n && !1 === i.isPlaying_ && i.showAd(n)
- }))
- }
- }
- ,
- t.handleClick = function() {
- void 0 !== p && p.open(this.adLink, "_blank")
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- cn.prototype.options_ = {
- children: ["pauseAdContent"]
- },
- He.registerComponent("pauseAdOverLay", cn);
- var hn = function(r) {
- function e(e, t, n) {
- var i;
- return (i = r.call(this, e, t) || this).on("click", i.handleClick),
- i
- }
- We(e, r);
- var t = e.prototype;
- return t.setAdData = function(e) {
- this.adLink = e.clickUrl,
- this.eventExposure = e.eventExposure,
- this.eventExposure1 = e.eventExposure1,
- this.imgUrl = e.url;
- var t = this.el().getElementsByTagName("img")[0];
- t.src = this.imgUrl,
- t.style.width = "540px",
- t.style.height = "70px",
- this.el().style.width = "540px",
- this.el().style.height = "70px"
- }
- ,
- t.createEl = function() {
- var e = this.buildCSSClass();
- return r.prototype.createEl.call(this, "div", {
- className: e + "banner-ad-content",
- innerHTML: '<img class="banner-ad-img" role="presentation" src="" ></img>'
- })
- }
- ,
- t.dispose = function() {
- this.contentTextEl_ = null,
- this.contentEl_ = null,
- this.textNode_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.showAd = function() {
- this.show()
- }
- ,
- t.hideAd = function() {
- this.hide()
- }
- ,
- t.handleClick = function(e) {
- void 0 !== p && void 0 !== this.adLink && p.open(this.adLink, "_blank")
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- hn.prototype.options_ = {
- children: ["BannerAdCloseButton"]
- },
- He.registerComponent("BannerAdContent", hn);
- var dn = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "banner-ad-close " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {}
- ,
- t.playerResize = function() {}
- ,
- e
- }(Qt);
- He.registerComponent("BannerAdCloseButton", dn);
- var pn = function(r) {
- function e(e, t) {
- var n;
- (n = r.call(this, e, t) || this).player_.mainContentDuration_ = void 0,
- n.timer = void 0,
- n.bannerAd1Showed = !1,
- n.bannerAd2Showed = !1,
- n.hide(),
- n.on(e, "timeupdate", n.timeUpdata);
- var i = n.getChild("bannerAdContent").getChild("BannerAdCloseButton");
- return n.on(i, "click", n.hideAd),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.imgLoaded = function() {}
- ,
- t.playerResize = function() {}
- ,
- t.createEl = function() {
- var e = this.buildCSSClass();
- return r.prototype.createEl.call(this, "div", {
- className: e + "banner-ad-overlay"
- })
- }
- ,
- t.dispose = function() {
- this.contentTextEl_ = null,
- this.contentEl_ = null,
- this.textNode_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.showAd = function(e) {
- var t = JSON.parse(e)
- , n = this.getChild("BannerAdContent");
- t[0] && (n.setAdData(t[0]),
- this.show(),
- this.timer && clearTimeout(this.timer),
- this.timer = setTimeout(this.timeHide, 1e4, this))
- }
- ,
- t.timeHide = function(e) {
- e.hide()
- }
- ,
- t.hideAd = function(e) {
- clearTimeout(this.timer),
- this.hide(),
- e.stopPropagation()
- }
- ,
- t.timeUpdata = function() {
- !this.bannerAd2Showed && 300 < this.player_.mainContentDuration_ && 180 <= this.player_.currentTime() ? (this.bannerAd2Showed = !0,
- this.getAdData()) : !this.bannerAd1Showed && 300 < this.player_.mainContentDuration_ && 60 <= this.player_.currentTime() && this.player_.currentTime() < 180 ? (this.bannerAd1Showed = !0,
- this.getAdData()) : !this.bannerAd1Showed && 60 <= this.player_.mainContentDuration_ && this.player_.mainContentDuration_ <= 300 && 60 <= this.player_.currentTime() && (this.bannerAd1Showed = !0,
- this.getAdData())
- }
- ,
- t.getAdData = function() {
- var i = this;
- if (i.player_.ads && !1 === i.player_.ads.isInAdMode() && !1 !== i.player_.options().bannerAd && void 0 !== i.player_.options().bannerAdUrl && "" !== i.player_.options().bannerAdUrl) {
- var e = {
- uri: i.player_.options().bannerAdUrl
- }
- , t = ln(i.player_.options().bannerAdUrl);
- t && (e.cors = t),
- Zt(e, Te(i, function(e, t, n) {
- if (e)
- return !1;
- null != n && i.showAd(n)
- }))
- }
- }
- ,
- t.handleClick = function() {
- void 0 !== p && p.open(this.adLink, "_blank")
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- pn.prototype.options_ = {
- children: ["bannerAdContent"]
- },
- He.registerComponent("bannerAdOverLay", pn);
- var fn = function(i) {
- function e(e) {
- var t;
- void 0 === e && (e = []),
- (t = i.call(this) || this).tracks_ = [],
- Object.defineProperty(Ve(t), "length", {
- get: function() {
- return this.tracks_.length
- }
- });
- for (var n = 0; n < e.length; n++)
- t.addTrack(e[n]);
- return t
- }
- We(e, i);
- var t = e.prototype;
- return t.addTrack = function(e) {
- var t = this.tracks_.length;
- "" + t in this || Object.defineProperty(this, t, {
- get: function() {
- return this.tracks_[t]
- }
- }),
- -1 === this.tracks_.indexOf(e) && (this.tracks_.push(e),
- this.trigger({
- track: e,
- type: "addtrack",
- target: this
- }))
- }
- ,
- t.removeTrack = function(e) {
- for (var t, n = 0, i = this.length; n < i; n++)
- if (this[n] === e) {
- (t = this[n]).off && t.off(),
- this.tracks_.splice(n, 1);
- break
- }
- t && this.trigger({
- track: t,
- type: "removetrack",
- target: this
- })
- }
- ,
- t.getTrackById = function(e) {
- for (var t = null, n = 0, i = this.length; n < i; n++) {
- var r = this[n];
- if (r.id === e) {
- t = r;
- break
- }
- }
- return t
- }
- ,
- e
- }(ke);
- for (var vn in fn.prototype.allowedEvents_ = {
- change: "change",
- addtrack: "addtrack",
- removetrack: "removetrack"
- },
- fn.prototype.allowedEvents_)
- fn.prototype["on" + vn] = null;
- function gn(e, t) {
- for (var n = 0; n < e.length; n++)
- Object.keys(e[n]).length && t.id !== e[n].id && (e[n].enabled = !1)
- }
- function yn(e, t) {
- for (var n = 0; n < e.length; n++)
- Object.keys(e[n]).length && t.id !== e[n].id && (e[n].selected = !1)
- }
- function mn(e, t) {
- var n = new p.WebVTT.Parser(p,p.vttjs,p.WebVTT.StringDecoder())
- , i = [];
- n.oncue = function(e) {
- t.addCue(e)
- }
- ,
- n.onparsingerror = function(e) {
- i.push(e)
- }
- ,
- n.onflush = function() {
- t.trigger({
- type: "loadeddata",
- target: t
- })
- }
- ,
- n.parse(e),
- 0 < i.length && (p.console && p.console.groupCollapsed && p.console.groupCollapsed("Text Track parsing errors for " + t.src),
- i.forEach(function(e) {
- return m.error(e)
- }),
- p.console && p.console.groupEnd && p.console.groupEnd()),
- n.flush()
- }
- function _n(e, i) {
- var t = {
- uri: e
- }
- , n = ln(e);
- n && (t.cors = n),
- Zt(t, Te(this, function(e, t, n) {
- if (e)
- return m.error(e, t);
- i.loaded_ = !0,
- "function" != typeof p.WebVTT ? i.tech_ && i.tech_.any(["vttjsloaded", "vttjserror"], function(e) {
- if ("vttjserror" !== e.type)
- return mn(n, i);
- m.error("vttjs failed to load, stopping trying to process " + i.src)
- }) : mn(n, i)
- }))
- }
- var bn = function(i) {
- function e(e) {
- var t;
- void 0 === e && (e = []);
- for (var n = e.length - 1; 0 <= n; n--)
- if (e[n].enabled) {
- gn(e, e[n]);
- break
- }
- return (t = i.call(this, e) || this).changing_ = !1,
- t
- }
- We(e, i);
- var t = e.prototype;
- return t.addTrack = function(e) {
- var t = this;
- e.enabled && gn(this, e),
- i.prototype.addTrack.call(this, e),
- e.addEventListener && (e.enabledChange_ = function() {
- t.changing_ || (t.changing_ = !0,
- gn(t, e),
- t.changing_ = !1,
- t.trigger("change"))
- }
- ,
- e.addEventListener("enabledchange", e.enabledChange_))
- }
- ,
- t.removeTrack = function(e) {
- i.prototype.removeTrack.call(this, e),
- e.removeEventListener && e.enabledChange_ && (e.removeEventListener("enabledchange", e.enabledChange_),
- e.enabledChange_ = null)
- }
- ,
- e
- }(fn)
- , Tn = function(i) {
- function e(e) {
- var t;
- void 0 === e && (e = []);
- for (var n = e.length - 1; 0 <= n; n--)
- if (e[n].selected) {
- yn(e, e[n]);
- break
- }
- return (t = i.call(this, e) || this).changing_ = !1,
- Object.defineProperty(Ve(t), "selectedIndex", {
- get: function() {
- for (var e = 0; e < this.length; e++)
- if (this[e].selected)
- return e;
- return -1
- },
- set: function() {}
- }),
- t
- }
- We(e, i);
- var t = e.prototype;
- return t.addTrack = function(e) {
- var t = this;
- e.selected && yn(this, e),
- i.prototype.addTrack.call(this, e),
- e.addEventListener && (e.selectedChange_ = function() {
- t.changing_ || (t.changing_ = !0,
- yn(t, e),
- t.changing_ = !1,
- t.trigger("change"))
- }
- ,
- e.addEventListener("selectedchange", e.selectedChange_))
- }
- ,
- t.removeTrack = function(e) {
- i.prototype.removeTrack.call(this, e),
- e.removeEventListener && e.selectedChange_ && (e.removeEventListener("selectedchange", e.selectedChange_),
- e.selectedChange_ = null)
- }
- ,
- e
- }(fn)
- , Cn = function(n) {
- function e() {
- return n.apply(this, arguments) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.addTrack = function(e) {
- var t = this;
- n.prototype.addTrack.call(this, e),
- this.queueChange_ || (this.queueChange_ = function() {
- return t.queueTrigger("change")
- }
- ),
- this.triggerSelectedlanguagechange || (this.triggerSelectedlanguagechange_ = function() {
- return t.trigger("selectedlanguagechange")
- }
- ),
- e.addEventListener("modechange", this.queueChange_);
- -1 === ["metadata", "chapters"].indexOf(e.kind) && e.addEventListener("modechange", this.triggerSelectedlanguagechange_)
- }
- ,
- t.removeTrack = function(e) {
- n.prototype.removeTrack.call(this, e),
- e.removeEventListener && (this.queueChange_ && e.removeEventListener("modechange", this.queueChange_),
- this.selectedlanguagechange_ && e.removeEventListener("modechange", this.triggerSelectedlanguagechange_))
- }
- ,
- e
- }(fn)
- , kn = function() {
- function e(e) {
- void 0 === e && (e = []),
- this.trackElements_ = [],
- Object.defineProperty(this, "length", {
- get: function() {
- return this.trackElements_.length
- }
- });
- for (var t = 0, n = e.length; t < n; t++)
- this.addTrackElement_(e[t])
- }
- var t = e.prototype;
- return t.addTrackElement_ = function(e) {
- var t = this.trackElements_.length;
- "" + t in this || Object.defineProperty(this, t, {
- get: function() {
- return this.trackElements_[t]
- }
- }),
- -1 === this.trackElements_.indexOf(e) && this.trackElements_.push(e)
- }
- ,
- t.getTrackElementByTrack_ = function(e) {
- for (var t, n = 0, i = this.trackElements_.length; n < i; n++)
- if (e === this.trackElements_[n].track) {
- t = this.trackElements_[n];
- break
- }
- return t
- }
- ,
- t.removeTrackElement_ = function(e) {
- for (var t = 0, n = this.trackElements_.length; t < n; t++)
- if (e === this.trackElements_[t]) {
- this.trackElements_[t].track && "function" == typeof this.trackElements_[t].track.off && this.trackElements_[t].track.off(),
- "function" == typeof this.trackElements_[t].off && this.trackElements_[t].off(),
- this.trackElements_.splice(t, 1);
- break
- }
- }
- ,
- e
- }()
- , En = function() {
- function t(e) {
- t.prototype.setCues_.call(this, e),
- Object.defineProperty(this, "length", {
- get: function() {
- return this.length_
- }
- })
- }
- var e = t.prototype;
- return e.setCues_ = function(e) {
- var t = this.length || 0
- , n = 0
- , i = e.length;
- this.cues_ = e,
- this.length_ = e.length;
- function r(e) {
- "" + e in this || Object.defineProperty(this, "" + e, {
- get: function() {
- return this.cues_[e]
- }
- })
- }
- if (t < i)
- for (n = t; n < i; n++)
- r.call(this, n)
- }
- ,
- e.getCueById = function(e) {
- for (var t = null, n = 0, i = this.length; n < i; n++) {
- var r = this[n];
- if (r.id === e) {
- t = r;
- break
- }
- }
- return t
- }
- ,
- t
- }()
- , Sn = {
- alternative: "alternative",
- captions: "captions",
- main: "main",
- sign: "sign",
- subtitles: "subtitles",
- commentary: "commentary"
- }
- , wn = {
- alternative: "alternative",
- descriptions: "descriptions",
- main: "main",
- "main-desc": "main-desc",
- translation: "translation",
- commentary: "commentary"
- }
- , xn = {
- subtitles: "subtitles",
- captions: "captions",
- descriptions: "descriptions",
- chapters: "chapters",
- metadata: "metadata"
- }
- , An = {
- disabled: "disabled",
- hidden: "hidden",
- showing: "showing"
- }
- , Pn = function(s) {
- function e(e) {
- var t;
- void 0 === e && (e = {}),
- t = s.call(this) || this;
- function n(e) {
- Object.defineProperty(Ve(t), e, {
- get: function() {
- return i[e]
- },
- set: function() {}
- })
- }
- var i = {
- id: e.id || "vjs_track_" + le(),
- kind: e.kind || "",
- label: e.label || "",
- language: e.language || ""
- };
- for (var r in i)
- n(r);
- return t
- }
- return We(e, s),
- e
- }(ke)
- , Ln = function(u) {
- function e(e) {
- var t;
- if (void 0 === e && (e = {}),
- !e.tech)
- throw new Error("A tech was not provided.");
- var n = Fe(e, {
- kind: xn[e.kind] || "subtitles",
- language: e.language || e.srclang || ""
- })
- , i = An[n.mode] || "disabled"
- , r = n.default;
- "metadata" !== n.kind && "chapters" !== n.kind || (i = "hidden"),
- (t = u.call(this, n) || this).tech_ = n.tech,
- t.cues_ = [],
- t.activeCues_ = [],
- t.preload_ = !1 !== t.tech_.preloadTextTracks;
- var s = new En(t.cues_)
- , a = new En(t.activeCues_)
- , o = !1
- , l = Te(Ve(t), function() {
- this.activeCues = this.activeCues,
- o && (this.trigger("cuechange"),
- o = !1)
- });
- return "disabled" !== i && t.tech_.ready(function() {
- t.tech_.on("timeupdate", l)
- }, !0),
- Object.defineProperties(Ve(t), {
- default: {
- get: function() {
- return r
- },
- set: function() {}
- },
- mode: {
- get: function() {
- return i
- },
- set: function(e) {
- var t = this;
- An[e] && (i = e,
- this.preload_ || "disabled" === i || 0 !== this.cues.length || _n(this.src, this),
- "disabled" !== i ? this.tech_.ready(function() {
- t.tech_.on("timeupdate", l)
- }, !0) : this.tech_.off("timeupdate", l),
- this.trigger("modechange"))
- }
- },
- cues: {
- get: function() {
- return this.loaded_ ? s : null
- },
- set: function() {}
- },
- activeCues: {
- get: function() {
- if (!this.loaded_)
- return null;
- if (0 === this.cues.length)
- return a;
- for (var e = this.tech_.currentTime(), t = [], n = 0, i = this.cues.length; n < i; n++) {
- var r = this.cues[n];
- r.startTime <= e && r.endTime >= e ? t.push(r) : r.startTime === r.endTime && r.startTime <= e && r.startTime + .5 >= e && t.push(r)
- }
- if (o = !1,
- t.length !== this.activeCues_.length)
- o = !0;
- else
- for (var s = 0; s < t.length; s++)
- -1 === this.activeCues_.indexOf(t[s]) && (o = !0);
- return this.activeCues_ = t,
- a.setCues_(this.activeCues_),
- a
- },
- set: function() {}
- }
- }),
- n.src ? (t.src = n.src,
- t.preload_ || (t.loaded_ = !0),
- (t.preload_ || r || "subtitles" !== n.kind && "captions" !== n.kind) && _n(t.src, Ve(t))) : t.loaded_ = !0,
- t
- }
- We(e, u);
- var t = e.prototype;
- return t.addCue = function(e) {
- var t = e;
- if (p.vttjs && !(e instanceof p.vttjs.VTTCue)) {
- for (var n in t = new p.vttjs.VTTCue(e.startTime,e.endTime,e.text),
- e)
- n in t || (t[n] = e[n]);
- t.id = e.id,
- t.originalCue_ = e
- }
- for (var i = this.tech_.textTracks(), r = 0; r < i.length; r++)
- i[r] !== this && i[r].removeCue(t);
- this.cues_.push(t),
- this.cues.setCues_(this.cues_)
- }
- ,
- t.removeCue = function(e) {
- for (var t = this.cues_.length; t--; ) {
- var n = this.cues_[t];
- if (n === e || n.originalCue_ && n.originalCue_ === e) {
- this.cues_.splice(t, 1),
- this.cues.setCues_(this.cues_);
- break
- }
- }
- }
- ,
- e
- }(Pn);
- Ln.prototype.allowedEvents_ = {
- cuechange: "cuechange"
- };
- var In = function(r) {
- function e(e) {
- var t;
- void 0 === e && (e = {});
- var n = Fe(e, {
- kind: wn[e.kind] || ""
- });
- t = r.call(this, n) || this;
- var i = !1;
- return Object.defineProperty(Ve(t), "enabled", {
- get: function() {
- return i
- },
- set: function(e) {
- "boolean" == typeof e && e !== i && (i = e,
- this.trigger("enabledchange"))
- }
- }),
- n.enabled && (t.enabled = n.enabled),
- t.loaded_ = !0,
- t
- }
- return We(e, r),
- e
- }(Pn)
- , Mn = function(r) {
- function e(e) {
- var t;
- void 0 === e && (e = {});
- var n = Fe(e, {
- kind: Sn[e.kind] || ""
- });
- t = r.call(this, n) || this;
- var i = !1;
- return Object.defineProperty(Ve(t), "selected", {
- get: function() {
- return i
- },
- set: function(e) {
- "boolean" == typeof e && e !== i && (i = e,
- this.trigger("selectedchange"))
- }
- }),
- n.selected && (t.selected = n.selected),
- t
- }
- return We(e, r),
- e
- }(Pn)
- , jn = function(r) {
- function e(e) {
- var t, n;
- void 0 === e && (e = {}),
- t = r.call(this) || this;
- var i = new Ln(e);
- return t.kind = i.kind,
- t.src = i.src,
- t.srclang = i.language,
- t.label = i.label,
- t.default = i.default,
- Object.defineProperties(Ve(t), {
- readyState: {
- get: function() {
- return n
- }
- },
- track: {
- get: function() {
- return i
- }
- }
- }),
- n = 0,
- i.addEventListener("loadeddata", function() {
- n = 2,
- t.trigger({
- type: "load",
- target: Ve(t)
- })
- }),
- t
- }
- return We(e, r),
- e
- }(ke);
- jn.prototype.allowedEvents_ = {
- load: "load"
- },
- jn.NONE = 0,
- jn.LOADING = 1,
- jn.LOADED = 2,
- jn.ERROR = 3;
- var On = {
- audio: {
- ListClass: bn,
- TrackClass: In,
- capitalName: "Audio"
- },
- video: {
- ListClass: Tn,
- TrackClass: Mn,
- capitalName: "Video"
- },
- text: {
- ListClass: Cn,
- TrackClass: Ln,
- capitalName: "Text"
- }
- };
- Object.keys(On).forEach(function(e) {
- On[e].getterName = e + "Tracks",
- On[e].privateName = e + "Tracks_"
- });
- var Nn = {
- remoteText: {
- ListClass: Cn,
- TrackClass: Ln,
- capitalName: "RemoteText",
- getterName: "remoteTextTracks",
- privateName: "remoteTextTracks_"
- },
- remoteTextEl: {
- ListClass: kn,
- TrackClass: jn,
- capitalName: "RemoteTextTrackEls",
- getterName: "remoteTextTrackEls",
- privateName: "remoteTextTrackEls_"
- }
- }
- , Dn = r({}, On, Nn);
- Nn.names = Object.keys(Nn),
- On.names = Object.keys(On),
- Dn.names = [].concat(Nn.names).concat(On.names);
- var Bn = Object.create || function(e) {
- if (1 !== arguments.length)
- throw new Error("Object.create shim only accepts one parameter.");
- return Rn.prototype = e,
- new Rn
- }
- ;
- function Rn() {}
- function Fn(e, t) {
- this.name = "ParsingError",
- this.code = e.code,
- this.message = t || e.message
- }
- function Hn(e) {
- function t(e, t, n, i) {
- return 3600 * (0 | e) + 60 * (0 | t) + (0 | n) + (0 | i) / 1e3
- }
- var n = e.match(/^(\d+):(\d{1,2})(:\d{1,2})?\.(\d{3})/);
- 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
- }
- function Vn() {
- this.values = Bn(null)
- }
- function Qn(e, t, n, i) {
- var r = i ? e.split(i) : [e];
- for (var s in r)
- if ("string" == typeof r[s]) {
- var a = r[s].split(n);
- if (2 === a.length)
- t(a[0], a[1])
- }
- }
- function Un(t, e, a) {
- var n = t;
- function i() {
- var e = Hn(t);
- if (null === e)
- throw new Fn(Fn.Errors.BadTimeStamp,"Malformed timestamp: " + n);
- return t = t.replace(/^[^\sa-zA-Z-]+/, ""),
- e
- }
- function r() {
- t = t.replace(/^\s+/, "")
- }
- if (r(),
- e.startTime = i(),
- r(),
- "--\x3e" !== t.substr(0, 3))
- throw new Fn(Fn.Errors.BadTimeStamp,"Malformed time stamp (time stamps must be separated by '--\x3e'): " + n);
- t = t.substr(3),
- r(),
- e.endTime = i(),
- r(),
- function(e, t) {
- var s = new Vn;
- Qn(e, function(e, t) {
- switch (e) {
- case "region":
- for (var n = a.length - 1; 0 <= n; n--)
- if (a[n].id === t) {
- s.set(e, a[n].region);
- break
- }
- break;
- case "vertical":
- s.alt(e, t, ["rl", "lr"]);
- break;
- case "line":
- var i = t.split(",")
- , r = i[0];
- s.integer(e, r),
- s.percent(e, r) && s.set("snapToLines", !1),
- s.alt(e, r, ["auto"]),
- 2 === i.length && s.alt("lineAlign", i[1], ["start", "center", "end"]);
- break;
- case "position":
- i = t.split(","),
- s.percent(e, i[0]),
- 2 === i.length && s.alt("positionAlign", i[1], ["start", "center", "end"]);
- break;
- case "size":
- s.percent(e, t);
- break;
- case "align":
- s.alt(e, t, ["start", "center", "end", "left", "right"])
- }
- }, /:/, /\s/),
- t.region = s.get("region", null),
- t.vertical = s.get("vertical", "");
- try {
- t.line = s.get("line", "auto")
- } catch (e) {}
- t.lineAlign = s.get("lineAlign", "start"),
- t.snapToLines = s.get("snapToLines", !0),
- t.size = s.get("size", 100);
- try {
- t.align = s.get("align", "center")
- } catch (e) {
- t.align = s.get("align", "middle")
- }
- try {
- t.position = s.get("position", "auto")
- } catch (e) {
- t.position = s.get("position", {
- start: 0,
- left: 0,
- center: 50,
- middle: 50,
- end: 100,
- right: 100
- }, t.align)
- }
- t.positionAlign = s.get("positionAlign", {
- start: "start",
- left: "start",
- center: "center",
- middle: "center",
- end: "end",
- right: "end"
- }, t.align)
- }(t, e)
- }
- ((Fn.prototype = Bn(Error.prototype)).constructor = Fn).Errors = {
- BadSignature: {
- code: 0,
- message: "Malformed WebVTT signature."
- },
- BadTimeStamp: {
- code: 1,
- message: "Malformed time stamp."
- }
- },
- Vn.prototype = {
- set: function(e, t) {
- this.get(e) || "" === t || (this.values[e] = t)
- },
- get: function(e, t, n) {
- return n ? this.has(e) ? this.values[e] : t[n] : this.has(e) ? this.values[e] : t
- },
- has: function(e) {
- return e in this.values
- },
- alt: function(e, t, n) {
- for (var i = 0; i < n.length; ++i)
- if (t === n[i]) {
- this.set(e, t);
- break
- }
- },
- integer: function(e, t) {
- /^-?\d+$/.test(t) && this.set(e, parseInt(t, 10))
- },
- percent: function(e, t) {
- return !!(t.match(/^([\d]{1,3})(\.[\d]*)?%$/) && 0 <= (t = parseFloat(t)) && t <= 100) && (this.set(e, t),
- !0)
- }
- };
- var qn = f.createElement("textarea")
- , zn = {
- c: "span",
- i: "i",
- b: "b",
- u: "u",
- ruby: "ruby",
- rt: "rt",
- v: "span",
- lang: "span"
- }
- , Wn = {
- white: "rgba(255,255,255,1)",
- lime: "rgba(0,255,0,1)",
- cyan: "rgba(0,255,255,1)",
- red: "rgba(255,0,0,1)",
- yellow: "rgba(255,255,0,1)",
- magenta: "rgba(255,0,255,1)",
- blue: "rgba(0,0,255,1)",
- black: "rgba(0,0,0,1)"
- }
- , Kn = {
- v: "title",
- lang: "lang"
- }
- , Xn = {
- rt: "ruby"
- };
- function Gn(s, n) {
- function e() {
- if (!n)
- return null;
- var e, t = n.match(/^([^<]*)(<[^>]*>?)?/);
- return e = t[1] ? t[1] : t[2],
- n = n.substr(e.length),
- e
- }
- function t(e, t) {
- var n = zn[e];
- if (!n)
- return null;
- var i = s.document.createElement(n)
- , r = Kn[e];
- return r && t && (i[r] = t.trim()),
- i
- }
- for (var i, r, a, o, l = s.document.createElement("div"), u = l, c = []; null !== (i = e()); )
- if ("<" !== i[0])
- u.appendChild(s.document.createTextNode((r = i,
- qn.innerHTML = r,
- r = qn.textContent,
- qn.textContent = "",
- r)));
- else {
- if ("/" === i[1]) {
- c.length && c[c.length - 1] === i.substr(2).replace(">", "") && (c.pop(),
- u = u.parentNode);
- continue
- }
- var h, d = Hn(i.substr(1, i.length - 2));
- if (d) {
- h = s.document.createProcessingInstruction("timestamp", d),
- u.appendChild(h);
- continue
- }
- var p = i.match(/^<([^.\s/0-9>]+)(\.[^\s\\>]+)?([^>\\]+)?(\\?)>?$/);
- if (!p)
- continue;
- if (!(h = t(p[1], p[3])))
- continue;
- if (a = u,
- Xn[(o = h).localName] && Xn[o.localName] !== a.localName)
- continue;
- if (p[2]) {
- var f = p[2].split(".");
- f.forEach(function(e) {
- var t = /^bg_/.test(e)
- , n = t ? e.slice(3) : e;
- if (Wn.hasOwnProperty(n)) {
- var i = t ? "background-color" : "color"
- , r = Wn[n];
- h.style[i] = r
- }
- }),
- h.className = f.join(" ")
- }
- c.push(p[1]),
- u.appendChild(h),
- u = h
- }
- return l
- }
- 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]];
- function $n(e) {
- for (var t = 0; t < Yn.length; t++) {
- var n = Yn[t];
- if (e >= n[0] && e <= n[1])
- return !0
- }
- return !1
- }
- function Jn() {}
- function Zn(e, t, n) {
- Jn.call(this),
- this.cue = t,
- this.cueDiv = Gn(e, t.text);
- var i = {
- color: "rgba(255, 255, 255, 1)",
- backgroundColor: "rgba(0, 0, 0, 0.8)",
- position: "relative",
- left: 0,
- right: 0,
- top: 0,
- bottom: 0,
- display: "inline",
- writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
- unicodeBidi: "plaintext"
- };
- this.applyStyles(i, this.cueDiv),
- this.div = e.document.createElement("div"),
- i = {
- direction: function(e) {
- var t = []
- , n = "";
- if (!e || !e.childNodes)
- return "ltr";
- function r(e, t) {
- for (var n = t.childNodes.length - 1; 0 <= n; n--)
- e.push(t.childNodes[n])
- }
- function s(e) {
- if (!e || !e.length)
- return null;
- var t = e.pop()
- , n = t.textContent || t.innerText;
- if (n) {
- var i = n.match(/^.*(\n|\r)/);
- return i ? i[e.length = 0] : n
- }
- return "ruby" === t.tagName ? s(e) : t.childNodes ? (r(e, t),
- s(e)) : void 0
- }
- for (r(t, e); n = s(t); )
- for (var i = 0; i < n.length; i++)
- if ($n(n.charCodeAt(i)))
- return "rtl";
- return "ltr"
- }(this.cueDiv),
- writingMode: "" === t.vertical ? "horizontal-tb" : "lr" === t.vertical ? "vertical-lr" : "vertical-rl",
- unicodeBidi: "plaintext",
- textAlign: "middle" === t.align ? "center" : t.align,
- font: n.font,
- whiteSpace: "pre-line",
- position: "absolute"
- },
- this.applyStyles(i),
- this.div.appendChild(this.cueDiv);
- var r = 0;
- switch (t.positionAlign) {
- case "start":
- r = t.position;
- break;
- case "center":
- r = t.position - t.size / 2;
- break;
- case "end":
- r = t.position - t.size
- }
- "" === t.vertical ? this.applyStyles({
- left: this.formatStyle(r, "%"),
- width: this.formatStyle(t.size, "%")
- }) : this.applyStyles({
- top: this.formatStyle(r, "%"),
- height: this.formatStyle(t.size, "%")
- }),
- this.move = function(e) {
- this.applyStyles({
- top: this.formatStyle(e.top, "px"),
- bottom: this.formatStyle(e.bottom, "px"),
- left: this.formatStyle(e.left, "px"),
- right: this.formatStyle(e.right, "px"),
- height: this.formatStyle(e.height, "px"),
- width: this.formatStyle(e.width, "px")
- })
- }
- }
- function ei(e) {
- var t, n, i, r;
- if (e.div) {
- n = e.div.offsetHeight,
- i = e.div.offsetWidth,
- r = e.div.offsetTop;
- var s = (s = e.div.childNodes) && (s = s[0]) && s.getClientRects && s.getClientRects();
- e = e.div.getBoundingClientRect(),
- t = s ? Math.max(s[0] && s[0].height || 0, e.height / s.length) : 0
- }
- this.left = e.left,
- this.right = e.right,
- this.top = e.top || r,
- this.height = e.height || n,
- this.bottom = e.bottom || r + (e.height || n),
- this.width = e.width || i,
- this.lineHeight = void 0 !== t ? t : e.lineHeight
- }
- function ti(e, t, o, l) {
- var n = new ei(t)
- , i = t.cue
- , r = function(e) {
- if ("number" == typeof e.line && (e.snapToLines || 0 <= e.line && e.line <= 100))
- return e.line;
- if (!e.track || !e.track.textTrackList || !e.track.textTrackList.mediaElement)
- return -1;
- for (var t = e.track, n = t.textTrackList, i = 0, r = 0; r < n.length && n[r] !== t; r++)
- "showing" === n[r].mode && i++;
- return -1 * ++i
- }(i)
- , s = [];
- if (i.snapToLines) {
- var a;
- switch (i.vertical) {
- case "":
- s = ["+y", "-y"],
- a = "height";
- break;
- case "rl":
- s = ["+x", "-x"],
- a = "width";
- break;
- case "lr":
- s = ["-x", "+x"],
- a = "width"
- }
- var u = n.lineHeight
- , c = u * Math.round(r)
- , h = o[a] + u
- , d = s[0];
- Math.abs(c) > h && (c = c < 0 ? -1 : 1,
- c *= Math.ceil(h / u) * u),
- r < 0 && (c += "" === i.vertical ? o.height : o.width,
- s = s.reverse()),
- n.move(d, c)
- } else {
- var p = n.lineHeight / o.height * 100;
- switch (i.lineAlign) {
- case "center":
- r -= p / 2;
- break;
- case "end":
- r -= p
- }
- switch (i.vertical) {
- case "":
- t.applyStyles({
- top: t.formatStyle(r, "%")
- });
- break;
- case "rl":
- t.applyStyles({
- left: t.formatStyle(r, "%")
- });
- break;
- case "lr":
- t.applyStyles({
- right: t.formatStyle(r, "%")
- })
- }
- s = ["+y", "-x", "+x", "-y"],
- n = new ei(t)
- }
- var f = function(e, t) {
- for (var n, i = new ei(e), r = 1, s = 0; s < t.length; s++) {
- for (; e.overlapsOppositeAxis(o, t[s]) || e.within(o) && e.overlapsAny(l); )
- e.move(t[s]);
- if (e.within(o))
- return e;
- var a = e.intersectPercentage(o);
- a < r && (n = new ei(e),
- r = a),
- e = new ei(i)
- }
- return n || i
- }(n, s);
- t.move(f.toCSSCompatValues(o))
- }
- function ni() {}
- Jn.prototype.applyStyles = function(e, t) {
- for (var n in t = t || this.div,
- e)
- e.hasOwnProperty(n) && (t.style[n] = e[n])
- }
- ,
- Jn.prototype.formatStyle = function(e, t) {
- return 0 === e ? 0 : e + t
- }
- ,
- (Zn.prototype = Bn(Jn.prototype)).constructor = Zn,
- ei.prototype.move = function(e, t) {
- switch (t = void 0 !== t ? t : this.lineHeight,
- e) {
- case "+x":
- this.left += t,
- this.right += t;
- break;
- case "-x":
- this.left -= t,
- this.right -= t;
- break;
- case "+y":
- this.top += t,
- this.bottom += t;
- break;
- case "-y":
- this.top -= t,
- this.bottom -= t
- }
- }
- ,
- ei.prototype.overlaps = function(e) {
- return this.left < e.right && this.right > e.left && this.top < e.bottom && this.bottom > e.top
- }
- ,
- ei.prototype.overlapsAny = function(e) {
- for (var t = 0; t < e.length; t++)
- if (this.overlaps(e[t]))
- return !0;
- return !1
- }
- ,
- ei.prototype.within = function(e) {
- return this.top >= e.top && this.bottom <= e.bottom && this.left >= e.left && this.right <= e.right
- }
- ,
- ei.prototype.overlapsOppositeAxis = function(e, t) {
- switch (t) {
- case "+x":
- return this.left < e.left;
- case "-x":
- return this.right > e.right;
- case "+y":
- return this.top < e.top;
- case "-y":
- return this.bottom > e.bottom
- }
- }
- ,
- ei.prototype.intersectPercentage = function(e) {
- 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)
- }
- ,
- ei.prototype.toCSSCompatValues = function(e) {
- return {
- top: this.top - e.top,
- bottom: e.bottom - this.bottom,
- left: this.left - e.left,
- right: e.right - this.right,
- height: this.height,
- width: this.width
- }
- }
- ,
- ei.getSimpleBoxPosition = function(e) {
- var t = e.div ? e.div.offsetHeight : e.tagName ? e.offsetHeight : 0
- , n = e.div ? e.div.offsetWidth : e.tagName ? e.offsetWidth : 0
- , i = e.div ? e.div.offsetTop : e.tagName ? e.offsetTop : 0;
- return {
- left: (e = e.div ? e.div.getBoundingClientRect() : e.tagName ? e.getBoundingClientRect() : e).left,
- right: e.right,
- top: e.top || i,
- height: e.height || t,
- bottom: e.bottom || i + (e.height || t),
- width: e.width || n
- }
- }
- ,
- ni.StringDecoder = function() {
- return {
- decode: function(e) {
- if (!e)
- return "";
- if ("string" != typeof e)
- throw new Error("Error - expected string data.");
- return decodeURIComponent(encodeURIComponent(e))
- }
- }
- }
- ,
- ni.convertCueToDOMTree = function(e, t) {
- return e && t ? Gn(e, t) : null
- }
- ;
- ni.processCues = function(i, r, e) {
- if (!i || !r || !e)
- return null;
- for (; e.firstChild; )
- e.removeChild(e.firstChild);
- var s = i.document.createElement("div");
- if (s.style.position = "absolute",
- s.style.left = "0",
- s.style.right = "0",
- s.style.top = "0",
- s.style.bottom = "0",
- s.style.margin = "1.5%",
- e.appendChild(s),
- function(e) {
- for (var t = 0; t < e.length; t++)
- if (e[t].hasBeenReset || !e[t].displayState)
- return !0;
- return !1
- }(r)) {
- var a = []
- , o = ei.getSimpleBoxPosition(s)
- , l = {
- font: Math.round(.05 * o.height * 100) / 100 + "px sans-serif"
- };
- !function() {
- for (var e, t, n = 0; n < r.length; n++)
- t = r[n],
- e = new Zn(i,t,l),
- s.appendChild(e.div),
- ti(0, e, o, a),
- t.displayState = e.div,
- a.push(ei.getSimpleBoxPosition(e))
- }()
- } else
- for (var t = 0; t < r.length; t++)
- s.appendChild(r[t].displayState)
- }
- ,
- (ni.Parser = function(e, t, n) {
- n || (n = t,
- t = {}),
- t = t || {},
- this.window = e,
- this.vttjs = t,
- this.state = "INITIAL",
- this.buffer = "",
- this.decoder = n || new TextDecoder("utf8"),
- this.regionList = []
- }
- ).prototype = {
- reportOrThrowError: function(e) {
- if (!(e instanceof Fn))
- throw e;
- this.onparsingerror && this.onparsingerror(e)
- },
- parse: function(e) {
- var i = this;
- function t() {
- for (var e = i.buffer, t = 0; t < e.length && "\r" !== e[t] && "\n" !== e[t]; )
- ++t;
- var n = e.substr(0, t);
- return "\r" === e[t] && ++t,
- "\n" === e[t] && ++t,
- i.buffer = e.substr(t),
- n
- }
- function n(e) {
- e.match(/X-TIMESTAMP-MAP/) ? Qn(e, function(e, t) {
- switch (e) {
- case "X-TIMESTAMP-MAP":
- !function(e) {
- var n = new Vn;
- Qn(e, function(e, t) {
- switch (e) {
- case "MPEGT":
- n.integer(e + "S", t);
- break;
- case "LOCA":
- n.set(e + "L", Hn(t))
- }
- }, /[^\d]:/, /,/),
- i.ontimestampmap && i.ontimestampmap({
- MPEGTS: n.get("MPEGTS"),
- LOCAL: n.get("LOCAL")
- })
- }(t)
- }
- }, /=/) : Qn(e, function(e, t) {
- switch (e) {
- case "Region":
- !function(e) {
- var r = new Vn;
- if (Qn(e, function(e, t) {
- switch (e) {
- case "id":
- r.set(e, t);
- break;
- case "width":
- r.percent(e, t);
- break;
- case "lines":
- r.integer(e, t);
- break;
- case "regionanchor":
- case "viewportanchor":
- var n = t.split(",");
- if (2 !== n.length)
- break;
- var i = new Vn;
- if (i.percent("x", n[0]),
- i.percent("y", n[1]),
- !i.has("x") || !i.has("y"))
- break;
- r.set(e + "X", i.get("x")),
- r.set(e + "Y", i.get("y"));
- break;
- case "scroll":
- r.alt(e, t, ["up"])
- }
- }, /=/, /\s/),
- r.has("id")) {
- var t = new (i.vttjs.VTTRegion || i.window.VTTRegion);
- t.width = r.get("width", 100),
- t.lines = r.get("lines", 3),
- t.regionAnchorX = r.get("regionanchorX", 0),
- t.regionAnchorY = r.get("regionanchorY", 100),
- t.viewportAnchorX = r.get("viewportanchorX", 0),
- t.viewportAnchorY = r.get("viewportanchorY", 100),
- t.scroll = r.get("scroll", ""),
- i.onregion && i.onregion(t),
- i.regionList.push({
- id: r.get("id"),
- region: t
- })
- }
- }(t)
- }
- }, /:/)
- }
- e && (i.buffer += i.decoder.decode(e, {
- stream: !0
- }));
- try {
- var r;
- if ("INITIAL" === i.state) {
- if (!/\r\n|\n/.test(i.buffer))
- return this;
- var s = (r = t()).match(/^WEBVTT([ \t].*)?$/);
- if (!s || !s[0])
- throw new Fn(Fn.Errors.BadSignature);
- i.state = "HEADER"
- }
- for (var a = !1; i.buffer; ) {
- if (!/\r\n|\n/.test(i.buffer))
- return this;
- switch (a ? a = !1 : r = t(),
- i.state) {
- case "HEADER":
- /:/.test(r) ? n(r) : r || (i.state = "ID");
- continue;
- case "NOTE":
- r || (i.state = "ID");
- continue;
- case "ID":
- if (/^NOTE($|[ \t])/.test(r)) {
- i.state = "NOTE";
- break
- }
- if (!r)
- continue;
- i.cue = new (i.vttjs.VTTCue || i.window.VTTCue)(0,0,"");
- try {
- i.cue.align = "center"
- } catch (e) {
- i.cue.align = "middle"
- }
- if (i.state = "CUE",
- -1 === r.indexOf("--\x3e")) {
- i.cue.id = r;
- continue
- }
- case "CUE":
- try {
- Un(r, i.cue, i.regionList)
- } catch (e) {
- i.reportOrThrowError(e),
- i.cue = null,
- i.state = "BADCUE";
- continue
- }
- i.state = "CUETEXT";
- continue;
- case "CUETEXT":
- var o = -1 !== r.indexOf("--\x3e");
- if (!r || o && (a = !0)) {
- i.oncue && i.oncue(i.cue),
- i.cue = null,
- i.state = "ID";
- continue
- }
- i.cue.text && (i.cue.text += "\n"),
- i.cue.text += r.replace(/\u2028/g, "\n").replace(/u2029/g, "\n");
- continue;
- case "BADCUE":
- r || (i.state = "ID");
- continue
- }
- }
- } catch (e) {
- i.reportOrThrowError(e),
- "CUETEXT" === i.state && i.cue && i.oncue && i.oncue(i.cue),
- i.cue = null,
- i.state = "INITIAL" === i.state ? "BADWEBVTT" : "BADCUE"
- }
- return this
- },
- flush: function() {
- var t = this;
- try {
- if (t.buffer += t.decoder.decode(),
- !t.cue && "HEADER" !== t.state || (t.buffer += "\n\n",
- t.parse()),
- "INITIAL" === t.state)
- throw new Fn(Fn.Errors.BadSignature)
- } catch (e) {
- t.reportOrThrowError(e)
- }
- return t.onflush && t.onflush(),
- this
- }
- };
- var ii = ni
- , ri = {
- "": 1,
- lr: 1,
- rl: 1
- }
- , si = {
- start: 1,
- center: 1,
- end: 1,
- left: 1,
- right: 1,
- auto: 1,
- "line-left": 1,
- "line-right": 1
- };
- function ai(e) {
- return "string" == typeof e && (!!si[e.toLowerCase()] && e.toLowerCase())
- }
- function oi(e, t, n) {
- this.hasBeenReset = !1;
- var i = ""
- , r = !1
- , s = e
- , a = t
- , o = n
- , l = null
- , u = ""
- , c = !0
- , h = "auto"
- , d = "start"
- , p = "auto"
- , f = "auto"
- , v = 100
- , g = "center";
- Object.defineProperties(this, {
- id: {
- enumerable: !0,
- get: function() {
- return i
- },
- set: function(e) {
- i = "" + e
- }
- },
- pauseOnExit: {
- enumerable: !0,
- get: function() {
- return r
- },
- set: function(e) {
- r = !!e
- }
- },
- startTime: {
- enumerable: !0,
- get: function() {
- return s
- },
- set: function(e) {
- if ("number" != typeof e)
- throw new TypeError("Start time must be set to a number.");
- s = e,
- this.hasBeenReset = !0
- }
- },
- endTime: {
- enumerable: !0,
- get: function() {
- return a
- },
- set: function(e) {
- if ("number" != typeof e)
- throw new TypeError("End time must be set to a number.");
- a = e,
- this.hasBeenReset = !0
- }
- },
- text: {
- enumerable: !0,
- get: function() {
- return o
- },
- set: function(e) {
- o = "" + e,
- this.hasBeenReset = !0
- }
- },
- region: {
- enumerable: !0,
- get: function() {
- return l
- },
- set: function(e) {
- l = e,
- this.hasBeenReset = !0
- }
- },
- vertical: {
- enumerable: !0,
- get: function() {
- return u
- },
- set: function(e) {
- var t = function(e) {
- return "string" == typeof e && (!!ri[e.toLowerCase()] && e.toLowerCase())
- }(e);
- if (!1 === t)
- throw new SyntaxError("Vertical: an invalid or illegal direction string was specified.");
- u = t,
- this.hasBeenReset = !0
- }
- },
- snapToLines: {
- enumerable: !0,
- get: function() {
- return c
- },
- set: function(e) {
- c = !!e,
- this.hasBeenReset = !0
- }
- },
- line: {
- enumerable: !0,
- get: function() {
- return h
- },
- set: function(e) {
- if ("number" != typeof e && "auto" !== e)
- throw new SyntaxError("Line: an invalid number or illegal string was specified.");
- h = e,
- this.hasBeenReset = !0
- }
- },
- lineAlign: {
- enumerable: !0,
- get: function() {
- return d
- },
- set: function(e) {
- var t = ai(e);
- t && (d = t,
- this.hasBeenReset = !0)
- }
- },
- position: {
- enumerable: !0,
- get: function() {
- return p
- },
- set: function(e) {
- if (e < 0 || 100 < e)
- throw new Error("Position must be between 0 and 100.");
- p = e,
- this.hasBeenReset = !0
- }
- },
- positionAlign: {
- enumerable: !0,
- get: function() {
- return f
- },
- set: function(e) {
- var t = ai(e);
- t && (f = t,
- this.hasBeenReset = !0)
- }
- },
- size: {
- enumerable: !0,
- get: function() {
- return v
- },
- set: function(e) {
- if (e < 0 || 100 < e)
- throw new Error("Size must be between 0 and 100.");
- v = e,
- this.hasBeenReset = !0
- }
- },
- align: {
- enumerable: !0,
- get: function() {
- return g
- },
- set: function(e) {
- var t = ai(e);
- if (!t)
- throw new SyntaxError("align: an invalid or illegal alignment string was specified.");
- g = t,
- this.hasBeenReset = !0
- }
- }
- }),
- this.displayState = void 0
- }
- oi.prototype.getCueAsHTML = function() {
- return WebVTT.convertCueToDOMTree(window, this.text)
- }
- ;
- var li = oi
- , ui = {
- "": !0,
- up: !0
- };
- function ci(e) {
- return "number" == typeof e && 0 <= e && e <= 100
- }
- function hi() {
- var t = 100
- , n = 3
- , i = 0
- , r = 100
- , s = 0
- , a = 100
- , o = "";
- Object.defineProperties(this, {
- width: {
- enumerable: !0,
- get: function() {
- return t
- },
- set: function(e) {
- if (!ci(e))
- throw new Error("Width must be between 0 and 100.");
- t = e
- }
- },
- lines: {
- enumerable: !0,
- get: function() {
- return n
- },
- set: function(e) {
- if ("number" != typeof e)
- throw new TypeError("Lines must be set to a number.");
- n = e
- }
- },
- regionAnchorY: {
- enumerable: !0,
- get: function() {
- return r
- },
- set: function(e) {
- if (!ci(e))
- throw new Error("RegionAnchorX must be between 0 and 100.");
- r = e
- }
- },
- regionAnchorX: {
- enumerable: !0,
- get: function() {
- return i
- },
- set: function(e) {
- if (!ci(e))
- throw new Error("RegionAnchorY must be between 0 and 100.");
- i = e
- }
- },
- viewportAnchorY: {
- enumerable: !0,
- get: function() {
- return a
- },
- set: function(e) {
- if (!ci(e))
- throw new Error("ViewportAnchorY must be between 0 and 100.");
- a = e
- }
- },
- viewportAnchorX: {
- enumerable: !0,
- get: function() {
- return s
- },
- set: function(e) {
- if (!ci(e))
- throw new Error("ViewportAnchorX must be between 0 and 100.");
- s = e
- }
- },
- scroll: {
- enumerable: !0,
- get: function() {
- return o
- },
- set: function(e) {
- var t = function(e) {
- return "string" == typeof e && (!!ui[e.toLowerCase()] && e.toLowerCase())
- }(e);
- !1 === t || (o = t)
- }
- }
- })
- }
- var di = n(function(e) {
- var t = e.exports = {
- WebVTT: ii,
- VTTCue: li,
- VTTRegion: hi
- };
- p.vttjs = t,
- p.WebVTT = t.WebVTT;
- var n = t.VTTCue
- , i = t.VTTRegion
- , r = p.VTTCue
- , s = p.VTTRegion;
- t.shim = function() {
- p.VTTCue = n,
- p.VTTRegion = i
- }
- ,
- t.restore = function() {
- p.VTTCue = r,
- p.VTTRegion = s
- }
- ,
- p.VTTCue || t.shim()
- });
- di.WebVTT,
- di.VTTCue,
- di.VTTRegion;
- var pi = function(t) {
- function n(n, e) {
- var i;
- return void 0 === n && (n = {}),
- void 0 === e && (e = function() {}
- ),
- n.reportTouchActivity = !1,
- (i = t.call(this, null, n, e) || this).hasStarted_ = !1,
- i.on("playing", function() {
- this.hasStarted_ = !0
- }),
- i.on("loadstart", function() {
- this.hasStarted_ = !1
- }),
- Dn.names.forEach(function(e) {
- var t = Dn[e];
- n && n[t.getterName] && (i[t.privateName] = n[t.getterName])
- }),
- i.featuresProgressEvents || i.manualProgressOn(),
- i.featuresTimeupdateEvents || i.manualTimeUpdatesOn(),
- ["Text", "Audio", "Video"].forEach(function(e) {
- !1 === n["native" + e + "Tracks"] && (i["featuresNative" + e + "Tracks"] = !1)
- }),
- !1 === n.nativeCaptions || !1 === n.nativeTextTracks ? i.featuresNativeTextTracks = !1 : !0 !== n.nativeCaptions && !0 !== n.nativeTextTracks || (i.featuresNativeTextTracks = !0),
- i.featuresNativeTextTracks || i.emulateTextTracks(),
- i.preloadTextTracks = !1 !== n.preloadTextTracks,
- i.autoRemoteTextTracks_ = new Dn.text.ListClass,
- i.initTrackListeners(),
- n.nativeControlsForTouch || i.emitTapEvents(),
- i.constructor && (i.name_ = i.constructor.name || "Unknown Tech"),
- i
- }
- We(n, t);
- var e = n.prototype;
- return e.triggerSourceset = function(e) {
- var t = this;
- this.isReady_ || this.one("ready", function() {
- return t.setTimeout(function() {
- return t.triggerSourceset(e)
- }, 1)
- }),
- this.trigger({
- src: e,
- type: "sourceset"
- })
- }
- ,
- e.manualProgressOn = function() {
- this.on("durationchange", this.onDurationChange),
- this.manualProgress = !0,
- this.one("ready", this.trackProgress)
- }
- ,
- e.manualProgressOff = function() {
- this.manualProgress = !1,
- this.stopTrackingProgress(),
- this.off("durationchange", this.onDurationChange)
- }
- ,
- e.trackProgress = function(e) {
- this.stopTrackingProgress(),
- this.progressInterval = this.setInterval(Te(this, function() {
- var e = this.bufferedPercent();
- this.bufferedPercent_ !== e && this.trigger("progress"),
- 1 === (this.bufferedPercent_ = e) && this.stopTrackingProgress()
- }), 500)
- }
- ,
- e.onDurationChange = function(e) {
- this.duration_ = this.duration()
- }
- ,
- e.buffered = function() {
- return gt(0, 0)
- }
- ,
- e.bufferedPercent = function() {
- return yt(this.buffered(), this.duration_)
- }
- ,
- e.stopTrackingProgress = function() {
- this.clearInterval(this.progressInterval)
- }
- ,
- e.manualTimeUpdatesOn = function() {
- this.manualTimeUpdates = !0,
- this.on("play", this.trackCurrentTime),
- this.on("pause", this.stopTrackingCurrentTime)
- }
- ,
- e.manualTimeUpdatesOff = function() {
- this.manualTimeUpdates = !1,
- this.stopTrackingCurrentTime(),
- this.off("play", this.trackCurrentTime),
- this.off("pause", this.stopTrackingCurrentTime)
- }
- ,
- e.trackCurrentTime = function() {
- this.currentTimeInterval && this.stopTrackingCurrentTime(),
- this.currentTimeInterval = this.setInterval(function() {
- this.trigger({
- type: "timeupdate",
- target: this,
- manuallyTriggered: !0
- })
- }, 250)
- }
- ,
- e.stopTrackingCurrentTime = function() {
- this.clearInterval(this.currentTimeInterval),
- this.trigger({
- type: "timeupdate",
- target: this,
- manuallyTriggered: !0
- })
- }
- ,
- e.dispose = function() {
- this.clearTracks(On.names),
- this.manualProgress && this.manualProgressOff(),
- this.manualTimeUpdates && this.manualTimeUpdatesOff(),
- t.prototype.dispose.call(this)
- }
- ,
- e.clearTracks = function(e) {
- var r = this;
- (e = [].concat(e)).forEach(function(e) {
- for (var t = r[e + "Tracks"]() || [], n = t.length; n--; ) {
- var i = t[n];
- "text" === e && r.removeRemoteTextTrack(i),
- t.removeTrack(i)
- }
- })
- }
- ,
- e.cleanupAutoTextTracks = function() {
- for (var e = this.autoRemoteTextTracks_ || [], t = e.length; t--; ) {
- var n = e[t];
- this.removeRemoteTextTrack(n)
- }
- }
- ,
- e.reset = function() {}
- ,
- e.error = function(e) {
- return void 0 !== e && (this.error_ = new Et(e),
- this.trigger("error")),
- this.error_
- }
- ,
- e.played = function() {
- return this.hasStarted_ ? gt(0, 0) : gt()
- }
- ,
- e.setCurrentTime = function() {
- this.manualTimeUpdates && this.trigger({
- type: "timeupdate",
- target: this,
- manuallyTriggered: !0
- })
- }
- ,
- e.initTrackListeners = function() {
- var r = this;
- On.names.forEach(function(e) {
- function t() {
- r.trigger(e + "trackchange")
- }
- var n = On[e]
- , i = r[n.getterName]();
- i.addEventListener("removetrack", t),
- i.addEventListener("addtrack", t),
- r.on("dispose", function() {
- i.removeEventListener("removetrack", t),
- i.removeEventListener("addtrack", t)
- })
- })
- }
- ,
- e.addWebVttScript_ = function() {
- var e = this;
- if (!p.WebVTT)
- if (f.body.contains(this.el())) {
- if (!this.options_["vtt.js"] && c(di) && 0 < Object.keys(di).length)
- return void this.trigger("vttjsloaded");
- var t = f.createElement("script");
- t.src = this.options_["vtt.js"] || "https://vjs.zencdn.net/vttjs/0.14.1/vtt.min.js",
- t.onload = function() {
- e.trigger("vttjsloaded")
- }
- ,
- t.onerror = function() {
- e.trigger("vttjserror")
- }
- ,
- this.on("dispose", function() {
- t.onload = null,
- t.onerror = null
- }),
- p.WebVTT = !0,
- this.el().parentNode.appendChild(t)
- } else
- this.ready(this.addWebVttScript_)
- }
- ,
- e.emulateTextTracks = function() {
- function t(e) {
- return i.addTrack(e.track)
- }
- function n(e) {
- return i.removeTrack(e.track)
- }
- var e = this
- , i = this.textTracks()
- , r = this.remoteTextTracks();
- r.on("addtrack", t),
- r.on("removetrack", n),
- this.addWebVttScript_();
- function s() {
- return e.trigger("texttrackchange")
- }
- function a() {
- s();
- for (var e = 0; e < i.length; e++) {
- var t = i[e];
- t.removeEventListener("cuechange", s),
- "showing" === t.mode && t.addEventListener("cuechange", s)
- }
- }
- a(),
- i.addEventListener("change", a),
- i.addEventListener("addtrack", a),
- i.addEventListener("removetrack", a),
- this.on("dispose", function() {
- r.off("addtrack", t),
- r.off("removetrack", n),
- i.removeEventListener("change", a),
- i.removeEventListener("addtrack", a),
- i.removeEventListener("removetrack", a);
- for (var e = 0; e < i.length; e++) {
- i[e].removeEventListener("cuechange", s)
- }
- })
- }
- ,
- e.addTextTrack = function(e, t, n) {
- if (!e)
- throw new Error("TextTrack kind is required but was not provided");
- return function(e, t, n, i, r) {
- void 0 === r && (r = {});
- var s = e.textTracks();
- r.kind = t,
- n && (r.label = n),
- i && (r.language = i),
- r.tech = e;
- var a = new Dn.text.TrackClass(r);
- return s.addTrack(a),
- a
- }(this, e, t, n)
- }
- ,
- e.createRemoteTextTrack = function(e) {
- var t = Fe(e, {
- tech: this
- });
- return new Nn.remoteTextEl.TrackClass(t)
- }
- ,
- e.addRemoteTextTrack = function(e, t) {
- var n = this;
- void 0 === e && (e = {});
- var i = this.createRemoteTextTrack(e);
- 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'),
- t = !0),
- this.remoteTextTrackEls().addTrackElement_(i),
- this.remoteTextTracks().addTrack(i.track),
- !0 !== t && this.ready(function() {
- return n.autoRemoteTextTracks_.addTrack(i.track)
- }),
- i
- }
- ,
- e.removeRemoteTextTrack = function(e) {
- var t = this.remoteTextTrackEls().getTrackElementByTrack_(e);
- this.remoteTextTrackEls().removeTrackElement_(t),
- this.remoteTextTracks().removeTrack(e),
- this.autoRemoteTextTracks_.removeTrack(e)
- }
- ,
- e.getVideoPlaybackQuality = function() {
- return {}
- }
- ,
- e.requestPictureInPicture = function() {
- var e = this.options_.Promise || p.Promise;
- if (e)
- return e.reject()
- }
- ,
- e.setPoster = function() {}
- ,
- e.playsinline = function() {}
- ,
- e.setPlaysinline = function() {}
- ,
- e.overrideNativeAudioTracks = function() {}
- ,
- e.overrideNativeVideoTracks = function() {}
- ,
- e.canPlayType = function() {
- return ""
- }
- ,
- n.canPlayType = function() {
- return ""
- }
- ,
- n.canPlaySource = function(e, t) {
- return n.canPlayType(e.type)
- }
- ,
- n.isTech = function(e) {
- return e.prototype instanceof n || e instanceof n || e === n
- }
- ,
- n.registerTech = function(e, t) {
- if (n.techs_ || (n.techs_ = {}),
- !n.isTech(t))
- throw new Error("Tech " + e + " must be a Tech");
- if (!n.canPlayType)
- throw new Error("Techs must have a static canPlayType method on them");
- if (!n.canPlaySource)
- throw new Error("Techs must have a static canPlaySource method on them");
- return e = Re(e),
- n.techs_[e] = t,
- n.techs_[Be(e)] = t,
- "Tech" !== e && n.defaultTechOrder_.push(e),
- t
- }
- ,
- n.getTech = function(e) {
- if (e)
- return n.techs_ && n.techs_[e] ? n.techs_[e] : (e = Re(e),
- 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)"),
- p.videojs[e]) : void 0)
- }
- ,
- n
- }(He);
- Dn.names.forEach(function(e) {
- var t = Dn[e];
- pi.prototype[t.getterName] = function() {
- return this[t.privateName] = this[t.privateName] || new t.ListClass,
- this[t.privateName]
- }
- }),
- pi.prototype.featuresVolumeControl = !0,
- pi.prototype.featuresMuteControl = !0,
- pi.prototype.featuresFullscreenResize = !1,
- pi.prototype.featuresPlaybackRate = !1,
- pi.prototype.featuresPlaybackQuality = !0,
- pi.prototype.featuresProgressEvents = !1,
- pi.prototype.featuresSourceset = !1,
- pi.prototype.featuresTimeupdateEvents = !1,
- pi.prototype.featuresNativeTextTracks = !1,
- pi.withSourceHandlers = function(r) {
- r.registerSourceHandler = function(e, t) {
- var n = r.sourceHandlers;
- n = n || (r.sourceHandlers = []),
- void 0 === t && (t = n.length),
- n.splice(t, 0, e)
- }
- ,
- r.canPlayType = function(e) {
- for (var t, n = r.sourceHandlers || [], i = 0; i < n.length; i++)
- if (t = n[i].canPlayType(e))
- return t;
- return ""
- }
- ,
- r.selectSourceHandler = function(e, t) {
- for (var n = r.sourceHandlers || [], i = 0; i < n.length; i++)
- if (n[i].canHandleSource(e, t))
- return n[i];
- return null
- }
- ,
- r.canPlaySource = function(e, t) {
- var n = r.selectSourceHandler(e, t);
- return n ? n.canHandleSource(e, t) : ""
- }
- ;
- ["seekable", "seeking", "duration"].forEach(function(e) {
- var t = this[e];
- "function" == typeof t && (this[e] = function() {
- return this.sourceHandler_ && this.sourceHandler_[e] ? this.sourceHandler_[e].apply(this.sourceHandler_, arguments) : t.apply(this, arguments)
- }
- )
- }, r.prototype),
- r.prototype.setSource = function(e) {
- var t = r.selectSourceHandler(e, this.options_);
- t || (r.nativeSourceHandler ? t = r.nativeSourceHandler : m.error("No source handler found for the current source.")),
- this.disposeSourceHandler(),
- this.off("dispose", this.disposeSourceHandler),
- t !== r.nativeSourceHandler && (this.currentSource_ = e),
- this.sourceHandler_ = t.handleSource(e, this, this.options_),
- this.one("dispose", this.disposeSourceHandler)
- }
- ,
- r.prototype.disposeSourceHandler = function() {
- this.currentSource_ && (this.clearTracks(["audio", "video"]),
- this.currentSource_ = null),
- this.cleanupAutoTextTracks(),
- this.sourceHandler_ && (this.sourceHandler_.dispose && this.sourceHandler_.dispose(),
- this.sourceHandler_ = null)
- }
- }
- ,
- He.registerComponent("Tech", pi),
- pi.registerTech("Tech", pi),
- pi.defaultTechOrder_ = [];
- var fi = {}
- , vi = {}
- , gi = {};
- function yi(e, t, n) {
- e.setTimeout(function() {
- return function n(i, e, r, s, a, o) {
- void 0 === i && (i = {});
- void 0 === e && (e = []);
- void 0 === a && (a = []);
- void 0 === o && (o = !1);
- var t = e
- , l = t[0]
- , u = t.slice(1);
- if ("string" == typeof l)
- n(i, fi[l], r, s, a, o);
- else if (l) {
- var c = ki(s, l);
- if (!c.setSource)
- return a.push(c),
- n(i, u, r, s, a, o);
- c.setSource(b({}, i), function(e, t) {
- if (e)
- return n(i, u, r, s, a, o);
- a.push(c),
- n(t, i.type === t.type ? u : fi[t.type], r, s, a, o)
- })
- } else
- u.length ? n(i, u, r, s, a, o) : o ? r(i, a) : n(i, fi["*"], r, s, a, !0)
- }(t, fi[t.type], n, e)
- }, 1)
- }
- function mi(e, t, n, i) {
- void 0 === i && (i = null);
- var r = "call" + Re(n)
- , s = e.reduce(Ci(r), i)
- , a = s === gi
- , o = a ? null : t[n](s);
- return function(e, t, n, i) {
- for (var r = e.length - 1; 0 <= r; r--) {
- var s = e[r];
- s[t] && s[t](i, n)
- }
- }(e, n, o, a),
- o
- }
- var _i = {
- buffered: 1,
- currentTime: 1,
- duration: 1,
- muted: 1,
- played: 1,
- paused: 1,
- seekable: 1,
- volume: 1
- }
- , bi = {
- setCurrentTime: 1,
- setMuted: 1,
- setVolume: 1
- }
- , Ti = {
- play: 1,
- pause: 1
- };
- function Ci(n) {
- return function(e, t) {
- return e === gi ? gi : t[n] ? t[n](e) : e
- }
- }
- function ki(e, t) {
- var n = vi[e.id()]
- , i = null;
- if (null == n)
- return i = t(e),
- vi[e.id()] = [[t, i]],
- i;
- for (var r = 0; r < n.length; r++) {
- var s = n[r]
- , a = s[0]
- , o = s[1];
- a === t && (i = o)
- }
- return null === i && (i = t(e),
- n.push([t, i])),
- i
- }
- function Ei(e) {
- void 0 === e && (e = "");
- var t = on(e);
- return Si[t.toLowerCase()] || ""
- }
- var Si = {
- opus: "video/ogg",
- ogv: "video/ogg",
- mp4: "video/mp4",
- mov: "video/mp4",
- m4v: "video/mp4",
- mkv: "video/x-matroska",
- m4a: "audio/mp4",
- mp3: "audio/mpeg",
- aac: "audio/aac",
- oga: "audio/ogg",
- m3u8: "application/x-mpegURL",
- jpg: "image/jpeg",
- jpeg: "image/jpeg",
- gif: "image/gif",
- png: "image/png",
- svg: "image/svg+xml",
- webp: "image/webp"
- };
- function wi(e) {
- if (!e.type) {
- var t = Ei(e.src);
- t && (e.type = t)
- }
- return e
- }
- var xi = Object.assign ? Object.assign : function(n, e, t, i) {
- for (var r = 1; r < arguments.length; r++)
- ji(Object(arguments[r]), function(e, t) {
- n[t] = e
- });
- return n
- }
- , Ai = function() {
- {
- if (Object.create)
- return function(e, t, n, i) {
- var r = Mi(arguments, 1);
- return xi.apply(this, [Object.create(e)].concat(r))
- }
- ;
- var s = function() {};
- return function(e, t, n, i) {
- var r = Mi(arguments, 1);
- return s.prototype = e,
- xi.apply(this, [new s].concat(r))
- }
- }
- }()
- , Pi = String.prototype.trim ? function(e) {
- return String.prototype.trim.call(e)
- }
- : function(e) {
- return e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "")
- }
- , Li = "undefined" != typeof window ? window : t
- , Ii = {
- assign: xi,
- create: Ai,
- trim: Pi,
- bind: function(e, t) {
- return function() {
- return t.apply(e, Array.prototype.slice.call(arguments, 0))
- }
- },
- slice: Mi,
- each: ji,
- map: function(e, n) {
- var i = Ni(e) ? [] : {};
- return Oi(e, function(e, t) {
- return i[t] = n(e, t),
- !1
- }),
- i
- },
- pluck: Oi,
- isList: Ni,
- isFunction: function(e) {
- return e && "[object Function]" === {}.toString.call(e)
- },
- isObject: function(e) {
- return e && "[object Object]" === {}.toString.call(e)
- },
- Global: Li
- };
- function Mi(e, t) {
- return Array.prototype.slice.call(e, t || 0)
- }
- function ji(e, n) {
- Oi(e, function(e, t) {
- return n(e, t),
- !1
- })
- }
- function Oi(e, t) {
- if (Ni(e)) {
- for (var n = 0; n < e.length; n++)
- if (t(e[n], n))
- return e[n]
- } else
- for (var i in e)
- if (e.hasOwnProperty(i) && t(e[i], i))
- return e[i]
- }
- function Ni(e) {
- return null != e && "function" != typeof e && "number" == typeof e.length
- }
- var Di = Ii.slice
- , Bi = Ii.pluck
- , Ri = Ii.each
- , Fi = Ii.bind
- , Hi = Ii.create
- , Vi = Ii.isList
- , Qi = Ii.isFunction
- , Ui = Ii.isObject
- , qi = {
- createStore: Wi
- }
- , zi = {
- version: "2.0.12",
- enabled: !1,
- get: function(e, t) {
- var n = this.storage.read(this._namespacePrefix + e);
- return this._deserialize(n, t)
- },
- set: function(e, t) {
- return void 0 === t ? this.remove(e) : (this.storage.write(this._namespacePrefix + e, this._serialize(t)),
- t)
- },
- remove: function(e) {
- this.storage.remove(this._namespacePrefix + e)
- },
- each: function(n) {
- var i = this;
- this.storage.each(function(e, t) {
- n.call(i, i._deserialize(e), (t || "").replace(i._namespaceRegexp, ""))
- })
- },
- clearAll: function() {
- this.storage.clearAll()
- },
- hasNamespace: function(e) {
- return this._namespacePrefix == "__storejs_" + e + "_"
- },
- createStore: function() {
- return Wi.apply(this, arguments)
- },
- addPlugin: function(e) {
- this._addPlugin(e)
- },
- namespace: function(e) {
- return Wi(this.storage, this.plugins, e)
- }
- };
- function Wi(e, t, n) {
- n = n || "",
- e && !Vi(e) && (e = [e]),
- t && !Vi(t) && (t = [t]);
- var i = n ? "__storejs_" + n + "_" : ""
- , r = n ? new RegExp("^" + i) : null;
- if (!/^[a-zA-Z0-9_\-]*$/.test(n))
- throw new Error("store.js namespaces can only have alphanumerics + underscores and dashes");
- var s = Hi({
- _namespacePrefix: i,
- _namespaceRegexp: r,
- _testStorage: function(e) {
- try {
- var t = "__storejs__test__";
- e.write(t, t);
- var n = e.read(t) === t;
- return e.remove(t),
- n
- } catch (e) {
- return !1
- }
- },
- _assignPluginFnProp: function(i, e) {
- var r = this[e];
- this[e] = function() {
- var n = Di(arguments, 0)
- , e = this;
- var t = [function() {
- if (r)
- return Ri(arguments, function(e, t) {
- n[t] = e
- }),
- r.apply(e, n)
- }
- ].concat(n);
- return i.apply(e, t)
- }
- },
- _serialize: function(e) {
- return JSON.stringify(e)
- },
- _deserialize: function(t, e) {
- if (!t)
- return e;
- var n = "";
- try {
- n = JSON.parse(t)
- } catch (e) {
- n = t
- }
- return void 0 !== n ? n : e
- },
- _addStorage: function(e) {
- this.enabled || this._testStorage(e) && (this.storage = e,
- this.enabled = !0)
- },
- _addPlugin: function(n) {
- var i = this;
- if (Vi(n))
- Ri(n, function(e) {
- i._addPlugin(e)
- });
- else if (!Bi(this.plugins, function(e) {
- return n === e
- })) {
- if (this.plugins.push(n),
- !Qi(n))
- throw new Error("Plugins must be function values that return objects");
- var e = n.call(this);
- if (!Ui(e))
- throw new Error("Plugins must return an object of function properties");
- Ri(e, function(e, t) {
- if (!Qi(e))
- throw new Error("Bad plugin property: " + t + " from plugin " + n.name + ". Plugins should only return functions.");
- i._assignPluginFnProp(e, t)
- })
- }
- },
- addStorage: function(e) {
- !function() {
- var e = "undefined" == typeof console ? null : console;
- e && (e.warn ? e.warn : e.log).apply(e, arguments)
- }("store.addStorage(storage) is deprecated. Use createStore([storages])"),
- this._addStorage(e)
- }
- }, zi, {
- plugins: []
- });
- return s.raw = {},
- Ri(s, function(e, t) {
- Qi(e) && (s.raw[t] = Fi(s, e))
- }),
- Ri(e, function(e) {
- s._addStorage(e)
- }),
- Ri(t, function(e) {
- s._addPlugin(e)
- }),
- s
- }
- var Ki = Ii.Global
- , Xi = {
- name: "localStorage",
- read: Yi,
- write: function(e, t) {
- return Gi().setItem(e, t)
- },
- each: function(e) {
- for (var t = Gi().length - 1; 0 <= t; t--) {
- var n = Gi().key(t);
- e(Yi(n), n)
- }
- },
- remove: function(e) {
- return Gi().removeItem(e)
- },
- clearAll: function() {
- return Gi().clear()
- }
- };
- function Gi() {
- return Ki.localStorage
- }
- function Yi(e) {
- return Gi().getItem(e)
- }
- var $i = Ii.Global
- , Ji = {
- name: "sessionStorage",
- read: er,
- write: function(e, t) {
- return Zi().setItem(e, t)
- },
- each: function(e) {
- for (var t = Zi().length - 1; 0 <= t; t--) {
- var n = Zi().key(t);
- e(er(n), n)
- }
- },
- remove: function(e) {
- return Zi().removeItem(e)
- },
- clearAll: function() {
- return Zi().clear()
- }
- };
- function Zi() {
- return $i.sessionStorage
- }
- function er(e) {
- return Zi().getItem(e)
- }
- var tr = Ii.trim
- , nr = {
- name: "cookieStorage",
- read: function(e) {
- if (!e || !ar(e))
- return null;
- var t = "(?:^|.*;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*((?:[^;](?!;))*[^;]?).*";
- return unescape(ir.cookie.replace(new RegExp(t), "$1"))
- },
- write: function(e, t) {
- if (!e)
- return;
- ir.cookie = escape(e) + "=" + escape(t) + "; expires=Tue, 19 Jan 2038 03:14:07 GMT; path=/"
- },
- each: rr,
- remove: sr,
- clearAll: function() {
- rr(function(e, t) {
- sr(t)
- })
- }
- }
- , ir = Ii.Global.document;
- function rr(e) {
- for (var t = ir.cookie.split(/; ?/g), n = t.length - 1; 0 <= n; n--)
- if (tr(t[n])) {
- var i = t[n].split("=")
- , r = unescape(i[0]);
- e(unescape(i[1]), r)
- }
- }
- function sr(e) {
- e && ar(e) && (ir.cookie = escape(e) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/")
- }
- function ar(e) {
- return new RegExp("(?:^|;\\s*)" + escape(e).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=").test(ir.cookie)
- }
- var or = {
- name: "memoryStorage",
- read: function(e) {
- return lr[e]
- },
- write: function(e, t) {
- lr[e] = t
- },
- each: function(e) {
- for (var t in lr)
- lr.hasOwnProperty(t) && e(lr[t], t)
- },
- remove: function(e) {
- delete lr[e]
- },
- clearAll: function(e) {
- lr = {}
- }
- }
- , lr = {};
- var ur = [Xi, Ji, nr, or]
- , cr = qi.createStore(ur, [])
- , hr = "vjs-text-track-settings"
- , dr = ["#000", "Black"]
- , pr = ["#00F", "Blue"]
- , fr = ["#0FF", "Cyan"]
- , vr = ["#0F0", "Green"]
- , gr = ["#F0F", "Magenta"]
- , yr = ["#F00", "Red"]
- , mr = ["#FFF", "White"]
- , _r = ["#FF0", "Yellow"]
- , br = ["1", "Opaque"]
- , Tr = ["0.5", "Semi-Transparent"]
- , Cr = ["0", "Transparent"]
- , kr = {
- backgroundColor: {
- selector: ".vjs-bg-color > select",
- id: "captions-background-color-%s",
- label: "Color",
- options: [dr, mr, yr, vr, pr, _r, gr, fr]
- },
- backgroundOpacity: {
- selector: ".vjs-bg-opacity > select",
- id: "captions-background-opacity-%s",
- label: "Transparency",
- options: [br, Tr, Cr]
- },
- color: {
- selector: ".vjs-fg-color > select",
- id: "captions-foreground-color-%s",
- label: "Color",
- options: [mr, dr, yr, vr, pr, _r, gr, fr]
- },
- edgeStyle: {
- selector: ".vjs-edge-style > select",
- id: "%s",
- label: "Text Edge Style",
- options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
- },
- fontFamily: {
- selector: ".vjs-font-family > select",
- id: "captions-font-family-%s",
- label: "Font Family",
- options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
- },
- fontPercent: {
- selector: ".vjs-font-percent > select",
- id: "captions-font-size-%s",
- label: "Font Size",
- 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%"]],
- default: 2,
- parser: function(e) {
- return "1.00" === e ? null : Number(e)
- }
- },
- textOpacity: {
- selector: ".vjs-text-opacity > select",
- id: "captions-foreground-opacity-%s",
- label: "Transparency",
- options: [br, Tr]
- },
- windowColor: {
- selector: ".vjs-window-color > select",
- id: "captions-window-color-%s",
- label: "Color"
- },
- windowOpacity: {
- selector: ".vjs-window-opacity > select",
- id: "captions-window-opacity-%s",
- label: "Transparency",
- options: [Cr, Tr, br]
- }
- };
- function Er(e, t) {
- if (t && (e = t(e)),
- e && "none" !== e)
- return e
- }
- kr.windowColor.options = kr.backgroundColor.options;
- var Sr = function(i) {
- function e(e, t) {
- var n;
- return t.temporary = !1,
- t.pauseOnOpen = !1,
- (n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
- n.fill(),
- n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
- n.endDialog = w("p", {
- className: "vjs-control-text",
- textContent: n.localize("End of dialog window.")
- }),
- n.el().appendChild(n.endDialog),
- n.setDefaults(),
- void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
- n.on(n.$(".vjs-done-button"), "click", function() {
- n.saveSettings(),
- n.close()
- }),
- n.on(n.$(".vjs-default-button"), "click", function() {
- n.setDefaults(),
- n.updateDisplay()
- }),
- a(kr, function(e) {
- n.on(n.$(e.selector), "change", n.updateDisplay)
- }),
- n.options_.persistTextTrackSettings && n.restoreSettings(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.dispose = function() {
- this.endDialog = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.createElSelect_ = function(e, t, n) {
- var i = this;
- void 0 === t && (t = ""),
- void 0 === n && (n = "label");
- var r = kr[e]
- , s = r.id.replace("%s", this.id_)
- , a = [t, s].join(" ").trim();
- return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "</" + n + ">", '<select aria-labelledby="' + a + '">'].concat(r.options.map(function(e) {
- var t = s + "-" + e[1].replace(/\W+/g, "");
- return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + " " + t + '">', i.localize(e[1]), "</option>"].join("")
- })).concat("</select>").join("")
- }
- ,
- t.createElFgColor_ = function() {
- var e = "captions-text-legend-" + this.id_;
- 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("")
- }
- ,
- t.createElBgColor_ = function() {
- var e = "captions-background-" + this.id_;
- 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("")
- }
- ,
- t.createElWinColor_ = function() {
- var e = "captions-window-" + this.id_;
- 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("")
- }
- ,
- t.createElColors_ = function() {
- return w("div", {
- className: "vjs-track-settings-colors",
- innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
- })
- }
- ,
- t.createElFont_ = function() {
- return w("div", {
- className: "vjs-track-settings-font",
- 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("")
- })
- }
- ,
- t.createElControls_ = function() {
- var e = this.localize("restore all settings to the default values");
- return w("div", {
- className: "vjs-track-settings-controls",
- 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("")
- })
- }
- ,
- t.content = function() {
- return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
- }
- ,
- t.label = function() {
- return this.localize("Caption Settings Dialog")
- }
- ,
- t.description = function() {
- return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
- }
- ,
- t.buildCSSClass = function() {
- return i.prototype.buildCSSClass.call(this) + "vjs-debug"
- }
- ,
- t.getValues = function() {
- var r = this;
- return o(kr, function(e, t, n) {
- var i = function(e, t) {
- return Er(e.options[e.options.selectedIndex].value, t)
- }(r.$(t.selector), t.parser);
- return void 0 !== i && (e[n] = i),
- e
- }, {})
- }
- ,
- t.setValues = function(n) {
- var i = this;
- a(kr, function(e, t) {
- !function(e, t, n) {
- if (t)
- for (var i = 0; i < e.options.length; i++)
- if (Er(e.options[i].value, n) === t) {
- e.selectedIndex = i;
- break
- }
- }(i.$(e.selector), n[t], e.parser)
- })
- }
- ,
- t.setDefaults = function() {
- var n = this;
- a(kr, function(e) {
- var t = e.hasOwnProperty("default") ? e.default : 0;
- n.$(e.selector).selectedIndex = t
- })
- }
- ,
- t.restoreSettings = function() {
- var e;
- try {
- e = JSON.parse(p.localStorage.getItem(hr))
- } catch (e) {
- m.warn(e)
- }
- e && this.setValues(e)
- }
- ,
- t.saveSettings = function() {
- if (this.options_.persistTextTrackSettings) {
- var e = this.getValues();
- try {
- Object.keys(e).length ? p.localStorage.setItem(hr, JSON.stringify(e)) : p.localStorage.removeItem(hr)
- } catch (e) {
- m.warn(e)
- }
- }
- }
- ,
- t.updateDisplay = function() {
- var e = this.player_.getChild("textTrackDisplay");
- e && e.updateDisplay()
- }
- ,
- t.conditionalBlur_ = function() {
- this.previouslyActiveEl_ = null;
- var e = this.player_.controlBar
- , t = e && e.subsCapsButton
- , n = e && e.captionsButton;
- t ? t.focus() : n && n.focus()
- }
- ,
- e
- }(Ot);
- He.registerComponent("DebugDialog", Sr);
- var wr = function(p) {
- function e(e, t, n, i, r, s) {
- var a;
- void 0 === n && (n = ""),
- (a = p.call(this, e, t) || this).parseContent(n),
- a.barrageId = i;
- var o = 9
- , l = 35
- , u = ["#ffffff", "#ff5353", "#42ebff", "#fad400", "#ff7f01", "#7ff75b"]
- , c = "#ffffff"
- , h = 10
- , d = 40;
- return void 0 !== a.options().playerOptions.config && (o = a.options().playerOptions.config.barrage.marginTop,
- l = a.options().playerOptions.config.barrage.lineHeight,
- u = a.options().playerOptions.config.barrage.color,
- c = a.options().playerOptions.config.barrage.colorSelf,
- h = a.options().playerOptions.config.barrage.paddingSelf,
- d = a.options().playerOptions.config.barrage.borderRadius),
- a.el().style.top = r * l + o + "px",
- a.el().style.color = u[Math.floor(Math.random() * u.length)],
- !0 === s && (a.el().style.color = c,
- a.el().style.paddingLeft = h + "px",
- a.el().style.paddingRight = h + "px",
- a.el().style["border-radius"] = d + "px",
- a.addClass("selfBarrageBorder")),
- a.el().oncontextmenu = function(e) {
- return !1
- }
- ,
- a.on(["tap", "click"], a.handleClick),
- a
- }
- We(e, p);
- var t = e.prototype;
- return t.handleClick = function() {
- this.player_.log("[barrage-display] click!" + this.barrageId)
- }
- ,
- t.parseContent = function(e) {
- if (-1 !== e.indexOf("[/") && -1 !== e.indexOf("]")) {
- for (var t, n = Mr.getEmoList().length, i = !1, r = 0; r < n; r++) {
- var s = e.indexOf(Mr.getEmoList()[r].text);
- if (-1 !== s) {
- if (i = !0,
- 0 !== s) {
- var a = e.substring(0, s);
- if (this.strContainEmo(a))
- continue;
- this.addContent(a),
- this.addEmo(Mr.getEmoList()[r].name)
- } else
- this.addEmo(Mr.getEmoList()[r].name);
- t = e.substr(s + Mr.getEmoList()[r].text.length);
- break
- }
- }
- i ? this.parseContent(t) : this.addContent(e)
- } else
- this.addContent(e)
- }
- ,
- t.strContainEmo = function(e) {
- for (var t = !1, n = Mr.getEmoList().length, i = 0; i < n; i++)
- if (-1 !== e.indexOf(Mr.getEmoList()[i].text)) {
- t = !0;
- break
- }
- return t
- }
- ,
- t.createEl = function() {
- var e = p.prototype.createEl.call(this, "div", {
- className: "barrage-display"
- })
- , t = 17
- , n = 35;
- return void 0 !== this.options().playerOptions.config && (t = this.options().playerOptions.config.barrage.fontSize,
- n = this.options().playerOptions.config.barrage.lineHeight),
- e.style["font-size"] = t + "px",
- e.style.height = n + "px",
- e.style["line-height"] = n + "px",
- e.style.left = this.player_.currentWidth() + "px",
- e
- }
- ,
- t.addEmo = function(e) {
- this.emoEl_ = w("img", {
- className: "barrage-emo",
- src: Mr.emoPicUrlPre() + "/" + e
- }),
- this.el().appendChild(this.emoEl_)
- }
- ,
- t.addContent = function(e) {
- this.contentEl_ = w("span", {
- className: "barrage-content",
- innerHTML: "" + e
- }),
- this.el().appendChild(w("span", {
- className: "barrage-content",
- innerHTML: "" + e
- }))
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- this.textNode_ = null,
- p.prototype.dispose.call(this)
- }
- ,
- e
- }(He);
- wr.prototype.labelText_ = "",
- wr.prototype.controlText_ = "",
- He.registerComponent("BarrageDisplay", wr);
- function xr(e, i) {
- var t = {
- uri: e
- }
- , n = ln(e);
- n && (t.cors = n),
- Zt(t, Te(this, function(e, t, n) {
- if (e)
- return m.error(e, t);
- !function(e, t) {
- t.emoJSON(JSON.parse(e)),
- t.onEmoConfigLoaded()
- }(n, i)
- }))
- }
- function Ar(e, i) {
- var t = {
- uri: e
- }
- , n = ln(e);
- n && (t.cors = n),
- Zt(t, Te(this, function(e, t, n) {
- if (e)
- return m.error(e, t);
- i.commentLoaded(n)
- }))
- }
- var Pr, Lr = [], Ir = !1, Mr = function(a) {
- function e(e, t, n) {
- var i;
- (i = a.call(this, e, t, n) || this).isVod = i.player_.options_.barrageVod,
- i.isVod ? i.BARRAGE_TIME_INTERVAL = 300 : (i.BARRAGE_TIME_INTERVAL = 60,
- i.liveBarrageLoadCounter = -1,
- void 0 !== i.player_.options_.barrageItemId && (i.liveBarrageLoadTimer = i.setInterval(i.liveBarrageLoadTimerHandler, 1e3))),
- i.SHOW_TIME = 1e4,
- i.FOLLOW_RATE = !0,
- i.narrageIdCounter = 1,
- i.commentData = [],
- i.barrageDisplay = [];
- var r = Te(Ve(i), i.updateDisplay);
- e.on("timeupdate", Te(Ve(i), i.timeUpdateHandler)),
- e.on("seeking", Te(Ve(i), i.seeking)),
- e.on("loadstart", Te(Ve(i), i.toggleDisplay)),
- e.on("texttrackchange", r),
- i.on(e, "play", i.play),
- i.on(e, "pause", i.pause),
- e.ready(Te(Ve(i), function() {
- e.tech_ && e.tech_.featuresNativeTextTracks ? this.hide() : (e.on("fullscreenchange", r),
- e.on("playerresize", r),
- p.addEventListener("orientationchange", r),
- e.on("dispose", function() {
- return p.removeEventListener("orientationchange", r)
- }))
- })),
- !0 !== i.player_.options_.hasBarrage || Ir || xr(i.player_.httpPre_ + i.player_.options_.barrageConfigUrl, Ve(i)),
- i.currentTimeInSecond_ = -1,
- i.loadCommentTimeInSecond_ = -1,
- i.lastTime = -1,
- i.totalTime = 0,
- i.counter = 0,
- i.paused = !0;
- var s = Ve(i);
- return p.requestAnimationFrame(function() {
- s.updateAnimation()
- }),
- i
- }
- We(e, a);
- var t = e.prototype;
- return t.updateAnimation = function() {
- this.counter++;
- var e = (new Date).getTime()
- , t = e - this.lastTime;
- -1 === this.lastTime && (t = 5),
- this.totalTime += t,
- this.lastTime = e;
- for (var n, i = this.barrageDisplay.length - 1; 0 <= i; i--) {
- n = this.barrageDisplay[i].el();
- var r = this.player().playbackRate();
- this.isVod ? this.paused || (!0 === this.FOLLOW_RATE ? this.barrageDisplay[i].showTime += t * r : this.barrageDisplay[i].showTime += t) : this.barrageDisplay[i].showTime += t,
- 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]),
- this.barrageDisplay.splice(i, 1))
- }
- var s = this;
- p.requestAnimationFrame(function() {
- s.updateAnimation()
- })
- }
- ,
- t.play = function() {
- this.paused = !1,
- this.lastTime = -1
- }
- ,
- t.pause = function() {
- this.paused = !0,
- this.lastTime = -1
- }
- ,
- t.open = function() {}
- ,
- t.close = function() {}
- ,
- e.getEmoList = function() {
- return Lr
- }
- ,
- e.emoPicUrlPre = function() {
- return Pr
- }
- ,
- t.currentTimeInSecond = function(e) {
- if (void 0 === e)
- return this.currentTimeInSecond_;
- this.currentTimeInSecond_ = e
- }
- ,
- t.timeUpdateHandler = function() {
- if (Ir && (!this.player_.ads || !0 !== this.player_.ads.isInAdMode())) {
- var e = Math.round(this.player_.currentTime());
- if (this.currentTimeInSecond() !== e && (this.currentTimeInSecond(e),
- this.isVod))
- for (var t = this.commentData.length - 1; 0 <= t; t--)
- this.commentData[t].relative_time <= 1e3 * this.player_.currentTime() && (this.addBarrage(this.commentData[t].message, !1),
- this.commentData.splice(t, 1));
- if (this.isVod) {
- if (this.currentTimeInSecond() < 0)
- return;
- if (!0 !== this.player_.options_.hasBarrage)
- return;
- if (-1 === this.loadCommentTimeInSecond_ || this.loadCommentTimeInSecond_ + this.BARRAGE_TIME_INTERVAL <= this.currentTimeInSecond()) {
- this.loadCommentTimeInSecond_ = this.currentTimeInSecond();
- 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);
- Ar(n, this)
- }
- }
- }
- }
- ,
- t.liveBarrageLoadTimerHandler = function() {
- if (this.liveBarrageLoadCounter++,
- this.liveBarrageLoadCounter % 4 == 0 && (this.player_.log("show live"),
- 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 0),
- 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 1),
- 0 < this.commentData.length && this.addBarrage(this.commentData.pop().message, !1, 2)),
- 60 <= this.liveBarrageLoadCounter || 0 === this.liveBarrageLoadCounter) {
- this.liveBarrageLoadCounter = 0,
- this.player_.log("loadComments live");
- var e = this.player_.httpPre_ + this.player_.options_.barrageContentUrl + "app=" + this.player_.options_.barrageApp + "&prepage=45&itemid=" + this.player_.options_.barrageItemId + "&nature=1";
- Ar(e, this)
- }
- }
- ,
- t.seeking = function() {
- if (this.isVod) {
- for (this.commentData.length = 0; 0 < this.barrageDisplay.length; )
- this.removeChild(this.barrageDisplay.pop());
- this.loadCommentTimeInSecond_ = -1
- }
- }
- ,
- t.emoJSON = function(e) {
- if (void 0 === e)
- return this.emoJSON_;
- this.emoJSON_ = e
- }
- ,
- t.emoData = function() {
- return this.emoJSON().data
- }
- ,
- t.onEmoConfigLoaded = function() {
- if (this.player().options().debug && this.player_.log("[barrage-layer] config loaded"),
- !0 !== Ir) {
- Ir = !0,
- Pr = this.emoJSON_.picUrl;
- for (var e = this.emoData().length, t = 0; t < e; t++)
- Lr.push(this.emoData()[t])
- }
- }
- ,
- t.commentLoaded = function(e) {
- if (this.isVod) {
- if (void 0 === this.commentData)
- return;
- this.commentData.length = 0;
- var t, n = JSON.parse(e);
- t = n.data.content.length;
- for (var i = 0; i < t; i++)
- this.commentData.push(n.data.content[i])
- } else {
- if (void 0 === this.commentData)
- return;
- this.commentData.length = 0;
- var r, s = JSON.parse(e);
- r = s.data.content.length;
- for (var a = 0; a < r; a++)
- this.commentData.push(s.data.content[a])
- }
- }
- ,
- t.showBarrage = function(e) {
- this.player_.ads && !0 === this.player_.ads.isInAdMode() || this.addBarrage(e, !0)
- }
- ,
- t.addBarrage = function(e, t, n) {
- this.narrageIdCounter++;
- void 0 === n && (n = Math.floor(3 * Math.random()));
- var i = new wr(this.player_,this.options_,e,"b" + this.narrageIdCounter,n,t);
- this.addChild(i),
- i.velocity = (this.player_.currentWidth() + i.width()) / this.SHOW_TIME,
- i.distance = this.player_.currentWidth() + i.width(),
- i.showTime = 0,
- this.barrageDisplay.push(i)
- }
- ,
- t.toggleDisplay = function() {
- this.player_.tech_ && this.player_.tech_.featuresNativeTextTracks ? this.hide() : this.show()
- }
- ,
- t.createEl = function() {
- return a.prototype.createEl.call(this, "div", {
- className: "vjs-barrage-layer"
- })
- }
- ,
- t.updateDisplay = function() {}
- ,
- e
- }(He);
- He.registerComponent("BarrageLayer", Mr);
- var jr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "choose-video-button-prev"
- }
- ,
- t.handleClick = function(e) {
- var t = this.player().getChild("chooseVideoPanel");
- void 0 !== t && t.prevPage_()
- }
- ,
- t.hide = function() {
- this.addClass("hideButton")
- }
- ,
- t.show = function() {
- this.removeClass("hideButton")
- }
- ,
- t.playerResize = function() {
- this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
- }
- ,
- e
- }(Qt);
- He.registerComponent("PrevPageButton", jr);
- var Or = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "choose-video-button-next"
- }
- ,
- t.handleClick = function(e) {
- var t = this.player().getChild("chooseVideoPanel");
- void 0 !== t && t.nextPage_()
- }
- ,
- t.playerResize = function() {
- this.el().style.top = Math.round((this.player().currentHeight() - 50) / 2) + "px"
- }
- ,
- e
- }(Qt);
- He.registerComponent("NextPageButton", Or);
- var Nr = function(n) {
- function e(e, t) {
- return void 0 === t && (t = {}),
- n.call(this, e, t) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.panelState_ = function() {}
- ,
- t.createEl = function() {
- return n.prototype.createEl.call(this, "div", {
- className: "choose-video-content",
- innerHTML: ""
- })
- }
- ,
- t.resetPage = function() {}
- ,
- t.updatePage = function(e) {
- var t = this.player().options_.chooseVideoData.data.list
- , n = 8;
- e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
- 600 <= this.player().currentHeight() && (n = 12,
- e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1)),
- e > Math.ceil(t.length / n) - 1 && (e = Math.ceil(t.length / n) - 1),
- this.el().innerHTML = "";
- for (var i = "<ul>", r = 0; r < n; r++)
- 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>"),
- r === n - 1 && (i += "</ul>");
- this.el().innerHTML = i;
- var s = .23 * this.player().currentWidth() / 16 * 9 + 40;
- this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - n / 4 * s) / 2 + 20 + "px"
- }
- ,
- t.dispose = function() {
- n.prototype.dispose.call(this)
- }
- ,
- e
- }(He);
- He.registerComponent("ChooseVideoPage", Nr);
- var Dr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "playerresize", n.playerResize),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "choose-video-close " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {}
- ,
- t.playerResize = function() {
- var e = 8;
- 600 <= this.player().currentHeight() && (e = 12);
- var t = .23 * this.player().currentWidth() / 16 * 9 + 40;
- this.el().style.top = (.96 * this.player().currentHeight() - 50 - 20 - e / 4 * t) / 2 + "px"
- }
- ,
- e
- }(Qt);
- He.registerComponent("ChooseVideoCloseButton", Dr);
- var Br = function(o) {
- function e(e, t) {
- var n;
- void 0 === t && (t = {}),
- (n = o.call(this, e, t) || this).on(e, "playerresize", n.playerResize);
- var i = new jr(e,t)
- , r = new Or(e,t);
- n.leftBtn(i),
- n.rightBtn(r);
- var s = new Nr(e,t);
- n.page(s),
- n.addChild(i),
- n.addChild(s),
- n.addChild(r);
- var a = new Dr(e,t);
- return n.addChild(a),
- n.on(a, "click", n.hide),
- n
- }
- We(e, o);
- var t = e.prototype;
- return t.leftBtn = function(e) {
- if (void 0 === e)
- return this.leftBtn_;
- this.leftBtn_ = e
- }
- ,
- t.rightBtn = function(e) {
- if (void 0 === e)
- return this.rightBtn_;
- this.rightBtn_ = e
- }
- ,
- t.page = function(e) {
- if (void 0 === e)
- return this.page_;
- this.page_ = e
- }
- ,
- t.pageNum = function(e) {
- if (void 0 === e)
- return void 0 === this.pageNum_ && (this.pageNum_ = 0),
- this.pageNum_;
- this.pageNum_ !== e && (this.pageNum_ = e,
- this.pageNum_ < 0 && (this.pageNum_ = 0),
- this.updatePage())
- }
- ,
- t.playerResize = function() {
- this.updatePage()
- }
- ,
- t.prevPage_ = function() {
- this.pageNum() <= 0 || this.pageNum(this.pageNum() - 1)
- }
- ,
- t.nextPage_ = function() {
- this.pageNum(this.pageNum() + 1)
- }
- ,
- t.createEl = function() {
- return o.prototype.createEl.call(this, "div", {
- className: "choose-video-panel vjs-hidden"
- })
- }
- ,
- t.hideToggle = function() {
- this.hasClass("vjs-hidden") ? this.show() : this.hide()
- }
- ,
- t.hide = function() {
- this.hasClass("vjs-hidden") || this.addClass("vjs-hidden"),
- this.player().getChild("ControlBar").getChild("chooseVideoButton").updateButtonState()
- }
- ,
- t.show = function() {
- this.removeClass("vjs-hidden")
- }
- ,
- t.updatePage = function() {
- this.pageNum() <= 0 ? this.leftBtn_.hide() : this.leftBtn_.show();
- var e = 8;
- 600 <= this.player().currentHeight() && (e = 12);
- var t = Math.ceil(this.player().options_.chooseVideoData.data.list.length / e) - 1;
- this.pageNum() >= t ? this.rightBtn_.hide() : this.rightBtn_.show(),
- this.page().updatePage(this.pageNum())
- }
- ,
- t.dispose = function() {
- o.prototype.dispose.call(this)
- }
- ,
- e
- }(He);
- He.registerComponent("ChooseVideoPanel", Br);
- var Rr = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- n = i.call(this, e, t) || this,
- t.replay = void 0 === t.replay || t.replay,
- n.on(e, "play", n.handlePlay),
- n.on(e, "pause", n.handlePause),
- t.replay && n.on(e, "ended", n.handleEnded),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return i.prototype.buildCSSClass.call(this) + " vjs-play-control-mini"
- }
- ,
- t.handleClick = function(e) {
- this.player_.paused() ? this.player_.play() : this.player_.pause()
- }
- ,
- t.handleSeeked = function(e) {
- this.removeClass("vjs-ended"),
- this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
- }
- ,
- t.handlePlay = function(e) {
- this.removeClass("vjs-ended"),
- this.removeClass("vjs-paused"),
- this.addClass("vjs-playing"),
- this.controlText("Pause")
- }
- ,
- t.handlePause = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-paused"),
- this.controlText("Play")
- }
- ,
- t.handleEnded = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-ended"),
- this.controlText("Replay"),
- this.one(this.player_, "seeked", this.handleSeeked)
- }
- ,
- e
- }(Qt);
- Rr.prototype.controlText_ = "Play",
- He.registerComponent("PlayToggleMini", Rr);
- var Fr = function(i) {
- function e(e, t) {
- var n;
- return n = i.call(this, e, t) || this,
- t && (n.menuButton_ = t.menuButton),
- n.focusedChild_ = -1,
- n.on("mouseover", n.handleMouseOver),
- n.on("mouseout", n.handleMouseOut),
- n.boundHandleBlur_ = Te(Ve(n), n.handleBlur),
- n.boundHandleTapClick_ = Te(Ve(n), n.handleTapClick),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.handleMouseOver = function(e) {
- this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.addClass("vjs-hover")
- }
- ,
- t.handleMouseOut = function(e) {
- this.parentComponent_ && this.parentComponent_.hasClass("vjs-menu-button-popup") && !this.hasClass("vjs-hover") && this.parentComponent_.removeClass("vjs-hover")
- }
- ,
- t.addEventListenerForItem = function(e) {
- e instanceof He && (this.on(e, "blur", this.boundHandleBlur_),
- this.on(e, ["tap", "click"], this.boundHandleTapClick_))
- }
- ,
- t.removeEventListenerForItem = function(e) {
- e instanceof He && (this.off(e, "blur", this.boundHandleBlur_),
- this.off(e, ["tap", "click"], this.boundHandleTapClick_))
- }
- ,
- t.removeChild = function(e) {
- "string" == typeof e && (e = this.getChild(e)),
- this.removeEventListenerForItem(e),
- i.prototype.removeChild.call(this, e)
- }
- ,
- t.addItem = function(e) {
- var t = this.addChild(e);
- t && this.addEventListenerForItem(t)
- }
- ,
- t.createEl = function() {
- var e = this.options_.contentElType || "ul";
- this.contentEl_ = w(e, {
- className: "vjs-menu-content"
- }),
- this.contentEl_.setAttribute("role", "menu");
- var t = i.prototype.createEl.call(this, "div", {
- append: this.contentEl_,
- className: "vjs-menu"
- });
- return t.appendChild(this.contentEl_),
- ge(t, "click", function(e) {
- e.preventDefault(),
- e.stopImmediatePropagation()
- }),
- t
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- this.boundHandleBlur_ = null,
- this.boundHandleTapClick_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.handleBlur = function(e) {
- var t = e.relatedTarget || f.activeElement;
- if (!this.children().some(function(e) {
- return e.el() === t
- })) {
- var n = this.menuButton_;
- n && n.buttonPressed_ && t !== n.el().firstChild && n.unpressButton()
- }
- }
- ,
- t.handleTapClick = function(t) {
- if (this.menuButton_) {
- this.menuButton_.unpressButton();
- var e = this.children();
- if (!Array.isArray(e))
- return;
- var n = e.filter(function(e) {
- return e.el() === t.target
- })[0];
- if (!n)
- return;
- "CaptionSettingsMenuItem" !== n.name() && this.menuButton_.focus()
- }
- }
- ,
- t.handleKeyDown = function(e) {
- Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
- e.stopPropagation(),
- this.stepForward()) : (Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up")) && (e.preventDefault(),
- e.stopPropagation(),
- this.stepBack())
- }
- ,
- t.stepForward = function() {
- var e = 0;
- void 0 !== this.focusedChild_ && (e = this.focusedChild_ + 1),
- this.focus(e)
- }
- ,
- t.stepBack = function() {
- var e = 0;
- void 0 !== this.focusedChild_ && (e = this.focusedChild_ - 1),
- this.focus(e)
- }
- ,
- t.focus = function(e) {
- void 0 === e && (e = 0);
- var t = this.children().slice();
- t.length && t[0].className && /vjs-menu-title/.test(t[0].className) && t.shift(),
- 0 < t.length && (e < 0 ? e = 0 : e >= t.length && (e = t.length - 1),
- t[this.focusedChild_ = e].el_.focus())
- }
- ,
- e
- }(He);
- He.registerComponent("Menu", Fr);
- var Hr = function(r) {
- function e(e, t) {
- var n;
- void 0 === t && (t = {}),
- (n = r.call(this, e, t) || this).menuButton_ = new Qt(e,t),
- n.menuButton_.controlText(n.controlText_),
- n.menuButton_.el_.setAttribute("aria-haspopup", "true");
- var i = Qt.prototype.buildCSSClass();
- return n.menuButton_.el_.className = n.buildCSSClass() + " " + i,
- n.menuButton_.removeClass("vjs-control"),
- n.addChild(n.menuButton_),
- n.update(),
- n.enabled_ = !0,
- n.on(n.menuButton_, "tap", n.handleClick),
- n.on(n.menuButton_, "click", n.handleClick),
- n.on(n.menuButton_, "keydown", n.handleKeyDown),
- n.on(n.menuButton_, "mouseenter", function() {
- n.addClass("vjs-hover"),
- n.menu.show(),
- n.handleMouseEnter(),
- ge(f, "keyup", Te(Ve(n), n.handleMenuKeyUp))
- }),
- n.on("mouseleave", n.handleMouseLeave),
- n.on("keydown", n.handleSubmenuKeyDown),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.update = function() {
- var e = this.createMenu();
- this.menu && (this.menu.dispose(),
- this.removeChild(this.menu)),
- this.menu = e,
- this.addChild(e),
- this.buttonPressed_ = !1,
- this.menuButton_.el_.setAttribute("aria-expanded", "false"),
- this.items && this.items.length <= this.hideThreshold_ ? this.hide() : this.show()
- }
- ,
- t.createMenu = function() {
- var e = new Fr(this.player_,{
- menuButton: this
- });
- if (this.hideThreshold_ = 0,
- this.options_.title) {
- var t = w("li", {
- className: "vjs-menu-title",
- innerHTML: Re(this.options_.title),
- tabIndex: -1
- });
- this.hideThreshold_ += 1;
- var n = new He(this.player_,{
- el: t
- });
- e.addItem(n)
- }
- if (this.items = this.createItems(),
- this.items)
- for (var i = 0; i < this.items.length; i++)
- e.addItem(this.items[i]);
- return e
- }
- ,
- t.createItems = function() {}
- ,
- t.createEl = function() {
- return r.prototype.createEl.call(this, "div", {
- className: this.buildWrapperCSSClass()
- }, {})
- }
- ,
- t.buildWrapperCSSClass = function() {
- var e = "vjs-menu-button";
- return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
- "vjs-menu-button " + e + " " + Qt.prototype.buildCSSClass() + " " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildCSSClass = function() {
- var e = "vjs-menu-button";
- return !0 === this.options_.inline ? e += "-inline" : e += "-popup",
- "vjs-menu-button " + e + " " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.controlText = function(e, t) {
- return void 0 === t && (t = this.menuButton_.el()),
- this.menuButton_.controlText(e, t)
- }
- ,
- t.dispose = function() {
- this.handleMouseLeave(),
- r.prototype.dispose.call(this)
- }
- ,
- t.handleClick = function(e) {
- this.buttonPressed_ ? this.unpressButton() : this.pressButton()
- }
- ,
- t.handleMouseLeave = function(e) {
- this.removeClass("vjs-hover"),
- ye(f, "keyup", Te(this, this.handleMenuKeyUp))
- }
- ,
- t.focus = function() {
- this.menuButton_.focus()
- }
- ,
- t.blur = function() {
- this.menuButton_.blur()
- }
- ,
- t.handleKeyDown = function(e) {
- Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab") ? (this.buttonPressed_ && this.unpressButton(),
- Mt.isEventKey(e, "Tab") || (e.preventDefault(),
- this.menuButton_.focus())) : (Mt.isEventKey(e, "Up") || Mt.isEventKey(e, "Down")) && (this.buttonPressed_ || (e.preventDefault(),
- this.pressButton()))
- }
- ,
- t.handleMenuKeyUp = function(e) {
- (Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && this.removeClass("vjs-hover")
- }
- ,
- t.handleMouseEnter = function() {}
- ,
- t.handleSubmenuKeyPress = function(e) {
- this.handleSubmenuKeyDown(e)
- }
- ,
- t.handleSubmenuKeyDown = function(e) {
- (Mt.isEventKey(e, "Esc") || Mt.isEventKey(e, "Tab")) && (this.buttonPressed_ && this.unpressButton(),
- Mt.isEventKey(e, "Tab") || (e.preventDefault(),
- this.menuButton_.focus()))
- }
- ,
- t.pressButton = function() {
- if (this.enabled_) {
- if (this.buttonPressed_ = !0,
- this.menu.show(),
- this.menu.lockShowing(),
- this.menuButton_.el_.setAttribute("aria-expanded", "true"),
- ht && E())
- return;
- this.menu.focus()
- }
- }
- ,
- t.unpressButton = function() {
- this.enabled_ && (this.buttonPressed_ = !1,
- this.menu.unlockShowing(),
- this.menu.hide(),
- this.menuButton_.el_.setAttribute("aria-expanded", "false"))
- }
- ,
- t.disable = function() {
- this.unpressButton(),
- this.enabled_ = !1,
- this.addClass("vjs-disabled"),
- this.menuButton_.disable()
- }
- ,
- t.enable = function() {
- this.enabled_ = !0,
- this.removeClass("vjs-disabled"),
- this.menuButton_.enable()
- }
- ,
- e
- }(He);
- He.registerComponent("MenuButton", Hr);
- var Vr = ["Tab", "Esc", "Up", "Down", "Right", "Left"]
- , Qr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).selectable = t.selectable,
- n.isSelected_ = t.selected || !1,
- n.multiSelectable = t.multiSelectable,
- n.selected(n.isSelected_),
- n.selectable ? n.multiSelectable ? n.el_.setAttribute("role", "menuitemcheckbox") : n.el_.setAttribute("role", "menuitemradio") : n.el_.setAttribute("role", "menuitem"),
- n.off("mouseover", n.handleMouseOver),
- n.off("mouseout", n.handleMouseOut),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.handleMouseOver = function(e) {}
- ,
- t.handleMouseOut = function(e) {}
- ,
- t.createEl = function(e, t, n) {
- return this.nonIconControl = !0,
- i.prototype.createEl.call(this, "li", b({
- className: "vjs-menu-item",
- innerHTML: '<span class="vjs-menu-item-text">' + this.localize(this.options_.label) + "</span>",
- tabIndex: -1
- }, t), n)
- }
- ,
- t.handleKeyDown = function(t) {
- Vr.some(function(e) {
- return Mt.isEventKey(t, e)
- }) || i.prototype.handleKeyDown.call(this, t)
- }
- ,
- t.handleClick = function(e) {
- this.selected(!0)
- }
- ,
- t.selected = function(e) {
- this.selectable && (e ? (this.addClass("vjs-selected"),
- this.el_.setAttribute("aria-checked", "true"),
- this.controlText(", selected"),
- this.isSelected_ = !0) : (this.removeClass("vjs-selected"),
- this.el_.setAttribute("aria-checked", "false"),
- this.controlText(""),
- this.isSelected_ = !1))
- }
- ,
- e
- }(Vt);
- He.registerComponent("MenuItem", Qr);
- var Ur = function(r) {
- function e(e, t) {
- var n, i = t.content;
- return t.label = i,
- t.selectable = !0,
- t.multiSelectable = !1,
- (n = r.call(this, e, t) || this).label = i,
- n.on("mouseover", n.handleMouseOver),
- n.on("mouseout", n.handleMouseOut),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.handleClick = function(e) {
- if (!0 === e.shiftKey) {
- var t = this.player_.getDebugInfo()
- , n = f.createElement("textarea");
- n.value = t,
- f.body.appendChild(n),
- n.select();
- var i = f.execCommand("copy");
- f.body.removeChild(n),
- i ? this.player_.log("[CMI] debug info has copied") : this.player_.warn("[CMI] copy failed!")
- }
- r.prototype.handleClick.call(this)
- }
- ,
- t.handleMouseOver = function(e) {}
- ,
- t.handleMouseOut = function(e) {
- this.selected(!1)
- }
- ,
- e
- }(Qr);
- Ur.prototype.contentElType = "button",
- He.registerComponent("ContextMenuItem", Ur);
- var qr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).showDebug_ = !1,
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return e.oncontextmenu = function() {
- return !1
- }
- ,
- e
- }
- ,
- t.moveAndShow = function(e, t) {
- this.showDebug_ = t,
- this.showDebug_ && this.player_.log("[player] show debug contextmenu"),
- this.update(),
- this.el().style.left = e.offsetX + "px",
- this.el().style.top = e.offsetY + "px",
- this.addClass("vjs-hover"),
- this.menu.show()
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "context-menu-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "context-menu " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- var e = new Fr(this.player());
- return e.addChild(new Ur(this.player(),{
- content: "core:" + this.player_.playerversion + " " + this.player_.updatedate
- })),
- e.addChild(new Ur(this.player(),{
- content: "wrap:" + this.options().playerOptions.wrapperVersion + " " + this.options().playerOptions.wrapperupdate
- })),
- this.showDebug_ && e.addChild(new Ur(this.player(),{
- content: "debug info..."
- })),
- e
- }
- ,
- t.updateARIAAttributes = function() {
- this.el().setAttribute("aria-valuenow", this.player().playbackRate())
- }
- ,
- t.handleClick = function(e) {}
- ,
- e
- }(Hr);
- qr.prototype.controlText_ = "",
- He.registerComponent("ContextMenuButton", qr);
- var zr = function(u) {
- function e(e, t, n) {
- var i, r = Fe({
- createEl: !1
- }, t);
- if (i = u.call(this, e, r, n) || this,
- t.playerOptions.sources && 0 !== t.playerOptions.sources.length)
- e.src(t.playerOptions.sources);
- else
- for (var s = 0, a = t.playerOptions.techOrder; s < a.length; s++) {
- var o = Re(a[s])
- , l = pi.getTech(o);
- if (o || (l = He.getComponent(o)),
- l && l.isSupported()) {
- e.loadTech_(o);
- break
- }
- }
- return i
- }
- return We(e, u),
- e
- }(He);
- He.registerComponent("MediaLoader", zr);
- var Wr = function(i) {
- function e(e, t) {
- var n;
- return n = i.call(this, e, t) || this,
- oo.browser.IS_SAFARI ? (n.canplay(!1),
- n.on(e, "canplaythrough", n.canClick)) : n.canplay(!0),
- n.update(),
- e.on("posterchange", Te(Ve(n), n.update)),
- G(n.el()),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.canClick = function() {
- this.canplay(!0)
- }
- ,
- t.canplay = function(e) {
- return void 0 !== e && (this.canplay_ = e),
- this.canplay_
- }
- ,
- t.dispose = function() {
- this.player().off("posterchange", this.update),
- i.prototype.dispose.call(this)
- }
- ,
- t.createEl = function() {
- return w("div", {
- className: "vjs-poster",
- tabIndex: -1
- })
- }
- ,
- t.update = function(e) {
- var t = this.player().poster();
- this.setSrc(t),
- t ? this.show() : this.hide()
- }
- ,
- t.setSrc = function(e) {
- var t = "";
- e && (t = 'url("' + e + '")'),
- this.el_.style.backgroundImage = t
- }
- ,
- t.handleClick = function(e) {
- if (!0 === this.canplay() && this.player_.controls()) {
- var t = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
- !this.player_.tech(!0) || (st || nt) && t || this.player_.tech(!0).focus(),
- this.player_.paused() ? At(this.player_.play()) : this.player_.pause()
- }
- }
- ,
- e
- }(Vt);
- He.registerComponent("PosterImage", Wr);
- var Kr = function(r) {
- function e() {
- return r.apply(this, arguments) || this
- }
- return We(e, r),
- e.prototype.createEl = function() {
- var e = this.player_.isAudio()
- , t = this.localize(e ? "Audio Player" : "Video Player")
- , n = w("span", {
- className: "vjs-control-text",
- innerHTML: this.localize("{1} is loading.", [t])
- })
- , i = r.prototype.createEl.call(this, "div", {
- className: "vjs-loading-spinner",
- dir: "ltr"
- });
- return i.appendChild(n),
- i
- }
- ,
- e
- }(He);
- He.registerComponent("LoadingSpinner", Kr);
- var Xr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).mouseused_ = !1,
- oo.browser.IS_SAFARI && (n.hide(),
- n.one(e, "canplay", n.beforeShow)),
- oo.browser.IS_FIREFOX && n.hide(),
- n.one(e, "canplaythrough", n.show),
- n.on("mousedown", n.handleMouseDown),
- G(n.el()),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-big-play-button"
- }
- ,
- t.show = function() {
- this.player().options().debug && this.player().log("show-bigplaybutton"),
- oo.browser.IS_SAFARI,
- i.prototype.show.call(this)
- }
- ,
- t.beforeShow = function() {
- this.player().log("beforeShow"),
- this.setTimeout(function() {
- this.show()
- }, 100)
- }
- ,
- t.handleClick = function(e) {
- oo.browser.IS_SAFARI;
- var t = this.player_.play();
- if (this.mouseused_ && e.clientX && e.clientY) {
- var n = this.player_.usingPlugin("eme") && this.player_.eme.sessions && 0 < this.player_.eme.sessions.length;
- return At(t),
- void (!this.player_.tech(!0) || (st || nt) && n || this.player_.tech(!0).focus())
- }
- var i = this.player_.getChild("controlBar")
- , r = i && i.getChild("playToggle");
- if (r) {
- var s = function() {
- return r.focus()
- };
- xt(t) ? t.then(s, function() {}) : this.setTimeout(s, 1)
- } else
- this.player_.tech(!0).focus()
- }
- ,
- t.handleKeyDown = function(e) {
- this.mouseused_ = !1,
- i.prototype.handleKeyDown.call(this, e)
- }
- ,
- t.handleMouseDown = function(e) {
- this.mouseused_ = !0
- }
- ,
- e
- }(Qt);
- Xr.prototype.controlText_ = "Play Video",
- He.registerComponent("BigPlayButton", Xr);
- var Gr = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).controlText(t && t.controlText || n.localize("Close")),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-close-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {
- this.trigger({
- type: "close",
- bubbles: !1
- })
- }
- ,
- t.handleKeyDown = function(e) {
- Mt.isEventKey(e, "Esc") ? (e.preventDefault(),
- e.stopPropagation(),
- this.trigger("click")) : i.prototype.handleKeyDown.call(this, e)
- }
- ,
- e
- }(Qt);
- He.registerComponent("CloseButton", Gr);
- var Yr = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- n = i.call(this, e, t) || this,
- t.replay = void 0 === t.replay || t.replay,
- n.on(e, "play", n.handlePlay),
- n.on(e, "pause", n.handlePause),
- t.replay && n.on(e, "ended", n.handleEnded),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-play-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {
- this.player_.paused() ? this.player_.play() : this.player_.pause()
- }
- ,
- t.handleSeeked = function(e) {
- this.removeClass("vjs-ended"),
- this.player_.paused() ? this.handlePause(e) : this.handlePlay(e)
- }
- ,
- t.handlePlay = function(e) {
- this.removeClass("vjs-ended"),
- this.removeClass("vjs-paused"),
- this.addClass("vjs-playing"),
- this.controlText("Pause")
- }
- ,
- t.handlePause = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-paused"),
- this.controlText("Play")
- }
- ,
- t.handleEnded = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-ended"),
- this.controlText("Replay"),
- this.one(this.player_, "seeked", this.handleSeeked)
- }
- ,
- e
- }(Qt);
- Yr.prototype.controlText_ = "Play",
- He.registerComponent("PlayToggle", Yr);
- var $r = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- t.vertical = !0,
- "undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
- t.volumeBar.vertical = t.vertical),
- (n = i.call(this, e, t) || this).throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
- n.on("click", n.handlerClick),
- n.on("touchstart", n.handleMouseDown),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-next-control-container",
- innerHTML: '<div class="next-image"><img src="' + this.player().options_.nextImageUrl + '"/></div><div class="next-title">' + this.player().options_.nextTitle + "</div>"
- })
- }
- ,
- t.handleMouseDown = function(e) {}
- ,
- t.handlerMouseOver = function(e) {}
- ,
- t.handlerClick = function(e) {}
- ,
- t.handleMouseUp = function(e) {}
- ,
- t.handleMouseMove = function(e) {}
- ,
- e
- }(He);
- $r.prototype.options_ = {},
- He.registerComponent("NextControl", $r);
- var Jr = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- n = i.call(this, e, t) || this,
- t.next = void 0 === t.next || t.next,
- n.on("mouseover", n.handleMouseOver),
- n.on("mouseout", n.handleMouseOut),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-next-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {}
- ,
- t.handleMouseOver = function(e) {}
- ,
- t.handleMouseOut = function(e) {}
- ,
- t.handleKeyPress = function(e) {}
- ,
- t.handlePlay = function(e) {
- this.removeClass("vjs-ended"),
- this.removeClass("vjs-paused"),
- this.addClass("vjs-playing"),
- this.controlText("Next")
- }
- ,
- t.handlePause = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-paused"),
- this.controlText("Next")
- }
- ,
- t.handleEnded = function(e) {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-ended"),
- this.controlText("Next")
- }
- ,
- e
- }(Qt);
- Jr.prototype.controlText_ = "Next",
- He.registerComponent("NextButton", Jr);
- var Zr = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- t.inline = !1,
- (n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
- n.on("click", n.handlerClick),
- n.on("mouseover", n.handleMouseOver),
- n.on("mouseout", n.handleMouseOut),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.volumePanelState_ = function() {}
- ,
- t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-next-panel vjs-control vjs-next-panel-vertical"
- })
- }
- ,
- t.dispose = function() {
- this.handleMouseOut(),
- i.prototype.dispose.call(this)
- }
- ,
- t.handleVolumeControlKeyUp = function(e) {
- Mt.isEventKey(e, "Esc")
- }
- ,
- t.handleMouseOver = function(e) {
- this.addClass("vjs-hover"),
- ge(f, "keyup", Te(this, this.handleKeyPress))
- }
- ,
- t.handleMouseOut = function(e) {
- this.removeClass("vjs-hover"),
- ye(f, "keyup", Te(this, this.handleKeyPress))
- }
- ,
- t.handlerClick = function(e) {
- this.player().trigger("nextvideo")
- }
- ,
- t.handleKeyPress = function(e) {
- Mt.isEventKey(e, "Esc") && this.handleMouseOut()
- }
- ,
- e
- }(He);
- Zr.prototype.options_ = {
- children: ["nextButton", "nextControl"]
- },
- He.registerComponent("NextPanel", Zr);
- var es = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "webfullscreenchange", n.handleWebfullscreenChange),
- !1 === f[e.fsApi_.webfullscreenEnabled] && n.disable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-webfullscreen-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleWebfullscreenChange = function(e) {
- this.player_.isWebFullscreen() ? this.controlText("Non-Webfullscreen") : this.controlText("Webfullscreen")
- }
- ,
- t.handleClick = function(e) {
- this.player_.isWebFullscreen() ? this.player_.exitFullWindow() : this.player_.enterFullWindow()
- }
- ,
- e
- }(Qt);
- es.prototype.controlText_ = "Webfullscreen",
- He.registerComponent("WebfullscreenToggle", es);
- var ts = function(r) {
- function e(e, t) {
- var n, i = t.content;
- return t.multiSelectable = !1,
- (n = r.call(this, e, t) || this).label = i,
- n.on(e, "autonextchange", n.update),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function(e, t, n) {
- return this.nonIconControl = !0,
- r.prototype.createEl.call(this, "li", b({
- className: "vjs-menu-item",
- 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>',
- tabIndex: -1
- }, t), n)
- }
- ,
- t.handleClick = function(e) {
- !0 === this.player().autoNext() ? this.player().autoNext(!1) : (this.player().autoNext(!0),
- this.player().loop2(!1))
- }
- ,
- t.update = function(e) {
- !0 === this.player().autoNext() ? (this.removeClass("selectorOff"),
- this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
- this.addClass("selectorOff"))
- }
- ,
- e
- }(Qr);
- ts.prototype.contentElType = "button",
- He.registerComponent("SetupMenuItemAutoNext", ts);
- var ns = function(r) {
- function e(e, t) {
- var n, i = t.content;
- return t.multiSelectable = !1,
- (n = r.call(this, e, t) || this).label = i,
- n.on(e, "loop2change", n.update),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function(e, t, n) {
- return this.nonIconControl = !0,
- r.prototype.createEl.call(this, "li", b({
- className: "vjs-menu-item",
- 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>',
- tabIndex: -1
- }, t), n)
- }
- ,
- t.handleClick = function(e) {
- !0 === this.player().loop2() ? this.player().loop2(!1) : (this.player().loop2(!0),
- this.player().autoNext(!1)),
- this.player().log("loop2 click" + this.player().loop2())
- }
- ,
- t.update = function(e) {
- !0 === this.player().loop2() ? (this.removeClass("selectorOff"),
- this.addClass("selectorOn")) : (this.removeClass("selectorOn"),
- this.addClass("selectorOff"))
- }
- ,
- e
- }(Qr);
- ns.prototype.contentElType = "button",
- He.registerComponent("SetupMenuItemLoop", ns);
- var is = function(n) {
- function e(e, t) {
- return n.call(this, e, t) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.createEl = function() {
- var e = n.prototype.createEl.call(this);
- return this.labelEl_ = w("div", {
- className: "vjs-setup-value",
- innerHTML: ""
- }),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- n.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-setup " + n.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-setup " + n.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- var e = new Fr(this.player());
- return !0 === this.player().options_.controlBar.nextPanel && e.addChild(new ts(this.player(),{
- content: "Auto Next"
- })),
- e.addChild(new ns(this.player(),{
- content: "Loop"
- })),
- e
- }
- ,
- t.updateARIAAttributes = function() {}
- ,
- t.handleClick = function(e) {}
- ,
- t.handleMouseEnter = function() {
- this.player().trigger("analyticALI.play.1.17")
- }
- ,
- e
- }(Hr);
- is.prototype.controlText_ = "Setup",
- He.registerComponent("SetupMenuButton", is);
- var rs = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).updateLabel(),
- n.on(e, "choosevideochange", n.updateLabel),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return this.labelEl_ = w("div", {
- className: "choose-video-value",
- innerHTML: "videos"
- }),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "choose-video " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "choose-video " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- return new Fr(this.player())
- }
- ,
- t.updateMenu = function() {}
- ,
- t.updateARIAAttributes = function() {}
- ,
- t.handleClick = function(e) {
- var t = this.player().getChild("chooseVideoPanel");
- void 0 !== t && (t.hideToggle(),
- t.updatePage(),
- this.updateButtonState())
- }
- ,
- t.updateButtonState = function() {
- var e = this.player().getChild("chooseVideoPanel");
- void 0 !== e && (e.hasClass("vjs-hidden") ? this.removeClass("vjs-selected") : this.addClass("vjs-selected"))
- }
- ,
- t.handleMouseEnter = function() {}
- ,
- t.updateVisibility = function(e) {}
- ,
- t.updateLabel = function(e) {
- this.labelEl_.innerHTML = "" + this.localize("videos")
- }
- ,
- e
- }(Hr);
- rs.prototype.controlText_ = "videos",
- He.registerComponent("ChooseVideoButton", rs);
- var ss = function(s) {
- function e(e, t) {
- var n, i = t.tracks;
- if ((n = s.call(this, e, t) || this).items.length <= 1 && n.hide(),
- !i)
- return Ve(n);
- var r = Te(Ve(n), n.update);
- return i.addEventListener("removetrack", r),
- i.addEventListener("addtrack", r),
- n.player_.on("ready", r),
- n.player_.on("dispose", function() {
- i.removeEventListener("removetrack", r),
- i.removeEventListener("addtrack", r)
- }),
- n
- }
- return We(e, s),
- e
- }(Hr);
- He.registerComponent("TrackButton", ss);
- var as = function(r) {
- function e(e, t) {
- return r.call(this, e, t) || this
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function(e, t, n) {
- var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.audioLabel);
- return i += "</span>",
- r.prototype.createEl.call(this, e, b({
- innerHTML: i
- }, t), n)
- }
- ,
- t.handleClick = function(e) {
- r.prototype.handleClick.call(this, e),
- this.player().changeAudioMode(this.options_.audioModeIndex)
- }
- ,
- e
- }(Qr);
- He.registerComponent("audioModeMenuItem", as);
- var os = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- (n = i.call(this, e, t) || this).on(e, "changeAudioMode", n.onChange),
- n.show(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return this.labelEl_ = w("div", {
- className: "vjs-audio-button-value",
- innerHTML: "" + this.localize("original")
- }),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-audio-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-audio-button " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createItems = function(e) {
- return void 0 === e && (e = []),
- e.push(new as(this.player_,{
- audioModeIndex: 0,
- audioLabel: "original",
- selectable: !0,
- multiSelectable: !1
- })),
- e.push(new as(this.player_,{
- audioModeIndex: 1,
- audioLabel: "earphone",
- selectable: !0,
- multiSelectable: !1
- })),
- e.push(new as(this.player_,{
- audioModeIndex: 2,
- audioLabel: "soundbox",
- selectable: !0,
- multiSelectable: !1
- })),
- e[0].selected(!0),
- e
- }
- ,
- t.onChange = function(e) {
- for (var t = 0; t < this.items.length; t++)
- this.items[t].selected(!1);
- this.items[e.audioMode].selected(!0),
- this.labelEl_.innerHTML = "" + this.localize(this.items[e.audioMode].options_.audioLabel)
- }
- ,
- e
- }(ss);
- os.prototype.controlText_ = "audio mode",
- He.registerComponent("AudioModeButton", os);
- var ls = function(n) {
- function e(e, t) {
- return n.call(this, e, t) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.createEl = function() {
- var e = "vjs-quality-menu-permit"
- , t = n.prototype.createEl.call(this, "span", {
- className: e
- });
- return this.contentEl_ = w("span", {
- className: e + "-display",
- innerHTML: "" + this.localize("登录看")
- }, {
- "aria-live": "off",
- role: "presentation"
- }),
- t.appendChild(this.contentEl_),
- t
- }
- ,
- t.visible = function(e) {
- e ? this.removeClass("opacity-0") : this.addClass("opacity-0")
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- this.textNode_ = null,
- n.prototype.dispose.call(this)
- }
- ,
- t.updateContent = function(e) {}
- ,
- e
- }(He);
- ls.prototype.labelText_ = "Time",
- ls.prototype.controlText_ = "PlaybackQualityMenuPermit",
- He.registerComponent("PlaybackQualityMenuPermit", ls);
- var us = function(l) {
- function e(e, t, n) {
- var i, r = t.quality, s = t.quality;
- if (t.label = r,
- t.selected = 1 === s,
- t.selectable = !0,
- t.multiSelectable = !1,
- (i = l.call(this, e, t) || this).label = r,
- i.quality = s,
- i.permit = t.permit,
- n) {
- var a = new ls(e,t);
- i.permit,
- 0,
- i.permit <= 0 && a.visible(!1),
- i.addChild(a)
- }
- i.on(e, "qualitychange", i.update);
- var o = i.player_.qualityLevels();
- return i.on(o, "change", i.update2),
- i
- }
- We(e, l);
- var t = e.prototype;
- return t.handleClick = function(e) {
- if (0 !== this.permit)
- return this.player().log("this.permit" + this.permit),
- this.player().pause(),
- this.player().trigger("loginstatus"),
- void cr.set("h5vodlocaldata", {
- lastQuality: this.label,
- lastVolume: this.player().volume()
- });
- l.prototype.handleClick.call(this),
- this.player().switchQualityDirect(this.label),
- this.player().trigger("analyticALI.play.1.13")
- }
- ,
- t.update = function(e) {
- this.selected(this.player().getCurentQuality() === this.quality)
- }
- ,
- t.update2 = function(e) {
- this.selected(this.player().getCurentQuality() === this.quality)
- }
- ,
- t.playbackQualities = function() {
- return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
- }
- ,
- t.playbackQualityIndexs = function() {
- return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
- }
- ,
- e
- }(Qr);
- us.prototype.contentElType = "Playback Quality",
- He.registerComponent("PlaybackQualityMenuItem", us);
- var cs = function(r) {
- function e(e, t) {
- var n;
- (n = r.call(this, e, t) || this).updateVisibility(),
- n.updateLabel(),
- n.on(e, "loadstart", n.updateVisibility),
- n.on(e, "loadedmetadata", n.updateMenu);
- n.player().options().qualityPermitMode;
- n.on(e, "qualitychange", n.updateLabel);
- var i = n.player_.qualityLevels();
- return n.on(i, "change", n.updateLabel2),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function() {
- var e = r.prototype.createEl.call(this);
- return this.labelEl_ = w("div", {
- className: "vjs-playback-quality-value",
- innerHTML: "HD"
- }),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- 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--)
- if (0 < i[s].permition) {
- r = !0;
- break
- }
- if (r && this.addClass("vjs-playback-quality-wide"),
- i)
- for (var a = i.length - 1; 0 <= a; a--) {
- var o = void 0;
- i[a].enabled && (o = t && r ? new us(this.player(),{
- quality: "" + i[a].label,
- permit: i[a].permition
- },!0) : new us(this.player(),{
- quality: "" + i[a].label,
- permit: 0
- },!1),
- e.addChild(o))
- }
- return e
- }
- ,
- t.updateMenu = function() {
- var e = !!this.player().options().qualityPermitMode;
- if (this.player().changingToMainContent() && e)
- for (var t = this.player_.qualityLevels().length, n = 0; n < t; n++) {
- var i = this.player().options_.playbackQualities
- , r = this.player().options_.playbackQualityIndex[i.lastIndexOf(this.player().getMainContentQuality())];
- this.player_.qualityLevels()[n].enabled = n === r
- }
- }
- ,
- t.initSwitchQuality = function() {
- var e = this.player_.qualityLevels().length;
- this.player_.clearPlaybackQualityLevel();
- for (var t = 0; t < e; t++)
- this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
- this.player().switchQuality(this.player().options().customDefaultQuality, !0),
- this.updateLabel()
- }
- ,
- t.updateARIAAttributes = function() {
- this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
- }
- ,
- t.handleClick = function(e) {
- for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
- if (n[r] > t) {
- i = n[r];
- break
- }
- this.player().playbackQuality(i)
- }
- ,
- t.handleMouseEnter = function() {
- this.player().trigger("analyticALI.play.1.14")
- }
- ,
- t.playbackQualities = function() {
- return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
- }
- ,
- t.playbackQualityIndexs = function() {
- return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
- }
- ,
- t.playbackQualitySupported = function() {
- return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
- }
- ,
- t.updateVisibility = function(e) {
- this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
- }
- ,
- t.updateLabel = function(e) {
- this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
- }
- ,
- t.updateLabel2 = function(e) {
- this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQualityLabel())
- }
- ,
- e
- }(Hr);
- cs.prototype.controlText_ = "Playback Quality",
- He.registerComponent("PlaybackQualityMenuButton", cs);
- var hs = function(a) {
- function e(e, t) {
- var n, i = t.quality, r = t.quality;
- t.label = i,
- t.selected = 1 === r,
- t.selectable = !0,
- t.multiSelectable = !1,
- (n = a.call(this, e, t) || this).label = i,
- n.quality = r,
- n.on(e, "qualitychange", n.update);
- var s = n.player_.qualityLevels();
- return n.on(s, "change", n.update2),
- n
- }
- We(e, a);
- var t = e.prototype;
- return t.handleClick = function(e) {
- a.prototype.handleClick.call(this),
- this.player().switchQuality(this.label),
- this.player().trigger("analyticALI.play.1.13")
- }
- ,
- t.update = function(e) {
- this.selected(this.player().getCurentQuality() === this.quality)
- }
- ,
- t.update2 = function(e) {
- this.selected(this.player().getCurentQuality() === this.quality)
- }
- ,
- t.playbackQualities = function() {
- return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
- }
- ,
- t.playbackQualityIndexs = function() {
- return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
- }
- ,
- e
- }(Qr);
- hs.prototype.contentElType = "Playback Quality",
- He.registerComponent("PlaybackQualityMenuItem3", hs);
- var ds = function(r) {
- function e(e, t) {
- var n;
- if ((n = r.call(this, e, t) || this).player().options().qualityPermitMode)
- return Ve(n);
- n.updateVisibility(),
- n.updateLabel(),
- n.on(e, "loadstart", n.updateVisibility),
- n.on(e, "loadedmetadata", n.updateMenu),
- n.on(e, "qualitychange", n.updateLabel);
- var i = n.player_.qualityLevels();
- return n.on(i, "change", n.updateLabel2),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function() {
- var e = r.prototype.createEl.call(this);
- return this.labelEl_ = w("div", {
- className: "vjs-playback-quality-value",
- innerHTML: "HD"
- }),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-playback-quality " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-playback-quality " + r.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- for (var e = new Fr(this.player()), t = ["HD-"], n = t.length - 1; 0 <= n; n--)
- e.addChild(new hs(this.player(),{
- quality: "" + t[n]
- }));
- return e
- }
- ,
- t.updateMenu = function() {
- var e = this.player_.qualityLevels().length;
- this.player_.clearPlaybackQualityLevel();
- for (var t = 0; t < e; t++)
- this.player_.addPlaybackQualityLevel(this.player_.qualityLevels()[t], t);
- for (var n, i = this.playbackQualities(), r = this.menu; 0 < r.children_.length; )
- n = r.children_[0],
- r.removeChild(n);
- var s, a, o = cr.get("h5vodlocaldata");
- if (void 0 !== o && void 0 !== o.lastQuality && 0 < this.player_.GET_DEFAULT_QUALITY_LABELS().indexOf(o.lastQuality) ? s = o.lastQuality : (s = "",
- this.player_.log("no lastQuality")),
- "" !== s && 0 <= i.indexOf(s))
- a = s;
- else if (null !== this.player_.options_.vdnDefaultStream) {
- a = this.player_.options_.vdnDefaultStream,
- this.player().options().debug && this.player_.log("vdn vdnDefaultStream: " + a)
- }
- 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]),
- 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]),
- this.player().options().debug && this.player_.log("[PlaybackQualityMenuItem3] defaultStream: " + a),
- this.player().switchQuality(a, !0),
- this.updateLabel(),
- i)
- for (var l = i.length - 1; 0 <= l; l--) {
- var u = new hs(this.player(),{
- quality: "" + i[l]
- });
- r.addChild(u),
- u.update()
- }
- }
- ,
- t.updateARIAAttributes = function() {
- this.el().setAttribute("aria-valuenow", this.player().playbackQuality())
- }
- ,
- t.handleClick = function(e) {
- for (var t = this.player().playbackQuality(), n = this.playbackQualities(), i = n[0], r = 0; r < n.length; r++)
- if (n[r] > t) {
- i = n[r];
- break
- }
- this.player().playbackQuality(i)
- }
- ,
- t.handleMouseEnter = function() {
- this.player().trigger("analyticALI.play.1.14")
- }
- ,
- t.playbackQualities = function() {
- return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
- }
- ,
- t.playbackQualityIndexs = function() {
- return this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex
- }
- ,
- t.playbackQualitySupported = function() {
- return this.player().tech_ && this.player().tech_.featuresPlaybackQuality && this.playbackQualities() && 0 < this.playbackQualities().length
- }
- ,
- t.updateVisibility = function(e) {
- this.playbackQualitySupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
- }
- ,
- t.updateLabel = function(e) {
- this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
- }
- ,
- t.updateLabel2 = function(e) {
- this.labelEl_.innerHTML = "" + this.localize(this.player_.getCurentQuality())
- }
- ,
- e
- }(Hr);
- ds.prototype.controlText_ = "Playback Quality",
- He.registerComponent("PlaybackQualityMenuButton3", ds);
- var ps = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- We(t, e);
- var n = t.prototype;
- return n.buildCSSClass = function() {
- return "vjs-current-time"
- }
- ,
- n.updateContent = function(e) {
- var t;
- t = this.player_.ended() ? this.player_.duration() : this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime(),
- this.updateTextNode_(t)
- }
- ,
- t
- }(Rt);
- ps.prototype.labelText_ = "Current Time",
- ps.prototype.controlText_ = "Current Time",
- He.registerComponent("CurrentTimeDisplay", ps);
- var fs = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
- n.on(e, "loadstart", n.updateContent),
- n.on(e, "loadedmetadata", n.updateContent),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-duration"
- }
- ,
- t.updateContent = function(e) {
- var t = this.player_.duration();
- this.updateTextNode_(t)
- }
- ,
- e
- }(Rt);
- fs.prototype.labelText_ = "Duration",
- fs.prototype.controlText_ = "Duration",
- He.registerComponent("DurationDisplay", fs);
- var vs = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- return We(t, e),
- t.prototype.createEl = function() {
- return e.prototype.createEl.call(this, "div", {
- className: "vjs-time-control vjs-time-divider",
- innerHTML: "<div><span>/</span></div>"
- }, {
- "aria-hidden": !0
- })
- }
- ,
- t
- }(He);
- He.registerComponent("TimeDivider", vs);
- var gs = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "durationchange", n.updateContent),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-remaining-time"
- }
- ,
- t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return e.insertBefore(w("span", {}, {
- "aria-hidden": !0
- }, "-"), this.contentEl_),
- e
- }
- ,
- t.updateContent = function(e) {
- var t;
- "number" == typeof this.player_.duration() && (t = this.player_.ended() ? 0 : this.player_.remainingTimeDisplay ? this.player_.remainingTimeDisplay() : this.player_.remainingTime(),
- this.updateTextNode_(t))
- }
- ,
- e
- }(Rt);
- gs.prototype.labelText_ = "Remaining Time",
- gs.prototype.controlText_ = "Remaining Time",
- He.registerComponent("RemainingTimeDisplay", gs);
- var ys = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).updateShowing(),
- n.on(n.player(), "durationchange", n.updateShowing),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this, "div", {
- className: "vjs-live-control vjs-control"
- });
- return this.contentEl_ = w("div", {
- className: "vjs-live-display",
- innerHTML: '<span class="vjs-control-text">' + this.localize("Stream Type") + " </span>" + this.localize("LIVE")
- }, {
- "aria-live": "off"
- }),
- e.appendChild(this.contentEl_),
- e
- }
- ,
- t.dispose = function() {
- this.contentEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.updateShowing = function(e) {
- this.player().duration() === 1 / 0 ? this.show() : this.hide()
- }
- ,
- e
- }(He);
- He.registerComponent("LiveDisplay", ys);
- var ms = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).updateLiveEdgeStatus(),
- n.player_.liveTracker && n.on(n.player_.liveTracker, "liveedgechange", n.updateLiveEdgeStatus),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this, "button", {
- className: "vjs-seek-to-live-control vjs-control"
- });
- return this.textEl_ = w("span", {
- className: "vjs-seek-to-live-text",
- innerHTML: this.localize("LIVE")
- }, {
- "aria-hidden": "true"
- }),
- e.appendChild(this.textEl_),
- e
- }
- ,
- t.updateLiveEdgeStatus = function() {
- !this.player_.liveTracker || this.player_.liveTracker.atLiveEdge() ? (this.setAttribute("aria-disabled", !0),
- this.addClass("vjs-at-live-edge"),
- this.controlText("Seek to live, currently playing live")) : (this.setAttribute("aria-disabled", !1),
- this.removeClass("vjs-at-live-edge"),
- this.controlText("Seek to live, currently behind live"))
- }
- ,
- t.handleClick = function() {
- this.player_.liveTracker.seekToLiveEdge()
- }
- ,
- t.dispose = function() {
- this.player_.liveTracker && this.off(this.player_.liveTracker, "liveedgechange", this.updateLiveEdgeStatus),
- this.textEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- e
- }(Qt);
- ms.prototype.controlText_ = "Seek to live, currently playing live",
- He.registerComponent("SeekToLive", ms);
- function _s(e, t, n) {
- return e = Number(e),
- Math.min(n, Math.max(t, isNaN(e) ? t : e))
- }
- var bs = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).bar = n.getChild(n.options_.barName),
- n.vertical(!!n.options_.vertical),
- n.enable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.enabled = function() {
- return this.enabled_
- }
- ,
- t.enable = function() {
- this.enabled() || (this.on("mousedown", this.handleMouseDown),
- this.on("touchstart", this.handleMouseDown),
- this.on("keydown", this.handleKeyDown),
- this.on("click", this.handleClick),
- this.on(this.player_, "controlsvisible", this.update),
- this.playerEvent && this.on(this.player_, this.playerEvent, this.update),
- this.removeClass("disabled"),
- this.setAttribute("tabindex", 0),
- this.enabled_ = !0)
- }
- ,
- t.disable = function() {
- if (this.enabled()) {
- var e = this.bar.el_.ownerDocument;
- this.off("mousedown", this.handleMouseDown),
- this.off("touchstart", this.handleMouseDown),
- this.off("keydown", this.handleKeyDown),
- this.off("click", this.handleClick),
- this.off(this.player_, "controlsvisible", this.update),
- this.off(e, "mousemove", this.handleMouseMove),
- this.off(e, "mouseup", this.handleMouseUp),
- this.off(e, "touchmove", this.handleMouseMove),
- this.off(e, "touchend", this.handleMouseUp),
- this.removeAttribute("tabindex"),
- this.addClass("disabled"),
- this.playerEvent && this.off(this.player_, this.playerEvent, this.update),
- this.enabled_ = !1
- }
- }
- ,
- t.createEl = function(e, t, n) {
- return void 0 === t && (t = {}),
- void 0 === n && (n = {}),
- t.className = t.className + " vjs-slider",
- t = b({
- tabIndex: 0
- }, t),
- n = b({
- role: "slider",
- "aria-valuenow": 0,
- "aria-valuemin": 0,
- "aria-valuemax": 100,
- tabIndex: 0
- }, n),
- i.prototype.createEl.call(this, e, t, n)
- }
- ,
- t.handleMouseDown = function(e) {
- var t = this.bar.el_.ownerDocument;
- "mousedown" === e.type && e.preventDefault(),
- "touchstart" !== e.type || it || e.preventDefault(),
- R(),
- this.addClass("vjs-sliding"),
- this.trigger("slideractive"),
- this.on(t, "mousemove", this.handleMouseMove),
- this.on(t, "mouseup", this.handleMouseUp),
- this.on(t, "touchmove", this.handleMouseMove),
- this.on(t, "touchend", this.handleMouseUp),
- this.handleMouseMove(e)
- }
- ,
- t.handleMouseMove = function(e) {}
- ,
- t.handleMouseUp = function() {
- var e = this.bar.el_.ownerDocument;
- F(),
- this.removeClass("vjs-sliding"),
- this.trigger("sliderinactive"),
- this.off(e, "mousemove", this.handleMouseMove),
- this.off(e, "mouseup", this.handleMouseUp),
- this.off(e, "touchmove", this.handleMouseMove),
- this.off(e, "touchend", this.handleMouseUp),
- this.update()
- }
- ,
- t.update = function() {
- var t = this;
- if (this.el_ && this.bar) {
- var n = this.getProgress();
- return n === this.progress_ || (this.progress_ = n,
- this.requestAnimationFrame(function() {
- var e = t.vertical() ? "height" : "width";
- t.bar.el().style[e] = (100 * n).toFixed(2) + "%"
- })),
- n
- }
- }
- ,
- t.getProgress = function() {
- return Number(_s(this.getPercent(), 0, 1).toFixed(4))
- }
- ,
- t.calculateDistance = function(e) {
- var t = Q(this.el_, e);
- return this.vertical() ? t.y : t.x
- }
- ,
- t.handleKeyDown = function(e) {
- Mt.isEventKey(e, "Left") || Mt.isEventKey(e, "Down") ? (e.preventDefault(),
- e.stopPropagation(),
- this.stepBack()) : Mt.isEventKey(e, "Right") || Mt.isEventKey(e, "Up") ? (e.preventDefault(),
- e.stopPropagation(),
- this.stepForward()) : i.prototype.handleKeyDown.call(this, e)
- }
- ,
- t.handleClick = function(e) {
- e.stopPropagation(),
- e.preventDefault()
- }
- ,
- t.vertical = function(e) {
- if (void 0 === e)
- return this.vertical_ || !1;
- this.vertical_ = !!e,
- this.vertical_ ? this.addClass("vjs-slider-vertical") : this.addClass("vjs-slider-horizontal")
- }
- ,
- e
- }(He);
- He.registerComponent("Slider", bs);
- function Ts(e, t) {
- return _s(e / t * 100, 0, 100).toFixed(2) + "%"
- }
- var Cs = function(r) {
- function e(e, t) {
- var n;
- return (n = r.call(this, e, t) || this).partEls_ = [],
- n.on(e, "progress", n.update),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function() {
- var e = r.prototype.createEl.call(this, "div", {
- className: "vjs-load-progress"
- })
- , t = w("span", {
- className: "vjs-control-text"
- })
- , n = w("span", {
- textContent: this.localize("Loaded")
- })
- , i = f.createTextNode(": ");
- return this.percentageEl_ = w("span", {
- className: "vjs-control-text-loaded-percentage",
- textContent: "0%"
- }),
- e.appendChild(t),
- t.appendChild(n),
- t.appendChild(i),
- t.appendChild(this.percentageEl_),
- e
- }
- ,
- t.dispose = function() {
- this.partEls_ = null,
- this.percentageEl_ = null,
- r.prototype.dispose.call(this)
- }
- ,
- t.update = function(e) {
- var h = this;
- this.requestAnimationFrame(function() {
- var e = h.player_.liveTracker
- , t = h.player_.buffered()
- , n = e && e.isLive() ? e.seekableEnd() : h.player_.duration()
- , i = h.player_.bufferedEnd()
- , r = h.partEls_
- , s = Ts(i, n);
- h.percent_ !== s && (h.el_.style.width = s,
- x(h.percentageEl_, s),
- h.percent_ = s);
- for (var a = 0; a < t.length; a++) {
- var o = t.start(a)
- , l = t.end(a)
- , u = r[a];
- u || (u = h.el_.appendChild(w()),
- r[a] = u),
- u.dataset.start === o && u.dataset.end === l || (u.dataset.start = o,
- u.dataset.end = l,
- u.style.left = Ts(o, i),
- u.style.width = Ts(l - o, i))
- }
- for (var c = r.length; c > t.length; c--)
- h.el_.removeChild(r[c - 1]);
- r.length = t.length
- })
- }
- ,
- e
- }(He);
- He.registerComponent("LoadProgressBar", Cs);
- var ks = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-time-tooltip"
- }, {
- "aria-hidden": "true"
- })
- }
- ,
- t.update = function(e, t, n) {
- var i = H(this.el_)
- , r = H(this.player_.el())
- , s = e.width * t;
- if (r && i) {
- var a = e.left - r.left + s
- , o = e.width - s + (r.right - e.right)
- , l = i.width / 2;
- a < l ? l += l - a : o < l && (l = o),
- l < 0 ? l = 0 : l > i.width && (l = i.width),
- this.el_.style.right = "-" + l + "px",
- this.write(n)
- }
- }
- ,
- t.write = function(e) {
- x(this.el_, e)
- }
- ,
- t.updateTime = function(r, s, a, o) {
- var l = this;
- this.rafId_ && this.cancelAnimationFrame(this.rafId_),
- this.rafId_ = this.requestAnimationFrame(function() {
- var e, t = l.player_.duration();
- if (l.player_.liveTracker && l.player_.liveTracker.isLive()) {
- var n = l.player_.liveTracker.liveWindow()
- , i = n - s * n;
- e = (i < 1 ? "" : "-") + Bt(i, n)
- } else
- e = Bt(a, t);
- l.update(r, s, e),
- o && o()
- })
- }
- ,
- e
- }(He);
- He.registerComponent("TimeTooltip", ks);
- var Es = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-play-progress vjs-slider-bar"
- }, {
- "aria-hidden": "true"
- })
- }
- ,
- t.update = function(e, t) {
- var n = this.getChild("timeTooltip");
- if (n) {
- var i = this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime();
- n.updateTime(e, t, i)
- }
- }
- ,
- e
- }(He);
- Es.prototype.options_ = {
- children: []
- },
- He.registerComponent("PlayProgressBar", Es);
- var Ss = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-mouse-display"
- })
- }
- ,
- t.update = function(e, t) {
- var n = this
- , i = t * this.player_.duration();
- this.getChild("timeTooltip").updateTime(e, t, i, function() {
- n.el_.style.left = e.width * t + "px"
- })
- }
- ,
- e
- }(He);
- Ss.prototype.options_ = {
- children: ["timeTooltip"]
- },
- He.registerComponent("MouseTimeDisplay", Ss);
- var ws = function(r) {
- function e(e, t, n) {
- var i;
- return void 0 === n && (n = 0),
- (i = r.call(this, e, t) || this).index_ = n,
- i.start_ = e.options_.cuePoints[n].start,
- i.title_ = e.options_.cuePoints[n].title,
- i.end_ = e.options_.cuePoints[n].end,
- i.guid_ = e.options_.cuePoints[n].guid,
- i.on(e, "durationchange", i.update),
- i.on(i.el_, "mouseover", i.handleMouseOver),
- i.on(i.el_, "mouseout", i.handleMouseOut),
- i.on(i.el_, "mousedown", i.handleMouseDown),
- i
- }
- We(e, r);
- var t = e.prototype;
- return t.createEl = function() {
- return r.prototype.createEl.call(this, "div", {
- className: "vjs-cue-point"
- }, {
- "aria-hidden": "true"
- })
- }
- ,
- t.getIndex = function() {
- return this.index_
- }
- ,
- t.getStart = function() {
- return this.start_
- }
- ,
- t.getTitle = function() {
- return this.title_
- }
- ,
- t.getEnd = function() {
- return this.end_
- }
- ,
- t.handleMouseOver = function(e) {
- this.parentComponent_.parentComponent_.getChild("cuePointPreview").show(),
- this.parentComponent_.parentComponent_.getChild("cuePointPreview").updateCue(this.index_, this.guid_, this.title_, this.start_ / 1e3),
- this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").hide()
- }
- ,
- t.handleMouseOut = function(e) {
- this.parentComponent_.parentComponent_.getChild("cuePointPreview").hide(),
- this.parentComponent_.getChild("mouseTimeDisplay").getChild("timeTooltip").show()
- }
- ,
- t.handleClick = function(e) {
- e.stopPropagation()
- }
- ,
- t.handleMouseDown = function(e) {
- this.player_.currentTime(this.start_ / 1e3),
- e.stopPropagation()
- }
- ,
- t.update = function() {
- isNaN(this.player_.duration()) && this.player_.duration(),
- this.el().style.left = this.getStart() / 1e3 / this.player_.duration() * 100 + "%"
- }
- ,
- e
- }(He);
- ws.prototype.options_ = {
- children: []
- },
- He.registerComponent("CuePoint", ws);
- var xs = function(s) {
- function e(e, t) {
- var n;
- if ((n = s.call(this, e, t) || this).setEventHandlers_(),
- void 0 !== e.options_.cuePoints && 0 < e.options_.cuePoints.length)
- for (var i = 0; i < e.options_.cuePoints.length; i++) {
- var r = new ws(e,t,i);
- n.addChild(r)
- }
- return n
- }
- We(e, s);
- var t = e.prototype;
- return t.setEventHandlers_ = function() {
- this.update_ = Te(this, this.update),
- this.update = Ce(this.update_, 30),
- this.on(this.player_, ["ended", "durationchange", "timeupdate"], this.update),
- this.player_.liveTracker && this.on(this.player_.liveTracker, "liveedgechange", this.update),
- this.updateInterval = null,
- this.on(this.player_, ["playing"], this.enableInterval_),
- this.on(this.player_, ["ended", "pause", "waiting"], this.disableInterval_),
- "hidden"in f && "visibilityState"in f && this.on(f, "visibilitychange", this.toggleVisibility_)
- }
- ,
- t.toggleVisibility_ = function(e) {
- f.hidden ? this.disableInterval_(e) : (this.enableInterval_(),
- this.update())
- }
- ,
- t.enableInterval_ = function() {
- this.updateInterval || (this.updateInterval = this.setInterval(this.update, 30))
- }
- ,
- t.disableInterval_ = function(e) {
- this.player_.liveTracker && this.player_.liveTracker.isLive() && "ended" !== e.type || this.updateInterval && (this.clearInterval(this.updateInterval),
- this.updateInterval = null)
- }
- ,
- t.createEl = function() {
- return s.prototype.createEl.call(this, "div", {
- className: "vjs-progress-holder"
- }, {
- "aria-label": this.localize("Progress Bar")
- })
- }
- ,
- t.update = function(e) {
- var i = this
- , r = s.prototype.update.call(this);
- return this.requestAnimationFrame(function() {
- var e = i.player_.ended() ? i.player_.duration() : i.getCurrentTime_()
- , t = i.player_.liveTracker
- , n = i.player_.duration();
- t && t.isLive() && (n = i.player_.liveTracker.liveCurrentTime()),
- i.percent_ !== r && (i.el_.setAttribute("aria-valuenow", (100 * r).toFixed(2)),
- i.percent_ = r),
- 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}")),
- i.currentTime_ = e,
- i.duration_ = n),
- i.bar && i.bar.update(H(i.el()), i.getProgress())
- }),
- r
- }
- ,
- t.getCurrentTime_ = function() {
- return this.player_.scrubbing() ? this.player_.getCache().currentTime : this.player_.currentTime()
- }
- ,
- t.getPercent = function() {
- var e, t = this.getCurrentTime_(), n = this.player_.liveTracker;
- return n && n.isLive() ? (e = (t - n.seekableStart()) / n.liveWindow(),
- n.atLiveEdge() && (e = 1)) : e = t / this.player_.duration(),
- e
- }
- ,
- t.handleMouseDown = function(e) {
- X(e) && (e.stopPropagation(),
- this.player_.scrubbing(!0),
- this.videoWasPlaying = !this.player_.paused(),
- this.player_.pause(),
- s.prototype.handleMouseDown.call(this, e))
- }
- ,
- t.handleMouseMove = function(e) {
- if (X(e)) {
- var t, n = this.calculateDistance(e), i = this.player_.liveTracker;
- if (i && i.isLive()) {
- if (.99 <= n)
- return void i.seekToLiveEdge();
- var r = i.seekableStart()
- , s = i.liveCurrentTime();
- if (s <= (t = r + n * i.liveWindow()) && (t = s),
- t <= r && (t = r + .1),
- t === 1 / 0)
- return
- } else
- (t = n * this.player_.duration()) === this.player_.duration() && (t -= .1);
- this.player_.currentTime(t)
- }
- }
- ,
- t.enable = function() {
- s.prototype.enable.call(this);
- var e = this.getChild("mouseTimeDisplay");
- e && e.show()
- }
- ,
- t.disable = function() {
- s.prototype.disable.call(this);
- var e = this.getChild("mouseTimeDisplay");
- e && e.hide()
- }
- ,
- t.handleMouseUp = function(e) {
- s.prototype.handleMouseUp.call(this, e),
- e && e.stopPropagation(),
- this.player_.scrubbing(!1),
- this.player_.trigger({
- type: "timeupdate",
- target: this,
- manuallyTriggered: !0
- }),
- this.videoWasPlaying ? At(this.player_.play()) : this.update_()
- }
- ,
- t.stepForward = function() {
- this.player_.currentTime(this.player_.currentTime() + 10)
- }
- ,
- t.stepBack = function() {
- this.player_.currentTime(this.player_.currentTime() - 10)
- }
- ,
- t.handleAction = function(e) {
- this.player_.paused() ? this.player_.play() : this.player_.pause()
- }
- ,
- t.handleKeyDown = function(e) {
- if (Mt.isEventKey(e, "Space") || Mt.isEventKey(e, "Enter"))
- e.preventDefault(),
- e.stopPropagation(),
- this.handleAction(e);
- else if (Mt.isEventKey(e, "Home"))
- e.preventDefault(),
- e.stopPropagation(),
- this.player_.currentTime(0);
- else if (Mt.isEventKey(e, "End"))
- e.preventDefault(),
- e.stopPropagation(),
- this.player_.currentTime(this.player_.duration());
- else if (/^[0-9]$/.test(Mt(e))) {
- e.preventDefault(),
- e.stopPropagation();
- var t = 10 * (Mt.codes[Mt(e)] - Mt.codes[0]) / 100;
- this.player_.currentTime(this.player_.duration() * t)
- } else
- Mt.isEventKey(e, "PgDn") ? (e.preventDefault(),
- e.stopPropagation(),
- this.player_.currentTime(this.player_.currentTime() - 120)) : Mt.isEventKey(e, "PgUp") ? (e.preventDefault(),
- e.stopPropagation(),
- this.player_.currentTime(this.player_.currentTime() + 120)) : s.prototype.handleKeyDown.call(this, e)
- }
- ,
- e
- }(bs);
- xs.prototype.options_ = {
- children: ["loadProgressBar", "playProgressBar"],
- barName: "playProgressBar"
- },
- ht || Je || xs.prototype.options_.children.push("mouseTimeDisplay"),
- He.registerComponent("SeekBar", xs);
- var As = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- (n = i.call(this, e, t) || this).update = Ce(Te(Ve(n), n.update), 30),
- n.on("mouseover", n.handlerMouseOver),
- n.on("click", n.handlerClick),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "cue-point-preview vjs-hidden",
- innerHTML: '<div class="cue-point-preview-image"></div><div class="cue-point-preview-title">-</div><span class="cue-point-preview-time">88:88</span>'
- })
- }
- ,
- t.updateCue = function(e, t, n, i) {
- var r = Bt(i, this.player_.duration())
- , s = this.player_.httpPre_ + this.player_.options_.videoSnapUrl;
- 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>"
- }
- ,
- t.handleMouseDown = function(e) {}
- ,
- t.handlerMouseOver = function(e) {
- this.player().log("[cue-point-preview] mouse over")
- }
- ,
- t.handlerClick = function(e) {}
- ,
- t.handleMouseUp = function(e) {}
- ,
- t.handleMouseMove = function(e) {}
- ,
- t.update = function(e, t) {
- var n = e.width * t + 10 - 73;
- n < 10 ? n = 10 : n > e.width + 10 - 146 && (n = e.width + 10 - 146),
- this.el_.style.left = n + "px"
- }
- ,
- e
- }(He);
- As.prototype.options_ = {
- children: []
- },
- He.registerComponent("CuePointPreview", As);
- var Ps = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).handleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
- n.throttledHandleMouseSeek = Ce(Te(Ve(n), n.handleMouseSeek), 30),
- n.enable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-progress-control vjs-control"
- })
- }
- ,
- t.handleMouseMove = function(e) {
- var t = this.getChild("seekBar");
- if (t) {
- var n = t.getChild("playProgressBar")
- , i = t.getChild("mouseTimeDisplay");
- if (n || i) {
- var r = t.el()
- , s = H(r)
- , a = Q(r, e).x;
- a = _s(0, 1, a),
- i && i.update(s, a),
- n && n.update(s, t.getProgress());
- var o = this.getChild("cuePointPreview");
- o && o.update(s, a)
- }
- }
- }
- ,
- t.handleMouseSeek = function(e) {
- var t = this.getChild("seekBar");
- t && t.handleMouseMove(e)
- }
- ,
- t.enabled = function() {
- return this.enabled_
- }
- ,
- t.disable = function() {
- this.children().forEach(function(e) {
- return e.disable && e.disable()
- }),
- this.enabled() && (this.off(["mousedown", "touchstart"], this.handleMouseDown),
- this.off(this.el_, "mousemove", this.handleMouseMove),
- this.handleMouseUp(),
- this.addClass("disabled"),
- this.enabled_ = !1)
- }
- ,
- t.enable = function() {
- this.children().forEach(function(e) {
- return e.enable && e.enable()
- }),
- this.enabled() || (this.on(["mousedown", "touchstart"], this.handleMouseDown),
- this.on(this.el_, "mousemove", this.handleMouseMove),
- this.removeClass("disabled"),
- this.enabled_ = !0)
- }
- ,
- t.handleMouseDown = function(e) {
- var t = this.el_.ownerDocument
- , n = this.getChild("seekBar");
- n && n.handleMouseDown(e),
- this.on(t, "mousemove", this.throttledHandleMouseSeek),
- this.on(t, "touchmove", this.throttledHandleMouseSeek),
- this.on(t, "mouseup", this.handleMouseUp),
- this.on(t, "touchend", this.handleMouseUp)
- }
- ,
- t.handleMouseUp = function(e) {
- var t = this.el_.ownerDocument
- , n = this.getChild("seekBar");
- n && n.handleMouseUp(e),
- this.off(t, "mousemove", this.throttledHandleMouseSeek),
- this.off(t, "touchmove", this.throttledHandleMouseSeek),
- this.off(t, "mouseup", this.handleMouseUp),
- this.off(t, "touchend", this.handleMouseUp)
- }
- ,
- e
- }(He);
- Ps.prototype.options_ = {
- children: ["seekBar", "cuePointPreview"]
- },
- He.registerComponent("ProgressControl", Ps);
- var Ls = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, ["enterpictureinpicture", "leavepictureinpicture"], n.handlePictureInPictureChange),
- f.pictureInPictureEnabled || n.disable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-picture-in-picture-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handlePictureInPictureChange = function(e) {
- this.player_.isInPictureInPicture() ? this.controlText("Exit Picture-in-Picture") : this.controlText("Picture-in-Picture")
- }
- ,
- t.handleClick = function(e) {
- this.player_.isInPictureInPicture() ? this.player_.exitPictureInPicture() : this.player_.requestPictureInPicture()
- }
- ,
- e
- }(Qt);
- Ls.prototype.controlText_ = "Picture-in-Picture",
- He.registerComponent("PictureInPictureToggle", Ls);
- var Is = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on(e, "fullscreenchange", n.handleFullscreenChange),
- !1 === f[e.fsApi_.fullscreenEnabled] && n.disable(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-fullscreen-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleFullscreenChange = function(e) {
- this.player_.isFullscreen() ? this.controlText("Non-Fullscreen") : this.controlText("Fullscreen")
- }
- ,
- t.handleClick = function(e) {
- this.player_.isFullscreen() ? this.player_.exitFullscreen() : this.player_.requestFullscreen()
- }
- ,
- e
- }(Qt);
- Is.prototype.controlText_ = "Fullscreen",
- He.registerComponent("FullscreenToggle", Is);
- var Ms = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- return We(t, e),
- t.prototype.createEl = function() {
- return e.prototype.createEl.call(this, "div", {
- className: "vjs-volume-level",
- innerHTML: '<span class="vjs-control-text"></span>'
- })
- }
- ,
- t
- }(He);
- He.registerComponent("VolumeLevel", Ms);
- var js = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).on("slideractive", n.updateLastVolume_),
- n.on(e, "volumechange", n.updateARIAAttributes),
- e.ready(function() {
- return n.updateARIAAttributes()
- }),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- return i.prototype.createEl.call(this, "div", {
- className: "vjs-volume-bar vjs-slider-bar"
- }, {
- "aria-label": this.localize("Volume Level"),
- "aria-live": "polite"
- })
- }
- ,
- t.handleMouseDown = function(e) {
- X(e) && i.prototype.handleMouseDown.call(this, e)
- }
- ,
- t.handleMouseMove = function(e) {
- X(e) && (this.checkMuted(),
- this.player_.volume(this.calculateDistance(e)))
- }
- ,
- t.checkMuted = function() {
- this.player_.muted() && this.player_.muted(!1)
- }
- ,
- t.getPercent = function() {
- return this.player_.muted() ? 0 : this.player_.volume()
- }
- ,
- t.stepForward = function() {
- this.checkMuted(),
- this.player_.volume(this.player_.volume() + .1)
- }
- ,
- t.stepBack = function() {
- this.checkMuted(),
- this.player_.volume(this.player_.volume() - .1)
- }
- ,
- t.updateARIAAttributes = function(e) {
- var t = this.player_.muted() ? 0 : this.volumeAsPercentage_();
- this.el_.setAttribute("aria-valuenow", t),
- this.el_.setAttribute("aria-valuetext", t + "%")
- }
- ,
- t.volumeAsPercentage_ = function() {
- return Math.round(100 * this.player_.volume())
- }
- ,
- t.updateLastVolume_ = function() {
- var e = this
- , t = this.player_.volume();
- this.one("sliderinactive", function() {
- 0 === e.player_.volume() && e.player_.lastVolume_(t)
- })
- }
- ,
- e
- }(bs);
- js.prototype.options_ = {
- children: ["volumeLevel"],
- barName: "volumeLevel"
- },
- js.prototype.playerEvent = "volumechange",
- He.registerComponent("VolumeBar", js);
- var Os = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- t.vertical = t.vertical || !1,
- "undefined" != typeof t.volumeBar && !c(t.volumeBar) || (t.volumeBar = t.volumeBar || {},
- t.volumeBar.vertical = t.vertical),
- n = i.call(this, e, t) || this,
- function(e, t) {
- t.tech_ && !t.tech_.featuresVolumeControl && e.addClass("vjs-hidden"),
- e.on(t, "loadstart", function() {
- t.tech_.featuresVolumeControl ? e.removeClass("vjs-hidden") : e.addClass("vjs-hidden")
- })
- }(Ve(n), e),
- n.throttledHandleMouseMove = Ce(Te(Ve(n), n.handleMouseMove), 30),
- n.on("mousedown", n.handleMouseDown),
- n.on("touchstart", n.handleMouseDown),
- n.on(n.volumeBar, ["focus", "slideractive"], function() {
- n.volumeBar.addClass("vjs-slider-active"),
- n.addClass("vjs-slider-active"),
- n.trigger("slideractive")
- }),
- n.on(n.volumeBar, ["blur", "sliderinactive"], function() {
- n.volumeBar.removeClass("vjs-slider-active"),
- n.removeClass("vjs-slider-active"),
- n.trigger("sliderinactive")
- }),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = "vjs-volume-horizontal";
- return this.options_.vertical && (e = "vjs-volume-vertical"),
- i.prototype.createEl.call(this, "div", {
- className: "vjs-volume-control vjs-control " + e
- })
- }
- ,
- t.handleMouseDown = function(e) {
- var t = this.el_.ownerDocument;
- this.on(t, "mousemove", this.throttledHandleMouseMove),
- this.on(t, "touchmove", this.throttledHandleMouseMove),
- this.on(t, "mouseup", this.handleMouseUp),
- this.on(t, "touchend", this.handleMouseUp)
- }
- ,
- t.handleMouseUp = function(e) {
- var t = this.el_.ownerDocument;
- this.off(t, "mousemove", this.throttledHandleMouseMove),
- this.off(t, "touchmove", this.throttledHandleMouseMove),
- this.off(t, "mouseup", this.handleMouseUp),
- this.off(t, "touchend", this.handleMouseUp)
- }
- ,
- t.handleMouseMove = function(e) {
- this.volumeBar.handleMouseMove(e)
- }
- ,
- e
- }(He);
- Os.prototype.options_ = {
- children: ["volumeBar"]
- },
- He.registerComponent("VolumeControl", Os);
- var Ns = function(i) {
- function e(e, t) {
- var n;
- return n = i.call(this, e, t) || this,
- Ut(Ve(n), e),
- n.on(e, ["loadstart", "volumechange"], n.update),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-mute-control " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.handleClick = function(e) {
- var t = this.player_.volume()
- , n = this.player_.lastVolume_();
- if (0 === t) {
- var i = n < .1 ? .1 : n;
- this.player_.volume(i),
- this.player_.muted(!1)
- } else
- this.player_.muted(!this.player_.muted())
- }
- ,
- t.update = function(e) {
- this.updateIcon_(),
- this.updateControlText_()
- }
- ,
- t.updateIcon_ = function() {
- var e = this.player_.volume()
- , t = 3;
- ht && this.player_.tech_ && this.player_.tech_.el_ && this.player_.muted(this.player_.tech_.el_.muted),
- 0 === e || this.player_.muted() ? t = 0 : e < .33 ? t = 1 : e < .67 && (t = 2);
- for (var n = 0; n < 4; n++)
- I(this.el_, "vjs-vol-" + n);
- L(this.el_, "vjs-vol-" + t)
- }
- ,
- t.updateControlText_ = function() {
- var e = this.player_.muted() || 0 === this.player_.volume() ? "Unmute" : "Mute";
- this.controlText() !== e && this.controlText(e)
- }
- ,
- e
- }(Qt);
- Ns.prototype.controlText_ = "Mute",
- He.registerComponent("MuteToggle", Ns);
- var Ds = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- "undefined" != typeof t.inline ? t.inline = t.inline : t.inline = !0,
- "undefined" != typeof t.volumeControl && !c(t.volumeControl) || (t.volumeControl = t.volumeControl || {},
- t.volumeControl.vertical = !t.inline),
- (n = i.call(this, e, t) || this).on(e, ["loadstart"], n.volumePanelState_),
- n.on(n.muteToggle, "keyup", n.handleKeyPress),
- n.on(n.volumeControl, "keyup", n.handleVolumeControlKeyUp),
- n.on("keydown", n.handleKeyPress),
- n.on("mouseover", n.handleMouseOver),
- n.on("mouseout", n.handleMouseOut),
- n.on(n.volumeControl, ["slideractive"], n.sliderActive_),
- n.on(n.volumeControl, ["sliderinactive"], n.sliderInactive_),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.sliderActive_ = function() {
- this.addClass("vjs-slider-active")
- }
- ,
- t.sliderInactive_ = function() {
- this.removeClass("vjs-slider-active")
- }
- ,
- t.volumePanelState_ = function() {
- this.volumeControl.hasClass("vjs-hidden") && this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-hidden"),
- this.volumeControl.hasClass("vjs-hidden") && !this.muteToggle.hasClass("vjs-hidden") && this.addClass("vjs-mute-toggle-only")
- }
- ,
- t.createEl = function() {
- var e = "vjs-volume-panel-horizontal";
- return this.options_.inline || (e = "vjs-volume-panel-vertical"),
- i.prototype.createEl.call(this, "div", {
- className: "vjs-volume-panel vjs-control " + e
- })
- }
- ,
- t.dispose = function() {
- this.handleMouseOut(),
- i.prototype.dispose.call(this)
- }
- ,
- t.handleVolumeControlKeyUp = function(e) {
- Mt.isEventKey(e, "Esc") && this.muteToggle.focus()
- }
- ,
- t.handleMouseOver = function(e) {
- this.addClass("vjs-hover"),
- ge(f, "keyup", Te(this, this.handleKeyPress))
- }
- ,
- t.handleMouseOut = function(e) {
- this.removeClass("vjs-hover"),
- ye(f, "keyup", Te(this, this.handleKeyPress))
- }
- ,
- t.handleKeyPress = function(e) {
- Mt.isEventKey(e, "Esc") && this.handleMouseOut()
- }
- ,
- e
- }(He);
- Ds.prototype.options_ = {
- children: ["muteToggle", "volumeControl"]
- },
- He.registerComponent("VolumePanel", Ds);
- var Bs = function(l) {
- function e(e, t) {
- var i, n = t.track, r = e.textTracks();
- t.label = n.label || n.language || "Unknown",
- t.selected = "showing" === n.mode,
- (i = l.call(this, e, t) || this).track = n,
- i.kinds = (t.kinds || [t.kind || i.track.kind]).filter(Boolean);
- function s() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- i.handleTracksChange.apply(Ve(i), t)
- }
- function a() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- i.handleSelectedLanguageChange.apply(Ve(i), t)
- }
- var o;
- e.on(["loadstart", "texttrackchange"], s),
- r.addEventListener("change", s),
- r.addEventListener("selectedlanguagechange", a),
- i.on("dispose", function() {
- e.off(["loadstart", "texttrackchange"], s),
- r.removeEventListener("change", s),
- r.removeEventListener("selectedlanguagechange", a)
- }),
- void 0 === r.onchange && i.on(["tap", "click"], function() {
- if ("object" != typeof p.Event)
- try {
- o = new p.Event("change")
- } catch (e) {}
- o || (o = f.createEvent("Event")).initEvent("change", !0, !0),
- r.dispatchEvent(o)
- });
- return i.handleTracksChange(),
- i
- }
- We(e, l);
- var t = e.prototype;
- return t.handleClick = function(e) {
- var t = this.track
- , n = this.player_.textTracks();
- if (l.prototype.handleClick.call(this, e),
- n)
- for (var i = 0; i < n.length; i++) {
- var r = n[i];
- -1 !== this.kinds.indexOf(r.kind) && (r === t ? "showing" !== r.mode && (r.mode = "showing") : "disabled" !== r.mode && (r.mode = "disabled"))
- }
- }
- ,
- t.handleTracksChange = function(e) {
- var t = "showing" === this.track.mode;
- t !== this.isSelected_ && this.selected(t)
- }
- ,
- t.handleSelectedLanguageChange = function(e) {
- if ("showing" === this.track.mode) {
- var t = this.player_.cache_.selectedLanguage;
- if (t && t.enabled && t.language === this.track.language && t.kind !== this.track.kind)
- return;
- this.player_.cache_.selectedLanguage = {
- enabled: !0,
- language: this.track.language,
- kind: this.track.kind
- }
- }
- }
- ,
- t.dispose = function() {
- this.track = null,
- l.prototype.dispose.call(this)
- }
- ,
- e
- }(Qr);
- He.registerComponent("TextTrackMenuItem", Bs);
- var Rs = function(n) {
- function e(e, t) {
- return t.track = {
- player: e,
- kind: t.kind,
- kinds: t.kinds,
- default: !1,
- mode: "disabled"
- },
- t.kinds || (t.kinds = [t.kind]),
- t.label ? t.track.label = t.label : t.track.label = t.kinds.join(" and ") + " off",
- t.selectable = !0,
- t.multiSelectable = !1,
- n.call(this, e, t) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.handleTracksChange = function(e) {
- for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
- var s = t[i];
- if (-1 < this.options_.kinds.indexOf(s.kind) && "showing" === s.mode) {
- n = !1;
- break
- }
- }
- n !== this.isSelected_ && this.selected(n)
- }
- ,
- t.handleSelectedLanguageChange = function(e) {
- for (var t = this.player().textTracks(), n = !0, i = 0, r = t.length; i < r; i++) {
- var s = t[i];
- if (-1 < ["captions", "descriptions", "subtitles"].indexOf(s.kind) && "showing" === s.mode) {
- n = !1;
- break
- }
- }
- n && (this.player_.cache_.selectedLanguage = {
- enabled: !1
- })
- }
- ,
- e
- }(Bs);
- He.registerComponent("OffTextTrackMenuItem", Rs);
- var Fs = function(n) {
- function e(e, t) {
- return void 0 === t && (t = {}),
- t.tracks = e.textTracks(),
- n.call(this, e, t) || this
- }
- return We(e, n),
- e.prototype.createItems = function(e, t) {
- var n;
- void 0 === e && (e = []),
- void 0 === t && (t = Bs),
- this.label_ && (n = this.label_ + " off"),
- e.push(new Rs(this.player_,{
- kinds: this.kinds_,
- kind: this.kind_,
- label: n
- })),
- this.hideThreshold_ += 1;
- var i = this.player_.textTracks();
- Array.isArray(this.kinds_) || (this.kinds_ = [this.kind_]);
- for (var r = 0; r < i.length; r++) {
- var s = i[r];
- if (-1 < this.kinds_.indexOf(s.kind)) {
- var a = new t(this.player_,{
- track: s,
- kinds: this.kinds_,
- kind: this.kind_,
- selectable: !0,
- multiSelectable: !1
- });
- a.addClass("vjs-" + s.kind + "-menu-item"),
- e.push(a)
- }
- }
- return e
- }
- ,
- e
- }(ss);
- He.registerComponent("TextTrackButton", Fs);
- var Hs = function(a) {
- function e(e, t) {
- var n, i = t.track, r = t.cue, s = e.currentTime();
- return t.selectable = !0,
- t.multiSelectable = !1,
- t.label = r.text,
- t.selected = r.startTime <= s && s < r.endTime,
- (n = a.call(this, e, t) || this).track = i,
- n.cue = r,
- i.addEventListener("cuechange", Te(Ve(n), n.update)),
- n
- }
- We(e, a);
- var t = e.prototype;
- return t.handleClick = function(e) {
- a.prototype.handleClick.call(this),
- this.player_.currentTime(this.cue.startTime),
- this.update(this.cue.startTime)
- }
- ,
- t.update = function(e) {
- var t = this.cue
- , n = this.player_.currentTime();
- this.selected(t.startTime <= n && n < t.endTime)
- }
- ,
- e
- }(Qr);
- He.registerComponent("ChaptersTrackMenuItem", Hs);
- var Vs = function(i) {
- function e(e, t, n) {
- return i.call(this, e, t, n) || this
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-chapters-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-chapters-button " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.update = function(e) {
- this.track_ && (!e || "addtrack" !== e.type && "removetrack" !== e.type) || this.setTrack(this.findChaptersTrack()),
- i.prototype.update.call(this)
- }
- ,
- t.setTrack = function(e) {
- if (this.track_ !== e) {
- if (this.updateHandler_ || (this.updateHandler_ = this.update.bind(this)),
- this.track_) {
- var t = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
- t && t.removeEventListener("load", this.updateHandler_),
- this.track_ = null
- }
- if (this.track_ = e,
- this.track_) {
- this.track_.mode = "hidden";
- var n = this.player_.remoteTextTrackEls().getTrackElementByTrack_(this.track_);
- n && n.addEventListener("load", this.updateHandler_)
- }
- }
- }
- ,
- t.findChaptersTrack = function() {
- for (var e = this.player_.textTracks() || [], t = e.length - 1; 0 <= t; t--) {
- var n = e[t];
- if (n.kind === this.kind_)
- return n
- }
- }
- ,
- t.getMenuCaption = function() {
- return this.track_ && this.track_.label ? this.track_.label : this.localize(Re(this.kind_))
- }
- ,
- t.createMenu = function() {
- return this.options_.title = this.getMenuCaption(),
- i.prototype.createMenu.call(this)
- }
- ,
- t.createItems = function() {
- var e = [];
- if (!this.track_)
- return e;
- var t = this.track_.cues;
- if (!t)
- return e;
- for (var n = 0, i = t.length; n < i; n++) {
- var r = t[n]
- , s = new Hs(this.player_,{
- track: this.track_,
- cue: r
- });
- e.push(s)
- }
- return e
- }
- ,
- e
- }(Fs);
- Vs.prototype.kind_ = "chapters",
- Vs.prototype.controlText_ = "Chapters",
- He.registerComponent("ChaptersButton", Vs);
- var Qs = function(a) {
- function e(e, t, n) {
- var i;
- i = a.call(this, e, t, n) || this;
- var r = e.textTracks()
- , s = Te(Ve(i), i.handleTracksChange);
- return r.addEventListener("change", s),
- i.on("dispose", function() {
- r.removeEventListener("change", s)
- }),
- i
- }
- We(e, a);
- var t = e.prototype;
- return t.handleTracksChange = function(e) {
- for (var t = this.player().textTracks(), n = !1, i = 0, r = t.length; i < r; i++) {
- var s = t[i];
- if (s.kind !== this.kind_ && "showing" === s.mode) {
- n = !0;
- break
- }
- }
- n ? this.disable() : this.enable()
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-descriptions-button " + a.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-descriptions-button " + a.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- e
- }(Fs);
- Qs.prototype.kind_ = "descriptions",
- Qs.prototype.controlText_ = "Descriptions",
- He.registerComponent("DescriptionsButton", Qs);
- var Us = function(i) {
- function e(e, t, n) {
- return i.call(this, e, t, n) || this
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-subtitles-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-subtitles-button " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- e
- }(Fs);
- Us.prototype.kind_ = "subtitles",
- Us.prototype.controlText_ = "Subtitles",
- He.registerComponent("SubtitlesButton", Us);
- var qs = function(i) {
- function e(e, t) {
- var n;
- return t.track = {
- player: e,
- kind: t.kind,
- label: t.kind + " settings",
- selectable: !1,
- default: !1,
- mode: "disabled"
- },
- t.selectable = !1,
- t.name = "CaptionSettingsMenuItem",
- (n = i.call(this, e, t) || this).addClass("vjs-texttrack-settings"),
- n.controlText(", opens " + t.kind + " settings dialog"),
- n
- }
- return We(e, i),
- e.prototype.handleClick = function(e) {
- this.player().getChild("textTrackSettings").open()
- }
- ,
- e
- }(Bs);
- He.registerComponent("CaptionSettingsMenuItem", qs);
- var zs = function(i) {
- function e(e, t, n) {
- return i.call(this, e, t, n) || this
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-captions-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-captions-button " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createItems = function() {
- var e = [];
- return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
- kind: this.kind_
- })),
- this.hideThreshold_ += 1),
- i.prototype.createItems.call(this, e)
- }
- ,
- e
- }(Fs);
- zs.prototype.kind_ = "captions",
- zs.prototype.controlText_ = "Captions",
- He.registerComponent("CaptionsButton", zs);
- var Ws = function(r) {
- function e() {
- return r.apply(this, arguments) || this
- }
- return We(e, r),
- e.prototype.createEl = function(e, t, n) {
- var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label);
- 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 "),
- i += "</span>",
- r.prototype.createEl.call(this, e, b({
- innerHTML: i
- }, t), n)
- }
- ,
- e
- }(Bs);
- He.registerComponent("SubsCapsMenuItem", Ws);
- var Ks = function(i) {
- function e(e, t) {
- var n;
- return void 0 === t && (t = {}),
- (n = i.call(this, e, t) || this).label_ = "subtitles",
- -1 < ["en", "en-us", "en-ca", "fr-ca"].indexOf(n.player_.language_) && (n.label_ = "captions"),
- n.menuButton_.controlText(Re(n.label_)),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-subs-caps-button " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-subs-caps-button " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createItems = function() {
- var e = [];
- return this.player().tech_ && this.player().tech_.featuresNativeTextTracks || !this.player().getChild("textTrackSettings") || (e.push(new qs(this.player_,{
- kind: this.label_
- })),
- this.hideThreshold_ += 1),
- e = i.prototype.createItems.call(this, e, Ws)
- }
- ,
- e
- }(Fs);
- Ks.prototype.kinds_ = ["captions", "subtitles"],
- Ks.prototype.controlText_ = "Subtitles",
- He.registerComponent("SubsCapsButton", Ks);
- var Xs = function(a) {
- function e(e, t) {
- var i, n = t.track, r = e.audioTracks();
- t.label = n.label || n.language || "Unknown",
- t.selected = n.enabled,
- (i = a.call(this, e, t) || this).track = n,
- i.addClass("vjs-" + n.kind + "-menu-item");
- function s() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- i.handleTracksChange.apply(Ve(i), t)
- }
- return r.addEventListener("change", s),
- i.on("dispose", function() {
- r.removeEventListener("change", s)
- }),
- i
- }
- We(e, a);
- var t = e.prototype;
- return t.createEl = function(e, t, n) {
- var i = '<span class="vjs-menu-item-text">' + this.localize(this.options_.label);
- 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 "),
- i += "</span>",
- a.prototype.createEl.call(this, e, b({
- innerHTML: i
- }, t), n)
- }
- ,
- t.handleClick = function(e) {
- var t = this.player_.audioTracks();
- a.prototype.handleClick.call(this, e);
- for (var n = 0; n < t.length; n++) {
- var i = t[n];
- i.enabled = i === this.track
- }
- }
- ,
- t.handleTracksChange = function(e) {
- this.selected(this.track.enabled)
- }
- ,
- e
- }(Qr);
- He.registerComponent("AudioTrackMenuItem", Xs);
- var Gs = function(n) {
- function e(e, t) {
- return void 0 === t && (t = {}),
- t.tracks = e.audioTracks(),
- n.call(this, e, t) || this
- }
- We(e, n);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-audio-button " + n.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-audio-button " + n.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createItems = function(e) {
- void 0 === e && (e = []),
- this.hideThreshold_ = 1;
- for (var t = this.player_.audioTracks(), n = 0; n < t.length; n++) {
- var i = t[n];
- e.push(new Xs(this.player_,{
- track: i,
- selectable: !0,
- multiSelectable: !1
- }))
- }
- return e
- }
- ,
- e
- }(ss);
- Gs.prototype.controlText_ = "Audio Track",
- He.registerComponent("AudioTrackButton", Gs);
- var Ys = function(s) {
- function e(e, t) {
- var n, i = t.rate, r = parseFloat(i, 10);
- return t.label = i,
- t.selected = 1 === r,
- t.selectable = !0,
- t.multiSelectable = !1,
- (n = s.call(this, e, t) || this).label = i,
- n.rate = r,
- n.on(e, "ratechange", n.update),
- n
- }
- We(e, s);
- var t = e.prototype;
- return t.handleClick = function(e) {
- s.prototype.handleClick.call(this),
- this.player().playbackRate(this.rate)
- }
- ,
- t.update = function(e) {
- this.selected(this.player().playbackRate() === this.rate)
- }
- ,
- e
- }(Qr);
- Ys.prototype.contentElType = "button",
- He.registerComponent("PlaybackRateMenuItem", Ys);
- var $s = function(i) {
- function e(e, t) {
- var n;
- return (n = i.call(this, e, t) || this).updateVisibility(),
- n.updateLabel(),
- n.on(e, "loadstart", n.updateVisibility),
- n.on(e, "ratechange", n.updateLabel),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.createEl = function() {
- var e = i.prototype.createEl.call(this);
- return "en" === this.player().language() ? this.labelEl_ = w("div", {
- className: "vjs-playback-rate-value",
- innerHTML: "1x"
- }) : (this.player().language(),
- this.labelEl_ = w("div", {
- className: "vjs-playback-rate-value",
- innerHTML: "倍速"
- })),
- e.appendChild(this.labelEl_),
- e
- }
- ,
- t.dispose = function() {
- this.labelEl_ = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.buildCSSClass = function() {
- return "vjs-playback-rate " + i.prototype.buildCSSClass.call(this)
- }
- ,
- t.buildWrapperCSSClass = function() {
- return "vjs-playback-rate " + i.prototype.buildWrapperCSSClass.call(this)
- }
- ,
- t.createMenu = function() {
- var e = new Fr(this.player())
- , t = this.playbackRates();
- if (t)
- for (var n = t.length - 1; 0 <= n; n--)
- e.addChild(new Ys(this.player(),{
- rate: t[n] + "x"
- }));
- return e
- }
- ,
- t.updateARIAAttributes = function() {
- this.el().setAttribute("aria-valuenow", this.player().playbackRate())
- }
- ,
- t.handleClick = function(e) {}
- ,
- t.playbackRates = function() {
- return this.options_.playbackRates || this.options_.playerOptions && this.options_.playerOptions.playbackRates
- }
- ,
- t.playbackRateSupported = function() {
- return this.player().tech_ && this.player().tech_.featuresPlaybackRate && this.playbackRates() && 0 < this.playbackRates().length
- }
- ,
- t.updateVisibility = function(e) {
- this.playbackRateSupported() ? this.removeClass("vjs-hidden") : this.addClass("vjs-hidden")
- }
- ,
- t.updateLabel = function(e) {
- this.playbackRateSupported() && ("en" === this.player().language() ? this.labelEl_.innerHTML = this.player().playbackRate() + "x" : this.labelEl_.innerHTML = "倍速")
- }
- ,
- e
- }(Hr);
- $s.prototype.controlText_ = "Playback Rate",
- He.registerComponent("PlaybackRateMenuButton", $s);
- var Js = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- We(t, e);
- var n = t.prototype;
- return n.buildCSSClass = function() {
- return "vjs-spacer " + e.prototype.buildCSSClass.call(this)
- }
- ,
- n.createEl = function() {
- return e.prototype.createEl.call(this, "div", {
- className: this.buildCSSClass()
- })
- }
- ,
- t
- }(He);
- He.registerComponent("Spacer", Js);
- var Zs = function(t) {
- function e() {
- return t.apply(this, arguments) || this
- }
- We(e, t);
- var n = e.prototype;
- return n.buildCSSClass = function() {
- return "vjs-custom-control-spacer " + t.prototype.buildCSSClass.call(this)
- }
- ,
- n.createEl = function() {
- var e = t.prototype.createEl.call(this, {
- className: this.buildCSSClass()
- });
- return e.innerHTML = " ",
- e
- }
- ,
- e
- }(Js);
- He.registerComponent("CustomControlSpacer", Zs);
- var ea = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- return We(t, e),
- t.prototype.createEl = function() {
- return e.prototype.createEl.call(this, "div", {
- className: "vjs-control-bar",
- dir: "ltr"
- })
- }
- ,
- t
- }(He);
- ea.prototype.options_ = {
- children: ["playToggle", "nextPanel", "currentTimeDisplay", "timeDivider", "durationDisplay", "liveDisplay", "seekToLive", "remainingTimeDisplay", "customControlSpacer", "chooseVideoButton", "audioModeButton", "playbackRateMenuButton", "playbackQualityMenuButton", "playbackQualityMenuButton3", "descriptionsButton", "subsCapsButton", "audioTrackButton", "setupMenuButton", "volumePanel", "webfullscreenToggle", "fullscreenToggle", "progressControl"]
- },
- He.registerComponent("ControlBar", ea);
- var ta = function(r) {
- function e(e, t) {
- var n;
- (n = r.call(this, e, t) || this).on(e, "error", n.open);
- var i = e;
- return n.el().oncontextmenu = function(e) {
- return !0 === e.ctrlKey && e.altKey ? i.showContextMenu(e, !0) : !0 === e.ctrlKey && i.showContextMenu(e, !1),
- !1
- }
- ,
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.buildCSSClass = function() {
- return "vjs-error-display " + r.prototype.buildCSSClass.call(this)
- }
- ,
- t.content = function() {
- var e = this.player().error();
- return e ? "" + this.localize(e.message) : "无法继续播放"
- }
- ,
- t.fill = function() {
- r.prototype.fill.call(this)
- }
- ,
- t.description = function() {
- return ""
- }
- ,
- e
- }(Ot);
- ta.prototype.options_ = r({}, Ot.prototype.options_, {
- pauseOnOpen: !0,
- fillAlways: !0,
- temporary: !1,
- uncloseable: !0
- }),
- He.registerComponent("ErrorDisplay", ta);
- var na = "vjs-text-track-settings"
- , ia = ["#000", "Black"]
- , ra = ["#00F", "Blue"]
- , sa = ["#0FF", "Cyan"]
- , aa = ["#0F0", "Green"]
- , oa = ["#F0F", "Magenta"]
- , la = ["#F00", "Red"]
- , ua = ["#FFF", "White"]
- , ca = ["#FF0", "Yellow"]
- , ha = ["1", "Opaque"]
- , da = ["0.5", "Semi-Transparent"]
- , pa = ["0", "Transparent"]
- , fa = {
- backgroundColor: {
- selector: ".vjs-bg-color > select",
- id: "captions-background-color-%s",
- label: "Color",
- options: [ia, ua, la, aa, ra, ca, oa, sa]
- },
- backgroundOpacity: {
- selector: ".vjs-bg-opacity > select",
- id: "captions-background-opacity-%s",
- label: "Transparency",
- options: [ha, da, pa]
- },
- color: {
- selector: ".vjs-fg-color > select",
- id: "captions-foreground-color-%s",
- label: "Color",
- options: [ua, ia, la, aa, ra, ca, oa, sa]
- },
- edgeStyle: {
- selector: ".vjs-edge-style > select",
- id: "%s",
- label: "Text Edge Style",
- options: [["none", "None"], ["raised", "Raised"], ["depressed", "Depressed"], ["uniform", "Uniform"], ["dropshadow", "Dropshadow"]]
- },
- fontFamily: {
- selector: ".vjs-font-family > select",
- id: "captions-font-family-%s",
- label: "Font Family",
- options: [["proportionalSansSerif", "Proportional Sans-Serif"], ["monospaceSansSerif", "Monospace Sans-Serif"], ["proportionalSerif", "Proportional Serif"], ["monospaceSerif", "Monospace Serif"], ["casual", "Casual"], ["script", "Script"], ["small-caps", "Small Caps"]]
- },
- fontPercent: {
- selector: ".vjs-font-percent > select",
- id: "captions-font-size-%s",
- label: "Font Size",
- 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%"]],
- default: 2,
- parser: function(e) {
- return "1.00" === e ? null : Number(e)
- }
- },
- textOpacity: {
- selector: ".vjs-text-opacity > select",
- id: "captions-foreground-opacity-%s",
- label: "Transparency",
- options: [ha, da]
- },
- windowColor: {
- selector: ".vjs-window-color > select",
- id: "captions-window-color-%s",
- label: "Color"
- },
- windowOpacity: {
- selector: ".vjs-window-opacity > select",
- id: "captions-window-opacity-%s",
- label: "Transparency",
- options: [pa, da, ha]
- }
- };
- function va(e, t) {
- if (t && (e = t(e)),
- e && "none" !== e)
- return e
- }
- fa.windowColor.options = fa.backgroundColor.options;
- var ga = function(i) {
- function e(e, t) {
- var n;
- return t.temporary = !1,
- (n = i.call(this, e, t) || this).updateDisplay = Te(Ve(n), n.updateDisplay),
- n.fill(),
- n.hasBeenOpened_ = n.hasBeenFilled_ = !0,
- n.endDialog = w("p", {
- className: "vjs-control-text",
- textContent: n.localize("End of dialog window.")
- }),
- n.el().appendChild(n.endDialog),
- n.setDefaults(),
- void 0 === t.persistTextTrackSettings && (n.options_.persistTextTrackSettings = n.options_.playerOptions.persistTextTrackSettings),
- n.on(n.$(".vjs-done-button"), "click", function() {
- n.saveSettings(),
- n.close()
- }),
- n.on(n.$(".vjs-default-button"), "click", function() {
- n.setDefaults(),
- n.updateDisplay()
- }),
- a(fa, function(e) {
- n.on(n.$(e.selector), "change", n.updateDisplay)
- }),
- n.options_.persistTextTrackSettings && n.restoreSettings(),
- n
- }
- We(e, i);
- var t = e.prototype;
- return t.dispose = function() {
- this.endDialog = null,
- i.prototype.dispose.call(this)
- }
- ,
- t.createElSelect_ = function(e, t, n) {
- var i = this;
- void 0 === t && (t = ""),
- void 0 === n && (n = "label");
- var r = fa[e]
- , s = r.id.replace("%s", this.id_)
- , a = [t, s].join(" ").trim();
- return ["<" + n + ' id="' + s + '" class="' + ("label" === n ? "vjs-label" : "") + '">', this.localize(r.label), "</" + n + ">", '<select aria-labelledby="' + a + '">'].concat(r.options.map(function(e) {
- var t = s + "-" + e[1].replace(/\W+/g, "");
- return ['<option id="' + t + '" value="' + e[0] + '" ', 'aria-labelledby="' + a + " " + t + '">', i.localize(e[1]), "</option>"].join("")
- })).concat("</select>").join("")
- }
- ,
- t.createElFgColor_ = function() {
- var e = "captions-text-legend-" + this.id_;
- 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("")
- }
- ,
- t.createElBgColor_ = function() {
- var e = "captions-background-" + this.id_;
- 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("")
- }
- ,
- t.createElWinColor_ = function() {
- var e = "captions-window-" + this.id_;
- 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("")
- }
- ,
- t.createElColors_ = function() {
- return w("div", {
- className: "vjs-track-settings-colors",
- innerHTML: [this.createElFgColor_(), this.createElBgColor_(), this.createElWinColor_()].join("")
- })
- }
- ,
- t.createElFont_ = function() {
- return w("div", {
- className: "vjs-track-settings-font",
- 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("")
- })
- }
- ,
- t.createElControls_ = function() {
- var e = this.localize("restore all settings to the default values");
- return w("div", {
- className: "vjs-track-settings-controls",
- 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("")
- })
- }
- ,
- t.content = function() {
- return [this.createElColors_(), this.createElFont_(), this.createElControls_()]
- }
- ,
- t.label = function() {
- return this.localize("Caption Settings Dialog")
- }
- ,
- t.description = function() {
- return this.localize("Beginning of dialog window. Escape will cancel and close the window.")
- }
- ,
- t.buildCSSClass = function() {
- return i.prototype.buildCSSClass.call(this) + " vjs-text-track-settings"
- }
- ,
- t.getValues = function() {
- var r = this;
- return o(fa, function(e, t, n) {
- var i = function(e, t) {
- return va(e.options[e.options.selectedIndex].value, t)
- }(r.$(t.selector), t.parser);
- return void 0 !== i && (e[n] = i),
- e
- }, {})
- }
- ,
- t.setValues = function(n) {
- var i = this;
- a(fa, function(e, t) {
- !function(e, t, n) {
- if (t)
- for (var i = 0; i < e.options.length; i++)
- if (va(e.options[i].value, n) === t) {
- e.selectedIndex = i;
- break
- }
- }(i.$(e.selector), n[t], e.parser)
- })
- }
- ,
- t.setDefaults = function() {
- var n = this;
- a(fa, function(e) {
- var t = e.hasOwnProperty("default") ? e.default : 0;
- n.$(e.selector).selectedIndex = t
- })
- }
- ,
- t.restoreSettings = function() {
- var e;
- try {
- e = JSON.parse(p.localStorage.getItem(na))
- } catch (e) {
- m.warn(e)
- }
- e && this.setValues(e)
- }
- ,
- t.saveSettings = function() {
- if (this.options_.persistTextTrackSettings) {
- var e = this.getValues();
- try {
- Object.keys(e).length ? p.localStorage.setItem(na, JSON.stringify(e)) : p.localStorage.removeItem(na)
- } catch (e) {
- m.warn(e)
- }
- }
- }
- ,
- t.updateDisplay = function() {
- var e = this.player_.getChild("textTrackDisplay");
- e && e.updateDisplay()
- }
- ,
- t.conditionalBlur_ = function() {
- this.previouslyActiveEl_ = null;
- var e = this.player_.controlBar
- , t = e && e.subsCapsButton
- , n = e && e.captionsButton;
- t ? t.focus() : n && n.focus()
- }
- ,
- e
- }(Ot);
- He.registerComponent("TextTrackSettings", ga);
- var ya = function(s) {
- function e(e, t) {
- var n, i = t.ResizeObserver || p.ResizeObserver;
- null === t.ResizeObserver && (i = !1);
- var r = Fe({
- createEl: !i,
- reportTouchActivity: !1
- }, t);
- return (n = s.call(this, e, r) || this).ResizeObserver = t.ResizeObserver || p.ResizeObserver,
- n.loadListener_ = null,
- n.resizeObserver_ = null,
- n.debouncedHandler_ = function(i, r, s, a) {
- var o;
- void 0 === a && (a = p);
- function e() {
- var e = this
- , t = arguments
- , n = function() {
- n = o = null,
- s || i.apply(e, t)
- };
- !o && s && i.apply(e, t),
- a.clearTimeout(o),
- o = a.setTimeout(n, r)
- }
- return e.cancel = function() {
- a.clearTimeout(o),
- o = null
- }
- ,
- e
- }(function() {
- n.resizeHandler()
- }, 100, !1, Ve(n)),
- i ? (n.resizeObserver_ = new n.ResizeObserver(n.debouncedHandler_),
- n.resizeObserver_.observe(e.el())) : (n.loadListener_ = function() {
- if (n.el_ && n.el_.contentWindow) {
- var e = n.debouncedHandler_
- , t = n.unloadListener_ = function() {
- ye(this, "resize", e),
- ye(this, "unload", t),
- t = null
- }
- ;
- ge(n.el_.contentWindow, "unload", t),
- ge(n.el_.contentWindow, "resize", e)
- }
- }
- ,
- n.one("load", n.loadListener_)),
- n
- }
- We(e, s);
- var t = e.prototype;
- return t.createEl = function() {
- return s.prototype.createEl.call(this, "iframe", {
- className: "vjs-resize-manager",
- tabIndex: -1
- }, {
- "aria-hidden": "true"
- })
- }
- ,
- t.resizeHandler = function() {
- this.player_ && this.player_.trigger && this.player_.trigger("playerresize")
- }
- ,
- t.dispose = function() {
- this.debouncedHandler_ && this.debouncedHandler_.cancel(),
- this.resizeObserver_ && (this.player_.el() && this.resizeObserver_.unobserve(this.player_.el()),
- this.resizeObserver_.disconnect()),
- this.loadListener_ && this.off("load", this.loadListener_),
- this.el_ && this.el_.contentWindow && this.unloadListener_ && this.unloadListener_.call(this.el_.contentWindow),
- this.ResizeObserver = null,
- this.resizeObserver = null,
- this.debouncedHandler_ = null,
- this.loadListener_ = null,
- s.prototype.dispose.call(this)
- }
- ,
- e
- }(He);
- He.registerComponent("ResizeManager", ya);
- var ma = {
- trackingThreshold: 30,
- liveTolerance: 15
- }
- , _a = function(r) {
- function e(e, t) {
- var n, i = Fe(ma, t, {
- createEl: !1
- });
- return (n = r.call(this, e, i) || this).reset_(),
- n.on(n.player_, "durationchange", n.handleDurationchange),
- st && "hidden"in f && "visibilityState"in f && n.on(f, "visibilitychange", n.handleVisibilityChange),
- n
- }
- We(e, r);
- var t = e.prototype;
- return t.handleVisibilityChange = function() {
- this.player_.duration() === 1 / 0 && (f.hidden ? this.stopTracking() : this.startTracking())
- }
- ,
- t.trackLive_ = function() {
- var e = this.player_.seekable();
- if (e && e.length) {
- var t = Number(p.performance.now().toFixed(4))
- , n = -1 === this.lastTime_ ? 0 : (t - this.lastTime_) / 1e3;
- this.lastTime_ = t,
- this.pastSeekEnd_ = this.pastSeekEnd() + n;
- var i = this.liveCurrentTime()
- , r = this.player_.currentTime()
- , s = this.player_.paused() || this.seekedBehindLive_ || Math.abs(i - r) > this.options_.liveTolerance;
- this.timeupdateSeen_ && i !== 1 / 0 || (s = !1),
- s !== this.behindLiveEdge_ && (this.behindLiveEdge_ = s,
- this.trigger("liveedgechange"))
- }
- }
- ,
- t.handleDurationchange = function() {
- this.player_.duration() === 1 / 0 && this.liveWindow() >= this.options_.trackingThreshold ? (this.player_.options_.liveui && this.player_.addClass("vjs-liveui"),
- this.startTracking()) : (this.player_.removeClass("vjs-liveui"),
- this.stopTracking())
- }
- ,
- t.startTracking = function() {
- this.isTracking() || (this.timeupdateSeen_ || (this.timeupdateSeen_ = this.player_.hasStarted()),
- this.trackingInterval_ = this.setInterval(this.trackLive_, 30),
- this.trackLive_(),
- this.on(this.player_, ["play", "pause"], this.trackLive_),
- this.timeupdateSeen_ ? this.on(this.player_, "seeked", this.handleSeeked) : (this.one(this.player_, "play", this.handlePlay),
- this.one(this.player_, "timeupdate", this.handleFirstTimeupdate)))
- }
- ,
- t.handleFirstTimeupdate = function() {
- this.timeupdateSeen_ = !0,
- this.on(this.player_, "seeked", this.handleSeeked)
- }
- ,
- t.handleSeeked = function() {
- var e = Math.abs(this.liveCurrentTime() - this.player_.currentTime());
- this.seekedBehindLive_ = !this.skipNextSeeked_ && 2 < e,
- this.skipNextSeeked_ = !1,
- this.trackLive_()
- }
- ,
- t.handlePlay = function() {
- this.one(this.player_, "timeupdate", this.seekToLiveEdge)
- }
- ,
- t.reset_ = function() {
- this.lastTime_ = -1,
- this.pastSeekEnd_ = 0,
- this.lastSeekEnd_ = -1,
- this.behindLiveEdge_ = !0,
- this.timeupdateSeen_ = !1,
- this.seekedBehindLive_ = !1,
- this.skipNextSeeked_ = !1,
- this.clearInterval(this.trackingInterval_),
- this.trackingInterval_ = null,
- this.off(this.player_, ["play", "pause"], this.trackLive_),
- this.off(this.player_, "seeked", this.handleSeeked),
- this.off(this.player_, "play", this.handlePlay),
- this.off(this.player_, "timeupdate", this.handleFirstTimeupdate),
- this.off(this.player_, "timeupdate", this.seekToLiveEdge)
- }
- ,
- t.stopTracking = function() {
- this.isTracking() && (this.reset_(),
- this.trigger("liveedgechange"))
- }
- ,
- t.seekableEnd = function() {
- for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
- t.push(e.end(n));
- return t.length ? t.sort()[t.length - 1] : 1 / 0
- }
- ,
- t.seekableStart = function() {
- for (var e = this.player_.seekable(), t = [], n = e ? e.length : 0; n--; )
- t.push(e.start(n));
- return t.length ? t.sort()[0] : 0
- }
- ,
- t.liveWindow = function() {
- var e = this.liveCurrentTime();
- return e === 1 / 0 ? 1 / 0 : e - this.seekableStart()
- }
- ,
- t.isLive = function() {
- return this.isTracking()
- }
- ,
- t.atLiveEdge = function() {
- return !this.behindLiveEdge()
- }
- ,
- t.liveCurrentTime = function() {
- return this.pastSeekEnd() + this.seekableEnd()
- }
- ,
- t.pastSeekEnd = function() {
- var e = this.seekableEnd();
- return -1 !== this.lastSeekEnd_ && e !== this.lastSeekEnd_ && (this.pastSeekEnd_ = 0),
- this.lastSeekEnd_ = e,
- this.pastSeekEnd_
- }
- ,
- t.behindLiveEdge = function() {
- return this.behindLiveEdge_
- }
- ,
- t.isTracking = function() {
- return "number" == typeof this.trackingInterval_
- }
- ,
- t.seekToLiveEdge = function() {
- this.seekedBehindLive_ = !1,
- this.atLiveEdge() || (this.skipNextSeeked_ = !0,
- this.player_.currentTime(this.liveCurrentTime()))
- }
- ,
- t.dispose = function() {
- this.off(f, "visibilitychange", this.handleVisibilityChange),
- this.stopTracking(),
- r.prototype.dispose.call(this)
- }
- ,
- e
- }(He);
- He.registerComponent("LiveTracker", _a);
- function ba(e) {
- var t = e.el();
- if (t.hasAttribute("src"))
- return e.triggerSourceset(t.src),
- !0;
- var n = e.$$("source")
- , i = []
- , r = "";
- if (!n.length)
- return !1;
- for (var s = 0; s < n.length; s++) {
- var a = n[s].src;
- a && -1 === i.indexOf(a) && i.push(a)
- }
- return !!i.length && (1 === i.length && (r = i[0]),
- e.triggerSourceset(r),
- !0)
- }
- function Ta(e, t) {
- for (var n = {}, i = 0; i < e.length && !((n = Object.getOwnPropertyDescriptor(e[i], t)) && n.set && n.get); i++)
- ;
- return n.enumerable = !0,
- n.configurable = !0,
- n
- }
- function Ca(s) {
- var a = s.el();
- if (!a.resetSourceWatch_) {
- var t = {}
- , e = function(e) {
- return Ta([e.el(), p.HTMLMediaElement.prototype, p.Element.prototype, wa], "innerHTML")
- }(s)
- , n = function(r) {
- return function() {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- var i = r.apply(a, t);
- return ba(s),
- i
- }
- };
- ["append", "appendChild", "insertAdjacentHTML"].forEach(function(e) {
- a[e] && (t[e] = a[e],
- a[e] = n(t[e]))
- }),
- Object.defineProperty(a, "innerHTML", Fe(e, {
- set: n(e.set)
- })),
- a.resetSourceWatch_ = function() {
- a.resetSourceWatch_ = null,
- Object.keys(t).forEach(function(e) {
- a[e] = t[e]
- }),
- Object.defineProperty(a, "innerHTML", e)
- }
- ,
- s.one("sourceset", a.resetSourceWatch_)
- }
- }
- function ka(i) {
- if (i.featuresSourceset) {
- var r = i.el();
- if (!r.resetSourceset_) {
- var n = function(e) {
- return Ta([e.el(), p.HTMLMediaElement.prototype, xa], "src")
- }(i)
- , s = r.setAttribute
- , t = r.load;
- Object.defineProperty(r, "src", Fe(n, {
- set: function(e) {
- var t = n.set.call(r, e);
- return i.triggerSourceset(r.src),
- t
- }
- })),
- r.setAttribute = function(e, t) {
- var n = s.call(r, e, t);
- return /src/i.test(e) && i.triggerSourceset(r.src),
- n
- }
- ,
- r.load = function() {
- var e = t.call(r);
- return ba(i) || (i.triggerSourceset(""),
- Ca(i)),
- e
- }
- ,
- r.currentSrc ? i.triggerSourceset(r.currentSrc) : ba(i) || Ca(i),
- r.resetSourceset_ = function() {
- r.resetSourceset_ = null,
- r.load = t,
- r.setAttribute = s,
- Object.defineProperty(r, "src", n),
- r.resetSourceWatch_ && r.resetSourceWatch_()
- }
- }
- }
- }
- function Ea(t, n, i, e) {
- function r(e) {
- return Object.defineProperty(t, n, {
- value: e,
- enumerable: !0,
- writable: !0
- })
- }
- void 0 === e && (e = !0);
- var s = {
- configurable: !0,
- enumerable: !0,
- get: function() {
- var e = i();
- return r(e),
- e
- }
- };
- return e && (s.set = r),
- Object.defineProperty(t, n, s)
- }
- var Sa, wa = Object.defineProperty({}, "innerHTML", {
- get: function() {
- return this.cloneNode(!0).innerHTML
- },
- set: function(e) {
- var t = f.createElement(this.nodeName.toLowerCase());
- t.innerHTML = e;
- for (var n = f.createDocumentFragment(); t.childNodes.length; )
- n.appendChild(t.childNodes[0]);
- return this.innerText = "",
- p.Element.prototype.appendChild.call(this, n),
- this.innerHTML
- }
- }), xa = Object.defineProperty({}, "src", {
- get: function() {
- return this.hasAttribute("src") ? an(p.Element.prototype.getAttribute.call(this, "src")) : ""
- },
- set: function(e) {
- return p.Element.prototype.setAttribute.call(this, "src", e),
- e
- }
- }), Aa = function(c) {
- function o(e, t) {
- var n;
- n = c.call(this, e, t) || this;
- var i = e.source
- , r = !1;
- if (i && (n.el_.currentSrc !== i.src || e.tag && 3 === e.tag.initNetworkState_) ? n.setSource(i) : n.handleLateInit_(n.el_),
- e.enableSourceset && n.setupSourcesetHandling_(),
- n.el_.hasChildNodes()) {
- for (var s = n.el_.childNodes, a = s.length, o = []; a--; ) {
- var l = s[a];
- "track" === l.nodeName.toLowerCase() && (n.featuresNativeTextTracks ? (n.remoteTextTrackEls().addTrackElement_(l),
- n.remoteTextTracks().addTrack(l.track),
- n.textTracks().addTrack(l.track),
- r || n.el_.hasAttribute("crossorigin") || !ln(l.src) || (r = !0)) : o.push(l))
- }
- for (var u = 0; u < o.length; u++)
- n.el_.removeChild(o[u])
- }
- return n.proxyNativeTracks_(),
- 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."),
- n.restoreMetadataTracksInIOSNativePlayer_(),
- (lt || ct || et) && !0 === e.nativeControlsForTouch && n.setControls(!0),
- n.proxyWebkitFullscreen_(),
- n.triggerReady(),
- n
- }
- We(o, c);
- var e = o.prototype;
- return e.dispose = function() {
- this.el_ && this.el_.resetSourceset_ && this.el_.resetSourceset_(),
- o.disposeMediaElement(this.el_),
- this.options_ = null,
- c.prototype.dispose.call(this)
- }
- ,
- e.setupSourcesetHandling_ = function() {
- ka(this)
- }
- ,
- e.restoreMetadataTracksInIOSNativePlayer_ = function() {
- function e() {
- n = [];
- for (var e = 0; e < i.length; e++) {
- var t = i[e];
- "metadata" === t.kind && n.push({
- track: t,
- storedMode: t.mode
- })
- }
- }
- var n, i = this.textTracks();
- e(),
- i.addEventListener("change", e),
- this.on("dispose", function() {
- return i.removeEventListener("change", e)
- });
- function r() {
- for (var e = 0; e < n.length; e++) {
- var t = n[e];
- "disabled" === t.track.mode && t.track.mode !== t.storedMode && (t.track.mode = t.storedMode)
- }
- i.removeEventListener("change", r)
- }
- this.on("webkitbeginfullscreen", function() {
- i.removeEventListener("change", e),
- i.removeEventListener("change", r),
- i.addEventListener("change", r)
- }),
- this.on("webkitendfullscreen", function() {
- i.removeEventListener("change", e),
- i.addEventListener("change", e),
- i.removeEventListener("change", r)
- })
- }
- ,
- e.overrideNative_ = function(e, t) {
- var n = this;
- if (t === this["featuresNative" + e + "Tracks"]) {
- var i = e.toLowerCase();
- this[i + "TracksListeners_"] && Object.keys(this[i + "TracksListeners_"]).forEach(function(e) {
- n.el()[i + "Tracks"].removeEventListener(e, n[i + "TracksListeners_"][e])
- }),
- this["featuresNative" + e + "Tracks"] = !t,
- this[i + "TracksListeners_"] = null,
- this.proxyNativeTracksForType_(i)
- }
- }
- ,
- e.overrideNativeAudioTracks = function(e) {
- this.overrideNative_("Audio", e)
- }
- ,
- e.overrideNativeVideoTracks = function(e) {
- this.overrideNative_("Video", e)
- }
- ,
- e.proxyNativeTracksForType_ = function(n) {
- var i = this
- , e = On[n]
- , r = this.el()[e.getterName]
- , s = this[e.getterName]();
- if (this["featuresNative" + e.capitalName + "Tracks"] && r && r.addEventListener) {
- var a = {
- change: function(e) {
- var t = {
- type: "change",
- target: s,
- currentTarget: s,
- srcElement: s
- };
- s.trigger(t),
- "text" === n && i[Nn.remoteText.getterName]().trigger(t)
- },
- addtrack: function(e) {
- s.addTrack(e.track)
- },
- removetrack: function(e) {
- s.removeTrack(e.track)
- }
- }
- , t = function() {
- for (var e = [], t = 0; t < s.length; t++) {
- for (var n = !1, i = 0; i < r.length; i++)
- if (r[i] === s[t]) {
- n = !0;
- break
- }
- n || e.push(s[t])
- }
- for (; e.length; )
- s.removeTrack(e.shift())
- };
- this[e.getterName + "Listeners_"] = a,
- Object.keys(a).forEach(function(t) {
- var n = a[t];
- r.addEventListener(t, n),
- i.on("dispose", function(e) {
- return r.removeEventListener(t, n)
- })
- }),
- this.on("loadstart", t),
- this.on("dispose", function(e) {
- return i.off("loadstart", t)
- })
- }
- }
- ,
- e.proxyNativeTracks_ = function() {
- var t = this;
- On.names.forEach(function(e) {
- t.proxyNativeTracksForType_(e)
- })
- }
- ,
- e.createEl = function() {
- var e = this.options_.tag;
- if (!e || !this.options_.playerElIngest && !this.movingMediaElementInDOM) {
- if (e) {
- var t = e.cloneNode(!0);
- e.parentNode && e.parentNode.insertBefore(t, e),
- o.disposeMediaElement(e),
- e = t
- } else {
- e = f.createElement("video");
- var n = Fe({}, this.options_.tag && O(this.options_.tag));
- lt && !0 === this.options_.nativeControlsForTouch || delete n.controls,
- j(e, b(n, {
- id: this.options_.techId,
- class: "vjs-tech"
- }))
- }
- e.playerId = this.options_.playerId
- }
- "undefined" != typeof this.options_.preload && D(e, "preload", this.options_.preload);
- for (var i = ["loop", "muted", "playsinline", "autoplay"], r = 0; r < i.length; r++) {
- var s = i[r]
- , a = this.options_[s];
- "undefined" != typeof a && (a ? D(e, s, s) : B(e, s),
- e[s] = a)
- }
- return e
- }
- ,
- e.handleLateInit_ = function(e) {
- if (0 !== e.networkState && 3 !== e.networkState) {
- if (0 === e.readyState) {
- var t = !1
- , n = function() {
- t = !0
- };
- this.on("loadstart", n);
- var i = function() {
- t || this.trigger("loadstart")
- };
- return this.on("loadedmetadata", i),
- void this.ready(function() {
- this.off("loadstart", n),
- this.off("loadedmetadata", i),
- t || this.trigger("loadstart")
- })
- }
- var r = ["loadstart"];
- r.push("loadedmetadata"),
- 2 <= e.readyState && r.push("loadeddata"),
- 3 <= e.readyState && r.push("canplay"),
- 4 <= e.readyState && r.push("canplaythrough"),
- this.ready(function() {
- r.forEach(function(e) {
- this.trigger(e)
- }, this)
- })
- }
- }
- ,
- e.setCurrentTime = function(e) {
- try {
- this.el_.currentTime = e
- } catch (e) {
- m(e, "Video is not ready. (Video.js)")
- }
- }
- ,
- e.duration = function() {
- var t = this;
- if (this.el_.duration === 1 / 0 && Je && it && 0 === this.el_.currentTime) {
- return this.on("timeupdate", function e() {
- 0 < t.el_.currentTime && (t.el_.duration === 1 / 0 && t.trigger("durationchange"),
- t.off("timeupdate", e))
- }),
- NaN
- }
- return this.el_.duration || NaN
- }
- ,
- e.width = function() {
- return this.el_.offsetWidth
- }
- ,
- e.height = function() {
- return this.el_.offsetHeight
- }
- ,
- e.proxyWebkitFullscreen_ = function() {
- var e = this;
- if ("webkitDisplayingFullscreen"in this.el_) {
- var t = function() {
- this.trigger("fullscreenchange", {
- isFullscreen: !1
- })
- }
- , n = function() {
- "webkitPresentationMode"in this.el_ && "picture-in-picture" !== this.el_.webkitPresentationMode && (this.one("webkitendfullscreen", t),
- this.trigger("fullscreenchange", {
- isFullscreen: !0
- }))
- };
- this.on("webkitbeginfullscreen", n),
- this.on("dispose", function() {
- e.off("webkitbeginfullscreen", n),
- e.off("webkitendfullscreen", t)
- })
- }
- }
- ,
- e.supportsFullScreen = function() {
- if ("function" == typeof this.el_.webkitEnterFullScreen) {
- var e = p.navigator && p.navigator.userAgent || "";
- if (/Android/.test(e) || !/Chrome|Mac OS X 10.5/.test(e))
- return !0
- }
- return !1
- }
- ,
- e.enterFullScreen = function() {
- var e = this.el_;
- if (e.paused && e.networkState <= e.HAVE_METADATA)
- At(this.el_.play()),
- this.setTimeout(function() {
- e.pause();
- try {
- e.webkitEnterFullScreen()
- } catch (e) {
- this.trigger("fullscreenerror", e)
- }
- }, 0);
- else
- try {
- e.webkitEnterFullScreen()
- } catch (e) {
- this.trigger("fullscreenerror", e)
- }
- }
- ,
- e.exitFullScreen = function() {
- this.el_.webkitDisplayingFullscreen ? this.el_.webkitExitFullScreen() : this.trigger("fullscreenerror", new Error("The video is not fullscreen"))
- }
- ,
- e.requestPictureInPicture = function() {
- return this.el_.requestPictureInPicture()
- }
- ,
- e.src = function(e) {
- if (void 0 === e)
- return this.el_.src;
- this.setSrc(e)
- }
- ,
- e.reset = function() {
- o.resetMediaElement(this.el_)
- }
- ,
- e.currentSrc = function() {
- return this.currentSource_ ? this.currentSource_.src : this.el_.currentSrc
- }
- ,
- e.setControls = function(e) {
- this.el_.controls = !!e
- }
- ,
- e.addTextTrack = function(e, t, n) {
- return this.featuresNativeTextTracks ? this.el_.addTextTrack(e, t, n) : c.prototype.addTextTrack.call(this, e, t, n)
- }
- ,
- e.createRemoteTextTrack = function(e) {
- if (!this.featuresNativeTextTracks)
- return c.prototype.createRemoteTextTrack.call(this, e);
- var t = f.createElement("track");
- return e.kind && (t.kind = e.kind),
- e.label && (t.label = e.label),
- (e.language || e.srclang) && (t.srclang = e.language || e.srclang),
- e.default && (t.default = e.default),
- e.id && (t.id = e.id),
- e.src && (t.src = e.src),
- t
- }
- ,
- e.addRemoteTextTrack = function(e, t) {
- var n = c.prototype.addRemoteTextTrack.call(this, e, t);
- return this.featuresNativeTextTracks && this.el().appendChild(n),
- n
- }
- ,
- e.removeRemoteTextTrack = function(e) {
- if (c.prototype.removeRemoteTextTrack.call(this, e),
- this.featuresNativeTextTracks)
- for (var t = this.$$("track"), n = t.length; n--; )
- e !== t[n] && e !== t[n].track || this.el().removeChild(t[n])
- }
- ,
- e.getVideoPlaybackQuality = function() {
- if ("function" == typeof this.el().getVideoPlaybackQuality)
- return this.el().getVideoPlaybackQuality();
- var e = {};
- return "undefined" != typeof this.el().webkitDroppedFrameCount && "undefined" != typeof this.el().webkitDecodedFrameCount && (e.droppedVideoFrames = this.el().webkitDroppedFrameCount,
- e.totalVideoFrames = this.el().webkitDecodedFrameCount),
- 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),
- e
- }
- ,
- o
- }(pi);
- Ea(Aa, "TEST_VID", function() {
- if (C()) {
- var e = f.createElement("video")
- , t = f.createElement("track");
- return t.kind = "captions",
- t.srclang = "en",
- t.label = "English",
- e.appendChild(t),
- e
- }
- }),
- Aa.isSupported = function() {
- try {
- Aa.TEST_VID.volume = .5
- } catch (e) {
- return !1
- }
- return !(!Aa.TEST_VID || !Aa.TEST_VID.canPlayType)
- }
- ,
- Aa.canPlayType = function(e) {
- return Aa.TEST_VID.canPlayType(e)
- }
- ,
- Aa.canPlaySource = function(e, t) {
- return Aa.canPlayType(e.type)
- }
- ,
- Aa.canControlVolume = function() {
- try {
- var e = Aa.TEST_VID.volume;
- return Aa.TEST_VID.volume = e / 2 + .1,
- e !== Aa.TEST_VID.volume
- } catch (e) {
- return !1
- }
- }
- ,
- Aa.canMuteVolume = function() {
- try {
- var e = Aa.TEST_VID.muted;
- return Aa.TEST_VID.muted = !e,
- Aa.TEST_VID.muted ? D(Aa.TEST_VID, "muted", "muted") : B(Aa.TEST_VID, "muted"),
- e !== Aa.TEST_VID.muted
- } catch (e) {
- return !1
- }
- }
- ,
- Aa.canControlPlaybackRate = function() {
- if (Je && it && rt < 58)
- return !1;
- try {
- var e = Aa.TEST_VID.playbackRate;
- return Aa.TEST_VID.playbackRate = e / 2 + .1,
- e !== Aa.TEST_VID.playbackRate
- } catch (e) {
- return !1
- }
- }
- ,
- Aa.canOverrideAttributes = function() {
- try {
- var e = function() {};
- Object.defineProperty(f.createElement("video"), "src", {
- get: e,
- set: e
- }),
- Object.defineProperty(f.createElement("audio"), "src", {
- get: e,
- set: e
- }),
- Object.defineProperty(f.createElement("video"), "innerHTML", {
- get: e,
- set: e
- }),
- Object.defineProperty(f.createElement("audio"), "innerHTML", {
- get: e,
- set: e
- })
- } catch (e) {
- return !1
- }
- return !0
- }
- ,
- Aa.supportsNativeTextTracks = function() {
- return dt || ht && it
- }
- ,
- Aa.supportsNativeVideoTracks = function() {
- return !(!Aa.TEST_VID || !Aa.TEST_VID.videoTracks)
- }
- ,
- Aa.supportsNativeAudioTracks = function() {
- return !(!Aa.TEST_VID || !Aa.TEST_VID.audioTracks)
- }
- ,
- 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"],
- [["featuresVolumeControl", "canControlVolume"], ["featuresMuteControl", "canMuteVolume"], ["featuresPlaybackRate", "canControlPlaybackRate"], ["featuresSourceset", "canOverrideAttributes"], ["featuresNativeTextTracks", "supportsNativeTextTracks"], ["featuresNativeVideoTracks", "supportsNativeVideoTracks"], ["featuresNativeAudioTracks", "supportsNativeAudioTracks"]].forEach(function(e) {
- var t = e[0]
- , n = e[1];
- Ea(Aa.prototype, t, function() {
- return Aa[n]()
- }, !0)
- }),
- Aa.prototype.movingMediaElementInDOM = !ht,
- Aa.prototype.featuresFullscreenResize = !0,
- Aa.prototype.featuresProgressEvents = !0,
- Aa.prototype.featuresTimeupdateEvents = !0,
- Aa.patchCanPlayType = function() {
- 4 <= Ze && !tt && !it && (Sa = Aa.TEST_VID && Aa.TEST_VID.constructor.prototype.canPlayType,
- Aa.TEST_VID.constructor.prototype.canPlayType = function(e) {
- return e && /^application\/(?:x-|vnd\.apple\.)mpegurl/i.test(e) ? "maybe" : Sa.call(this, e)
- }
- )
- }
- ,
- Aa.unpatchCanPlayType = function() {
- var e = Aa.TEST_VID.constructor.prototype.canPlayType;
- return Sa && (Aa.TEST_VID.constructor.prototype.canPlayType = Sa),
- e
- }
- ,
- Aa.patchCanPlayType(),
- Aa.disposeMediaElement = function(e) {
- if (e) {
- for (e.parentNode && e.parentNode.removeChild(e); e.hasChildNodes(); )
- e.removeChild(e.firstChild);
- e.removeAttribute("src"),
- "function" == typeof e.load && function() {
- try {
- e.load()
- } catch (e) {}
- }()
- }
- }
- ,
- Aa.resetMediaElement = function(e) {
- if (e) {
- for (var t = e.querySelectorAll("source"), n = t.length; n--; )
- e.removeChild(t[n]);
- e.removeAttribute("src"),
- "function" == typeof e.load && function() {
- try {
- e.load()
- } catch (e) {}
- }()
- }
- }
- ,
- ["muted", "defaultMuted", "autoplay", "controls", "loop", "playsinline"].forEach(function(e) {
- Aa.prototype[e] = function() {
- return this.el_[e] || this.el_.hasAttribute(e)
- }
- }),
- ["muted", "defaultMuted", "autoplay", "loop", "playsinline"].forEach(function(t) {
- Aa.prototype["set" + Re(t)] = function(e) {
- (this.el_[t] = e) ? this.el_.setAttribute(t, t) : this.el_.removeAttribute(t)
- }
- }),
- ["paused", "currentTime", "buffered", "volume", "poster", "preload", "error", "seeking", "seekable", "ended", "playbackRate", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "played", "networkState", "readyState", "videoWidth", "videoHeight", "crossOrigin"].forEach(function(e) {
- Aa.prototype[e] = function() {
- return this.el_[e]
- }
- }),
- ["volume", "src", "poster", "preload", "playbackRate", "playbackQuality", "defaultPlaybackRate", "defaultPlaybackQuality", "crossOrigin"].forEach(function(t) {
- Aa.prototype["set" + Re(t)] = function(e) {
- this.el_[t] = e
- }
- }),
- ["pause", "load", "play"].forEach(function(e) {
- Aa.prototype[e] = function() {
- return this.el_[e]()
- }
- }),
- pi.withSourceHandlers(Aa),
- Aa.nativeSourceHandler = {},
- Aa.nativeSourceHandler.canPlayType = function(e) {
- try {
- return Aa.TEST_VID.canPlayType(e)
- } catch (e) {
- return ""
- }
- }
- ,
- Aa.nativeSourceHandler.canHandleSource = function(e, t) {
- if (e.type)
- return Aa.nativeSourceHandler.canPlayType(e.type);
- if (e.src) {
- var n = on(e.src);
- return Aa.nativeSourceHandler.canPlayType("video/" + n)
- }
- return ""
- }
- ,
- Aa.nativeSourceHandler.handleSource = function(e, t, n) {
- t.setSrc(e.src)
- }
- ,
- Aa.nativeSourceHandler.dispose = function() {}
- ,
- Aa.registerSourceHandler(Aa.nativeSourceHandler),
- pi.registerTech("Html5", Aa);
- var Pa = ["progress", "abort", "suspend", "emptied", "stalled", "loadedmetadata", "loadeddata", "timeupdate", "resize", "volumechange", "texttrackchange"]
- , La = {
- canplay: "CanPlay",
- canplaythrough: "CanPlayThrough",
- playing: "Playing",
- seeked: "Seeked"
- }
- , Ia = ["tiny", "xsmall", "small", "medium", "large", "xlarge", "huge"]
- , Ma = {};
- Ia.forEach(function(e) {
- var t = "x" === e.charAt(0) ? "x-" + e.substring(1) : e;
- Ma[e] = "vjs-layout-" + t
- });
- var ja = {
- tiny: 210,
- xsmall: 320,
- small: 425,
- medium: 768,
- large: 1440,
- xlarge: 2560,
- huge: 1 / 0
- }
- , Oa = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
- , Na = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
- , Da = [0, 25e4, 5e5, 1e6, 15e5, 23e5, 4e6, 6e6, 1e7]
- , Ba = ["SLD", "LD", "STD", "HD", "SD", "SHD", "720P", "1080P", "HI3", "HI4"]
- , Ra = function(h) {
- function d(e, t, n) {
- var i;
- if (e.id = e.id || t.id || "vjs_video_" + le(),
- (t = b(d.getTagSettings(e), t)).initChildren = !1,
- t.createEl = !1,
- t.evented = !1,
- t.reportTouchActivity = !1,
- !t.language)
- if ("function" == typeof e.closest) {
- var r = e.closest("[lang]");
- r && r.getAttribute && (t.language = r.getAttribute("lang"))
- } else
- for (var s = e; s && 1 === s.nodeType; ) {
- if (O(s).hasOwnProperty("lang")) {
- t.language = s.getAttribute("lang");
- break
- }
- s = s.parentNode
- }
- if ((i = h.call(this, null, t, n) || this).boundDocumentFullscreenChange_ = Te(Ve(i), i.documentFullscreenChange_),
- i.boundFullWindowOnEscKey_ = Te(Ve(i), i.fullWindowOnEscKey),
- i.isFullscreen_ = !1,
- i.isWebFullscreen_ = !1,
- i.log = _(i.id_),
- i.fsApi_ = _t,
- i.isPosterFromTech_ = !1,
- i.queuedCallbacks_ = [],
- i.isReady_ = !1,
- i.hasStarted_ = !1,
- i.userActive_ = !1,
- !i.options_ || !i.options_.techOrder || !i.options_.techOrder.length)
- throw new Error("No techOrder specified. Did you overwrite videojs.options instead of just changing the properties you want to override?");
- if (i.tag = e,
- i.tagAttributes = e && O(e),
- i.language(i.options_.language),
- t.languages) {
- var a = {};
- Object.getOwnPropertyNames(t.languages).forEach(function(e) {
- a[e.toLowerCase()] = t.languages[e]
- }),
- i.languages_ = a
- } else
- i.languages_ = d.prototype.options_.languages;
- i.resetCache_();
- var o = cr.get("h5vodlocaldata");
- if (void 0 !== o && void 0 !== o.lastVolume && i.volume(Number(o.lastVolume)),
- i.poster_ = t.poster || "",
- void 0 !== i.options_.controlBar.playbackQualityLabels && 5 <= i.options_.controlBar.playbackQualityLabels.length && i.options_.controlBar.playbackQualityLabels.length <= 10)
- for (var l = 0; l < i.options_.controlBar.playbackQualityLabels.length; l++)
- Na[l] = i.options_.controlBar.playbackQualityLabels[l];
- i.options_.playbackQualities = ["EMP"],
- i.options_.playbackQualityIndex = [],
- i.controls_ = !!t.controls,
- i.mini_ = !!t.mini,
- void 0 !== t.isHttps ? !0 === t.isHttps ? i.httpPre_ = "https://" : i.httpPre_ = "http://" : i.httpPre_ = "https://",
- e.controls = !1,
- e.removeAttribute("controls"),
- i.changingSrc_ = !1,
- i.playCallbacks_ = [],
- i.playTerminatedQueue_ = [],
- e.hasAttribute("autoplay") ? i.autoplay(!0) : i.autoplay(i.options_.autoplay),
- t.plugins && Object.keys(t.plugins).forEach(function(e) {
- if ("function" != typeof i[e])
- throw new Error('plugin "' + e + '" does not exist')
- }),
- i.scrubbing_ = !1,
- i.el_ = i.createEl(),
- Oe(Ve(i), {
- eventBusKey: "el_"
- }),
- i.fsApi_.requestFullscreen && (ge(f, i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_),
- i.on(i.fsApi_.fullscreenchange, i.boundDocumentFullscreenChange_)),
- i.fluid_ && i.on("playerreset", i.updateStyleEl_);
- var u = Fe(i.options_);
- t.plugins && Object.keys(t.plugins).forEach(function(e) {
- i[e](t.plugins[e])
- }),
- i.options_.playerOptions = u,
- i.middleware_ = [],
- i.initChildren(),
- i.player().options().qualityPermitMode ? i.getChild("controlBar").removeChild("PlaybackQualityMenuButton3") : i.getChild("controlBar").removeChild("PlaybackQualityMenuButton"),
- i.isAudio("audio" === e.nodeName.toLowerCase()),
- i.controls() ? i.addClass("vjs-controls-enabled") : i.addClass("vjs-controls-disabled"),
- i.el_.setAttribute("role", "region"),
- i.isAudio() ? i.el_.setAttribute("aria-label", i.localize("Audio Player")) : i.el_.setAttribute("aria-label", i.localize("Video Player")),
- i.isAudio() && i.addClass("vjs-audio"),
- i.flexNotSupported_() && i.addClass("vjs-no-flex"),
- lt && i.addClass("vjs-touch-enabled"),
- ht || i.addClass("vjs-workinghover"),
- d.players[i.id_] = Ve(i);
- var c = y.split(".")[0];
- return i.version = y,
- i.playerversion = v + (i.player().options_.drmLabel ? "d" : ""),
- 1 !== i.options_.logicIndex || i.options_.enableVip || (i.playerversion += " 4k"),
- i.updatedate = g,
- i.addClass("vjs-v" + c),
- i.userActive(!0),
- i.reportUserActivity(),
- i.one("play", i.listenForUserActivity_),
- i.on("stageclick", i.handleStageClick_),
- i.on("keydown", i.handleKeyDown),
- i.breakpoints(i.options_.breakpoints),
- i.responsive(i.options_.responsive),
- i
- }
- We(d, h);
- var e = d.prototype;
- return e.GET_DEFAULT_QUALITY_LABELS = function() {
- return Na
- }
- ,
- e.GET_CUSTOM_QUALITY_LABELS = function() {
- return Ba
- }
- ,
- e.GET_CUSTOM_QUALITIES_DIVIDE = function() {
- return Da
- }
- ,
- e.dispose = function() {
- this.player_.paused()
- var i = this;
- this.trigger("dispose"),
- this.off("dispose"),
- ye(f, this.fsApi_.fullscreenchange, this.boundDocumentFullscreenChange_),
- ye(f, "keydown", this.boundFullWindowOnEscKey_),
- this.styleEl_ && this.styleEl_.parentNode && (this.styleEl_.parentNode.removeChild(this.styleEl_),
- this.styleEl_ = null),
- d.players[this.id_] = null,
- this.tag && this.tag.player && (this.tag.player = null),
- this.el_ && this.el_.player && (this.el_.player = null),
- this.tech_ && (this.tech_.dispose(),
- this.isPosterFromTech_ = !1,
- this.poster_ = ""),
- this.playerElIngest_ && (this.playerElIngest_ = null),
- this.tag && (this.tag = null),
- function(e) {
- vi[e.id()] = null
- }(this),
- Dn.names.forEach(function(e) {
- var t = Dn[e]
- , n = i[t.getterName]();
- n && n.off && n.off()
- }),
- h.prototype.dispose.call(this)
- }
- ,
- e.createEl = function() {
- 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();
- e ? t = this.el_ = n.parentNode : i || (t = this.el_ = h.prototype.createEl.call(this, "div"));
- var r = O(n);
- if (i) {
- for (t = this.el_ = n,
- n = this.tag = f.createElement("video"); t.children.length; )
- n.appendChild(t.firstChild);
- P(t, "video-js") || L(t, "video-js"),
- t.appendChild(n),
- e = this.playerElIngest_ = t,
- Object.keys(t).forEach(function(e) {
- try {
- n[e] = t[e]
- } catch (e) {}
- })
- }
- if (n.setAttribute("tabindex", "-1"),
- r.tabindex = "-1",
- (st || it && ot) && (n.setAttribute("role", "application"),
- r.role = "application"),
- n.removeAttribute("width"),
- n.removeAttribute("height"),
- "width"in r && delete r.width,
- "height"in r && delete r.height,
- Object.getOwnPropertyNames(r).forEach(function(e) {
- i && "class" === e || t.setAttribute(e, r[e]),
- i && n.setAttribute(e, r[e])
- }),
- n.playerId = n.id,
- n.id += "_html5_api",
- n.className = "vjs-tech",
- n.player = t.player = this,
- this.addClass("vjs-paused"),
- !0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
- this.styleEl_ = re("vjs-styles-dimensions");
- var s = $(".vjs-styles-defaults")
- , a = $("head");
- a.insertBefore(this.styleEl_, s ? s.nextSibling : a.firstChild)
- }
- this.fill_ = !1,
- this.fluid_ = !1,
- this.width(this.options_.width),
- this.height(this.options_.height),
- this.fill(this.options_.fill),
- this.fluid(this.options_.fluid),
- this.aspectRatio(this.options_.aspectRatio),
- this.crossOrigin(this.options_.crossOrigin || this.options_.crossorigin);
- for (var o = n.getElementsByTagName("a"), l = 0; l < o.length; l++) {
- var u = o.item(l);
- L(u, "vjs-hidden"),
- u.setAttribute("hidden", "hidden")
- }
- n.initNetworkState_ = n.networkState,
- n.parentNode && !e && n.parentNode.insertBefore(t, n),
- A(n, t),
- this.children_.unshift(n);
- var c = this;
- return n.oncontextmenu = function(e) {
- return !0 === e.ctrlKey && e.altKey ? c.showContextMenu(e, !0) : c.showContextMenu(e, !1),
- !1
- }
- ,
- this.el_.setAttribute("lang", this.language_),
- this.el_ = t
- }
- ,
- e.crossOrigin = function(e) {
- if (!e)
- return this.techGet_("crossOrigin");
- "anonymous" === e || "use-credentials" === e ? this.techCall_("setCrossOrigin", e) : m.warn('crossOrigin must be "anonymous" or "use-credentials", given "' + e + '"')
- }
- ,
- e.showContextMenu = function(e, t) {
- this.getChild("contextMenuButton").moveAndShow(e, t)
- }
- ,
- e.getDebugInfo = function() {
- var e = "";
- e += "WH DEBUG:";
- var t, n = JSON.parse('{"DEBUG_INFO":"aaa1"}');
- for (t in this.options_)
- "playerOptions" !== t && (n[t] = this.options_[t]);
- return delete n.controlBar.playerOptions,
- n.tech = this.tech_.debugInfo,
- e += JSON.stringify(n)
- }
- ,
- e.width = function(e) {
- return this.dimension("width", e)
- }
- ,
- e.height = function(e) {
- return this.dimension("height", e)
- }
- ,
- e.dimension = function(e, t) {
- var n = e + "_";
- if (void 0 === t)
- return this[n] || 0;
- if ("" === t || "auto" === t)
- return this[n] = void 0,
- void this.updateStyleEl_();
- var i = parseFloat(t);
- isNaN(i) ? m.error('Improper value "' + t + '" supplied for for ' + e) : (this[n] = i,
- this.updateStyleEl_())
- }
- ,
- e.fluid = function(e) {
- if (void 0 === e)
- return !!this.fluid_;
- this.fluid_ = !!e,
- Me(this) && this.off("playerreset", this.updateStyleEl_),
- e ? (this.addClass("vjs-fluid"),
- this.fill(!1),
- function(e, t) {
- Me(e) ? t() : (e.eventedCallbacks || (e.eventedCallbacks = []),
- e.eventedCallbacks.push(t))
- }(function() {
- this.on("playerreset", this.updateStyleEl_)
- })) : this.removeClass("vjs-fluid"),
- this.updateStyleEl_()
- }
- ,
- e.fill = function(e) {
- if (void 0 === e)
- return !!this.fill_;
- this.fill_ = !!e,
- e ? (this.addClass("vjs-fill"),
- this.fluid(!1)) : this.removeClass("vjs-fill")
- }
- ,
- e.aspectRatio = function(e) {
- if (void 0 === e)
- return this.aspectRatio_;
- if (!/^\d+\:\d+$/.test(e))
- throw new Error("Improper value supplied for aspect ratio. The format should be width:height, for example 16:9.");
- this.aspectRatio_ = e,
- this.fluid(!0),
- this.updateStyleEl_()
- }
- ,
- e.updateStyleEl_ = function() {
- if (!0 !== p.VIDEOJS_NO_DYNAMIC_STYLE) {
- 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];
- e = void 0 !== this.width_ ? this.width_ : void 0 !== this.height_ ? this.height_ / r : this.videoWidth() || 300,
- t = void 0 !== this.height_ ? this.height_ : e * r,
- n = /^[^a-zA-Z]/.test(this.id()) ? "dimensions-" + this.id() : this.id() + "-dimensions",
- this.addClass(n),
- 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 ")
- } else {
- var s = "number" == typeof this.width_ ? this.width_ : this.options_.width
- , a = "number" == typeof this.height_ ? this.height_ : this.options_.height
- , o = this.tech_ && this.tech_.el();
- o && (0 <= s && (o.width = s),
- 0 <= a && (o.height = a))
- }
- }
- ,
- e.loadTech_ = function(e, t) {
- var n = this;
- this.tech_ && this.unloadTech_();
- var i = Re(e)
- , r = e.charAt(0).toLowerCase() + e.slice(1);
- "Html5" !== i && this.tag && (pi.getTech("Html5").disposeMediaElement(this.tag),
- this.tag.player = null,
- this.tag = null),
- this.techName_ = i,
- this.isReady_ = !1;
- var s = {
- source: t,
- autoplay: "string" != typeof this.autoplay() && this.autoplay(),
- nativeControlsForTouch: this.options_.nativeControlsForTouch,
- playerId: this.id(),
- techId: this.id() + "_" + r + "_api",
- playsinline: this.options_.playsinline,
- preload: this.options_.preload,
- loop: this.options_.loop,
- autoNext: this.options_.autoNext,
- muted: this.options_.muted,
- poster: this.poster(),
- language: this.language(),
- playerElIngest: this.playerElIngest_ || !1,
- "vtt.js": this.options_["vtt.js"],
- canOverridePoster: !!this.options_.techCanOverridePoster,
- enableSourceset: this.options_.enableSourceset,
- Promise: this.options_.Promise
- };
- Dn.names.forEach(function(e) {
- var t = Dn[e];
- s[t.getterName] = n[t.privateName]
- }),
- b(s, this.options_[i]),
- b(s, this.options_[r]),
- b(s, this.options_[e.toLowerCase()]),
- this.tag && (s.tag = this.tag),
- t && t.src === this.cache_.src && 0 < this.cache_.currentTime && (s.startTime = this.cache_.currentTime);
- var a = pi.getTech(e);
- if (!a)
- throw new Error("No Tech named '" + i + "' exists! '" + i + "' should be registered using videojs.registerTech()'");
- this.tech_ = new a(s),
- this.tech_.ready(Te(this, this.handleTechReady_), !0),
- It(this.textTracksJson_ || [], this.tech_),
- Pa.forEach(function(e) {
- n.on(n.tech_, e, n["handleTech" + Re(e) + "_"])
- }),
- Object.keys(La).forEach(function(t) {
- n.on(n.tech_, t, function(e) {
- 0 === n.tech_.playbackRate() && n.tech_.seeking() ? n.queuedCallbacks_.push({
- callback: n["handleTech" + La[t] + "_"].bind(n),
- event: e
- }) : n["handleTech" + La[t] + "_"](e)
- })
- }),
- this.on("loadedmetadata", this.initPlaybackQualityLevelDirect),
- this.on("adended", this.handleADSEnded_),
- this.on(this.tech_, "loadstart", this.handleTechLoadStart_),
- this.on(this.tech_, "sourceset", this.handleTechSourceset_),
- this.on(this.tech_, "waiting", this.handleTechWaiting_),
- this.on(this.tech_, "ended", this.handleTechEnded_),
- this.on(this.tech_, "seeking", this.handleTechSeeking_),
- this.on(this.tech_, "play", this.handleTechPlay_),
- this.on(this.tech_, "firstplay", this.handleTechFirstPlay_),
- this.on(this.tech_, "pause", this.handleTechPause_),
- this.on(this.tech_, "durationchange", this.handleTechDurationChange_),
- this.on(this.tech_, "fullscreenchange", this.handleTechFullscreenChange_),
- this.on(this.tech_, "fullscreenerror", this.handleTechFullscreenError_),
- this.on(this.tech_, "enterpictureinpicture", this.handleTechEnterPictureInPicture_),
- this.on(this.tech_, "leavepictureinpicture", this.handleTechLeavePictureInPicture_),
- this.on(this.tech_, "error", this.handleTechError_),
- this.on(this.tech_, "loadedmetadata", this.updateStyleEl_),
- this.on(this.tech_, "posterchange", this.handleTechPosterChange_),
- this.on(this.tech_, "textdata", this.handleTechTextData_),
- this.on(this.tech_, "ratechange", this.handleTechRateChange_),
- this.on(this.tech_, "qualitychange", this.handleTechQualityChange_),
- this.usingNativeControls(this.techGet_("controls")),
- this.controls() && !this.usingNativeControls() && this.addTechControlsListeners_(),
- this.tech_.el().parentNode === this.el() || "Html5" === i && this.tag || A(this.tech_.el(), this.el()),
- this.autoNext(this.options_.setup_autoNext),
- this.loop2(this.options_.setup_loop),
- this.tag && (this.tag.player = null,
- this.tag = null)
- }
- ,
- e.unloadTech_ = function() {
- var n = this;
- Dn.names.forEach(function(e) {
- var t = Dn[e];
- n[t.privateName] = n[t.getterName]()
- }),
- this.textTracksJson_ = Lt(this.tech_),
- this.isReady_ = !1,
- this.tech_.dispose(),
- this.tech_ = !1,
- this.isPosterFromTech_ && (this.poster_ = "",
- this.trigger("posterchange")),
- this.isPosterFromTech_ = !1
- }
- ,
- e.tech = function(e) {
- 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"),
- this.tech_
- }
- ,
- e.addTechControlsListeners_ = function() {
- this.removeTechControlsListeners_(),
- this.on(this.tech_, "mouseup", this.handleTechClick_),
- this.on(this.tech_, "dblclick", this.handleTechDoubleClick_),
- this.on(this.tech_, "touchstart", this.handleTechTouchStart_),
- this.on(this.tech_, "touchmove", this.handleTechTouchMove_),
- this.on(this.tech_, "touchend", this.handleTechTouchEnd_),
- this.on(this.tech_, "tap", this.handleTechTap_)
- }
- ,
- e.removeTechControlsListeners_ = function() {
- this.off(this.tech_, "tap", this.handleTechTap_),
- this.off(this.tech_, "touchstart", this.handleTechTouchStart_),
- this.off(this.tech_, "touchmove", this.handleTechTouchMove_),
- this.off(this.tech_, "touchend", this.handleTechTouchEnd_),
- this.off(this.tech_, "mouseup", this.handleTechClick_),
- this.off(this.tech_, "dblclick", this.handleTechDoubleClick_)
- }
- ,
- e.handleTechReady_ = function() {
- this.triggerReady(),
- this.cache_.volume && this.techCall_("setVolume", this.cache_.volume),
- this.handleTechPosterChange_(),
- this.handleTechDurationChange_()
- }
- ,
- e.handleTechLoadStart_ = function() {
- this.removeClass("vjs-ended"),
- this.removeClass("vjs-seeking"),
- this.error(null),
- this.handleTechDurationChange_(),
- this.paused() ? (this.hasStarted(!1),
- this.trigger("loadstart")) : (this.trigger("loadstart"),
- this.trigger("firstplay")),
- this.manualAutoplay_(this.autoplay())
- }
- ,
- e.manualAutoplay_ = function(t) {
- var i = this;
- if (this.tech_ && "string" == typeof t) {
- var e, n = function() {
- var e = i.muted();
- i.muted(!0);
- function t() {
- i.muted(e)
- }
- i.playTerminatedQueue_.push(t);
- var n = i.play();
- if (xt(n))
- return n.catch(t)
- };
- if ("any" === t && !0 !== this.muted() ? xt(e = this.play()) && (e = e.catch(n)) : e = "muted" === t && !0 !== this.muted() ? n() : this.play(),
- xt(e))
- return e.then(function() {
- i.trigger({
- type: "autoplay-success",
- autoplay: t
- })
- }).catch(function(e) {
- i.trigger({
- type: "autoplay-failure",
- autoplay: t
- })
- })
- }
- }
- ,
- e.updateSourceCaches_ = function(e) {
- void 0 === e && (e = "");
- var t = e
- , n = "";
- "string" != typeof t && (t = e.src,
- n = e.type),
- this.cache_.source = this.cache_.source || {},
- this.cache_.sources = this.cache_.sources || [],
- t && !n && (n = function(e, t) {
- if (!t)
- return "";
- if (e.cache_.source.src === t && e.cache_.source.type)
- return e.cache_.source.type;
- var n = e.cache_.sources.filter(function(e) {
- return e.src === t
- });
- if (n.length)
- return n[0].type;
- for (var i = e.$$("source"), r = 0; r < i.length; r++) {
- var s = i[r];
- if (s.type && s.src && s.src === t)
- return s.type
- }
- return Ei(t)
- }(this, t)),
- this.cache_.source = Fe({}, e, {
- src: t,
- type: n
- });
- for (var i = this.cache_.sources.filter(function(e) {
- return e.src && e.src === t
- }), r = [], s = this.$$("source"), a = [], o = 0; o < s.length; o++) {
- var l = O(s[o]);
- r.push(l),
- l.src && l.src === t && a.push(l.src)
- }
- a.length && !i.length ? this.cache_.sources = r : i.length || (this.cache_.sources = [this.cache_.source]),
- this.cache_.src = t
- }
- ,
- e.handleTechSourceset_ = function(e) {
- var n = this;
- if (!this.changingSrc_) {
- var t = function(e) {
- return n.updateSourceCaches_(e)
- }
- , i = this.currentSource().src
- , r = e.src;
- i && !/^blob:/.test(i) && /^blob:/.test(r) && (this.lastSource_ && (this.lastSource_.tech === r || this.lastSource_.player === i) || (t = function() {}
- )),
- t(r),
- e.src || this.tech_.any(["sourceset", "loadstart"], function(e) {
- if ("sourceset" !== e.type) {
- var t = n.techGet("currentSrc");
- n.lastSource_.tech = t,
- n.updateSourceCaches_(t)
- }
- })
- }
- this.lastSource_ = {
- player: this.currentSource().src,
- tech: e.src
- },
- this.trigger({
- src: e.src,
- type: "sourceset"
- })
- }
- ,
- e.hasStarted = function(e) {
- if (void 0 === e)
- return this.hasStarted_;
- e !== this.hasStarted_ && (this.hasStarted_ = e,
- this.hasStarted_ ? (this.addClass("vjs-has-started"),
- this.trigger("firstplay")) : this.removeClass("vjs-has-started"))
- }
- ,
- e.handleTechPlay_ = function() {
- this.removeClass("vjs-ended"),
- this.removeClass("vjs-paused"),
- this.addClass("vjs-playing"),
- this.hasStarted(!0),
- this.trigger("play")
- }
- ,
- e.handleTechRateChange_ = function() {
- 0 < this.tech_.playbackRate() && 0 === this.cache_.lastPlaybackRate && (this.queuedCallbacks_.forEach(function(e) {
- return e.callback(e.event)
- }),
- this.queuedCallbacks_ = []),
- this.cache_.lastPlaybackRate = this.tech_.playbackRate(),
- this.trigger("ratechange")
- }
- ,
- e.handleTechQualityChange_ = function() {
- this.cache_.lastPlaybackQuality = this.tech_.playbackQuality(),
- this.trigger("qualitychange")
- }
- ,
- e.handleTechWaiting_ = function() {
- var t = this;
- this.addClass("vjs-waiting"),
- this.trigger("waiting");
- var n = this.currentTime();
- this.on("timeupdate", function e() {
- n !== t.currentTime() && (t.removeClass("vjs-waiting"),
- t.off("timeupdate", e))
- })
- }
- ,
- e.handleTechCanPlay_ = function() {
- this.removeClass("vjs-waiting"),
- this.trigger("canplay")
- }
- ,
- e.handleTechCanPlayThrough_ = function() {
- this.removeClass("vjs-waiting"),
- this.trigger("canplaythrough")
- }
- ,
- e.handleTechPlaying_ = function() {
- this.removeClass("vjs-waiting"),
- this.trigger("playing")
- }
- ,
- e.handleTechSeeking_ = function() {
- this.addClass("vjs-seeking"),
- this.trigger("seeking")
- }
- ,
- e.handleTechSeeked_ = function() {
- this.removeClass("vjs-seeking"),
- this.removeClass("vjs-ended"),
- this.trigger("seeked")
- }
- ,
- e.handleTechFirstPlay_ = function() {
- this.options_.starttime && (m.warn("Passing the `starttime` option to the player will be deprecated in 6.0"),
- this.currentTime(this.options_.starttime)),
- this.addClass("vjs-has-started"),
- this.trigger("firstplay")
- }
- ,
- e.handleTechPause_ = function() {
- this.removeClass("vjs-playing"),
- this.addClass("vjs-paused"),
- this.trigger("pause")
- }
- ,
- e.isPlaying = function() {
- return this.hasClass("vjs-playing")
- }
- ,
- e.handleTechEnded_ = function() {
- this.addClass("vjs-ended"),
- this.trigger("ended")
- }
- ,
- e.handleTechDurationChange_ = function() {
- this.duration(this.techGet_("duration")),
- void 0 !== this.mainContentDuration_ || isNaN(this.duration()) || 0 === this.duration() || (this.mainContentDuration_ = this.duration())
- }
- ,
- e.handleTechClick_ = function(e) {
- X(e) ? this.controls_ && (this.mini_ || (this.paused() ? At(this.play()) : this.pause())) : e.button
- }
- ,
- e.handleTechDoubleClick_ = function(t) {
- this.controls_ && (this.mini_ || Array.prototype.some.call(this.$$(".vjs-control-bar, .vjs-modal-dialog"), function(e) {
- return e.contains(t.target)
- }) || 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()))
- }
- ,
- e.handleTechTap_ = function() {
- this.userActive(!this.userActive())
- }
- ,
- e.handleTechTouchStart_ = function() {
- this.userWasActive = this.userActive()
- }
- ,
- e.handleTechTouchMove_ = function() {
- this.userWasActive && this.reportUserActivity()
- }
- ,
- e.handleTechTouchEnd_ = function(e) {
- e.preventDefault()
- }
- ,
- e.handleStageClick_ = function() {
- this.reportUserActivity()
- }
- ,
- e.toggleFullscreenClass_ = function() {
- this.isFullscreen() ? this.addClass("vjs-fullscreen") : this.removeClass("vjs-fullscreen")
- }
- ,
- e.toggleWebFullscreenClass_ = function() {
- this.isWebFullscreen() ? this.addClass("vjs-webfullscreen") : this.removeClass("vjs-webfullscreen")
- }
- ,
- e.documentFullscreenChange_ = function(e) {
- var t = e.target.player;
- if (!t || t === this) {
- var n = this.el()
- , i = f[this.fsApi_.fullscreenElement] === n;
- !i && n.matches ? i = n.matches(":" + this.fsApi_.fullscreen) : !i && n.msMatchesSelector && (i = n.msMatchesSelector(":" + this.fsApi_.fullscreen)),
- this.isFullscreen(i)
- }
- }
- ,
- e.handleTechFullscreenChange_ = function(e, t) {
- t && this.isFullscreen(t.isFullscreen)
- }
- ,
- e.handleTechFullscreenError_ = function(e, t) {
- this.trigger("fullscreenerror", t)
- }
- ,
- e.togglePictureInPictureClass_ = function() {
- this.isInPictureInPicture() ? this.addClass("vjs-picture-in-picture") : this.removeClass("vjs-picture-in-picture")
- }
- ,
- e.handleTechEnterPictureInPicture_ = function(e) {
- this.isInPictureInPicture(!0)
- }
- ,
- e.handleTechLeavePictureInPicture_ = function(e) {
- this.isInPictureInPicture(!1)
- }
- ,
- e.handleTechError_ = function() {
- var e = this.tech_.error();
- this.error(e)
- }
- ,
- e.handleTechTextData_ = function(e, t) {
- var n = null;
- 1 < arguments.length && (n = t),
- this.trigger("textdata", n)
- }
- ,
- e.getCache = function() {
- return this.cache_
- }
- ,
- e.resetCache_ = function() {
- this.cache_ = {
- currentTime: 0,
- initTime: 0,
- inactivityTimeout: this.options_.inactivityTimeout,
- duration: NaN,
- lastVolume: 1,
- lastPlaybackRate: this.defaultPlaybackRate(),
- lastPlaybackQuality: this.defaultPlaybackQuality(),
- media: null,
- src: "",
- source: {},
- sources: [],
- volume: 1
- }
- }
- ,
- e.techCall_ = function(e, t) {
- this.ready(function() {
- if (e in bi)
- return function(e, t, n, i) {
- return t[n](e.reduce(Ci(n), i))
- }(this.middleware_, this.tech_, e, t);
- if (e in Ti)
- return mi(this.middleware_, this.tech_, e, t);
- try {
- this.tech_ && this.tech_[e](t)
- } catch (e) {
- throw m(e),
- e
- }
- }, !0)
- }
- ,
- e.techGet_ = function(t) {
- if (this.tech_ && this.tech_.isReady_) {
- if (t in _i)
- return function(e, t, n) {
- return e.reduceRight(Ci(n), t[n]())
- }(this.middleware_, this.tech_, t);
- if (t in Ti)
- return mi(this.middleware_, this.tech_, t);
- try {
- return this.tech_[t]()
- } catch (e) {
- if (void 0 === this.tech_[t])
- throw m("Video.js: " + t + " method not defined for " + this.techName_ + " playback technology.", e),
- e;
- if ("TypeError" === e.name)
- throw m("Video.js: " + t + " unavailable on " + this.techName_ + " playback technology element.", e),
- this.tech_.isReady_ = !1,
- e;
- throw m(e),
- e
- }
- }
- }
- ,
- e.play = function() {
- var t = this
- , e = this.options_.Promise || p.Promise;
- return e ? new e(function(e) {
- t.play_(e)
- }
- ) : this.play_()
- }
- ,
- e.play_ = function(e) {
- var t = this;
- void 0 === e && (e = At),
- this.playCallbacks_.push(e);
- var n = Boolean(!this.changingSrc_ && (this.src() || this.currentSrc()));
- if (this.waitToPlay_ && (this.off(["ready", "loadstart"], this.waitToPlay_),
- this.waitToPlay_ = null),
- !this.isReady_ || !n)
- return this.waitToPlay_ = function(e) {
- t.play_()
- }
- ,
- this.one(["ready", "loadstart"], this.waitToPlay_),
- void (n || !dt && !ht || this.load());
- var i = this.techGet_("play");
- null === i ? this.runPlayTerminatedQueue_() : this.runPlayCallbacks_(i)
- }
- ,
- e.runPlayTerminatedQueue_ = function() {
- var e = this.playTerminatedQueue_.slice(0);
- this.playTerminatedQueue_ = [],
- e.forEach(function(e) {
- e()
- })
- }
- ,
- e.runPlayCallbacks_ = function(t) {
- var e = this.playCallbacks_.slice(0);
- this.playCallbacks_ = [],
- this.playTerminatedQueue_ = [],
- e.forEach(function(e) {
- e(t)
- })
- }
- ,
- e.pause = function() {
- this.techCall_("pause")
- }
- ,
- e.paused = function() {
- return !1 !== this.techGet_("paused")
- }
- ,
- e.played = function() {
- return this.techGet_("played") || gt(0, 0)
- }
- ,
- e.scrubbing = function(e) {
- if ("undefined" == typeof e)
- return this.scrubbing_;
- this.scrubbing_ = !!e,
- e ? this.addClass("vjs-scrubbing") : this.removeClass("vjs-scrubbing")
- }
- ,
- e.currentTime = function(e) {
- return "undefined" != typeof e ? (e < 0 && (e = 0),
- this.isReady_ && !this.changingSrc_ && this.tech_ && this.tech_.isReady_ ? (this.techCall_("setCurrentTime", e),
- void (this.cache_.initTime = 0)) : (this.cache_.initTime = e,
- this.off("canplay", this.applyInitTime_),
- void this.one("canplay", this.applyInitTime_))) : (this.cache_.currentTime = this.techGet_("currentTime") || 0,
- this.cache_.currentTime)
- }
- ,
- e.applyInitTime_ = function() {
- this.currentTime(this.cache_.initTime)
- }
- ,
- e.duration = function(e) {
- if (void 0 === e)
- return void 0 !== this.cache_.duration ? this.cache_.duration : NaN;
- (e = parseFloat(e)) < 0 && (e = 1 / 0),
- e !== this.cache_.duration && ((this.cache_.duration = e) === 1 / 0 ? this.addClass("vjs-live") : this.removeClass("vjs-live"),
- isNaN(e) || this.trigger("durationchange"))
- }
- ,
- e.remainingTime = function() {
- return this.duration() - this.currentTime()
- }
- ,
- e.remainingTimeDisplay = function() {
- return Math.floor(this.duration()) - Math.floor(this.currentTime())
- }
- ,
- e.buffered = function() {
- var e = this.techGet_("buffered");
- return e && e.length || (e = gt(0, 0)),
- e
- }
- ,
- e.bufferedPercent = function() {
- return yt(this.buffered(), this.duration())
- }
- ,
- e.bufferedEnd = function() {
- var e = this.buffered()
- , t = this.duration()
- , n = e.end(e.length - 1);
- return t < n && (n = t),
- n
- }
- ,
- e.volume = function(e) {
- var t;
- if (void 0 === e)
- return t = parseFloat(this.techGet_("volume")),
- isNaN(t) ? 1 : t;
- if (t = Math.max(0, Math.min(1, parseFloat(e))),
- this.cache_.volume = t,
- this.techCall_("setVolume", t),
- 0 < t) {
- this.lastVolume_(t);
- var n = cr.get("h5vodlocaldata");
- void 0 !== n ? cr.set("h5vodlocaldata", {
- lastQuality: n.lastQuality,
- lastVolume: this.lastVolume_()
- }) : cr.set("h5vodlocaldata", {
- lastQuality: null,
- lastVolume: this.lastVolume_()
- })
- }
- }
- ,
- e.muted = function(e) {
- if (void 0 === e)
- return this.techGet_("muted") || !1;
- this.techCall_("setMuted", e)
- }
- ,
- e.defaultMuted = function(e) {
- return void 0 !== e ? this.techCall_("setDefaultMuted", e) : this.techGet_("defaultMuted") || !1
- }
- ,
- e.lastVolume_ = function(e) {
- if (void 0 === e || 0 === e)
- return this.cache_.lastVolume;
- this.cache_.lastVolume = e
- }
- ,
- e.supportsFullScreen = function() {
- return this.techGet_("supportsFullScreen") || !1
- }
- ,
- e.supportsWebFullScreen = function() {
- return !0
- }
- ,
- e.isFullscreen = function(e) {
- if (void 0 === e)
- return this.isFullscreen_;
- var t = this.isFullscreen_;
- return this.isFullscreen_ = Boolean(e),
- this.isFullscreen_ !== t && this.fsApi_.prefixed && this.trigger("fullscreenchange"),
- void this.toggleFullscreenClass_()
- }
- ,
- e.isWebFullscreen = function(e) {
- if (void 0 === e)
- return this.isWebFullscreen_;
- var t = this.isWebFullscreen_;
- return this.isWebFullscreen_ = Boolean(e),
- this.isWebFullscreen_ !== t && this.trigger("webfullscreenchange"),
- void this.toggleWebFullscreenClass_()
- }
- ,
- e.requestFullscreen = function(a) {
- var e = this.options_.Promise || p.Promise;
- if (e) {
- var o = this;
- return new e(function(e, n) {
- function i() {
- o.off(o.fsApi_.fullscreenerror, r),
- o.off(o.fsApi_.fullscreenchange, t)
- }
- function t() {
- i(),
- e()
- }
- function r(e, t) {
- i(),
- n(t)
- }
- o.one("fullscreenchange", t),
- o.one("fullscreenerror", r);
- var s = o.requestFullscreenHelper_(a);
- if (s)
- return s.then(i, i),
- s
- }
- )
- }
- return this.requestFullscreenHelper_()
- }
- ,
- e.requestFullscreenHelper_ = function(e) {
- var t, n = this;
- if (this.fsApi_.prefixed || (t = this.options_.fullscreen && this.options_.fullscreen.options || {},
- void 0 !== e && (t = e)),
- this.isWebFullscreen() && this.exitFullWindow(),
- this.fsApi_.requestFullscreen) {
- var i = this.el_[this.fsApi_.requestFullscreen](t);
- return i && i.then(function() {
- return n.isFullscreen(!0)
- }, function() {
- return n.isFullscreen(!1)
- }),
- i
- }
- this.tech_.supportsFullScreen() ? this.techCall_("enterFullScreen") : this.enterFullWindow()
- }
- ,
- e.requestFullWindow = function(e) {}
- ,
- e.exitFullscreen = function() {
- var e = this.options_.Promise || p.Promise;
- if (e) {
- var a = this;
- return new e(function(e, n) {
- function i() {
- a.off(a.fsApi_.fullscreenerror, r),
- a.off(a.fsApi_.fullscreenchange, t)
- }
- function t() {
- i(),
- e()
- }
- function r(e, t) {
- i(),
- n(t)
- }
- a.one("fullscreenchange", t),
- a.one("fullscreenerror", r);
- var s = a.exitFullscreenHelper_();
- if (s)
- return s.then(i, i),
- s
- }
- )
- }
- return this.exitFullscreenHelper_()
- }
- ,
- e.exitFullscreenHelper_ = function() {
- var e = this;
- if (this.fsApi_.requestFullscreen) {
- var t = f[this.fsApi_.exitFullscreen]();
- return t && t.then(function() {
- return e.isFullscreen(!1)
- }),
- t
- }
- this.tech_.supportsFullScreen() ? this.techCall_("exitFullScreen") : this.exitFullWindow()
- }
- ,
- e.enterFullWindow = function() {
- this.isFullscreen() && this.exitFullscreen(),
- this.isWebFullscreen(!0),
- this.isFullWindow = !0,
- this.docOrigOverflow = f.documentElement.style.overflow,
- ge(f, "keydown", this.boundFullWindowOnEscKey_),
- f.documentElement.style.overflow = "hidden",
- L(f.body, "vjs-webfull-window"),
- this.trigger("enterFullWindow")
- }
- ,
- e.fullWindowOnEscKey = function(e) {
- Mt.isEventKey(e, "Esc") && (!0 === this.isFullscreen() ? this.exitFullscreen() : this.exitFullWindow(),
- !0 === this.isWebFullscreen() && this.exitFullWindow())
- }
- ,
- e.exitFullWindow = function() {
- this.isWebFullscreen(!1),
- this.isFullWindow = !1,
- ye(f, "keydown", this.boundFullWindowOnEscKey_),
- f.documentElement.style.overflow = this.docOrigOverflow,
- I(f.body, "vjs-webfull-window"),
- this.trigger("exitFullWindow")
- }
- ,
- e.isInPictureInPicture = function(e) {
- return void 0 !== e ? (this.isInPictureInPicture_ = !!e,
- void this.togglePictureInPictureClass_()) : !!this.isInPictureInPicture_
- }
- ,
- e.requestPictureInPicture = function() {
- if ("pictureInPictureEnabled"in f)
- return this.techGet_("requestPictureInPicture")
- }
- ,
- e.exitPictureInPicture = function() {
- if ("pictureInPictureEnabled"in f)
- return f.exitPictureInPicture()
- }
- ,
- e.showBarrage = function(e) {
- var t = this.getChild("BarrageLayer");
- t && t.showBarrage(e)
- }
- ,
- e.barrageToggle = function(e) {
- var t = this.getChild("BarrageLayer");
- if (t)
- return !0 === e ? t.show() : !1 === e && t.hide(),
- !t.hasClass("vjs-hidden")
- }
- ,
- e.handleKeyDown = function(e) {
- var t = this.options_.userActions;
- if (t && t.hotkeys) {
- !function(e) {
- var t = e.tagName.toLowerCase();
- if (e.isContentEditable)
- return !0;
- if ("input" === t)
- return -1 === ["button", "checkbox", "hidden", "radio", "reset", "submit"].indexOf(e.type);
- return -1 !== ["textarea"].indexOf(t)
- }(this.el_.ownerDocument.activeElement) && ("function" == typeof t.hotkeys ? t.hotkeys.call(this, e) : this.handleHotkeys(e))
- }
- }
- ,
- e.handleHotkeys = function(e) {
- var t = this.options_.userActions ? this.options_.userActions.hotkeys : {}
- , n = t.stepForward
- , i = void 0 === n ? function(e) {
- return Mt.isEventKey(e, "right")
- }
- : n
- , r = t.stepBack
- , s = void 0 === r ? function(e) {
- return Mt.isEventKey(e, "left")
- }
- : r
- , a = t.fullscreenKey
- , o = void 0 === a ? function(e) {
- return Mt.isEventKey(e, "f")
- }
- : a
- , l = t.muteKey
- , u = void 0 === l ? function(e) {
- return Mt.isEventKey(e, "m")
- }
- : l
- , c = t.playPauseKey
- , h = void 0 === c ? function(e) {
- return Mt.isEventKey(e, "k") || Mt.isEventKey(e, "Space")
- }
- : c;
- if (o.call(this, e)) {
- e.preventDefault(),
- e.stopPropagation();
- var d = He.getComponent("FullscreenToggle");
- !1 !== f[this.fsApi_.fullscreenEnabled] && d.prototype.handleClick.call(this, e)
- } else if (u.call(this, e)) {
- e.preventDefault(),
- e.stopPropagation(),
- He.getComponent("MuteToggle").prototype.handleClick.call(this, e)
- } else if (h.call(this, e)) {
- if (e.preventDefault(),
- e.stopPropagation(),
- this.ads && !1 === this.ads.isInAdMode())
- He.getComponent("PlayToggle").prototype.handleClick.call(this, e)
- } else
- s.call(this, e) ? (e.preventDefault(),
- e.stopPropagation(),
- this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() - 20)) : i.call(this, e) && (e.preventDefault(),
- e.stopPropagation(),
- this.ads && !1 === this.ads.isInAdMode() && this.player_.currentTime(this.player_.currentTime() + 20))
- }
- ,
- e.canPlayType = function(e) {
- for (var t, n = 0, i = this.options_.techOrder; n < i.length; n++) {
- var r = i[n]
- , s = pi.getTech(r);
- if (s = s || He.getComponent(r)) {
- if (s.isSupported() && (t = s.canPlayType(e)))
- return t
- } else
- m.error('The "' + r + '" tech is undefined. Skipped browser support check for that tech.')
- }
- return ""
- }
- ,
- e.selectSource = function(e) {
- function t(e, n, i) {
- var r;
- return e.some(function(t) {
- return n.some(function(e) {
- if (r = i(t, e))
- return !0
- })
- }),
- r
- }
- function n(e, t) {
- var n = e[0];
- if (e[1].canPlaySource(t, r.options_[n.toLowerCase()]))
- return {
- source: t,
- tech: n
- }
- }
- var i, r = this, s = this.options_.techOrder.map(function(e) {
- return [e, pi.getTech(e)]
- }).filter(function(e) {
- var t = e[0]
- , n = e[1];
- return n ? n.isSupported() : (m.error('The "' + t + '" tech is undefined. Skipped browser support check for that tech.'),
- !1)
- });
- return (this.options_.sourceOrder ? t(e, s, (i = n,
- function(e, t) {
- return i(t, e)
- }
- )) : t(s, e, n)) || !1
- }
- ,
- e.src = function(e) {
- var n = this;
- if ("undefined" == typeof e)
- return this.cache_.src || "";
- var i = function t(e) {
- if (Array.isArray(e)) {
- var n = [];
- e.forEach(function(e) {
- e = t(e),
- Array.isArray(e) ? n = n.concat(e) : l(e) && n.push(e)
- }),
- e = n
- } else
- e = "string" == typeof e && e.trim() ? [wi({
- src: e
- })] : l(e) && "string" == typeof e.src && e.src && e.src.trim() ? [wi(e)] : [];
- return e
- }(e);
- i.length ? (this.changingSrc_ = !0,
- this.cache_.sources = i,
- this.updateSourceCaches_(i[0]),
- yi(this, i[0], function(e, t) {
- if (n.middleware_ = t,
- n.cache_.sources = i,
- n.updateSourceCaches_(e),
- n.src_(e))
- return 1 < i.length ? n.src(i.slice(1)) : (n.changingSrc_ = !1,
- n.setTimeout(function() {
- this.error({
- code: 4,
- message: this.localize(this.options_.notSupportedMessage)
- })
- }, 0),
- void n.triggerReady());
- !function(e, t) {
- e.forEach(function(e) {
- return e.setTech && e.setTech(t)
- })
- }(t, n.tech_)
- })) : this.setTimeout(function() {
- this.error({
- code: 4,
- message: this.localize(this.options_.notSupportedMessage)
- })
- }, 0)
- }
- ,
- e.src_ = function(e) {
- var t = this
- , n = this.selectSource([e]);
- return !n || (function(e, t) {
- return Re(e) === Re(t)
- }(n.tech, this.techName_) ? this.ready(function() {
- this.tech_.constructor.prototype.hasOwnProperty("setSource") ? this.techCall_("setSource", e) : this.techCall_("src", e.src),
- this.changingSrc_ = !1
- }, !0) : (this.changingSrc_ = !0,
- this.loadTech_(n.tech, n.source),
- this.tech_.ready(function() {
- t.changingSrc_ = !1
- })),
- !1)
- }
- ,
- e.load = function() {
- this.techCall_("load")
- }
- ,
- e.reset = function() {
- var e = this
- , t = this.options_.Promise || p.Promise;
- this.paused() || !t ? this.doReset_() : At(this.play().then(function() {
- return e.doReset_()
- }))
- }
- ,
- e.doReset_ = function() {
- this.tech_ && this.tech_.clearTracks("text"),
- this.resetCache_(),
- this.poster(""),
- this.loadTech_(this.options_.techOrder[0], null),
- this.techCall_("reset"),
- this.resetControlBarUI_(),
- Me(this) && this.trigger("playerreset")
- }
- ,
- e.resetControlBarUI_ = function() {
- this.resetProgressBar_(),
- this.resetPlaybackRate_(),
- this.resetPlaybackQuality_(),
- this.resetVolumeBar_()
- }
- ,
- e.resetProgressBar_ = function() {
- this.currentTime(0);
- var e = this.controlBar
- , t = e.durationDisplay
- , n = e.remainingTimeDisplay;
- t && t.updateContent(),
- n && n.updateContent()
- }
- ,
- e.resetPlaybackRate_ = function() {
- this.playbackRate(this.defaultPlaybackRate()),
- this.handleTechRateChange_()
- }
- ,
- e.resetPlaybackQuality_ = function() {
- this.playbackQuality(this.defaultPlaybackQuality()),
- this.handleTechQualityChange_()
- }
- ,
- e.resetVolumeBar_ = function() {
- this.volume(1),
- this.trigger("volumechange")
- }
- ,
- e.currentSources = function() {
- var e = this.currentSource()
- , t = [];
- return 0 !== Object.keys(e).length && t.push(e),
- this.cache_.sources || t
- }
- ,
- e.currentSource = function() {
- return this.cache_.source || {}
- }
- ,
- e.currentSrc = function() {
- return this.currentSource() && this.currentSource().src || ""
- }
- ,
- e.currentType = function() {
- return this.currentSource() && this.currentSource().type || ""
- }
- ,
- e.preload = function(e) {
- return void 0 !== e ? (this.techCall_("setPreload", e),
- void (this.options_.preload = e)) : this.techGet_("preload")
- }
- ,
- e.autoplay = function(e) {
- if (void 0 === e)
- return this.options_.autoplay || !1;
- var t;
- "string" == typeof e && /(any|play|muted)/.test(e) ? (this.options_.autoplay = e,
- this.manualAutoplay_(e),
- t = !1) : this.options_.autoplay = !!e,
- t = "undefined" == typeof t ? this.options_.autoplay : t,
- this.tech_ && this.techCall_("setAutoplay", t)
- }
- ,
- e.playsinline = function(e) {
- return void 0 !== e ? (this.techCall_("setPlaysinline", e),
- this.options_.playsinline = e,
- this) : this.techGet_("playsinline")
- }
- ,
- e.loop = function(e) {
- return void 0 !== e && (this.techCall_("setLoop", e),
- this.options_.loop !== e && (this.options_.loop = e,
- this.trigger("loopchange"))),
- this.techGet_("loop")
- }
- ,
- e.loop2 = function(e) {
- return void 0 !== e && this.options_.loop2 !== e && (this.options_.loop2 = e,
- this.trigger("loop2change")),
- this.options_.loop2
- }
- ,
- e.autoNext = function(e) {
- return void 0 !== e && this.options_.autoNext !== e && (this.options_.autoNext = e,
- this.trigger("autonextchange")),
- this.options_.autoNext
- }
- ,
- e.poster = function(e) {
- if (void 0 === e)
- return this.poster_;
- (e = e || "") !== this.poster_ && (this.poster_ = e,
- this.techCall_("setPoster", e),
- this.isPosterFromTech_ = !1,
- this.trigger("posterchange"))
- }
- ,
- e.handleTechPosterChange_ = function() {
- if ((!this.poster_ || this.options_.techCanOverridePoster) && this.tech_ && this.tech_.poster) {
- var e = this.tech_.poster() || "";
- e !== this.poster_ && (this.poster_ = e,
- this.isPosterFromTech_ = !0,
- this.trigger("posterchange"))
- }
- }
- ,
- e.controls = function(e) {
- if (void 0 === e)
- return !!this.controls_;
- e = !!e,
- this.controls_ !== e && (this.controls_ = e,
- this.usingNativeControls() && this.techCall_("setControls", e),
- this.controls_ ? (this.removeClass("vjs-controls-disabled"),
- this.addClass("vjs-controls-enabled"),
- this.trigger("controlsenabled"),
- this.usingNativeControls() || this.addTechControlsListeners_()) : (this.removeClass("vjs-controls-enabled"),
- this.addClass("vjs-controls-disabled"),
- this.trigger("controlsdisabled"),
- this.usingNativeControls() || this.removeTechControlsListeners_()))
- }
- ,
- e.miniPlayer = function(e) {
- if (void 0 === e)
- return !!this.mini_;
- e = !!e,
- this.mini_ !== e && (this.mini_ = e,
- this.mini_ ? (this.addClass("mini-controls"),
- this.controls(!1)) : (this.removeClass("mini-controls"),
- this.controls(!0)))
- }
- ,
- e.usingNativeControls = function(e) {
- if (void 0 === e)
- return !!this.usingNativeControls_;
- e = !!e,
- this.usingNativeControls_ !== e && (this.usingNativeControls_ = e,
- this.usingNativeControls_ ? (this.addClass("vjs-using-native-controls"),
- this.trigger("usingnativecontrols")) : (this.removeClass("vjs-using-native-controls"),
- this.trigger("usingcustomcontrols")))
- }
- ,
- e.error = function(e) {
- if (void 0 === e)
- return this.error_ || null;
- if (this.options_.suppressNotSupportedError && e && 4 === e.code) {
- var t = function() {
- this.error(e)
- };
- return this.options_.suppressNotSupportedError = !1,
- this.any(["click", "touchstart"], t),
- void this.one("loadstart", function() {
- this.off(["click", "touchstart"], t)
- })
- }
- if (null === e)
- return this.error_ = e,
- this.removeClass("vjs-error"),
- void (this.errorDisplay && this.errorDisplay.close());
- this.error_ = new Et(e),
- this.addClass("vjs-error"),
- m.error("(CODE:" + this.error_.code + " " + Et.errorTypes[this.error_.code] + ")", this.error_.message, this.error_),
- this.trigger("error", this.error_)
- }
- ,
- e.reportUserActivity = function(e) {
- this.userActivity_ = !0
- }
- ,
- e.userActive = function(e) {
- if (void 0 === e)
- return this.userActive_;
- if ((e = !!e) !== this.userActive_) {
- if (this.userActive_ = e,
- this.userActive_)
- return this.userActivity_ = !0,
- this.removeClass("vjs-user-inactive"),
- this.addClass("vjs-user-active"),
- void this.trigger("useractive");
- this.tech_ && this.tech_.one("mousemove", function(e) {
- e.stopPropagation(),
- e.preventDefault()
- }),
- this.userActivity_ = !1,
- this.removeClass("vjs-user-active"),
- this.addClass("vjs-user-inactive"),
- this.trigger("userinactive")
- }
- }
- ,
- e.listenForUserActivity_ = function() {
- function e(e) {
- r(),
- this.clearInterval(t)
- }
- var t, n, i, r = Te(this, this.reportUserActivity);
- this.on("mousedown", function() {
- r(),
- this.clearInterval(t),
- t = this.setInterval(r, 250)
- }),
- this.on("mousemove", function(e) {
- e.screenX === n && e.screenY === i || (n = e.screenX,
- i = e.screenY,
- r())
- }),
- this.on("mouseup", e),
- this.on("mouseleave", e);
- var s, a = this.getChild("controlBar");
- !a || ht || Je || (a.on("mouseenter", function(e) {
- this.player().cache_.inactivityTimeout = this.player().options_.inactivityTimeout,
- this.player().options_.inactivityTimeout = 0
- }),
- a.on("mouseleave", function(e) {
- this.player().options_.inactivityTimeout = this.player().cache_.inactivityTimeout
- }),
- G(a.el())),
- this.on("keydown", r),
- this.on("keyup", r),
- this.setInterval(function() {
- if (this.userActivity_) {
- this.userActivity_ = !1,
- this.userActive(!0),
- this.clearTimeout(s);
- var e = this.options_.inactivityTimeout;
- e <= 0 || (s = this.setTimeout(function() {
- this.userActivity_ || this.userActive(!1)
- }, e))
- }
- }, 250)
- }
- ,
- e.playbackRate = function(e) {
- if (void 0 === e)
- return this.tech_ && this.tech_.featuresPlaybackRate ? this.cache_.lastPlaybackRate || this.techGet_("playbackRate") : 1;
- this.techCall_("setPlaybackRate", e)
- }
- ,
- e.playbackQuality = function(e) {
- if (void 0 === e)
- return this.tech_ && this.tech_.featuresPlaybackQuality ? this.cache_.lastPlaybackQuality || this.techGet_("playbackQuality") : 1;
- this.techCall_("setPlaybackQuality", e)
- }
- ,
- e.clearPlaybackQualityLevel = function() {
- this.options_.playbackQualities.length = 0,
- this.options_.playbackQualityIndex.length = 0
- }
- ,
- e.addPlaybackQualityLevel = function(e, t) {
- var n;
- "EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
- 1 === this.player_.options_.logicIndex ? (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
- n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
- n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
- n = Na[3]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
- n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
- n = Na[7]) : e.enabled = !1,
- void 0 !== n ? (this.options_.playbackQualities.push(n),
- this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
- this.error(null))) : 0 === this.player_.options_.logicIndex && (e.bitrate < Oa[1] ? e.enabled = !1 : e.bitrate <= Oa[2] ? (e.enabled = !0,
- n = Na[1]) : e.bitrate <= Oa[3] ? (e.enabled = !0,
- n = Na[2]) : e.bitrate <= Oa[4] ? (e.enabled = !0,
- n = Na[3]) : e.bitrate <= Oa[5] ? (e.enabled = !0,
- n = Na[4]) : e.bitrate <= Oa[6] ? (e.enabled = !0,
- n = Na[5]) : e.bitrate <= Oa[7] ? (e.enabled = !0,
- n = Na[6]) : e.bitrate <= Oa[8] ? (e.enabled = !0,
- n = Na[7]) : e.enabled = !1,
- void 0 !== n ? (this.options_.playbackQualities.push(n),
- this.options_.playbackQualityIndex.push(t)) : (this.log("[player] 无有效码率"),
- this.error(null)))
- }
- ,
- e.initPlaybackQualityLevelDirect = function() {
- if (this.options().debug && this.log("[player] initPlaybackQualityLevelDirect() "),
- !!this.options_.qualityPermitMode) {
- "EMP" === this.options_.playbackQualities[this.options_.playbackQualities.length - 1] && this.options_.playbackQualities.pop(),
- this.options().debug && this.log(this.options_.playbackQualities),
- this.clearPlaybackQualityLevel();
- for (var e = this.options_.customQualityList, t = this.options_.customDefaultQuality, n = 0; n < e.length; n++)
- this.options_.playbackQualities.push(e[n].label),
- this.options_.playbackQualityIndex.push(e[n].masterIndex),
- e[n].label === t && e[n].enabled ? this.qualityLevels()[n].enabled = !0 : this.qualityLevels()[n].enabled = !1;
- var i = this.options_.playbackQualities
- , r = this.options_.playbackQualityIndex[i.lastIndexOf(t)];
- this.options().debug && this.log("qualityLevels().selectedIndex:" + this.qualityLevels().selectedIndex),
- this.trigger("qualitychange"),
- this.trigger({
- level: this.player_.qualityLevels()[r],
- type: "changeHLSP2P"
- }),
- this.mainContentQuality_ = t
- }
- }
- ,
- e.getMainContentQuality = function() {
- return this.mainContentQuality_
- }
- ,
- e.getMainContentQuality = function() {
- return this.mainContentQuality_
- }
- ,
- e.durationChange_ = function() {
- this.log("durationChange_"),
- this.log(this.ads.isInAdMode())
- }
- ,
- e.handleADSEnded_ = function() {
- this.log("handleADSEnded_"),
- this.log(this.ads.isInAdMode())
- }
- ,
- e.switchQuality = function(e, t) {
- this.options().debug && this.log("[player]switchQuality()" + this.getCurentQuality() + " switchQuality to:" + e);
- var n = this.options_.playbackQualities
- , i = this.options_.playbackQualityIndex[n.indexOf(e)]
- , r = this.player_.qualityLevels().length;
- this.options().debug && this.log("[player] switchQuality to index:" + i);
- for (var s = 0; s < r; s++)
- i === s ? (this.player_.qualityLevels()[s].enabled = !0,
- this.options().debug && this.log("[player] switchQuality() currentIndexInlevels i:" + s),
- this.trigger({
- level: this.player_.qualityLevels()[s],
- type: "changeHLSP2P"
- })) : this.player_.qualityLevels()[s].enabled = !1,
- this.options().debug && this.log("[player]switchQuality() i:" + s + ":" + this.player_.qualityLevels()[s].enabled);
- if (this.options().debug && this.log("enableQualityLock:" + this.options().enableQualityLock),
- this.options().enableQualityLock || "undefined" == typeof this.options().enableQualityLock) {
- if (!0 === t)
- return;
- this.options().debug && this.log("[player] hls-select-index-change :" + Na.indexOf(e)),
- this.trigger({
- type: "hls-select-index-change",
- data: Na.indexOf(e)
- })
- }
- this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
- lastQuality: e,
- lastVolume: this.volume()
- })
- }
- ,
- e.switchQualityDirect = function(e) {
- this.options().debug && this.log("[player]switchQualityDirect()" + this.getCurentQualityLabel() + " switchQuality to:" + e);
- var t = this.options_.playbackQualities
- , n = this.options_.playbackQualityIndex[t.lastIndexOf(e)];
- this.options().debug && this.log("[player] switchQualityDirect() to lastLevelIndex:" + this.qualityLevels().selectedIndex + "to false"),
- this.qualityLevels()[this.qualityLevels().selectedIndex].enabled = !1,
- this.options().debug && this.log("[player] switchQualityDirect() to newLevelIndex:" + n + "to true"),
- this.qualityLevels()[n].enabled = !0,
- this.mainContentQuality_ = e,
- this.trigger({
- level: this.player_.qualityLevels()[n],
- type: "changeHLSP2P"
- }),
- this.ads && !1 === this.ads.isInAdMode() && cr.set("h5vodlocaldata", {
- lastQuality: e,
- lastVolume: this.volume()
- })
- }
- ,
- e.getCurentQuality = function() {
- 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)]
- }
- ,
- e.getCurentQualityLabel = function() {
- return this.options_.playbackQualities[this.qualityLevels().selectedIndex]
- }
- ,
- e.selectedQuality = function(e) {
- null !== (this.selectedQuality_ = e) && this.selectedQuality_ !== e && (this.selectedQuality_ = e,
- this.trigger({
- type: "qualityselected",
- quality: e
- }))
- }
- ,
- e.getSelectedQuality = function() {
- return this.selectedQuality_
- }
- ,
- e.getCurentBitrate = function() {
- var e = (this.options_.playbackQualityIndex || this.options_.playerOptions && this.options_.playerOptions.playbackQualityIndex).indexOf(this.qualityLevels().selectedIndex);
- return this.player_.qualityLevels()[e] ? this.player_.qualityLevels()[e].bitrate : null
- }
- ,
- e.getQualityLevels = function() {
- return this.options_.playbackQualities || this.options_.playerOptions && this.options_.playerOptions.playbackQualities
- }
- ,
- e.defaultPlaybackRate = function(e) {
- return void 0 !== e ? this.techCall_("setDefaultPlaybackRate", e) : this.tech_ && this.tech_.featuresPlaybackRate ? this.techGet_("defaultPlaybackRate") : 1
- }
- ,
- e.defaultPlaybackQuality = function(e) {
- return void 0 !== e ? this.techCall_("setDefaultPlaybackQuality", e) : this.tech_ && this.tech_.featuresPlaybackQuality ? this.techGet_("defaultPlaybackQuality") : 1
- }
- ,
- e.changeAudioMode = function(e) {
- this.trigger({
- type: "changeAudioMode",
- audioMode: e
- })
- }
- ,
- e.isAudio = function(e) {
- if (void 0 === e)
- return !!this.isAudio_;
- this.isAudio_ = !!e
- }
- ,
- e.addTextTrack = function(e, t, n) {
- if (this.tech_)
- return this.tech_.addTextTrack(e, t, n)
- }
- ,
- e.addRemoteTextTrack = function(e, t) {
- if (this.tech_)
- return this.tech_.addRemoteTextTrack(e, t)
- }
- ,
- e.removeRemoteTextTrack = function(e) {
- void 0 === e && (e = {});
- var t = e.track;
- if (t = t || e,
- this.tech_)
- return this.tech_.removeRemoteTextTrack(t)
- }
- ,
- e.getVideoPlaybackQuality = function() {
- return this.techGet_("getVideoPlaybackQuality")
- }
- ,
- e.videoWidth = function() {
- return this.tech_ && this.tech_.videoWidth && this.tech_.videoWidth() || 0
- }
- ,
- e.videoHeight = function() {
- return this.tech_ && this.tech_.videoHeight && this.tech_.videoHeight() || 0
- }
- ,
- e.language = function(e) {
- if (void 0 === e)
- return this.language_;
- this.language_ = String(e).toLowerCase()
- }
- ,
- e.languages = function() {
- return Fe(d.prototype.options_.languages, this.languages_)
- }
- ,
- e.toJSON = function() {
- var e = Fe(this.options_)
- , t = e.tracks;
- e.tracks = [];
- for (var n = 0; n < t.length; n++) {
- var i = t[n];
- (i = Fe(i)).player = void 0,
- e.tracks[n] = i
- }
- return e
- }
- ,
- e.createModal = function(e, t) {
- var n = this;
- (t = t || {}).content = e || "";
- var i = new Ot(this,t);
- return this.addChild(i),
- i.on("dispose", function() {
- n.removeChild(i)
- }),
- i.open(),
- i
- }
- ,
- e.updateCurrentBreakpoint_ = function() {
- if (this.responsive())
- for (var e = this.currentBreakpoint(), t = this.currentWidth(), n = 0; n < Ia.length; n++) {
- var i = Ia[n];
- if (t <= this.breakpoints_[i]) {
- if (e === i)
- return;
- e && this.removeClass(Ma[e]),
- this.addClass(Ma[i]),
- this.breakpoint_ = i;
- break
- }
- }
- }
- ,
- e.removeCurrentBreakpoint_ = function() {
- var e = this.currentBreakpointClass();
- this.breakpoint_ = "",
- e && this.removeClass(e)
- }
- ,
- e.breakpoints = function(e) {
- return void 0 === e || (this.breakpoint_ = "",
- this.breakpoints_ = b({}, ja, e),
- this.updateCurrentBreakpoint_()),
- b(this.breakpoints_)
- }
- ,
- e.responsive = function(e) {
- return void 0 === e ? this.responsive_ : (e = Boolean(e)) !== this.responsive_ ? ((this.responsive_ = e) ? (this.on("playerresize", this.updateCurrentBreakpoint_),
- this.updateCurrentBreakpoint_()) : (this.off("playerresize", this.updateCurrentBreakpoint_),
- this.removeCurrentBreakpoint_()),
- e) : void 0
- }
- ,
- e.currentBreakpoint = function() {
- return this.breakpoint_
- }
- ,
- e.currentBreakpointClass = function() {
- return Ma[this.breakpoint_] || ""
- }
- ,
- e.loadMedia = function(e, t) {
- var n = this;
- if (e && "object" == typeof e) {
- this.reset(),
- this.cache_.media = Fe(e);
- var i = this.cache_.media
- , r = i.artwork
- , s = i.poster
- , a = i.src
- , o = i.textTracks;
- !r && s && (this.cache_.media.artwork = [{
- src: s,
- type: Ei(s)
- }]),
- a && this.src(a),
- s && this.poster(s),
- Array.isArray(o) && o.forEach(function(e) {
- return n.addRemoteTextTrack(e, !1)
- }),
- this.ready(t)
- }
- }
- ,
- e.getMedia = function() {
- if (this.cache_.media)
- return Fe(this.cache_.media);
- var e = this.poster()
- , t = {
- src: this.currentSources(),
- textTracks: Array.prototype.map.call(this.remoteTextTracks(), function(e) {
- return {
- kind: e.kind,
- label: e.label,
- language: e.language,
- src: e.src
- }
- })
- };
- return e && (t.poster = e,
- t.artwork = [{
- src: t.poster,
- type: Ei(t.poster)
- }]),
- t
- }
- ,
- e.setAdsLabel = function(e, t, n) {
- void 0 === e ? (this.getChild("adsOverLay").hide(),
- this.changingToMainContent_ = !0) : (this.changingToMainContent_ = !1,
- this.getChild("adsOverLay").show(),
- this.getChild("adsOverLay").updateTextNode(e, t, n))
- }
- ,
- e.changingToMainContent = function() {
- return this.changingToMainContent_
- }
- ,
- e.getSavedPosition = function(e) {
- var t = 0
- , n = cr.get("h5vodLastPostion")
- , i = (new Date).getTime() / 1e3;
- return void 0 !== n && e === n.videoid && n.timestamp < i && n.timestamp + 604800 > i && void 0 !== n.position && (t = n.position),
- t
- }
- ,
- e.saveVideoPosition = function(e) {
- if (!this.ads || !0 !== this.ads.isInAdMode()) {
- var t = this.currentTime();
- if (!(t < 5))
- if (t < 30 || t + 30 > this.duration())
- cr.remove("h5vodLastPostion");
- else {
- var n = (new Date).getTime() / 1e3;
- cr.set("h5vodLastPostion", {
- videoid: e,
- timestamp: n,
- position: t
- })
- }
- }
- }
- ,
- d.getTagSettings = function(e) {
- var t = {
- sources: [],
- tracks: []
- }
- , n = O(e)
- , i = n["data-setup"];
- if (P(e, "vjs-fill") && (n.fill = !0),
- P(e, "vjs-fluid") && (n.fluid = !0),
- null !== i) {
- var r = wt(i || "{}")
- , s = r[0]
- , a = r[1];
- s && m.error(s),
- b(n, a)
- }
- if (b(t, n),
- e.hasChildNodes())
- for (var o = e.childNodes, l = 0, u = o.length; l < u; l++) {
- var c = o[l]
- , h = c.nodeName.toLowerCase();
- "source" === h ? t.sources.push(O(c)) : "track" === h && t.tracks.push(O(c))
- }
- return t
- }
- ,
- e.flexNotSupported_ = function() {
- var e = f.createElement("i");
- return !("flexBasis"in e.style || "webkitFlexBasis"in e.style || "mozFlexBasis"in e.style || "msFlexBasis"in e.style || "msFlexOrder"in e.style)
- }
- ,
- d
- }(He);
- Dn.names.forEach(function(e) {
- var t = Dn[e];
- Ra.prototype[t.getterName] = function() {
- return this.tech_ ? this.tech_[t.getterName]() : (this[t.privateName] = this[t.privateName] || new t.ListClass,
- this[t.privateName])
- }
- }),
- Ra.prototype.crossorigin = Ra.prototype.crossOrigin,
- Ra.players = {};
- var Fa = p.navigator;
- Ra.prototype.options_ = {
- techOrder: pi.defaultTechOrder_,
- html5: {},
- flash: {},
- inactivityTimeout: 1e3,
- playbackRates: [],
- liveui: !1,
- children: ["mediaLoader", "adsOverLay", "pauseAdOverLay", "bannerAdOverLay", "posterImage", "VipSkipAdTip", "barrageLayer", "chooseVideoPanel", "loadingSpinner", "switchBezel", "playToggleMini", "bigPlayButton", "liveTracker", "controlBar", "errorDisplay", "contextMenuButton", "resizeManager"],
- language: Fa && (Fa.languages && Fa.languages[0] || Fa.userLanguage || Fa.language) || "en",
- languages: {},
- notSupportedMessage: "No compatible source was found for this media.",
- fullscreen: {
- options: {
- navigationUI: "hide"
- }
- },
- breakpoints: {},
- responsive: !1
- },
- "pictureInPictureEnabled"in f && Ra.prototype.options_.children.push("pictureInPictureToggle"),
- ["ended", "seeking", "seekable", "networkState", "readyState"].forEach(function(e) {
- Ra.prototype[e] = function() {
- return this.techGet_(e)
- }
- }),
- Pa.forEach(function(e) {
- Ra.prototype["handleTech" + Re(e) + "_"] = function() {
- return this.trigger(e)
- }
- }),
- He.registerComponent("Player", Ra);
- var Ha = n(function(n) {
- function i(e, t) {
- return n.exports = i = Object.setPrototypeOf || function(e, t) {
- return e.__proto__ = t,
- e
- }
- ,
- i(e, t)
- }
- n.exports = i
- });
- function Va(e) {
- return Ya.hasOwnProperty(e)
- }
- function Qa(e) {
- return Va(e) ? Ya[e] : void 0
- }
- function Ua(e, t) {
- e[Ga] = e[Ga] || {},
- e[Ga][t] = !0
- }
- function qa(e, t, n) {
- var i = (n ? "before" : "") + "pluginsetup";
- e.trigger(i, t),
- e.trigger(i + ":" + t.name, t)
- }
- function za(r, s) {
- return s.prototype.name = r,
- function() {
- qa(this, {
- name: r,
- plugin: s,
- instance: null
- }, !0);
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- var i = Ka(s, [this].concat(t));
- return this[r] = function() {
- return i
- }
- ,
- qa(this, i.getEventHash()),
- i
- }
- }
- var Wa = function() {
- if ("undefined" == typeof Reflect || !Reflect.construct)
- return !1;
- if (Reflect.construct.sham)
- return !1;
- if ("function" == typeof Proxy)
- return !0;
- try {
- return Date.prototype.toString.call(Reflect.construct(Date, [], function() {})),
- !0
- } catch (e) {
- return !1
- }
- }
- , Ka = n(function(i) {
- function r(e, t, n) {
- return Wa() ? i.exports = r = Reflect.construct : i.exports = r = function(e, t, n) {
- var i = [null];
- i.push.apply(i, t);
- var r = new (Function.bind.apply(e, i));
- return n && Ha(r, n.prototype),
- r
- }
- ,
- r.apply(null, arguments)
- }
- i.exports = r
- })
- , Xa = "plugin"
- , Ga = "activePlugins_"
- , Ya = {}
- , $a = function() {
- function n(e) {
- if (this.constructor === n)
- throw new Error("Plugin must be sub-classed; not directly instantiated.");
- this.player = e,
- Oe(this),
- delete this.trigger,
- De(this, this.constructor.defaultState),
- Ua(e, this.name),
- this.dispose = Te(this, this.dispose),
- e.on("dispose", this.dispose)
- }
- var e = n.prototype;
- return e.version = function() {
- return this.constructor.VERSION
- }
- ,
- e.getEventHash = function(e) {
- return void 0 === e && (e = {}),
- e.name = this.name,
- e.plugin = this.constructor,
- e.instance = this,
- e
- }
- ,
- e.trigger = function(e, t) {
- return void 0 === t && (t = {}),
- me(this.eventBusEl_, e, this.getEventHash(t))
- }
- ,
- e.handleStateChanged = function(e) {}
- ,
- e.dispose = function() {
- var e = this.name
- , t = this.player;
- this.trigger("dispose"),
- this.off(),
- t.off("dispose", this.dispose),
- t[Ga][e] = !1,
- this.player = this.state = null,
- t[e] = za(e, Ya[e])
- }
- ,
- n.isBasic = function(e) {
- var t = "string" == typeof e ? Qa(e) : e;
- return "function" == typeof t && !n.prototype.isPrototypeOf(t.prototype)
- }
- ,
- n.registerPlugin = function(e, t) {
- if ("string" != typeof e)
- throw new Error('Illegal plugin name, "' + e + '", must be a string, was ' + typeof e + ".");
- if (Va(e))
- m.warn('A plugin named "' + e + '" already exists. You may want to avoid re-registering plugins!');
- else if (Ra.prototype.hasOwnProperty(e))
- throw new Error('Illegal plugin name, "' + e + '", cannot share a name with an existing player method!');
- if ("function" != typeof t)
- throw new Error('Illegal plugin for "' + e + '", must be a function, was ' + typeof t + ".");
- return Ya[e] = t,
- e !== Xa && (n.isBasic(t) ? Ra.prototype[e] = function(t, n) {
- function i() {
- qa(this, {
- name: t,
- plugin: n,
- instance: null
- }, !0);
- var e = n.apply(this, arguments);
- return Ua(this, t),
- qa(this, {
- name: t,
- plugin: n,
- instance: e
- }),
- e
- }
- return Object.keys(n).forEach(function(e) {
- i[e] = n[e]
- }),
- i
- }(e, t) : Ra.prototype[e] = za(e, t)),
- t
- }
- ,
- n.deregisterPlugin = function(e) {
- if (e === Xa)
- throw new Error("Cannot de-register base plugin.");
- Va(e) && (delete Ya[e],
- delete Ra.prototype[e])
- }
- ,
- n.getPlugins = function(e) {
- var n;
- return void 0 === e && (e = Object.keys(Ya)),
- e.forEach(function(e) {
- var t = Qa(e);
- t && ((n = n || {})[e] = t)
- }),
- n
- }
- ,
- n.getPluginVersion = function(e) {
- var t = Qa(e);
- return t && t.VERSION || ""
- }
- ,
- n
- }();
- $a.getPlugin = Qa,
- $a.BASE_PLUGIN_NAME = Xa,
- $a.registerPlugin(Xa, $a),
- Ra.prototype.usingPlugin = function(e) {
- return !!this[Ga] && !0 === this[Ga][e]
- }
- ,
- Ra.prototype.hasPlugin = function(e) {
- return !!Va(e)
- }
- ;
- var Ja = function(e, t) {
- if ("function" != typeof t && null !== t)
- throw new TypeError("Super expression must either be null or a function");
- e.prototype = Object.create(t && t.prototype, {
- constructor: {
- value: e,
- writable: !0,
- configurable: !0
- }
- }),
- t && Ha(e, t)
- };
- /*! @name m3u8-parser @version 4.4.0 @license Apache-2.0 */
- function Za() {
- return (Za = Object.assign || function(e) {
- for (var t = 1; t < arguments.length; t++) {
- var n = arguments[t];
- for (var i in n)
- Object.prototype.hasOwnProperty.call(n, i) && (e[i] = n[i])
- }
- return e
- }
- ).apply(this, arguments)
- }
- function eo(e, t) {
- e.prototype = Object.create(t.prototype),
- (e.prototype.constructor = e).__proto__ = t
- }
- function to(e) {
- for (var t, n = e.split(new RegExp('(?:^|,)((?:[^=]*)=(?:"[^"]*"|[^,]*))')), i = {}, r = n.length; r--; )
- "" !== n[r] && ((t = /([^=]*)=(.*)/.exec(n[r]).slice(1))[0] = t[0].replace(/^\s+|\s+$/g, ""),
- t[1] = t[1].replace(/^\s+|\s+$/g, ""),
- t[1] = t[1].replace(/^['"](.*)['"]$/g, "$1"),
- i[t[0]] = t[1]);
- return i
- }
- var no = function() {
- function e() {
- this.listeners = {}
- }
- var t = e.prototype;
- return t.on = function(e, t) {
- this.listeners[e] || (this.listeners[e] = []),
- this.listeners[e].push(t)
- }
- ,
- t.off = function(e, t) {
- if (!this.listeners[e])
- return !1;
- var n = this.listeners[e].indexOf(t);
- return this.listeners[e].splice(n, 1),
- -1 < n
- }
- ,
- t.trigger = function(e, t) {
- var n, i, r, s = this.listeners[e];
- if (s)
- if (2 === arguments.length)
- for (i = s.length,
- n = 0; n < i; ++n)
- s[n].call(this, t);
- else
- for (r = Array.prototype.slice.call(arguments, 1),
- i = s.length,
- n = 0; n < i; ++n)
- s[n].apply(this, r)
- }
- ,
- t.dispose = function() {
- this.listeners = {}
- }
- ,
- t.pipe = function(t) {
- this.on("data", function(e) {
- t.push(e)
- })
- }
- ,
- e
- }()
- , io = function(t) {
- function e() {
- var e;
- return (e = t.call(this) || this).buffer = "",
- e
- }
- return eo(e, t),
- e.prototype.push = function(e) {
- var t;
- for (this.buffer += e,
- t = this.buffer.indexOf("\n"); -1 < t; t = this.buffer.indexOf("\n"))
- this.trigger("data", this.buffer.substring(0, t)),
- this.buffer = this.buffer.substring(t + 1)
- }
- ,
- e
- }(no)
- , ro = function(t) {
- function e() {
- var e;
- return (e = t.call(this) || this).customParsers = [],
- e.tagMappers = [],
- e
- }
- eo(e, t);
- var n = e.prototype;
- return n.push = function(i) {
- var l, u, c = this;
- 0 !== (i = i.trim()).length && ("#" === i[0] ? this.tagMappers.reduce(function(e, t) {
- var n = t(i);
- return n === i ? e : e.concat([n])
- }, [i]).forEach(function(e) {
- for (var t = 0; t < c.customParsers.length; t++)
- if (c.customParsers[t].call(c, e))
- return;
- if (0 === e.indexOf("#EXT"))
- if (e = e.replace("\r", ""),
- l = /^#EXTM3U/.exec(e))
- c.trigger("data", {
- type: "tag",
- tagType: "m3u"
- });
- else {
- if (l = /^#EXTINF:?([0-9\.]*)?,?(.*)?$/.exec(e))
- return u = {
- type: "tag",
- tagType: "inf"
- },
- l[1] && (u.duration = parseFloat(l[1])),
- l[2] && (u.title = l[2]),
- void c.trigger("data", u);
- if (l = /^#EXT-X-TARGETDURATION:?([0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "targetduration"
- },
- l[1] && (u.duration = parseInt(l[1], 10)),
- void c.trigger("data", u);
- if (l = /^#ZEN-TOTAL-DURATION:?([0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "totalduration"
- },
- l[1] && (u.duration = parseInt(l[1], 10)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-VERSION:?([0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "version"
- },
- l[1] && (u.version = parseInt(l[1], 10)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-MEDIA-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "media-sequence"
- },
- l[1] && (u.number = parseInt(l[1], 10)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-DISCONTINUITY-SEQUENCE:?(\-?[0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "discontinuity-sequence"
- },
- l[1] && (u.number = parseInt(l[1], 10)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-PLAYLIST-TYPE:?(.*)?$/.exec(e))
- return u = {
- type: "tag",
- tagType: "playlist-type"
- },
- l[1] && (u.playlistType = l[1]),
- void c.trigger("data", u);
- if (l = /^#EXT-X-BYTERANGE:?([0-9.]*)?@?([0-9.]*)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "byterange"
- },
- l[1] && (u.length = parseInt(l[1], 10)),
- l[2] && (u.offset = parseInt(l[2], 10)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-ALLOW-CACHE:?(YES|NO)?/.exec(e))
- return u = {
- type: "tag",
- tagType: "allow-cache"
- },
- l[1] && (u.allowed = !/NO/.test(l[1])),
- void c.trigger("data", u);
- if (l = /^#EXT-X-MAP:?(.*)$/.exec(e)) {
- if (u = {
- type: "tag",
- tagType: "map"
- },
- l[1]) {
- var n = to(l[1]);
- if (n.URI && (u.uri = n.URI),
- n.BYTERANGE) {
- var i = n.BYTERANGE.split("@")
- , r = i[0]
- , s = i[1];
- u.byterange = {},
- r && (u.byterange.length = parseInt(r, 10)),
- s && (u.byterange.offset = parseInt(s, 10))
- }
- }
- c.trigger("data", u)
- } else if (l = /^#EXT-X-STREAM-INF:?(.*)$/.exec(e)) {
- if (u = {
- type: "tag",
- tagType: "stream-inf"
- },
- l[1]) {
- if (u.attributes = to(l[1]),
- u.attributes.RESOLUTION) {
- var a = u.attributes.RESOLUTION.split("x")
- , o = {};
- a[0] && (o.width = parseInt(a[0], 10)),
- a[1] && (o.height = parseInt(a[1], 10)),
- u.attributes.RESOLUTION = o
- }
- u.attributes.BANDWIDTH && (u.attributes.BANDWIDTH = parseInt(u.attributes.BANDWIDTH, 10)),
- u.attributes["PROGRAM-ID"] && (u.attributes["PROGRAM-ID"] = parseInt(u.attributes["PROGRAM-ID"], 10))
- }
- c.trigger("data", u)
- } else {
- if (l = /^#EXT-X-MEDIA:?(.*)$/.exec(e))
- return u = {
- type: "tag",
- tagType: "media"
- },
- l[1] && (u.attributes = to(l[1])),
- void c.trigger("data", u);
- if (l = /^#EXT-X-ENDLIST/.exec(e))
- c.trigger("data", {
- type: "tag",
- tagType: "endlist"
- });
- else if (l = /^#EXT-X-DISCONTINUITY/.exec(e))
- c.trigger("data", {
- type: "tag",
- tagType: "discontinuity"
- });
- else {
- if (l = /^#EXT-X-PROGRAM-DATE-TIME:?(.*)$/.exec(e))
- return u = {
- type: "tag",
- tagType: "program-date-time"
- },
- l[1] && (u.dateTimeString = l[1],
- u.dateTimeObject = new Date(l[1])),
- void c.trigger("data", u);
- if (l = /^#EXT-X-KEY:?(.*)$/.exec(e))
- return u = {
- type: "tag",
- tagType: "key"
- },
- l[1] && (u.attributes = to(l[1]),
- u.attributes.IV && ("0x" === u.attributes.IV.substring(0, 2).toLowerCase() && (u.attributes.IV = u.attributes.IV.substring(2)),
- u.attributes.IV = u.attributes.IV.match(/.{8}/g),
- u.attributes.IV[0] = parseInt(u.attributes.IV[0], 16),
- u.attributes.IV[1] = parseInt(u.attributes.IV[1], 16),
- u.attributes.IV[2] = parseInt(u.attributes.IV[2], 16),
- u.attributes.IV[3] = parseInt(u.attributes.IV[3], 16),
- u.attributes.IV = new Uint32Array(u.attributes.IV))),
- void c.trigger("data", u);
- if (l = /^#EXT-X-START:?(.*)$/.exec(e))
- return u = {
- type: "tag",
- tagType: "start"
- },
- l[1] && (u.attributes = to(l[1]),
- u.attributes["TIME-OFFSET"] = parseFloat(u.attributes["TIME-OFFSET"]),
- u.attributes.PRECISE = /YES/.test(u.attributes.PRECISE)),
- void c.trigger("data", u);
- if (l = /^#EXT-X-CUE-OUT-CONT:?(.*)?$/.exec(e))
- return u = {
- type: "tag",
- tagType: "cue-out-cont"
- },
- l[1] ? u.data = l[1] : u.data = "",
- void c.trigger("data", u);
- if (l = /^#EXT-X-CUE-OUT:?(.*)?$/.exec(e))
- return u = {
- type: "tag",
- tagType: "cue-out"
- },
- l[1] ? u.data = l[1] : u.data = "",
- void c.trigger("data", u);
- if (l = /^#EXT-X-CUE-IN:?(.*)?$/.exec(e))
- return u = {
- type: "tag",
- tagType: "cue-in"
- },
- l[1] ? u.data = l[1] : u.data = "",
- void c.trigger("data", u);
- c.trigger("data", {
- type: "tag",
- data: e.slice(4)
- })
- }
- }
- }
- else
- c.trigger("data", {
- type: "comment",
- text: e.slice(1)
- })
- }) : this.trigger("data", {
- type: "uri",
- uri: i
- }))
- }
- ,
- n.addParser = function(e) {
- var t = this
- , n = e.expression
- , i = e.customType
- , r = e.dataParser
- , s = e.segment;
- "function" != typeof r && (r = function(e) {
- return e
- }
- ),
- this.customParsers.push(function(e) {
- if (n.exec(e))
- return t.trigger("data", {
- type: "custom",
- data: r(e),
- customType: i,
- segment: s
- }),
- !0
- })
- }
- ,
- n.addTagMapper = function(e) {
- var t = e.expression
- , n = e.map;
- this.tagMappers.push(function(e) {
- return t.test(e) ? n(e) : e
- })
- }
- ,
- e
- }(no);
- var so = function(t) {
- function e() {
- var e;
- (e = t.call(this) || this).lineStream = new io,
- e.parseStream = new ro,
- e.lineStream.pipe(e.parseStream);
- var r, s, a = function(e) {
- if (void 0 === e)
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e
- }(e), o = [], l = {}, u = {
- AUDIO: {},
- VIDEO: {},
- "CLOSED-CAPTIONS": {},
- SUBTITLES: {}
- }, c = 0;
- return e.manifest = {
- allowCache: !0,
- discontinuityStarts: [],
- segments: []
- },
- e.parseStream.on("data", function(t) {
- var n, i;
- ({
- tag: function() {
- ({
- "allow-cache": function() {
- this.manifest.allowCache = t.allowed,
- "allowed"in t || (this.trigger("info", {
- message: "defaulting allowCache to YES"
- }),
- this.manifest.allowCache = !0)
- },
- byterange: function() {
- var e = {};
- "length"in t && ((l.byterange = e).length = t.length,
- "offset"in t || (this.trigger("info", {
- message: "defaulting offset to zero"
- }),
- t.offset = 0)),
- "offset"in t && ((l.byterange = e).offset = t.offset)
- },
- endlist: function() {
- this.manifest.endList = !0
- },
- inf: function() {
- "mediaSequence"in this.manifest || (this.manifest.mediaSequence = 0,
- this.trigger("info", {
- message: "defaulting media sequence to zero"
- })),
- "discontinuitySequence"in this.manifest || (this.manifest.discontinuitySequence = 0,
- this.trigger("info", {
- message: "defaulting discontinuity sequence to zero"
- })),
- 0 < t.duration && (l.duration = t.duration),
- 0 === t.duration && (l.duration = .01,
- this.trigger("info", {
- message: "updating zero segment duration to a small value"
- })),
- this.manifest.segments = o
- },
- key: function() {
- if (t.attributes)
- if ("NONE" !== t.attributes.METHOD)
- if (t.attributes.URI) {
- if ("urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed" === t.attributes.KEYFORMAT) {
- return -1 === ["SAMPLE-AES", "SAMPLE-AES-CTR", "SAMPLE-AES-CENC"].indexOf(t.attributes.METHOD) ? void this.trigger("warn", {
- message: "invalid key method provided for Widevine"
- }) : ("SAMPLE-AES-CENC" === t.attributes.METHOD && this.trigger("warn", {
- message: "SAMPLE-AES-CENC is deprecated, please use SAMPLE-AES-CTR instead"
- }),
- "data:text/plain;base64," !== t.attributes.URI.substring(0, 23) ? void this.trigger("warn", {
- message: "invalid key URI provided for Widevine"
- }) : t.attributes.KEYID && "0x" === t.attributes.KEYID.substring(0, 2) ? void (this.manifest.contentProtection = {
- "com.widevine.alpha": {
- attributes: {
- schemeIdUri: t.attributes.KEYFORMAT,
- keyId: t.attributes.KEYID.substring(2)
- },
- pssh: function(e) {
- for (var t = p.atob(e || ""), n = new Uint8Array(t.length), i = 0; i < t.length; i++)
- n[i] = t.charCodeAt(i);
- return n
- }(t.attributes.URI.split(",")[1])
- }
- }) : void this.trigger("warn", {
- message: "invalid key ID provided for Widevine"
- }))
- }
- t.attributes.METHOD || this.trigger("warn", {
- message: "defaulting key method to AES-128"
- }),
- s = {
- method: t.attributes.METHOD || "AES-128",
- uri: t.attributes.URI
- },
- "undefined" != typeof t.attributes.IV && (s.iv = t.attributes.IV)
- } else
- this.trigger("warn", {
- message: "ignoring key declaration without URI"
- });
- else
- s = null;
- else
- this.trigger("warn", {
- message: "ignoring key declaration without attribute list"
- })
- },
- "media-sequence": function() {
- isFinite(t.number) ? this.manifest.mediaSequence = t.number : this.trigger("warn", {
- message: "ignoring invalid media sequence: " + t.number
- })
- },
- "discontinuity-sequence": function() {
- isFinite(t.number) ? (this.manifest.discontinuitySequence = t.number,
- c = t.number) : this.trigger("warn", {
- message: "ignoring invalid discontinuity sequence: " + t.number
- })
- },
- "playlist-type": function() {
- /VOD|EVENT/.test(t.playlistType) ? this.manifest.playlistType = t.playlistType : this.trigger("warn", {
- message: "ignoring unknown playlist type: " + t.playlist
- })
- },
- map: function() {
- r = {},
- t.uri && (r.uri = t.uri),
- t.byterange && (r.byterange = t.byterange)
- },
- "stream-inf": function() {
- this.manifest.playlists = o,
- this.manifest.mediaGroups = this.manifest.mediaGroups || u,
- t.attributes ? (l.attributes || (l.attributes = {}),
- Za(l.attributes, t.attributes)) : this.trigger("warn", {
- message: "ignoring empty stream-inf attributes"
- })
- },
- media: function() {
- if (this.manifest.mediaGroups = this.manifest.mediaGroups || u,
- t.attributes && t.attributes.TYPE && t.attributes["GROUP-ID"] && t.attributes.NAME) {
- var e = this.manifest.mediaGroups[t.attributes.TYPE];
- e[t.attributes["GROUP-ID"]] = e[t.attributes["GROUP-ID"]] || {},
- n = e[t.attributes["GROUP-ID"]],
- (i = {
- default: /yes/i.test(t.attributes.DEFAULT)
- }).default ? i.autoselect = !0 : i.autoselect = /yes/i.test(t.attributes.AUTOSELECT),
- t.attributes.LANGUAGE && (i.language = t.attributes.LANGUAGE),
- t.attributes.URI && (i.uri = t.attributes.URI),
- t.attributes["INSTREAM-ID"] && (i.instreamId = t.attributes["INSTREAM-ID"]),
- t.attributes.CHARACTERISTICS && (i.characteristics = t.attributes.CHARACTERISTICS),
- t.attributes.FORCED && (i.forced = /yes/i.test(t.attributes.FORCED)),
- n[t.attributes.NAME] = i
- } else
- this.trigger("warn", {
- message: "ignoring incomplete or missing media group"
- })
- },
- discontinuity: function() {
- c += 1,
- l.discontinuity = !0,
- this.manifest.discontinuityStarts.push(o.length)
- },
- "program-date-time": function() {
- "undefined" == typeof this.manifest.dateTimeString && (this.manifest.dateTimeString = t.dateTimeString,
- this.manifest.dateTimeObject = t.dateTimeObject),
- l.dateTimeString = t.dateTimeString,
- l.dateTimeObject = t.dateTimeObject
- },
- targetduration: function() {
- !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
- message: "ignoring invalid target duration: " + t.duration
- }) : this.manifest.targetDuration = t.duration
- },
- totalduration: function() {
- !isFinite(t.duration) || t.duration < 0 ? this.trigger("warn", {
- message: "ignoring invalid total duration: " + t.duration
- }) : this.manifest.totalDuration = t.duration
- },
- start: function() {
- t.attributes && !isNaN(t.attributes["TIME-OFFSET"]) ? this.manifest.start = {
- timeOffset: t.attributes["TIME-OFFSET"],
- precise: t.attributes.PRECISE
- } : this.trigger("warn", {
- message: "ignoring start declaration without appropriate attribute list"
- })
- },
- "cue-out": function() {
- l.cueOut = t.data
- },
- "cue-out-cont": function() {
- l.cueOutCont = t.data
- },
- "cue-in": function() {
- l.cueIn = t.data
- }
- }[t.tagType] || function() {}
- ).call(a)
- },
- uri: function() {
- l.uri = t.uri,
- o.push(l),
- !this.manifest.targetDuration || "duration"in l || (this.trigger("warn", {
- message: "defaulting segment duration to the target duration"
- }),
- l.duration = this.manifest.targetDuration),
- s && (l.key = s),
- l.timeline = c,
- r && (l.map = r),
- l = {}
- },
- comment: function() {},
- custom: function() {
- t.segment ? (l.custom = l.custom || {},
- l.custom[t.customType] = t.data) : (this.manifest.custom = this.manifest.custom || {},
- this.manifest.custom[t.customType] = t.data)
- }
- })[t.type].call(a)
- }),
- e
- }
- eo(e, t);
- var n = e.prototype;
- return n.push = function(e) {
- this.lineStream.push(e)
- }
- ,
- n.end = function() {
- this.lineStream.push("\n")
- }
- ,
- n.addParser = function(e) {
- this.parseStream.addParser(e)
- }
- ,
- n.addTagMapper = function(e) {
- this.parseStream.addTagMapper(e)
- }
- ,
- e
- }(no)
- , ao = function(e) {
- return 0 === e.indexOf("#") ? e.slice(1) : e
- };
- function oo(e, n, t) {
- var i = oo.getPlayer(e);
- if (i)
- return n && m.warn('Player "' + e + '" is already initialised. Options will not be applied.'),
- t && i.ready(t),
- i;
- var r = "string" == typeof e ? $("#" + ao(e)) : e;
- if (!k(r))
- throw new TypeError("The element or ID supplied is not valid. (videojs)");
- r.ownerDocument.defaultView && r.ownerDocument.body.contains(r) || m.warn("The element supplied is not included in the DOM"),
- n = n || {},
- oo.hooks("beforesetup").forEach(function(e) {
- var t = e(r, Fe(n));
- l(t) && !Array.isArray(t) ? n = Fe(n, t) : m.error("please return an object in beforesetup hooks")
- });
- var s = He.getComponent("Player");
- return i = new s(r,n,t),
- oo.hooks("setup").forEach(function(e) {
- return e(i)
- }),
- !0 === n.debug && (i.log("ads plugin init, version:" + i.ads.VERSION),
- i.log("qualityLevel plugin init, version:"),
- i.log(i.qualityLevels())),
- i.ads({
- debug: !!n.debug,
- timeout: 6e3
- }),
- i
- }
- if (oo.hooks_ = {},
- oo.hooks = function(e, t) {
- return oo.hooks_[e] = oo.hooks_[e] || [],
- t && (oo.hooks_[e] = oo.hooks_[e].concat(t)),
- oo.hooks_[e]
- }
- ,
- oo.hook = function(e, t) {
- oo.hooks(e, t)
- }
- ,
- oo.hookOnce = function(n, e) {
- oo.hooks(n, [].concat(e).map(function(t) {
- return function e() {
- return oo.removeHook(n, e),
- t.apply(void 0, arguments)
- }
- }))
- }
- ,
- oo.removeHook = function(e, t) {
- var n = oo.hooks(e).indexOf(t);
- return !(n <= -1) && (oo.hooks_[e] = oo.hooks_[e].slice(),
- oo.hooks_[e].splice(n, 1),
- !0)
- }
- ,
- !0 !== p.VIDEOJS_NO_DYNAMIC_STYLE && C()) {
- var lo = $(".vjs-styles-defaults");
- if (!lo) {
- lo = re("vjs-styles-defaults");
- var uo = $("head");
- uo && uo.insertBefore(lo, uo.firstChild),
- se(lo, "\n .video-js {\n width: 300px;\n height: 150px;\n }\n\n .vjs-fluid {\n padding-top: 56.25%\n }\n ")
- }
- }
- ne(1, oo),
- oo.VERSION = y,
- oo.PLAYER_VERSION = v,
- oo.UPDATE_DATE = g,
- oo.options = Ra.prototype.options_,
- oo.getPlayers = function() {
- return Ra.players
- }
- ,
- oo.getPlayer = function(e) {
- var t, n = Ra.players;
- if ("string" == typeof e) {
- var i = ao(e)
- , r = n[i];
- if (r)
- return r;
- t = $("#" + i)
- } else
- t = e;
- if (k(t)) {
- var s = t
- , a = s.player
- , o = s.playerId;
- if (a || n[o])
- return a || n[o]
- }
- }
- ,
- oo.getAllPlayers = function() {
- return Object.keys(Ra.players).map(function(e) {
- return Ra.players[e]
- }).filter(Boolean)
- }
- ,
- oo.players = Ra.players,
- oo.getComponent = He.getComponent,
- oo.registerComponent = function(e, t) {
- pi.isTech(t) && m.warn("The " + e + " tech was registered as a component. It should instead be registered using videojs.registerTech(name, tech)"),
- He.registerComponent.call(He, e, t)
- }
- ,
- oo.getTech = pi.getTech,
- oo.registerTech = pi.registerTech,
- oo.use = function(e, t) {
- fi[e] = fi[e] || [],
- fi[e].push(t)
- }
- ,
- Object.defineProperty(oo, "middleware", {
- value: {},
- writeable: !1,
- enumerable: !0
- }),
- Object.defineProperty(oo.middleware, "TERMINATOR", {
- value: gi,
- writeable: !1,
- enumerable: !0
- }),
- oo.browser = pt,
- oo.TOUCH_ENABLED = lt,
- oo.extend = function(e, t) {
- void 0 === t && (t = {});
- var n = function() {
- e.apply(this, arguments)
- }
- , i = {};
- for (var r in "object" == typeof t ? (t.constructor !== Object.prototype.constructor && (n = t.constructor),
- i = t) : "function" == typeof t && (n = t),
- Ja(n, e),
- e && (n.super_ = e),
- i)
- i.hasOwnProperty(r) && (n.prototype[r] = i[r]);
- return n
- }
- ,
- oo.mergeOptions = Fe,
- oo.bind = Te,
- oo.registerPlugin = $a.registerPlugin,
- oo.deregisterPlugin = $a.deregisterPlugin,
- oo.plugin = function(e, t) {
- return m.warn("videojs.plugin() is deprecated; use videojs.registerPlugin() instead"),
- $a.registerPlugin(e, t)
- }
- ,
- oo.getPlugins = $a.getPlugins,
- oo.getPlugin = $a.getPlugin,
- oo.getPluginVersion = $a.getPluginVersion,
- oo.addLanguage = function(e, t) {
- var n;
- return e = ("" + e).toLowerCase(),
- oo.options.languages = Fe(oo.options.languages, ((n = {})[e] = t,
- n)),
- oo.options.languages[e]
- }
- ,
- oo.log = m,
- oo.createLogger = _,
- oo.createTimeRange = oo.createTimeRanges = gt,
- oo.formatTime = Bt,
- oo.setFormatTime = function(e) {
- Dt = e
- }
- ,
- oo.resetFormatTime = function() {
- Dt = Nt
- }
- ,
- oo.parseUrl = sn,
- oo.isCrossOrigin = ln,
- oo.EventTarget = ke,
- oo.on = ge,
- oo.one = _e,
- oo.off = ye,
- oo.trigger = me,
- oo.xhr = Zt,
- oo.TextTrack = Ln,
- oo.AudioTrack = In,
- oo.VideoTrack = Mn,
- oo.storePub = cr,
- oo.M3u8Parser = so,
- ["isEl", "isTextNode", "createEl", "hasClass", "addClass", "removeClass", "toggleClass", "setAttributes", "getAttributes", "emptyEl", "appendContent", "insertContent"].forEach(function(e) {
- oo[e] = function() {
- return m.warn("videojs." + e + "() is deprecated; use videojs.dom." + e + "() instead"),
- Z[e].apply(null, arguments)
- }
- }),
- oo.computedStyle = h,
- oo.dom = Z,
- oo.url = un,
- oo.defineLazyProperty = Ea;
- function co(e, t) {
- t.isImmediatePropagationStopped = function() {
- return !0
- }
- ,
- t.cancelBubble = !0,
- t.isPropagationStopped = function() {
- return !0
- }
- }
- function ho(e, t, n) {
- co(0, n),
- e.trigger({
- type: t + n.type,
- originalEvent: n
- })
- }
- function po(e) {
- "playing" === e.type ? function(e, t) {
- e.ads.isInAdMode() && (e.ads.isContentResuming() ? e.ads._contentEnding && ho(e, "content", t) : ho(e, "ad", t))
- }(this, e) : "ended" === e.type ? function(e, t) {
- e.ads.isInAdMode() ? e.ads.isContentResuming() ? (co(0, t),
- e.trigger("resumeended")) : ho(e, "ad", t) : e.ads._contentHasEnded || e.ads.stitchedAds() || (ho(e, "content", t),
- e.trigger("readyforpostroll"))
- }(this, e) : "loadstart" === e.type || "loadeddata" === e.type || "loadedmetadata" === e.type ? function(e, t) {
- if (!("loadstart" === t.type && !e.ads._hasThereBeenALoadStartDuringPlayerLife || "loadeddata" === t.type && !e.ads._hasThereBeenALoadedData || "loadedmetadata" === t.type && !e.ads._hasThereBeenALoadedMetaData))
- if (e.ads.inAdBreak())
- ho(e, "ad", t);
- else {
- if (e.currentSrc() !== e.ads.contentSrc)
- return;
- ho(e, "content", t)
- }
- }(this, e) : "play" === e.type ? function(e, t) {
- e.ads.inAdBreak() ? ho(e, "ad", t) : e.ads.isContentResuming() && ho(e, "content", t)
- }(this, e) : this.ads.isInAdMode() && (this.ads.isContentResuming() ? ho(this, "content", e) : ho(this, "ad", e))
- }
- function fo() {
- !function() {
- if (oo.dom.isInFrame() && "function" != typeof p.__tcfapi) {
- for (var a, e = p, o = {}; e; ) {
- try {
- if (e.frames.__tcfapiLocator) {
- a = e;
- break
- }
- } catch (e) {}
- if (e === p.top)
- break;
- e = e.parent
- }
- if (!a)
- return;
- p.__tcfapi = function(e, t, n, i) {
- var r = Math.random() + ""
- , s = {
- __tcfapiCall: {
- command: e,
- parameter: i,
- version: t,
- callId: r
- }
- };
- o[r] = n,
- a.postMessage(s, "*")
- }
- ,
- p.addEventListener("message", function(e) {
- var t = {};
- try {
- t = "string" == typeof e.data ? JSON.parse(e.data) : e.data
- } catch (e) {}
- var n = t.__tcfapiReturn;
- n && "function" == typeof o[n.callId] && (o[n.callId](n.returnValue, n.success),
- o[n.callId] = null)
- }, !1)
- }
- }(),
- "function" == typeof p.__tcfapi && p.__tcfapi("addEventListener", 2, function(e, t) {
- t && (yo = e)
- })
- }
- function vo(e, t) {
- return t ? encodeURIComponent(e) : e
- }
- function go(e, t, n) {
- if (e && e[n])
- for (var i = e[n], r = Object.keys(i), s = 0; s < r.length; s++) {
- t["{mediainfo." + n + "." + r[s] + "}"] = i[r[s]]
- }
- }
- var yo = {};
- var mo = {
- processMetadataTracks: function(t, n) {
- for (var e = t.textTracks(), i = function(e) {
- "metadata" === e.kind && (t.ads.cueTextTracks.setMetadataTrackMode(e),
- n(t, e))
- }, r = 0; r < e.length; r++)
- i(e[r]);
- e.addEventListener("addtrack", function(e) {
- i(e.track)
- })
- },
- setMetadataTrackMode: function(e) {},
- getSupportedAdCue: function(e, t) {
- return t
- },
- isSupportedAdCue: function(e, t) {
- return !0
- },
- getCueId: function(e, t) {
- return t.id
- }
- };
- function _o() {
- !1 !== this.ads._shouldBlockPlay && (this.paused() || (this.ads.debug("Playback was canceled by cancelContentPlay"),
- this.pause()),
- this.ads._cancelledPlay = !0)
- }
- mo.processAdTrack = function(e, t, n, i) {
- e.ads.includedCues = {};
- for (var r = 0; r < t.length; r++) {
- var s = t[r]
- , a = this.getSupportedAdCue(e, s);
- if (!this.isSupportedAdCue(e, s))
- return void oo.log.warn("Skipping as this is not a supported ad cue.", s);
- var o = this.getCueId(e, s)
- , l = s.startTime;
- if (h = e,
- void 0 !== (d = o) && h.ads.includedCues[d])
- return void oo.log("Skipping ad already seen with ID " + o);
- i && i(e, a, o, l),
- n(e, a, o, l),
- u = e,
- void 0 !== (c = o) && "" !== c && (u.ads.includedCues[c] = !0)
- }
- var u, c, h, d
- }
- ;
- var bo = {}
- , To = oo;
- bo.isMiddlewareMediatorSupported = function() {
- return !To.browser.IS_IOS && !To.browser.IS_ANDROID && !!(To.use && To.middleware && To.middleware.TERMINATOR)
- }
- ,
- bo.playMiddleware = function(n) {
- return {
- setSource: function(e, t) {
- t(null, e)
- },
- callPlay: function() {
- if (n.ads && !0 === n.ads._shouldBlockPlay)
- return n.ads.debug("Using playMiddleware to block content playback"),
- n.ads._playBlocked = !0,
- To.middleware.TERMINATOR
- },
- play: function(e, t) {
- n.ads && n.ads._playBlocked && e ? (n.ads.debug("Play call to Tech was terminated."),
- n.trigger("play"),
- n.addClass("vjs-has-started"),
- n.ads._playBlocked = !1) : t && t.catch && t.catch(function(e) {
- "NotAllowedError" !== e.name || oo.browser.IS_SAFARI || n.trigger("pause")
- })
- }
- }
- }
- ,
- bo.testHook = function(e) {
- To = e
- }
- ;
- var Co = bo.playMiddleware
- , ko = bo.isMiddlewareMediatorSupported;
- var Eo = function() {
- function n() {}
- return n.getState = function(e) {
- if (e)
- return n.states_ && n.states_[e] ? n.states_[e] : void 0
- }
- ,
- n.registerState = function(e, t) {
- if ("string" != typeof e || !e)
- throw new Error('Illegal state name, "' + e + '"; must be a non-empty string.');
- return n.states_ || (n.states_ = {}),
- n.states_[e] = t
- }
- ,
- n
- }()
- , So = function() {
- function e(e) {
- this.player = e
- }
- e._getName = function() {
- return "Anonymous State"
- }
- ;
- var t = e.prototype;
- return t.transitionTo = function(e) {
- var t = this.player;
- this.cleanup(t);
- var n = new e(t);
- t.ads._state = n,
- t.ads.debug(this.constructor._getName() + " -> " + n.constructor._getName());
- for (var i = arguments.length, r = new Array(1 < i ? i - 1 : 0), s = 1; s < i; s++)
- r[s - 1] = arguments[s];
- n.init.apply(n, [t].concat(r))
- }
- ,
- t.init = function() {}
- ,
- t.cleanup = function() {}
- ,
- t.onPlay = function() {}
- ,
- t.onPlaying = function() {}
- ,
- t.onEnded = function() {}
- ,
- t.onAdEnded = function() {}
- ,
- t.onAdsReady = function() {
- oo.log.warn("Unexpected adsready event")
- }
- ,
- t.onAdsError = function() {}
- ,
- t.onAdsCanceled = function() {}
- ,
- t.onAdTimeout = function() {}
- ,
- t.onAdStarted = function() {}
- ,
- t.onContentChanged = function() {}
- ,
- t.onContentResumed = function() {}
- ,
- t.onReadyForPostroll = function() {
- oo.log.warn("Unexpected readyforpostroll event")
- }
- ,
- t.onNoPreroll = function() {}
- ,
- t.onNoPostroll = function() {}
- ,
- t.startLinearAdMode = function() {
- oo.log.warn("Unexpected startLinearAdMode invocation (State via " + this.constructor._getName() + ")")
- }
- ,
- t.endLinearAdMode = function() {
- oo.log.warn("Unexpected endLinearAdMode invocation (State via " + this.constructor._getName() + ")")
- }
- ,
- t.skipLinearAdMode = function() {
- oo.log.warn("Unexpected skipLinearAdMode invocation (State via " + this.constructor._getName() + ")")
- }
- ,
- t.isAdState = function() {
- throw new Error("isAdState unimplemented for " + this.constructor._getName())
- }
- ,
- t.isWaitingForAdBreak = function() {
- return !1
- }
- ,
- t.isContentResuming = function() {
- return !1
- }
- ,
- t.inAdBreak = function() {
- return !1
- }
- ,
- t.handleEvent = function(e) {
- var t = this.player;
- "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)
- }
- ,
- e
- }();
- function wo(e, t) {
- e.prototype = Object.create(t.prototype),
- (e.prototype.constructor = e).__proto__ = t
- }
- Eo.registerState("State", So);
- var xo = function(n) {
- function e(e) {
- var t;
- return (t = n.call(this, e) || this).contentResuming = !1,
- t.waitingForAdBreak = !1,
- t
- }
- wo(e, n);
- var t = e.prototype;
- return t.isAdState = function() {
- return !0
- }
- ,
- t.onPlaying = function() {
- var e = Eo.getState("ContentPlayback");
- this.contentResuming && this.transitionTo(e)
- }
- ,
- t.onContentResumed = function() {
- var e = Eo.getState("ContentPlayback");
- this.contentResuming && this.transitionTo(e)
- }
- ,
- t.isWaitingForAdBreak = function() {
- return this.waitingForAdBreak
- }
- ,
- t.isContentResuming = function() {
- return this.contentResuming
- }
- ,
- t.inAdBreak = function() {
- return !0 === this.player.ads._inLinearAdMode
- }
- ,
- e
- }(So);
- Eo.registerState("AdState", xo);
- var Ao = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e);
- var n = t.prototype;
- return n.isAdState = function() {
- return !1
- }
- ,
- n.onContentChanged = function(e) {
- var t = Eo.getState("BeforePreroll")
- , n = Eo.getState("Preroll");
- e.ads.debug("Received contentchanged event (ContentState)"),
- e.paused() ? this.transitionTo(t) : (this.transitionTo(n, !1),
- e.pause(),
- e.ads._pausedOnContentupdate = !0)
- }
- ,
- t
- }(So);
- Eo.registerState("ContentState", Ao);
- var Po, Lo = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "AdsDone"
- }
- ;
- var n = t.prototype;
- return n.init = function(e) {
- e.ads._contentHasEnded = !0,
- e.trigger("ended")
- }
- ,
- n.startLinearAdMode = function() {
- oo.log.warn("Unexpected startLinearAdMode invocation (AdsDone)")
- }
- ,
- t
- }(Eo.getState("ContentState"));
- Eo.registerState("AdsDone", Lo);
- var Io = {
- start: function(e) {
- e.ads.debug("Starting ad break"),
- e.ads._inLinearAdMode = !0,
- e.trigger("adstart"),
- e.ads.shouldTakeSnapshots() && (e.ads.snapshot = function(e) {
- var t;
- t = oo.browser.IS_IOS && e.ads.isLive(e) && 0 < e.seekable().length ? e.currentTime() - e.seekable().end(0) : e.currentTime();
- var n = e.$(".vjs-tech")
- , i = e.textTracks ? e.textTracks() : []
- , r = []
- , s = {
- ended: e.ended(),
- currentSrc: e.currentSrc(),
- sources: e.currentSources(),
- src: e.tech_.src(),
- currentTime: t,
- type: e.currentType()
- };
- n && (s.style = n.getAttribute("style"));
- for (var a = 0; a < i.length; a++) {
- var o = i[a];
- r.push({
- track: o,
- mode: o.mode
- }),
- o.mode = "disabled"
- }
- return s.suppressedTracks = r,
- s
- }(e)),
- e.ads.shouldPlayContentBehindAd(e) && (e.ads.preAdVolume_ = e.volume(),
- e.volume(0)),
- e.addClass("vjs-ad-playing"),
- e.hasClass("vjs-live") && e.removeClass("vjs-live"),
- e.ads.removeNativePoster()
- },
- end: function(e, t) {
- e.ads.debug("Ending ad break"),
- void 0 === t && (t = function() {}
- ),
- e.ads.adType = null,
- e.ads._inLinearAdMode = !1,
- e.trigger("adend"),
- e.removeClass("vjs-ad-playing"),
- e.ads.isLive(e) && e.addClass("vjs-live"),
- e.ads.shouldTakeSnapshots() ? function(i, e) {
- var r = i.ads.snapshot;
- if (void 0 === e && (e = function() {}
- ),
- !0 === i.ads.disableNextSnapshotRestore)
- return i.ads.disableNextSnapshotRestore = !1,
- delete i.ads.snapshot,
- e();
- function t() {
- for (var e = 0; e < u.length; e++)
- (a = u[e]).track.mode = a.mode
- }
- function n() {
- var e;
- if (oo.browser.IS_IOS && i.ads.isLive(i)) {
- if (r.currentTime < 0 && (e = 0 < i.seekable().length ? i.seekable().end(0) + r.currentTime : i.currentTime(),
- i.currentTime(e)),
- i.paused()) {
- var t = i.play();
- t && t.catch && t.catch(function(e) {
- oo.log.warn("Play promise rejected in IOS snapshot resume", e)
- })
- }
- } else if (r.ended)
- i.currentTime(i.duration());
- else {
- i.currentTime(r.currentTime);
- var n = i.play();
- n && n.catch && n.catch(function(e) {
- oo.log.warn("Play promise rejected in snapshot resume", e)
- })
- }
- i.ads.shouldRemoveAutoplay_ && (i.autoplay(!1),
- i.ads.shouldRemoveAutoplay_ = !1)
- }
- function s() {
- if (i.off("contentcanplay", s),
- Po && i.clearTimeout(Po),
- 1 < (o = i.el().querySelector(".vjs-tech")).readyState)
- return n();
- if (void 0 === o.seekable)
- return n();
- if (0 < o.seekable.length)
- return n();
- if (l--)
- i.setTimeout(s, 50);
- else
- try {
- n()
- } catch (e) {
- oo.log.warn("Failed to resume the content after an advertisement", e)
- }
- }
- var a, o = i.$(".vjs-tech"), l = 20, u = r.suppressedTracks;
- if ("style"in r && o.setAttribute("style", r.style || ""),
- i.ads.videoElementRecycled())
- i.one("resumeended", function() {
- delete i.ads.snapshot,
- e()
- }),
- i.one("contentloadedmetadata", t),
- oo.browser.IS_IOS && !i.autoplay() && (i.autoplay(!0),
- i.ads.shouldRemoveAutoplay_ = !0),
- i.src(r.sources),
- i.one("contentcanplay", s),
- Po = i.setTimeout(s, 2e3);
- else {
- if (t(),
- !i.ended()) {
- var c = i.play();
- c && c.catch && c.catch(function(e) {
- oo.log.warn("Play promise rejected in snapshot restore", e)
- })
- }
- delete i.ads.snapshot,
- e()
- }
- }(e, t) : (e.volume(e.ads.preAdVolume_),
- t())
- }
- }
- , Mo = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "Preroll"
- }
- ;
- var n = t.prototype;
- return n.init = function(e, t, n) {
- if (this.waitingForAdBreak = !0,
- e.addClass("vjs-ad-loading"),
- n || e.ads.nopreroll_)
- return this.resumeAfterNoPreroll(e);
- var i = e.ads.settings.timeout;
- "number" == typeof e.ads.settings.prerollTimeout && (i = e.ads.settings.prerollTimeout),
- this._timeout = e.setTimeout(function() {
- e.trigger("adtimeout")
- }, i),
- t ? this.handleAdsReady() : this.adsReady = !1
- }
- ,
- n.onAdsReady = function(e) {
- e.ads.inAdBreak() ? oo.log.warn("Unexpected adsready event (Preroll)") : (e.ads.debug("Received adsready event (Preroll)"),
- this.handleAdsReady())
- }
- ,
- n.handleAdsReady = function() {
- this.adsReady = !0,
- this.readyForPreroll()
- }
- ,
- n.afterLoadStart = function(e) {
- var t = this.player;
- t.ads._hasThereBeenALoadStartDuringPlayerLife ? e() : (t.ads.debug("Waiting for loadstart..."),
- t.one("loadstart", function() {
- t.ads.debug("Received loadstart event"),
- e()
- }))
- }
- ,
- n.noPreroll = function() {
- var e = this;
- this.afterLoadStart(function() {
- e.player.ads.debug("Skipping prerolls due to nopreroll event (Preroll)"),
- e.resumeAfterNoPreroll(e.player)
- })
- }
- ,
- n.readyForPreroll = function() {
- var e = this.player;
- this.afterLoadStart(function() {
- e.ads.debug("Triggered readyforpreroll event (Preroll)"),
- e.trigger("readyforpreroll")
- })
- }
- ,
- n.onAdsCanceled = function(e) {
- var t = this;
- e.ads.debug("adscanceled (Preroll)"),
- this.afterLoadStart(function() {
- t.resumeAfterNoPreroll(e)
- })
- }
- ,
- n.onAdsError = function(e) {
- var t = this;
- oo.log("adserror (Preroll)"),
- this.inAdBreak() ? e.ads.endLinearAdMode() : this.afterLoadStart(function() {
- t.resumeAfterNoPreroll(e)
- })
- }
- ,
- n.startLinearAdMode = function() {
- var e = this.player;
- !this.adsReady || e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Preroll)") : (this.clearTimeout(e),
- e.ads.adType = "preroll",
- this.waitingForAdBreak = !1,
- Io.start(e),
- e.ads._shouldBlockPlay = !1)
- }
- ,
- n.onAdStarted = function(e) {
- e.removeClass("vjs-ad-loading")
- }
- ,
- n.endLinearAdMode = function() {
- var e = this.player;
- this.inAdBreak() && (e.removeClass("vjs-ad-loading"),
- e.addClass("vjs-ad-content-resuming"),
- this.contentResuming = !0,
- Io.end(e))
- }
- ,
- n.skipLinearAdMode = function() {
- var e = this
- , t = this.player;
- t.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : this.afterLoadStart(function() {
- t.trigger("adskip"),
- t.ads.debug("skipLinearAdMode (Preroll)"),
- e.resumeAfterNoPreroll(t)
- })
- }
- ,
- n.onAdTimeout = function(e) {
- var t = this;
- this.afterLoadStart(function() {
- e.ads.debug("adtimeout (Preroll)"),
- t.resumeAfterNoPreroll(e)
- })
- }
- ,
- n.onNoPreroll = function(e) {
- e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected nopreroll event (Preroll)") : this.noPreroll()
- }
- ,
- n.resumeAfterNoPreroll = function(e) {
- if (this.contentResuming = !0,
- e.ads._shouldBlockPlay = !1,
- this.cleanupPartial(e),
- e.ads._playRequested || e.ads._pausedOnContentupdate)
- if (e.paused()) {
- e.ads.debug("resumeAfterNoPreroll: attempting to resume playback (Preroll)");
- var t = e.play();
- t && t.then && t.then(null, function(e) {})
- } else
- e.ads.debug("resumeAfterNoPreroll: already playing (Preroll)"),
- e.trigger("play"),
- e.trigger("playing")
- }
- ,
- n.cleanup = function(e) {
- e.ads._hasThereBeenALoadStartDuringPlayerLife || oo.log.warn("Leaving Preroll state before loadstart event can cause issues."),
- this.cleanupPartial(e)
- }
- ,
- n.cleanupPartial = function(e) {
- e.removeClass("vjs-ad-loading"),
- e.removeClass("vjs-ad-content-resuming"),
- this.clearTimeout(e)
- }
- ,
- n.clearTimeout = function(e) {
- e.clearTimeout(this._timeout),
- this._timeout = null
- }
- ,
- t
- }(Eo.getState("AdState"));
- Eo.registerState("Preroll", Mo);
- var jo = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "BeforePreroll"
- }
- ;
- var n = t.prototype;
- return n.init = function(e) {
- this.adsReady = !1,
- this.shouldResumeToContent = !1,
- e.ads._shouldBlockPlay = !e.ads.settings.allowVjsAutoplay || !e.autoplay()
- }
- ,
- n.onAdsReady = function(e) {
- e.ads.debug("Received adsready event (BeforePreroll)"),
- this.adsReady = !0
- }
- ,
- n.onPlay = function(e) {
- var t = Eo.getState("Preroll");
- e.ads.debug("Received play event (BeforePreroll)"),
- this.transitionTo(t, this.adsReady, this.shouldResumeToContent)
- }
- ,
- n.onAdsCanceled = function(e) {
- e.ads.debug("adscanceled (BeforePreroll)"),
- this.shouldResumeToContent = !0
- }
- ,
- n.onAdsError = function() {
- this.player.ads.debug("adserror (BeforePreroll)"),
- this.shouldResumeToContent = !0
- }
- ,
- n.onNoPreroll = function() {
- this.player.ads.debug("Skipping prerolls due to nopreroll event (BeforePreroll)"),
- this.shouldResumeToContent = !0
- }
- ,
- n.skipLinearAdMode = function() {
- var e = this.player;
- e.trigger("adskip"),
- e.ads.debug("skipLinearAdMode (BeforePreroll)"),
- this.shouldResumeToContent = !0
- }
- ,
- n.onContentChanged = function() {
- this.init(this.player)
- }
- ,
- t
- }(Eo.getState("ContentState"));
- Eo.registerState("BeforePreroll", jo);
- var Oo = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "Midroll"
- }
- ;
- var n = t.prototype;
- return n.init = function(e) {
- e.ads.adType = "midroll",
- Io.start(e),
- e.addClass("vjs-ad-loading")
- }
- ,
- n.onAdStarted = function(e) {
- e.removeClass("vjs-ad-loading")
- }
- ,
- n.endLinearAdMode = function() {
- var e = this.player;
- this.inAdBreak() && (this.contentResuming = !0,
- e.addClass("vjs-ad-content-resuming"),
- e.removeClass("vjs-ad-loading"),
- Io.end(e))
- }
- ,
- n.onAdsError = function(e) {
- this.inAdBreak() && e.ads.endLinearAdMode()
- }
- ,
- n.cleanup = function(e) {
- e.removeClass("vjs-ad-loading"),
- e.removeClass("vjs-ad-content-resuming")
- }
- ,
- t
- }(Eo.getState("AdState"));
- Eo.registerState("Midroll", Oo);
- var No = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "Postroll"
- }
- ;
- var n = t.prototype;
- return n.init = function(e) {
- if (this.waitingForAdBreak = !0,
- e.ads._contentEnding = !0,
- e.ads.nopostroll_) {
- this.resumeContent(e);
- var t = Eo.getState("AdsDone");
- this.transitionTo(t)
- } else {
- e.addClass("vjs-ad-loading");
- var n = e.ads.settings.timeout;
- "number" == typeof e.ads.settings.postrollTimeout && (n = e.ads.settings.postrollTimeout),
- this._postrollTimeout = e.setTimeout(function() {
- e.trigger("adtimeout")
- }, n)
- }
- }
- ,
- n.startLinearAdMode = function() {
- var e = this.player;
- e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected startLinearAdMode invocation (Postroll)") : (e.ads.adType = "postroll",
- e.clearTimeout(this._postrollTimeout),
- this.waitingForAdBreak = !1,
- Io.start(e))
- }
- ,
- n.onAdStarted = function(e) {
- e.removeClass("vjs-ad-loading")
- }
- ,
- n.endLinearAdMode = function() {
- var e = this
- , t = this.player
- , n = Eo.getState("AdsDone");
- this.inAdBreak() && (t.removeClass("vjs-ad-loading"),
- this.resumeContent(t),
- Io.end(t, function() {
- e.transitionTo(n)
- }))
- }
- ,
- n.skipLinearAdMode = function() {
- var e = this.player;
- e.ads.inAdBreak() || this.isContentResuming() ? oo.log.warn("Unexpected skipLinearAdMode invocation") : (e.ads.debug("Postroll abort (skipLinearAdMode)"),
- e.trigger("adskip"),
- this.abort(e))
- }
- ,
- n.onAdTimeout = function(e) {
- e.ads.debug("Postroll abort (adtimeout)"),
- this.abort(e)
- }
- ,
- n.onAdsError = function(e) {
- e.ads.debug("Postroll abort (adserror)"),
- e.ads.inAdBreak() ? e.ads.endLinearAdMode() : this.abort(e)
- }
- ,
- n.onContentChanged = function(e) {
- if (this.isContentResuming()) {
- var t = Eo.getState("BeforePreroll");
- this.transitionTo(t)
- } else if (!this.inAdBreak()) {
- var n = Eo.getState("Preroll");
- this.transitionTo(n)
- }
- }
- ,
- n.onNoPostroll = function(e) {
- this.isContentResuming() || this.inAdBreak() ? oo.log.warn("Unexpected nopostroll event (Postroll)") : this.abort(e)
- }
- ,
- n.resumeContent = function(e) {
- this.contentResuming = !0,
- e.addClass("vjs-ad-content-resuming")
- }
- ,
- n.abort = function(e) {
- var t = Eo.getState("AdsDone");
- this.resumeContent(e),
- e.removeClass("vjs-ad-loading"),
- this.transitionTo(t)
- }
- ,
- n.cleanup = function(e) {
- e.removeClass("vjs-ad-content-resuming"),
- e.clearTimeout(this._postrollTimeout),
- e.ads._contentEnding = !1
- }
- ,
- t
- }(Eo.getState("AdState"));
- Eo.registerState("Postroll", No);
- var Do = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "ContentPlayback"
- }
- ;
- var n = t.prototype;
- return n.init = function(e) {
- e.ads._shouldBlockPlay = !1
- }
- ,
- n.onAdsReady = function(e) {
- e.ads.debug("Received adsready event (ContentPlayback)"),
- e.ads.nopreroll_ || (e.ads.debug("Triggered readyforpreroll event (ContentPlayback)"),
- e.trigger("readyforpreroll"))
- }
- ,
- n.onReadyForPostroll = function(e) {
- var t = Eo.getState("Postroll");
- e.ads.debug("Received readyforpostroll event"),
- this.transitionTo(t)
- }
- ,
- n.startLinearAdMode = function() {
- var e = Eo.getState("Midroll");
- this.transitionTo(e)
- }
- ,
- t
- }(Eo.getState("ContentState"));
- Eo.registerState("ContentPlayback", Do);
- var Bo = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "StitchedContentPlayback"
- }
- ;
- var n = t.prototype;
- return n.init = function() {
- this.player.ads._shouldBlockPlay = !1
- }
- ,
- n.onContentChanged = function() {
- this.player.ads.debug("Received contentchanged event (" + this.constructor._getName() + ")")
- }
- ,
- n.startLinearAdMode = function() {
- var e = Eo.getState("StitchedAdRoll");
- this.transitionTo(e)
- }
- ,
- t
- }(Eo.getState("ContentState"));
- Eo.registerState("StitchedContentPlayback", Bo);
- var Ro = function(e) {
- function t() {
- return e.apply(this, arguments) || this
- }
- wo(t, e),
- t._getName = function() {
- return "StitchedAdRoll"
- }
- ;
- var n = t.prototype;
- return n.init = function() {
- this.waitingForAdBreak = !1,
- this.contentResuming = !1,
- this.player.ads.adType = "stitched",
- Io.start(this.player)
- }
- ,
- n.onPlaying = function() {}
- ,
- n.onContentResumed = function() {}
- ,
- n.onAdEnded = function() {
- this.endLinearAdMode(),
- this.player.trigger("ended")
- }
- ,
- n.endLinearAdMode = function() {
- var e = Eo.getState("StitchedContentPlayback");
- Io.end(this.player),
- this.transitionTo(e)
- }
- ,
- t
- }(Eo.getState("AdState"));
- Eo.registerState("StitchedAdRoll", Ro);
- function Fo(e) {
- var i = this
- , t = oo.mergeOptions(Uo, e)
- , n = [];
- function r() {
- var e = i.textTracks();
- if (!i.ads.shouldPlayContentBehindAd(i) && i.ads.inAdBreak() && i.tech_.featuresNativeTextTracks && oo.browser.IS_IOS && !Array.isArray(i.textTracks()))
- for (var t = 0; t < e.length; t++) {
- var n = e[t];
- "showing" === n.mode && (n.mode = "disabled")
- }
- }
- Qo.concat(["firstplay", "loadedalldata"]).forEach(function(e) {
- -1 === n.indexOf(e) && n.push(e)
- }),
- i.on(n, po),
- Vo() || function(e, t) {
- t && oo.log("Using cancelContentPlay to block content playback"),
- e.on("play", _o)
- }(i, t.debug),
- i.setTimeout(function() {
- 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")
- }, 5e3),
- i.on("ended", function() {
- i.hasClass("vjs-has-started") || i.addClass("vjs-has-started")
- }),
- i.on("contenttimeupdate", function() {
- i.removeClass("vjs-waiting")
- }),
- i.on(["addurationchange", "adcanplay"], function() {
- if (!i.ads.settings.stitchedAds && !i.hasStarted() && (!i.ads.snapshot || i.currentSrc() !== i.ads.snapshot.currentSrc) && i.ads.inAdBreak()) {
- var e = i.play();
- e && e.catch && e.catch(function(e) {
- oo.log.warn("Play promise rejected when playing ad", e)
- })
- }
- }),
- i.on("nopreroll", function() {
- i.ads.debug("Received nopreroll event"),
- i.ads.nopreroll_ = !0
- }),
- i.on("nopostroll", function() {
- i.ads.debug("Received nopostroll event"),
- i.ads.nopostroll_ = !0
- }),
- i.on("playing", function() {
- i.ads._cancelledPlay = !1,
- i.ads._pausedOnContentupdate = !1
- }),
- i.on("play", function() {
- i.ads._playRequested = !0
- }),
- i.one("loadstart", function() {
- i.ads._hasThereBeenALoadStartDuringPlayerLife = !0
- }),
- i.on("loadeddata", function() {
- i.ads._hasThereBeenALoadedData = !0
- }),
- i.on("loadedmetadata", function() {
- i.ads._hasThereBeenALoadedMetaData = !0
- }),
- i.ads = function(n) {
- return {
- disableNextSnapshotRestore: !1,
- _contentEnding: !1,
- _contentHasEnded: !1,
- _hasThereBeenALoadStartDuringPlayerLife: !1,
- _hasThereBeenALoadedData: !1,
- _hasThereBeenALoadedMetaData: !1,
- _inLinearAdMode: !1,
- _shouldBlockPlay: !1,
- _playBlocked: !1,
- _playRequested: !1,
- adType: null,
- VERSION: "6.9.0",
- reset: function() {
- n.ads.disableNextSnapshotRestore = !1,
- n.ads._contentEnding = !1,
- n.ads._contentHasEnded = !1,
- n.ads.snapshot = null,
- n.ads.adType = null,
- n.ads._hasThereBeenALoadedData = !1,
- n.ads._hasThereBeenALoadedMetaData = !1,
- n.ads._cancelledPlay = !1,
- n.ads._shouldBlockPlay = !1,
- n.ads._playBlocked = !1,
- n.ads.nopreroll_ = !1,
- n.ads.nopostroll_ = !1,
- n.ads._playRequested = !1
- },
- startLinearAdMode: function() {
- n.ads._state.startLinearAdMode()
- },
- endLinearAdMode: function() {
- n.ads._state.endLinearAdMode()
- },
- skipLinearAdMode: function() {
- n.ads._state.skipLinearAdMode()
- },
- stitchedAds: function(e) {
- 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."),
- this.settings.stitchedAds = !!e),
- this.settings.stitchedAds
- },
- videoElementRecycled: function() {
- if (n.ads.shouldPlayContentBehindAd(n))
- return !1;
- if (!this.snapshot)
- throw new Error("You cannot use videoElementRecycled while there is no snapshot.");
- var e = n.tech_.src() !== this.snapshot.src
- , t = n.currentSrc() !== this.snapshot.currentSrc;
- return e || t
- },
- isLive: function(e) {
- return void 0 === e && (e = n),
- "boolean" == typeof e.ads.settings.contentIsLive ? e.ads.settings.contentIsLive : e.duration() === 1 / 0 || "8" === oo.browser.IOS_VERSION && 0 === e.duration()
- },
- shouldPlayContentBehindAd: function(e) {
- if (void 0 === e && (e = n),
- e)
- return !!e.ads.settings.liveCuePoints && (!oo.browser.IS_IOS && !oo.browser.IS_ANDROID && e.duration() === 1 / 0);
- throw new Error("shouldPlayContentBehindAd requires a player as a param")
- },
- shouldTakeSnapshots: function(e) {
- return void 0 === e && (e = n),
- !this.shouldPlayContentBehindAd(e) && !this.stitchedAds()
- },
- isInAdMode: function() {
- return this._state.isAdState()
- },
- isWaitingForAdBreak: function() {
- return this._state.isWaitingForAdBreak()
- },
- isContentResuming: function() {
- return this._state.isContentResuming()
- },
- isAdPlaying: function() {
- return this._state.inAdBreak()
- },
- inAdBreak: function() {
- return this._state.inAdBreak()
- },
- removeNativePoster: function() {
- var e = n.$(".vjs-tech");
- e && e.removeAttribute("poster")
- },
- debug: function() {
- if (this.settings.debug) {
- for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
- t[n] = arguments[n];
- 1 === t.length && "string" == typeof t[0] ? oo.log("ADS: " + t[0]) : oo.log.apply(oo, ["ADS:"].concat(t))
- }
- }
- }
- }(i),
- (i.ads.settings = t).stitchedAds = !!t.stitchedAds,
- t.stitchedAds ? i.ads._state = new (Eo.getState("StitchedContentPlayback"))(i) : i.ads._state = new (Eo.getState("BeforePreroll"))(i),
- i.ads._state.init(i),
- i.ads.cueTextTracks = mo,
- i.ads.adMacroReplacement = function(e, o, t) {
- var n = this
- , l = {};
- e = e.replace(/{([^}=]+)=([^}]+)}/g, function(e, t, n) {
- return l["{" + t + "}"] = n,
- "{" + t + "}"
- }),
- void 0 === o && (o = !1);
- var i = {};
- for (var r in void 0 !== t && (i = t),
- i["{player.id}"] = this.options_["data-player"] || this.id_,
- i["{player.height}"] = this.currentHeight(),
- i["{player.width}"] = this.currentWidth(),
- i["{mediainfo.id}"] = this.mediainfo ? this.mediainfo.id : "",
- i["{mediainfo.name}"] = this.mediainfo ? this.mediainfo.name : "",
- i["{mediainfo.duration}"] = this.mediainfo ? this.mediainfo.duration : "",
- i["{player.duration}"] = this.duration(),
- i["{player.pageUrl}"] = oo.dom.isInFrame() ? f.referrer : p.location.href,
- i["{playlistinfo.id}"] = this.playlistinfo ? this.playlistinfo.id : "",
- i["{playlistinfo.name}"] = this.playlistinfo ? this.playlistinfo.name : "",
- i["{timestamp}"] = (new Date).getTime(),
- i["{document.referrer}"] = f.referrer,
- i["{window.location.href}"] = p.location.href,
- i["{random}"] = Math.floor(1e12 * Math.random()),
- ["description", "tags", "reference_id", "ad_keys"].forEach(function(e) {
- n.mediainfo && n.mediainfo[e] ? i["{mediainfo." + e + "}"] = n.mediainfo[e] : l["{mediainfo." + e + "}"] ? i["{mediainfo." + e + "}"] = l["{mediainfo." + e + "}"] : i["{mediainfo." + e + "}"] = ""
- }),
- go(this.mediainfo, i, "custom_fields"),
- go(this.mediainfo, i, "customFields"),
- Object.keys(yo).forEach(function(e) {
- i["{tcf." + e + "}"] = yo[e]
- }),
- i["{tcf.gdprAppliesInt}"] = yo.gdprApplies ? 1 : 0,
- i)
- e = e.split(r).join(vo(i[r], o));
- for (var s in e = e.replace(/{pageVariable\.([^}]+)}/g, function(e, t) {
- for (var n, i = p, r = t.split("."), s = 0; s < r.length; s++)
- s === r.length - 1 ? n = i[r[s]] : i = i[r[s]];
- var a = typeof n;
- return null === n ? "null" : void 0 === n ? l["{pageVariable." + t + "}"] ? l["{pageVariable." + t + "}"] : (oo.log.warn('Page variable "' + t + '" not found'),
- "") : "string" != a && "number" != a && "boolean" != a ? (oo.log.warn('Page variable "' + t + '" is not a supported type'),
- "") : vo(String(n), o)
- }),
- l)
- e = e.replace(s, l[s]);
- return e
- }
- .bind(i),
- function(t) {
- t.ads.contentSrc = t.currentSrc(),
- t.ads._seenInitialLoadstart = !1,
- t.on("loadstart", function() {
- if (!t.ads.inAdBreak()) {
- var e = t.currentSrc();
- e !== t.ads.contentSrc && (t.ads._seenInitialLoadstart && t.trigger({
- type: "contentchanged"
- }),
- t.trigger({
- type: "contentupdate",
- oldValue: t.ads.contentSrc,
- newValue: e
- }),
- t.ads.contentSrc = e),
- t.ads._seenInitialLoadstart = !0
- }
- })
- }(i),
- i.on("contentchanged", i.ads.reset),
- i.ready(function() {
- i.textTracks().addEventListener("change", r)
- }),
- i.on(["play", "playing", "ended", "adsready", "adscanceled", "adskip", "adserror", "adtimeout", "adended", "ads-ad-started", "contentchanged", "dispose", "contentresumed", "readyforpostroll", "nopreroll", "nopostroll"], function(e) {
- i.ads._state.handleEvent(e.type)
- }),
- i.on("dispose", function() {
- i.ads.reset(),
- i.textTracks().removeEventListener("change", r)
- }),
- fo(),
- i.ads.listenToTcf = fo
- }
- var Ho, Vo = bo.isMiddlewareMediatorSupported, Qo = oo.getTech("Html5").Events, Uo = {
- timeout: 5e3,
- prerollTimeout: void 0,
- postrollTimeout: void 0,
- debug: !1,
- stitchedAds: !1,
- contentIsLive: void 0,
- liveCuePoints: !0,
- allowVjsAutoplay: oo.options.normalizeAutoplay || !1
- };
- function qo(e) {
- if (void 0 === e)
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
- return e
- }
- Fo.VERSION = "6.9.0",
- Ho = Fo,
- function() {
- if (oo.getPlugin)
- return Boolean(oo.getPlugin("ads"));
- var e = oo.getComponent("Player");
- return Boolean(e && e.prototype.ads)
- }() || ((oo.registerPlugin || oo.plugin)("ads", Ho),
- ko() && !oo.usingContribAdsMiddleware_ && (oo.use("*", Co),
- oo.usingContribAdsMiddleware_ = !0,
- oo.log.debug("Play middleware has been registered with videojs")));
- function zo(e) {
- var t = this;
- if (oo.browser.IS_IE8)
- for (var n in t = f.createElement("custom"),
- zo.prototype)
- "constructor" !== n && (t[n] = zo.prototype[n]);
- return t.id = e.id,
- t.label = t.id,
- t.width = e.width,
- t.height = e.height,
- t.bitrate = e.bandwidth,
- t.enabled_ = e.enabled,
- Object.defineProperty(t, "enabled", {
- get: function() {
- return t.enabled_()
- },
- set: function(e) {
- t.enabled_(e)
- }
- }),
- t
- }
- var Wo = function(i) {
- function r() {
- var e, t = qo(qo(e = i.call(this) || this));
- if (oo.browser.IS_IE8)
- for (var n in t = f.createElement("custom"),
- r.prototype)
- "constructor" !== n && (t[n] = r.prototype[n]);
- return t.levels_ = [],
- t.selectedIndex_ = -1,
- Object.defineProperty(t, "selectedIndex", {
- get: function() {
- return t.selectedIndex_
- }
- }),
- Object.defineProperty(t, "length", {
- get: function() {
- return t.levels_.length
- }
- }),
- t || qo(e)
- }
- !/*! @name videojs-contrib-quality-levels @version 2.1.0 @license Apache-2.0 */
- function(e, t) {
- e.prototype = Object.create(t.prototype),
- (e.prototype.constructor = e).__proto__ = t
- }(r, i);
- var e = r.prototype;
- return e.addQualityLevel = function(e) {
- var t = this.getQualityLevelById(e.id);
- if (t)
- return t;
- var n = this.levels_.length;
- return t = new zo(e),
- "" + n in this || Object.defineProperty(this, n, {
- get: function() {
- return this.levels_[n]
- }
- }),
- this.levels_.push(t),
- this.trigger({
- qualityLevel: t,
- type: "addqualitylevel"
- }),
- t
- }
- ,
- e.removeQualityLevel = function(e) {
- for (var t = null, n = 0, i = this.length; n < i; n++)
- if (this[n] === e) {
- t = this.levels_.splice(n, 1)[0],
- this.selectedIndex_ === n ? this.selectedIndex_ = -1 : this.selectedIndex_ > n && this.selectedIndex_--;
- break
- }
- return t && this.trigger({
- qualityLevel: e,
- type: "removequalitylevel"
- }),
- t
- }
- ,
- e.getQualityLevelById = function(e) {
- for (var t = 0, n = this.length; t < n; t++) {
- var i = this[t];
- if (i.id === e)
- return i
- }
- return null
- }
- ,
- e.dispose = function() {
- this.selectedIndex_ = -1,
- this.levels_.length = 0
- }
- ,
- r
- }(oo.EventTarget);
- for (var Ko in Wo.prototype.allowedEvents_ = {
- change: "change",
- addqualitylevel: "addqualitylevel",
- removequalitylevel: "removequalitylevel"
- },
- Wo.prototype.allowedEvents_)
- Wo.prototype["on" + Ko] = null;
- function Xo(e) {
- return function(t) {
- var n = t.qualityLevels
- , i = new Wo;
- return t.on("dispose", function e() {
- i.dispose(),
- t.qualityLevels = n,
- t.off("dispose", e)
- }),
- t.qualityLevels = function() {
- return i
- }
- ,
- t.qualityLevels.VERSION = "2.1.0",
- i
- }(this, oo.mergeOptions({}, e))
- }
- return (oo.registerPlugin || oo.plugin)("qualityLevels", Xo),
- Xo.VERSION = "2.1.0",
- oo
- });
|