12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829 |
- ;(function () {
- var _excluded = ['premium', 'referrerPolicy']
- function _objectWithoutProperties(source, excluded) {
- if (source == null) return {}
- var target = _objectWithoutPropertiesLoose(source, excluded)
- var key, i
- if (Object.getOwnPropertySymbols) {
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source)
- for (i = 0; i < sourceSymbolKeys.length; i++) {
- key = sourceSymbolKeys[i]
- if (excluded.indexOf(key) >= 0) continue
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue
- target[key] = source[key]
- }
- }
- return target
- }
- function _objectWithoutPropertiesLoose(source, excluded) {
- if (source == null) return {}
- var target = {}
- var sourceKeys = Object.keys(source)
- var key, i
- for (i = 0; i < sourceKeys.length; i++) {
- key = sourceKeys[i]
- if (excluded.indexOf(key) >= 0) continue
- target[key] = source[key]
- }
- return target
- }
- function _toConsumableArray(arr) {
- return (
- _arrayWithoutHoles(arr) ||
- _iterableToArray(arr) ||
- _unsupportedIterableToArray(arr) ||
- _nonIterableSpread()
- )
- }
- function _nonIterableSpread() {
- throw new TypeError(
- 'Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
- )
- }
- function _iterableToArray(iter) {
- if (
- (typeof Symbol !== 'undefined' && iter[Symbol.iterator] != null) ||
- iter['@@iterator'] != null
- )
- return Array.from(iter)
- }
- function _arrayWithoutHoles(arr) {
- if (Array.isArray(arr)) return _arrayLikeToArray(arr)
- }
- function _classCallCheck2(instance, Constructor) {
- if (!(instance instanceof Constructor)) {
- throw new TypeError('Cannot call a class as a function')
- }
- }
- function _defineProperties(target, props) {
- for (var i = 0; i < props.length; i++) {
- var descriptor = props[i]
- descriptor.enumerable = descriptor.enumerable || false
- descriptor.configurable = true
- if ('value' in descriptor) descriptor.writable = true
- Object.defineProperty(target, descriptor.key, descriptor)
- }
- }
- function _createClass2(Constructor, protoProps, staticProps) {
- if (protoProps) _defineProperties(Constructor.prototype, protoProps)
- if (staticProps) _defineProperties(Constructor, staticProps)
- Object.defineProperty(Constructor, 'prototype', { writable: false })
- return Constructor
- }
- function ownKeys(object, enumerableOnly) {
- var keys = Object.keys(object)
- if (Object.getOwnPropertySymbols) {
- var symbols = Object.getOwnPropertySymbols(object)
- enumerableOnly &&
- (symbols = symbols.filter(function (sym) {
- return Object.getOwnPropertyDescriptor(object, sym).enumerable
- })),
- keys.push.apply(keys, symbols)
- }
- return keys
- }
- function _objectSpread(target) {
- for (var i = 1; i < arguments.length; i++) {
- var source = null != arguments[i] ? arguments[i] : {}
- i % 2
- ? ownKeys(Object(source), !0).forEach(function (key) {
- _defineProperty2(target, key, source[key])
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(
- target,
- Object.getOwnPropertyDescriptors(source)
- )
- : ownKeys(Object(source)).forEach(function (key) {
- Object.defineProperty(
- target,
- key,
- Object.getOwnPropertyDescriptor(source, key)
- )
- })
- }
- return target
- }
- function _slicedToArray(arr, i) {
- return (
- _arrayWithHoles(arr) ||
- _iterableToArrayLimit(arr, i) ||
- _unsupportedIterableToArray(arr, i) ||
- _nonIterableRest()
- )
- }
- function _nonIterableRest() {
- throw new TypeError(
- 'Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'
- )
- }
- function _unsupportedIterableToArray(o, minLen) {
- if (!o) return
- if (typeof o === 'string') return _arrayLikeToArray(o, minLen)
- var n = Object.prototype.toString.call(o).slice(8, -1)
- if (n === 'Object' && o.constructor) n = o.constructor.name
- if (n === 'Map' || n === 'Set') return Array.from(o)
- if (n === 'Arguments' || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
- return _arrayLikeToArray(o, minLen)
- }
- function _arrayLikeToArray(arr, len) {
- if (len == null || len > arr.length) len = arr.length
- for (var i = 0, arr2 = new Array(len); i < len; i++) {
- arr2[i] = arr[i]
- }
- return arr2
- }
- function _iterableToArrayLimit(arr, i) {
- var _i =
- arr == null
- ? null
- : (typeof Symbol !== 'undefined' && arr[Symbol.iterator]) ||
- arr['@@iterator']
- if (_i == null) return
- var _arr = []
- var _n = true
- var _d = false
- var _s, _e
- try {
- for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
- _arr.push(_s.value)
- if (i && _arr.length === i) break
- }
- } catch (err) {
- _d = true
- _e = err
- } finally {
- try {
- if (!_n && _i['return'] != null) _i['return']()
- } finally {
- if (_d) throw _e
- }
- }
- return _arr
- }
- function _arrayWithHoles(arr) {
- if (Array.isArray(arr)) return arr
- }
- function _defineProperty2(obj, key, value) {
- if (key in obj) {
- Object.defineProperty(obj, key, {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- })
- } else {
- obj[key] = value
- }
- return obj
- }
- function _typeof(obj) {
- '@babel/helpers - typeof'
- return (
- (_typeof =
- 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator
- ? function (obj) {
- return typeof obj
- }
- : function (obj) {
- return obj &&
- 'function' == typeof Symbol &&
- obj.constructor === Symbol &&
- obj !== Symbol.prototype
- ? 'symbol'
- : typeof obj
- }),
- _typeof(obj)
- )
- }
- var __vite_style__ = document.createElement('style')
- __vite_style__.innerHTML =
- '@charset "UTF-8";._video-container_1vz16_1{position:relative;width:100%;--plyr-color-main: #01c1b5}._video-container_1vz16_1 video{width:100%}._video-container_1vz16_1 .video-back{position:absolute;left:.53333rem;top:.53333rem;color:#fff;z-index:99;font-size:.64rem;width:.8rem;height:.8rem;background-color:rgba(0,0,0,.5);border-radius:50%;padding:.10667rem .13333rem .10667rem .08rem}._video-container_1vz16_1 .plyr__poster{background-size:cover}._video-container_1vz16_1 .plyr__control--overlaid{border:.02667rem solid #fff;background-color:transparent!important}._video-container_1vz16_1 .plyr--video .plyr__control:hover{background-color:transparent!important}._video-container_1vz16_1 ._video_1vz16_1{position:relative}._loadingVideo_1vz16_35{position:absolute;top:0;left:0;bottom:0;right:0;background:rgba(0,0,0,.9);z-index:10}._playOver_1vz16_44{background:rgba(0,0,0,.5);color:#fff;display:flex;align-items:center;justify-content:center;flex-direction:column}._playOver_1vz16_44 ._tips_1vz16_52{font-size:.4rem;color:#fff}._playOver_1vz16_44 ._btn_1vz16_56{margin:.26667rem 0}._freeTxt_1vz16_59{font-size:.4rem;color:#fff;line-height:.56rem;padding-top:.26667rem}._freeRate_1vz16_65{color:#32ffd8}@keyframes plyr-progress{to{background-position:.66667rem 0;background-position:var(--plyr-progress-loading-size,25px) 0}}@keyframes plyr-popup{0%{opacity:.5;transform:translateY(.26667rem)}to{opacity:1;transform:translateY(0)}}@keyframes plyr-fade-in{0%{opacity:0}to{opacity:1}}.plyr{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;align-items:center;direction:ltr;display:flex;flex-direction:column;font-family:inherit;font-family:var(--plyr-font-family,inherit);font-variant-numeric:tabular-nums;font-weight:400;font-weight:var(--plyr-font-weight-regular,400);line-height:1.7;line-height:var(--plyr-line-height,1.7);max-width:100%;min-width:5.33333rem;position:relative;text-shadow:none;transition:box-shadow .3s ease;z-index:0}.plyr audio,.plyr iframe,.plyr video{display:block;height:100%;width:100%}.plyr button{font:inherit;line-height:inherit;width:auto}.plyr:focus{outline:0}.plyr--full-ui{box-sizing:border-box}.plyr--full-ui *,.plyr--full-ui :after,.plyr--full-ui :before{box-sizing:inherit}.plyr--full-ui a,.plyr--full-ui button,.plyr--full-ui input,.plyr--full-ui label{touch-action:manipulation}.plyr__badge{background:#4a5464;background:var(--plyr-badge-background,#4a5464);border-radius:.05333rem;border-radius:var(--plyr-badge-border-radius,2px);color:#fff;color:var(--plyr-badge-text-color,#fff);font-size:.24rem;font-size:var(--plyr-font-size-badge,9px);line-height:1;padding:.08rem .10667rem}.plyr--full-ui ::-webkit-media-text-track-container{display:none}.plyr__captions{animation:plyr-fade-in .3s ease;bottom:0;display:none;font-size:.34667rem;font-size:var(--plyr-font-size-small,13px);left:0;padding:.26667rem;padding:var(--plyr-control-spacing,10px);position:absolute;text-align:center;transition:transform .4s ease-in-out;width:100%}.plyr__captions span:empty{display:none}@media (min-width:480px){.plyr__captions{font-size:.4rem;font-size:var(--plyr-font-size-base,15px);padding:.53333rem;padding:calc(var(--plyr-control-spacing, 10px)*2)}}@media (min-width:768px){.plyr__captions{font-size:.48rem;font-size:var(--plyr-font-size-large,18px)}}.plyr--captions-active .plyr__captions{display:block}.plyr:not(.plyr--hide-controls) .plyr__controls:not(:empty)~.plyr__captions{transform:translateY(-1.06667rem);transform:translateY(calc(var(--plyr-control-spacing, 10px)*-4))}.plyr__caption{background:rgba(0,0,0,.8);background:var(--plyr-captions-background,rgba(0,0,0,.8));border-radius:.05333rem;-webkit-box-decoration-break:clone;box-decoration-break:clone;color:#fff;color:var(--plyr-captions-text-color,#fff);line-height:185%;padding:.2em .5em;white-space:pre-wrap}.plyr__caption div{display:inline}.plyr__control{background:transparent;border:0;border-radius:.08rem;border-radius:var(--plyr-control-radius,3px);color:inherit;cursor:pointer;flex-shrink:0;overflow:visible;padding:.18667rem;padding:calc(var(--plyr-control-spacing, 10px)*.7);position:relative;transition:all .3s ease}.plyr__control svg{fill:currentColor;display:block;height:.48rem;height:var(--plyr-control-icon-size,18px);pointer-events:none;width:.48rem;width:var(--plyr-control-icon-size,18px)}.plyr__control:focus{outline:0}.plyr__control.plyr__tab-focus{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}a.plyr__control{text-decoration:none}.plyr__control.plyr__control--pressed .icon--not-pressed,.plyr__control.plyr__control--pressed .label--not-pressed,.plyr__control:not(.plyr__control--pressed) .icon--pressed,.plyr__control:not(.plyr__control--pressed) .label--pressed,a.plyr__control:after,a.plyr__control:before{display:none}.plyr--full-ui ::-webkit-media-controls{display:none}.plyr__controls{align-items:center;display:flex;justify-content:flex-end;text-align:center}.plyr__controls .plyr__progress__container{flex:1;min-width:0}.plyr__controls .plyr__controls__item{margin-left:.06667rem;margin-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item:first-child{margin-left:0;margin-right:auto}.plyr__controls .plyr__controls__item.plyr__progress__container{padding-left:.06667rem;padding-left:calc(var(--plyr-control-spacing, 10px)/4)}.plyr__controls .plyr__controls__item.plyr__time{padding:0 .13333rem;padding:0 calc(var(--plyr-control-spacing, 10px)/2)}.plyr__controls .plyr__controls__item.plyr__progress__container:first-child,.plyr__controls .plyr__controls__item.plyr__time+.plyr__time,.plyr__controls .plyr__controls__item.plyr__time:first-child{padding-left:0}.plyr [data-plyr=airplay],.plyr [data-plyr=captions],.plyr [data-plyr=fullscreen],.plyr [data-plyr=pip],.plyr__controls:empty{display:none}.plyr--airplay-supported [data-plyr=airplay],.plyr--captions-enabled [data-plyr=captions],.plyr--fullscreen-enabled [data-plyr=fullscreen],.plyr--pip-supported [data-plyr=pip]{display:inline-block}.plyr__menu{display:flex;position:relative}.plyr__menu .plyr__control svg{transition:transform .3s ease}.plyr__menu .plyr__control[aria-expanded=true] svg{transform:rotate(90deg)}.plyr__menu .plyr__control[aria-expanded=true] .plyr__tooltip{display:none}.plyr__menu__container{animation:plyr-popup .2s ease;background:hsla(0,0%,100%,.9);background:var(--plyr-menu-background,hsla(0,0%,100%,.9));border-radius:.10667rem;bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-menu-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-menu-color,#4a5464);font-size:.4rem;font-size:var(--plyr-font-size-base,15px);margin-bottom:.26667rem;position:absolute;right:-.08rem;text-align:left;white-space:nowrap;z-index:3}.plyr__menu__container>div{overflow:hidden;transition:height .35s cubic-bezier(.4,0,.2,1),width .35s cubic-bezier(.4,0,.2,1)}.plyr__menu__container:after{border:.10667rem solid transparent;border-top-color:rgba(255,255,255,.9);border:var(--plyr-menu-arrow-size,4px) solid transparent;border-top-color:var(--plyr-menu-background,hsla(0,0%,100%,.9));content:"";height:0;position:absolute;right:.37333rem;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7 - var(--plyr-menu-arrow-size, 4px)/2);top:100%;width:0}.plyr__menu__container [role=menu]{padding:.18667rem;padding:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container [role=menuitem],.plyr__menu__container [role=menuitemradio]{margin-top:.05333rem}.plyr__menu__container [role=menuitem]:first-child,.plyr__menu__container [role=menuitemradio]:first-child{margin-top:0}.plyr__menu__container .plyr__control{align-items:center;color:#4a5464;color:var(--plyr-menu-color,#4a5464);display:flex;font-size:.34667rem;font-size:var(--plyr-font-size-menu,var(--plyr-font-size-small,13px));padding:.12444rem .28rem;padding:calc(var(--plyr-control-spacing, 10px)*.7/1.5) calc(var(--plyr-control-spacing, 10px)*.7*1.5);-webkit-user-select:none;user-select:none;width:100%}.plyr__menu__container .plyr__control>span{align-items:inherit;display:flex;width:100%}.plyr__menu__container .plyr__control:after{border:.10667rem solid transparent;border:var(--plyr-menu-item-arrow-size,4px) solid transparent;content:"";position:absolute;top:50%;transform:translateY(-50%)}.plyr__menu__container .plyr__control--forward{padding-right:.74667rem;padding-right:calc(var(--plyr-control-spacing, 10px)*.7*4)}.plyr__menu__container .plyr__control--forward:after{border-left-color:#728197;border-left-color:var(--plyr-menu-arrow-color,#728197);right:.17333rem;right:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--forward.plyr__tab-focus:after,.plyr__menu__container .plyr__control--forward:hover:after{border-left-color:currentColor}.plyr__menu__container .plyr__control--back{font-weight:400;font-weight:var(--plyr-font-weight-regular,400);margin:.18667rem;margin:calc(var(--plyr-control-spacing, 10px)*.7);margin-bottom:.09333rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)*.7/2);padding-left:.74667rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*4);position:relative;width:calc(100% - 0.37333rem);width:calc(100% - var(--plyr-control-spacing, 10px)*.7*2)}.plyr__menu__container .plyr__control--back:after{border-right-color:#728197;border-right-color:var(--plyr-menu-arrow-color,#728197);left:.17333rem;left:calc(var(--plyr-control-spacing, 10px)*.7*1.5 - var(--plyr-menu-item-arrow-size, 4px))}.plyr__menu__container .plyr__control--back:before{background:#dcdfe5;background:var(--plyr-menu-back-border-color,#dcdfe5);box-shadow:0 .02667rem #fff;box-shadow:0 .02667rem 0 var(--plyr-menu-back-border-shadow-color,#fff);content:"";height:.02667rem;left:0;margin-top:.09333rem;margin-top:calc(var(--plyr-control-spacing, 10px)*.7/2);overflow:hidden;position:absolute;right:0;top:100%}.plyr__menu__container .plyr__control--back.plyr__tab-focus:after,.plyr__menu__container .plyr__control--back:hover:after{border-right-color:currentColor}.plyr__menu__container .plyr__control[role=menuitemradio]{padding-left:.18667rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7)}.plyr__menu__container .plyr__control[role=menuitemradio]:after,.plyr__menu__container .plyr__control[role=menuitemradio]:before{border-radius:100%}.plyr__menu__container .plyr__control[role=menuitemradio]:before{background:rgba(0,0,0,.1);content:"";display:block;flex-shrink:0;height:.42667rem;margin-right:.26667rem;margin-right:var(--plyr-control-spacing,10px);transition:all .3s ease;width:.42667rem}.plyr__menu__container .plyr__control[role=menuitemradio]:after{background:#fff;border:0;height:.16rem;left:.32rem;opacity:0;top:50%;transform:translateY(-50%) scale(0);transition:transform .3s ease,opacity .3s ease;width:.16rem}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:before{background:#00b2ff;background:var(--plyr-control-toggle-checked-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)))}.plyr__menu__container .plyr__control[role=menuitemradio][aria-checked=true]:after{opacity:1;transform:translateY(-50%) scale(1)}.plyr__menu__container .plyr__control[role=menuitemradio].plyr__tab-focus:before,.plyr__menu__container .plyr__control[role=menuitemradio]:hover:before{background:rgba(35,40,47,.1)}.plyr__menu__container .plyr__menu__value{align-items:center;display:flex;margin-left:auto;margin-right:calc(-0.18667rem + 2);margin-right:calc(var(--plyr-control-spacing, 10px)*.7*-1 - -2);overflow:hidden;padding-left:.65333rem;padding-left:calc(var(--plyr-control-spacing, 10px)*.7*3.5);pointer-events:none}.plyr--full-ui input[type=range]{-webkit-appearance:none;appearance:none;background:transparent;border:0;border-radius:.69333rem;border-radius:calc(var(--plyr-range-thumb-height, 13px)*2);color:#00b2ff;color:var(--plyr-range-fill-background,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));display:block;height:.50667rem;height:calc(var(--plyr-range-thumb-active-shadow-width, 3px)*2 + var(--plyr-range-thumb-height, 13px));margin:0;min-width:0;padding:0;transition:box-shadow .3s ease;width:100%}.plyr--full-ui input[type=range]::-webkit-slider-runnable-track{background:transparent;background-image:linear-gradient(90deg,currentColor 0,transparent 0);background-image:linear-gradient(to right,currentColor var(--value,0),transparent var(--value,0));border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-webkit-transition:box-shadow .3s ease;transition:box-shadow .3s ease;-webkit-user-select:none;user-select:none}.plyr--full-ui input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);margin-top:-.10667rem;margin-top:calc((var(--plyr-range-thumb-height, 13px) - var(--plyr-range-track-height, 5px))/2*-1);position:relative;-webkit-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-track{background:transparent;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-moz-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-moz-range-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);position:relative;-moz-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-moz-range-progress{background:currentColor;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px)}.plyr--full-ui input[type=range]::-ms-track{color:transparent}.plyr--full-ui input[type=range]::-ms-fill-upper,.plyr--full-ui input[type=range]::-ms-track{background:transparent;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-fill-lower{background:transparent;background:currentColor;border:0;border-radius:.06667rem;border-radius:calc(var(--plyr-range-track-height, 5px)/2);height:.13333rem;height:var(--plyr-range-track-height,5px);-ms-transition:box-shadow .3s ease;transition:box-shadow .3s ease;user-select:none}.plyr--full-ui input[type=range]::-ms-thumb{background:#fff;background:var(--plyr-range-thumb-background,#fff);border:0;border-radius:100%;box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2));height:.34667rem;height:var(--plyr-range-thumb-height,13px);margin-top:0;position:relative;-ms-transition:all .2s ease;transition:all .2s ease;width:.34667rem;width:var(--plyr-range-thumb-height,13px)}.plyr--full-ui input[type=range]::-ms-tooltip{display:none}.plyr--full-ui input[type=range]::-moz-focus-outer{border:0}.plyr--full-ui input[type=range]:focus{outline:0}.plyr--full-ui input[type=range].plyr__tab-focus::-webkit-slider-runnable-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr--full-ui input[type=range].plyr__tab-focus::-moz-range-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr--full-ui input[type=range].plyr__tab-focus::-ms-track{outline:.08rem dotted #00b2ff;outline:var(--plyr-tab-focus-color,var(--plyr-color-main,var(--plyr-color-main,#00b2ff))) dotted .08rem;outline-offset:.05333rem}.plyr__poster{background-color:#000;background-color:var(--plyr-video-background,var(--plyr-video-background,#000));background-position:50% 50%;background-repeat:no-repeat;background-size:contain;height:100%;left:0;opacity:0;position:absolute;top:0;transition:opacity .2s ease;width:100%;z-index:1}.plyr--stopped.plyr__poster-enabled .plyr__poster{opacity:1}.plyr--youtube.plyr--paused.plyr__poster-enabled:not(.plyr--stopped) .plyr__poster{display:none}.plyr__time{font-size:.34667rem;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__time+.plyr__time:before{content:"\\2044";margin-right:.26667rem;margin-right:var(--plyr-control-spacing,10px)}@media (max-width:767px){.plyr__time+.plyr__time{display:none}}.plyr__tooltip{background:hsla(0,0%,100%,.9);background:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:.13333rem;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));color:#4a5464;color:var(--plyr-tooltip-color,#4a5464);font-size:.34667rem;font-size:var(--plyr-font-size-small,13px);font-weight:400;font-weight:var(--plyr-font-weight-regular,400);left:50%;line-height:1.3;margin-bottom:.26667rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:.13333rem .2rem;padding:calc(var(--plyr-control-spacing, 10px)/2) calc(var(--plyr-control-spacing, 10px)/2*1.5);pointer-events:none;position:absolute;transform:translate(-50%,.26667rem) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;white-space:nowrap;z-index:2}.plyr__tooltip:before{border-left:.10667rem solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:.10667rem solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:.10667rem solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-.10667rem;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:50%;position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr .plyr__control.plyr__tab-focus .plyr__tooltip,.plyr .plyr__control:hover .plyr__tooltip,.plyr__tooltip--visible{opacity:1;transform:translate(-50%) scale(1)}.plyr .plyr__control:hover .plyr__tooltip{z-index:3}.plyr__controls>.plyr__control:first-child .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip{left:0;transform:translateY(.26667rem) scale(.8);transform-origin:0 100%}.plyr__controls>.plyr__control:first-child .plyr__tooltip:before,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip:before{left:.42667rem;left:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7)}.plyr__controls>.plyr__control:last-child .plyr__tooltip{left:auto;right:0;transform:translateY(.26667rem) scale(.8);transform-origin:100% 100%}.plyr__controls>.plyr__control:last-child .plyr__tooltip:before{left:auto;right:.42667rem;right:calc(var(--plyr-control-icon-size, 18px)/2 + var(--plyr-control-spacing, 10px)*.7);transform:translate(50%)}.plyr__controls>.plyr__control:first-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control .plyr__tooltip--visible,.plyr__controls>.plyr__control:first-child+.plyr__control.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child+.plyr__control:hover .plyr__tooltip,.plyr__controls>.plyr__control:first-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:first-child:hover .plyr__tooltip,.plyr__controls>.plyr__control:last-child .plyr__tooltip--visible,.plyr__controls>.plyr__control:last-child.plyr__tab-focus .plyr__tooltip,.plyr__controls>.plyr__control:last-child:hover .plyr__tooltip{transform:translate(0) scale(1)}.plyr__progress{left:.17333rem;left:calc(var(--plyr-range-thumb-height, 13px)*.5);margin-right:.34667rem;margin-right:var(--plyr-range-thumb-height,13px);position:relative}.plyr__progress input[type=range],.plyr__progress__buffer{margin-left:-.17333rem;margin-left:calc(var(--plyr-range-thumb-height, 13px)*-.5);margin-right:-.17333rem;margin-right:calc(var(--plyr-range-thumb-height, 13px)*-.5);width:calc(100% + 0.34667rem);width:calc(100% + var(--plyr-range-thumb-height, 13px))}.plyr__progress input[type=range]{position:relative;z-index:2}.plyr__progress .plyr__tooltip{left:0;max-width:3.2rem;overflow-wrap:break-word;white-space:normal}.plyr__progress__buffer{-webkit-appearance:none;background:transparent;border:0;border-radius:2.66667rem;height:.13333rem;height:var(--plyr-range-track-height,5px);left:0;margin-top:-.06667rem;margin-top:calc((var(--plyr-range-track-height, 5px)/2)*-1);padding:0;position:absolute;top:50%}.plyr__progress__buffer::-webkit-progress-bar{background:transparent}.plyr__progress__buffer::-webkit-progress-value{background:currentColor;border-radius:2.66667rem;min-width:.13333rem;min-width:var(--plyr-range-track-height,5px);-webkit-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-moz-progress-bar{background:currentColor;border-radius:2.66667rem;min-width:.13333rem;min-width:var(--plyr-range-track-height,5px);-moz-transition:width .2s ease;transition:width .2s ease}.plyr__progress__buffer::-ms-fill{border-radius:2.66667rem;-ms-transition:width .2s ease;transition:width .2s ease}.plyr--loading .plyr__progress__buffer{animation:plyr-progress 1s linear infinite;background-image:linear-gradient(-45deg,rgba(35,40,47,.6) 25%,transparent 0,transparent 50%,rgba(35,40,47,.6) 0,rgba(35,40,47,.6) 75%,transparent 0,transparent);background-image:linear-gradient(-45deg,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 25%,transparent 25%,transparent 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 50%,var(--plyr-progress-loading-background,rgba(35,40,47,.6)) 75%,transparent 75%,transparent);background-repeat:repeat-x;background-size:.66667rem .66667rem;background-size:var(--plyr-progress-loading-size,25px) var(--plyr-progress-loading-size,25px);color:transparent}.plyr--video.plyr--loading .plyr__progress__buffer{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr--audio.plyr--loading .plyr__progress__buffer{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr__progress__marker{background-color:#fff;background-color:var(--plyr-progress-marker-background,#fff);border-radius:.02667rem;height:.13333rem;height:var(--plyr-range-track-height,5px);position:absolute;top:50%;transform:translate(-50%,-50%);width:.08rem;width:var(--plyr-progress-marker-width,3px);z-index:3}.plyr__volume{align-items:center;display:flex;max-width:2.93333rem;min-width:2.13333rem;position:relative;width:20%}.plyr__volume input[type=range]{margin-left:.13333rem;margin-left:calc(var(--plyr-control-spacing, 10px)/2);margin-right:.13333rem;margin-right:calc(var(--plyr-control-spacing, 10px)/2);position:relative;z-index:2}.plyr--is-ios .plyr__volume{min-width:0;width:auto}.plyr--audio{display:block}.plyr--audio .plyr__controls{background:#fff;background:var(--plyr-audio-controls-background,#fff);border-radius:inherit;color:#4a5464;color:var(--plyr-audio-control-color,#4a5464);padding:.26667rem;padding:var(--plyr-control-spacing,10px)}.plyr--audio .plyr__control.plyr__tab-focus,.plyr--audio .plyr__control:hover,.plyr--audio .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-audio-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-audio-control-color-hover,#fff)}.plyr--full-ui.plyr--audio input[type=range]::-webkit-slider-runnable-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-moz-range-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]::-ms-track{background-color:rgba(193,200,209,.6);background-color:var(--plyr-audio-range-track-background,var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6)))}.plyr--full-ui.plyr--audio input[type=range]:active::-webkit-slider-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-moz-range-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--full-ui.plyr--audio input[type=range]:active::-ms-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(35,40,47,.1);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,rgba(35,40,47,.1))}.plyr--audio .plyr__progress__buffer{color:rgba(193,200,209,.6);color:var(--plyr-audio-progress-buffered-background,rgba(193,200,209,.6))}.plyr--video{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));overflow:hidden}.plyr--video.plyr--menu-open{overflow:visible}.plyr__video-wrapper{background:#000;background:var(--plyr-video-background,var(--plyr-video-background,#000));height:100%;margin:auto;overflow:hidden;position:relative;width:100%}.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{aspect-ratio:16/9}@supports not (aspect-ratio:16/9){.plyr__video-embed,.plyr__video-wrapper--fixed-ratio{height:0;padding-bottom:56.25%;position:relative}}.plyr__video-embed iframe,.plyr__video-wrapper--fixed-ratio video{border:0;height:100%;left:0;position:absolute;top:0;width:100%}.plyr--full-ui .plyr__video-embed>.plyr__video-embed__container{padding-bottom:240%;position:relative;transform:translateY(-38.28125%)}.plyr--video .plyr__controls{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:inherit;border-bottom-right-radius:inherit;bottom:0;color:#fff;color:var(--plyr-video-control-color,#fff);left:0;padding:.13333rem;padding:calc(var(--plyr-control-spacing, 10px)/2);padding-top:.53333rem;padding-top:calc(var(--plyr-control-spacing, 10px)*2);position:absolute;right:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out;z-index:3}@media (min-width:480px){.plyr--video .plyr__controls{padding:.26667rem;padding:var(--plyr-control-spacing,10px);padding-top:.93333rem;padding-top:calc(var(--plyr-control-spacing, 10px)*3.5)}}.plyr--video.plyr--hide-controls .plyr__controls{opacity:0;pointer-events:none;transform:translateY(100%)}.plyr--video .plyr__control.plyr__tab-focus,.plyr--video .plyr__control:hover,.plyr--video .plyr__control[aria-expanded=true]{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));color:#fff;color:var(--plyr-video-control-color-hover,#fff)}.plyr__control--overlaid{background:#00b2ff;background:var(--plyr-video-control-background-hover,var(--plyr-color-main,var(--plyr-color-main,#00b2ff)));border:0;border-radius:100%;color:#fff;color:var(--plyr-video-control-color,#fff);display:none;left:50%;opacity:.9;padding:.4rem;padding:calc(var(--plyr-control-spacing, 10px)*1.5);position:absolute;top:50%;transform:translate(-50%,-50%);transition:.3s;z-index:2}.plyr__control--overlaid svg{left:.05333rem;position:relative}.plyr__control--overlaid:focus,.plyr__control--overlaid:hover{opacity:1}.plyr--playing .plyr__control--overlaid{opacity:0;visibility:hidden}.plyr--full-ui.plyr--video .plyr__control--overlaid{display:block}.plyr--full-ui.plyr--video input[type=range]::-webkit-slider-runnable-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-moz-range-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]::-ms-track{background-color:rgba(255,255,255,.25);background-color:var(--plyr-video-range-track-background,var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25)))}.plyr--full-ui.plyr--video input[type=range]:active::-webkit-slider-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-moz-range-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--full-ui.plyr--video input[type=range]:active::-ms-thumb{box-shadow:0 .02667rem .02667rem rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2),0 0 0 .08rem rgba(255,255,255,.5);box-shadow:var(--plyr-range-thumb-shadow,0 1px 1px rgba(35,40,47,.15),0 0 0 .02667rem rgba(35,40,47,.2)),0 0 0 var(--plyr-range-thumb-active-shadow-width,3px) var(--plyr-audio-range-thumb-active-shadow-color,hsla(0,0%,100%,.5))}.plyr--video .plyr__progress__buffer{color:rgba(255,255,255,.25);color:var(--plyr-video-progress-buffered-background,hsla(0,0%,100%,.25))}.plyr:-webkit-full-screen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:fullscreen{background:#000;border-radius:0!important;height:100%;margin:0;width:100%}.plyr:-webkit-full-screen video{height:100%}.plyr:fullscreen video{height:100%}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen{display:block}.plyr:fullscreen .plyr__control .icon--exit-fullscreen{display:block}.plyr:-webkit-full-screen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:fullscreen .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr:-webkit-full-screen.plyr--hide-controls{cursor:none}.plyr:fullscreen.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr:-webkit-full-screen .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}.plyr:fullscreen .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr--fullscreen-fallback{background:#000;border-radius:0!important;bottom:0;display:block;height:100%;left:0;margin:0;position:fixed;right:0;top:0;width:100%;z-index:10000000}.plyr--fullscreen-fallback video{height:100%}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen{display:block}.plyr--fullscreen-fallback .plyr__control .icon--exit-fullscreen+svg{display:none}.plyr--fullscreen-fallback.plyr--hide-controls{cursor:none}@media (min-width:1024px){.plyr--fullscreen-fallback .plyr__captions{font-size:.56rem;font-size:var(--plyr-font-size-xlarge,21px)}}.plyr__ads{border-radius:inherit;bottom:0;cursor:pointer;left:0;overflow:hidden;position:absolute;right:0;top:0;z-index:-1}.plyr__ads>div,.plyr__ads>div iframe{height:100%;position:absolute;width:100%}.plyr__ads:after{background:#23282f;border-radius:.05333rem;bottom:.26667rem;bottom:var(--plyr-control-spacing,10px);color:#fff;content:attr(data-badge-text);font-size:.29333rem;padding:.05333rem .16rem;pointer-events:none;position:absolute;right:.26667rem;right:var(--plyr-control-spacing,10px);z-index:3}.plyr__ads:empty:after{display:none}.plyr__cues{background:currentColor;display:block;height:.13333rem;height:var(--plyr-range-track-height,5px);left:0;opacity:.8;position:absolute;top:50%;transform:translateY(-50%);width:.08rem;z-index:3}.plyr__preview-thumb{background-color:rgba(255,255,255,.9);background-color:var(--plyr-tooltip-background,hsla(0,0%,100%,.9));border-radius:.13333rem;border-radius:var(--plyr-tooltip-radius,5px);bottom:100%;box-shadow:0 .02667rem .05333rem rgba(0,0,0,.15);box-shadow:var(--plyr-tooltip-shadow,0 1px 2px rgba(0,0,0,.15));margin-bottom:.26667rem;margin-bottom:calc(var(--plyr-control-spacing, 10px)/2*2);opacity:0;padding:.08rem;pointer-events:none;position:absolute;transform:translateY(.26667rem) scale(.8);transform-origin:50% 100%;transition:transform .2s ease .1s,opacity .2s ease .1s;z-index:2}.plyr__preview-thumb--is-shown{opacity:1;transform:translate(0) scale(1)}.plyr__preview-thumb:before{border-left:.10667rem solid transparent;border-left:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-right:.10667rem solid transparent;border-right:var(--plyr-tooltip-arrow-size,4px) solid transparent;border-top:.10667rem solid hsla(0,0%,100%,.9);border-top:var(--plyr-tooltip-arrow-size,4px) solid var(--plyr-tooltip-background,hsla(0,0%,100%,.9));bottom:-.10667rem;bottom:calc(var(--plyr-tooltip-arrow-size, 4px)*-1);content:"";height:0;left:calc(50% + var(--preview-arrow-offset));position:absolute;transform:translate(-50%);width:0;z-index:2}.plyr__preview-thumb__image-container{background:#c1c8d1;border-radius:.10667rem;border-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);overflow:hidden;position:relative;z-index:0}.plyr__preview-thumb__image-container img,.plyr__preview-thumb__image-container:after{height:100%;left:0;position:absolute;top:0;width:100%}.plyr__preview-thumb__image-container:after{border-radius:inherit;box-shadow:inset 0 0 0 .02667rem rgba(0,0,0,.15);content:"";pointer-events:none}.plyr__preview-thumb__image-container img{max-height:none;max-width:none}.plyr__preview-thumb__time-container{background:linear-gradient(transparent,rgba(0,0,0,.75));background:var(--plyr-video-controls-background,linear-gradient(transparent,rgba(0,0,0,.75)));border-bottom-left-radius:.10667rem;border-bottom-left-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);border-bottom-right-radius:.10667rem;border-bottom-right-radius:calc(var(--plyr-tooltip-radius, 5px) - .02667rem);bottom:0;left:0;line-height:1.1;padding:.53333rem .16rem .16rem;position:absolute;right:0;z-index:3}.plyr__preview-thumb__time-container span{color:#fff;font-size:.34667rem;font-size:var(--plyr-font-size-time,var(--plyr-font-size-small,13px))}.plyr__preview-scrubbing{bottom:0;filter:blur(.02667rem);height:100%;left:0;margin:auto;opacity:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;transition:opacity .3s ease;width:100%;z-index:1}.plyr__preview-scrubbing--is-shown{opacity:1}.plyr__preview-scrubbing img{height:100%;left:0;max-height:none;max-width:none;object-fit:contain;position:absolute;top:0;width:100%}.plyr--no-transition{transition:none!important}.plyr__sr-only{clip:rect(.02667rem,.02667rem,.02667rem,.02667rem);border:0!important;height:.02667rem!important;overflow:hidden;padding:0!important;position:absolute!important;width:.02667rem!important}.plyr [hidden]{display:none!important}\n'
- document.head.appendChild(__vite_style__)
- System.register(
- ['./vendor-legacy.09f20d09.js', './index-legacy.595c24c3.js'],
- function (exports) {
- 'use strict'
- var defineComponent,
- createVNode,
- Loading,
- createTextVNode,
- Fragment,
- Icon,
- Button,
- Toast,
- listenerMessage,
- browser$1,
- postMessage,
- state
- return {
- setters: [
- function (module) {
- defineComponent = module.d
- createVNode = module.a
- Loading = module.L
- createTextVNode = module.j
- Fragment = module.F
- Icon = module.K
- Button = module.B
- Toast = module.T
- },
- function (module) {
- listenerMessage = module.l
- browser$1 = module.b
- postMessage = module.p
- state = module.s
- }
- ],
- execute: function execute() {
- var video = '_video_1vz16_1'
- var loadingVideo = '_loadingVideo_1vz16_35'
- var playOver = '_playOver_1vz16_44'
- var tips = '_tips_1vz16_52'
- var btn = '_btn_1vz16_56'
- var freeTxt = '_freeTxt_1vz16_59'
- var freeRate = '_freeRate_1vz16_65'
- var styles = {
- 'video-container': '_video-container_1vz16_1',
- video: video,
- loadingVideo: loadingVideo,
- playOver: playOver,
- tips: tips,
- btn: btn,
- freeTxt: freeTxt,
- freeRate: freeRate
- }
- function _defineProperty$1(e, t, i) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: i,
- enumerable: !0,
- configurable: !0,
- writable: !0
- })
- : (e[t] = i),
- e
- )
- }
- function _classCallCheck(e, t) {
- if (!(e instanceof t))
- throw new TypeError('Cannot call a class as a function')
- }
- function _defineProperties(e, t) {
- for (var i = 0; i < t.length; i++) {
- var s = t[i]
- ;(s.enumerable = s.enumerable || !1),
- (s.configurable = !0),
- 'value' in s && (s.writable = !0),
- Object.defineProperty(e, s.key, s)
- }
- }
- function _createClass(e, t, i) {
- return (
- t && _defineProperties(e.prototype, t),
- i && _defineProperties(e, i),
- e
- )
- }
- function _defineProperty(e, t, i) {
- return (
- t in e
- ? Object.defineProperty(e, t, {
- value: i,
- enumerable: !0,
- configurable: !0,
- writable: !0
- })
- : (e[t] = i),
- e
- )
- }
- function ownKeys(e, t) {
- var i = Object.keys(e)
- if (Object.getOwnPropertySymbols) {
- var s = Object.getOwnPropertySymbols(e)
- t &&
- (s = s.filter(function (t) {
- return Object.getOwnPropertyDescriptor(e, t).enumerable
- })),
- i.push.apply(i, s)
- }
- return i
- }
- function _objectSpread2(e) {
- for (var t = 1; t < arguments.length; t++) {
- var i = null != arguments[t] ? arguments[t] : {}
- t % 2
- ? ownKeys(Object(i), !0).forEach(function (t) {
- _defineProperty(e, t, i[t])
- })
- : Object.getOwnPropertyDescriptors
- ? Object.defineProperties(
- e,
- Object.getOwnPropertyDescriptors(i)
- )
- : ownKeys(Object(i)).forEach(function (t) {
- Object.defineProperty(
- e,
- t,
- Object.getOwnPropertyDescriptor(i, t)
- )
- })
- }
- return e
- }
- var defaults$1 = { addCSS: !0, thumbWidth: 15, watch: !0 }
- function matches$1(e, t) {
- return function () {
- return Array.from(document.querySelectorAll(t)).includes(this)
- }.call(e, t)
- }
- function trigger(e, t) {
- if (e && t) {
- var i = new Event(t, { bubbles: !0 })
- e.dispatchEvent(i)
- }
- }
- var getConstructor$1 = function getConstructor$1(e) {
- return null != e ? e.constructor : null
- },
- instanceOf$1 = function instanceOf$1(e, t) {
- return !!(e && t && e instanceof t)
- },
- isNullOrUndefined$1 = function isNullOrUndefined$1(e) {
- return null == e
- },
- isObject$1 = function isObject$1(e) {
- return getConstructor$1(e) === Object
- },
- isNumber$1 = function isNumber$1(e) {
- return getConstructor$1(e) === Number && !Number.isNaN(e)
- },
- isString$1 = function isString$1(e) {
- return getConstructor$1(e) === String
- },
- isBoolean$1 = function isBoolean$1(e) {
- return getConstructor$1(e) === Boolean
- },
- isFunction$1 = function isFunction$1(e) {
- return getConstructor$1(e) === Function
- },
- isArray$1 = function isArray$1(e) {
- return Array.isArray(e)
- },
- isNodeList$1 = function isNodeList$1(e) {
- return instanceOf$1(e, NodeList)
- },
- isElement$1 = function isElement$1(e) {
- return instanceOf$1(e, Element)
- },
- isEvent$1 = function isEvent$1(e) {
- return instanceOf$1(e, Event)
- },
- isEmpty$1 = function isEmpty$1(e) {
- return (
- isNullOrUndefined$1(e) ||
- ((isString$1(e) || isArray$1(e) || isNodeList$1(e)) &&
- !e.length) ||
- (isObject$1(e) && !Object.keys(e).length)
- )
- },
- is$1 = {
- nullOrUndefined: isNullOrUndefined$1,
- object: isObject$1,
- number: isNumber$1,
- string: isString$1,
- boolean: isBoolean$1,
- function: isFunction$1,
- array: isArray$1,
- nodeList: isNodeList$1,
- element: isElement$1,
- event: isEvent$1,
- empty: isEmpty$1
- }
- function getDecimalPlaces(e) {
- var t = ''.concat(e).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/)
- return t
- ? Math.max(0, (t[1] ? t[1].length : 0) - (t[2] ? +t[2] : 0))
- : 0
- }
- function round(e, t) {
- if (1 > t) {
- var i = getDecimalPlaces(t)
- return parseFloat(e.toFixed(i))
- }
- return Math.round(e / t) * t
- }
- var RangeTouch = (function () {
- function e(t, i) {
- _classCallCheck(this, e),
- is$1.element(t)
- ? (this.element = t)
- : is$1.string(t) &&
- (this.element = document.querySelector(t)),
- is$1.element(this.element) &&
- is$1.empty(this.element.rangeTouch) &&
- ((this.config = _objectSpread2({}, defaults$1, {}, i)),
- this.init())
- }
- return (
- _createClass(
- e,
- [
- {
- key: 'init',
- value: function value() {
- e.enabled &&
- (this.config.addCSS &&
- ((this.element.style.userSelect = 'none'),
- (this.element.style.webKitUserSelect = 'none'),
- (this.element.style.touchAction = 'manipulation')),
- this.listeners(!0),
- (this.element.rangeTouch = this))
- }
- },
- {
- key: 'destroy',
- value: function value() {
- e.enabled &&
- (this.config.addCSS &&
- ((this.element.style.userSelect = ''),
- (this.element.style.webKitUserSelect = ''),
- (this.element.style.touchAction = '')),
- this.listeners(!1),
- (this.element.rangeTouch = null))
- }
- },
- {
- key: 'listeners',
- value: function value(e) {
- var t = this,
- i = e ? 'addEventListener' : 'removeEventListener'
- ;['touchstart', 'touchmove', 'touchend'].forEach(
- function (e) {
- t.element[i](
- e,
- function (e) {
- return t.set(e)
- },
- !1
- )
- }
- )
- }
- },
- {
- key: 'get',
- value: function value(t) {
- if (!e.enabled || !is$1.event(t)) return null
- var i,
- s = t.target,
- n = t.changedTouches[0],
- r = parseFloat(s.getAttribute('min')) || 0,
- a = parseFloat(s.getAttribute('max')) || 100,
- o = parseFloat(s.getAttribute('step')) || 1,
- l = s.getBoundingClientRect(),
- c =
- ((100 / l.width) * (this.config.thumbWidth / 2)) / 100
- return (
- 0 > (i = (100 / l.width) * (n.clientX - l.left))
- ? (i = 0)
- : 100 < i && (i = 100),
- 50 > i
- ? (i -= (100 - 2 * i) * c)
- : 50 < i && (i += 2 * (i - 50) * c),
- r + round((i / 100) * (a - r), o)
- )
- }
- },
- {
- key: 'set',
- value: function value(t) {
- e.enabled &&
- is$1.event(t) &&
- !t.target.disabled &&
- (t.preventDefault(),
- (t.target.value = this.get(t)),
- trigger(
- t.target,
- 'touchend' === t.type ? 'change' : 'input'
- ))
- }
- }
- ],
- [
- {
- key: 'setup',
- value: function value(t) {
- var i =
- 1 < arguments.length && void 0 !== arguments[1]
- ? arguments[1]
- : {},
- s = null
- if (
- (is$1.empty(t) || is$1.string(t)
- ? (s = Array.from(
- document.querySelectorAll(
- is$1.string(t) ? t : 'input[type="range"]'
- )
- ))
- : is$1.element(t)
- ? (s = [t])
- : is$1.nodeList(t)
- ? (s = Array.from(t))
- : is$1.array(t) && (s = t.filter(is$1.element)),
- is$1.empty(s))
- )
- return null
- var n = _objectSpread2({}, defaults$1, {}, i)
- if (is$1.string(t) && n.watch) {
- var r = new MutationObserver(function (i) {
- Array.from(i).forEach(function (i) {
- Array.from(i.addedNodes).forEach(function (i) {
- is$1.element(i) && matches$1(i, t) && new e(i, n)
- })
- })
- })
- r.observe(document.body, { childList: !0, subtree: !0 })
- }
- return s.map(function (t) {
- return new e(t, i)
- })
- }
- },
- {
- key: 'enabled',
- get: function get() {
- return 'ontouchstart' in document.documentElement
- }
- }
- ]
- ),
- e
- )
- })()
- var getConstructor = function getConstructor(e) {
- return null != e ? e.constructor : null
- },
- instanceOf = function instanceOf(e, t) {
- return Boolean(e && t && e instanceof t)
- },
- isNullOrUndefined = function isNullOrUndefined(e) {
- return null == e
- },
- isObject = function isObject(e) {
- return getConstructor(e) === Object
- },
- isNumber = function isNumber(e) {
- return getConstructor(e) === Number && !Number.isNaN(e)
- },
- isString = function isString(e) {
- return getConstructor(e) === String
- },
- isBoolean = function isBoolean(e) {
- return getConstructor(e) === Boolean
- },
- isFunction = function isFunction(e) {
- return getConstructor(e) === Function
- },
- isArray = function isArray(e) {
- return Array.isArray(e)
- },
- isWeakMap = function isWeakMap(e) {
- return instanceOf(e, WeakMap)
- },
- isNodeList = function isNodeList(e) {
- return instanceOf(e, NodeList)
- },
- isTextNode = function isTextNode(e) {
- return getConstructor(e) === Text
- },
- isEvent = function isEvent(e) {
- return instanceOf(e, Event)
- },
- isKeyboardEvent = function isKeyboardEvent(e) {
- return instanceOf(e, KeyboardEvent)
- },
- isCue = function isCue(e) {
- return (
- instanceOf(e, window.TextTrackCue) ||
- instanceOf(e, window.VTTCue)
- )
- },
- isTrack = function isTrack(e) {
- return (
- instanceOf(e, TextTrack) ||
- (!isNullOrUndefined(e) && isString(e.kind))
- )
- },
- isPromise = function isPromise(e) {
- return instanceOf(e, Promise) && isFunction(e.then)
- },
- isElement = function isElement(e) {
- return (
- null !== e &&
- 'object' == _typeof(e) &&
- 1 === e.nodeType &&
- 'object' == _typeof(e.style) &&
- 'object' == _typeof(e.ownerDocument)
- )
- },
- isEmpty = function isEmpty(e) {
- return (
- isNullOrUndefined(e) ||
- ((isString(e) || isArray(e) || isNodeList(e)) && !e.length) ||
- (isObject(e) && !Object.keys(e).length)
- )
- },
- isUrl = function isUrl(e) {
- if (instanceOf(e, window.URL)) return !0
- if (!isString(e)) return !1
- var t = e
- ;(e.startsWith('http://') && e.startsWith('https://')) ||
- (t = 'http://'.concat(e))
- try {
- return !isEmpty(new URL(t).hostname)
- } catch (e) {
- return !1
- }
- }
- var is = {
- nullOrUndefined: isNullOrUndefined,
- object: isObject,
- number: isNumber,
- string: isString,
- boolean: isBoolean,
- function: isFunction,
- array: isArray,
- weakMap: isWeakMap,
- nodeList: isNodeList,
- element: isElement,
- textNode: isTextNode,
- event: isEvent,
- keyboardEvent: isKeyboardEvent,
- cue: isCue,
- track: isTrack,
- promise: isPromise,
- url: isUrl,
- empty: isEmpty
- }
- var transitionEndEvent = (function () {
- var e = document.createElement('span'),
- t = {
- WebkitTransition: 'webkitTransitionEnd',
- MozTransition: 'transitionend',
- OTransition: 'oTransitionEnd otransitionend',
- transition: 'transitionend'
- },
- i = Object.keys(t).find(function (t) {
- return void 0 !== e.style[t]
- })
- return !!is.string(i) && t[i]
- })()
- function repaint(e, t) {
- setTimeout(function () {
- try {
- ;(e.hidden = !0), e.offsetHeight, (e.hidden = !1)
- } catch (e) {}
- }, t)
- }
- var browser = {
- isIE: Boolean(window.document.documentMode),
- isEdge: window.navigator.userAgent.includes('Edge'),
- isWebkit:
- 'WebkitAppearance' in document.documentElement.style &&
- !/Edge/.test(navigator.userAgent),
- isIPhone: /(iPhone|iPod)/gi.test(navigator.platform),
- isIos:
- ('MacIntel' === navigator.platform &&
- navigator.maxTouchPoints > 1) ||
- /(iPad|iPhone|iPod)/gi.test(navigator.platform)
- }
- function cloneDeep(e) {
- return JSON.parse(JSON.stringify(e))
- }
- function getDeep(e, t) {
- return t.split('.').reduce(function (e, t) {
- return e && e[t]
- }, e)
- }
- function extend() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : {}
- for (
- var _len = arguments.length,
- t = new Array(_len > 1 ? _len - 1 : 0),
- _key = 1;
- _key < _len;
- _key++
- ) {
- t[_key - 1] = arguments[_key]
- }
- if (!t.length) return e
- var i = t.shift()
- return is.object(i)
- ? (Object.keys(i).forEach(function (t) {
- is.object(i[t])
- ? (Object.keys(e).includes(t) ||
- Object.assign(e, _defineProperty2({}, t, {})),
- extend(e[t], i[t]))
- : Object.assign(e, _defineProperty2({}, t, i[t]))
- }),
- extend.apply(void 0, [e].concat(t)))
- : e
- }
- function wrap(e, t) {
- var i = e.length ? e : [e]
- Array.from(i)
- .reverse()
- .forEach(function (e, i) {
- var s = i > 0 ? t.cloneNode(!0) : t,
- n = e.parentNode,
- r = e.nextSibling
- s.appendChild(e), r ? n.insertBefore(s, r) : n.appendChild(s)
- })
- }
- function setAttributes(e, t) {
- is.element(e) &&
- !is.empty(t) &&
- Object.entries(t)
- .filter(function (_ref) {
- var _ref2 = _slicedToArray(_ref, 2),
- e = _ref2[1]
- return !is.nullOrUndefined(e)
- })
- .forEach(function (_ref3) {
- var _ref4 = _slicedToArray(_ref3, 2),
- t = _ref4[0],
- i = _ref4[1]
- return e.setAttribute(t, i)
- })
- }
- function createElement(e, t, i) {
- var s = document.createElement(e)
- return (
- is.object(t) && setAttributes(s, t),
- is.string(i) && (s.innerText = i),
- s
- )
- }
- function insertAfter(e, t) {
- is.element(e) &&
- is.element(t) &&
- t.parentNode.insertBefore(e, t.nextSibling)
- }
- function insertElement(e, t, i, s) {
- is.element(t) && t.appendChild(createElement(e, i, s))
- }
- function removeElement(e) {
- is.nodeList(e) || is.array(e)
- ? Array.from(e).forEach(removeElement)
- : is.element(e) &&
- is.element(e.parentNode) &&
- e.parentNode.removeChild(e)
- }
- function emptyElement(e) {
- if (!is.element(e)) return
- var t = e.childNodes.length
- for (; t > 0; ) {
- e.removeChild(e.lastChild), (t -= 1)
- }
- }
- function replaceElement(e, t) {
- return is.element(t) && is.element(t.parentNode) && is.element(e)
- ? (t.parentNode.replaceChild(e, t), e)
- : null
- }
- function getAttributesFromSelector(e, t) {
- if (!is.string(e) || is.empty(e)) return {}
- var i = {},
- s = extend({}, t)
- return (
- e.split(',').forEach(function (e) {
- var t = e.trim(),
- n = t.replace('.', ''),
- r = t.replace(/[[\]]/g, '').split('='),
- _r = _slicedToArray(r, 1),
- a = _r[0],
- o = r.length > 1 ? r[1].replace(/["']/g, '') : ''
- switch (t.charAt(0)) {
- case '.':
- is.string(s.class)
- ? (i.class = ''.concat(s.class, ' ').concat(n))
- : (i.class = n)
- break
- case '#':
- i.id = t.replace('#', '')
- break
- case '[':
- i[a] = o
- }
- }),
- extend(s, i)
- )
- }
- function toggleHidden(e, t) {
- if (!is.element(e)) return
- var i = t
- is.boolean(i) || (i = !e.hidden), (e.hidden = i)
- }
- function toggleClass(e, t, i) {
- if (is.nodeList(e))
- return Array.from(e).map(function (e) {
- return toggleClass(e, t, i)
- })
- if (is.element(e)) {
- var s = 'toggle'
- return (
- void 0 !== i && (s = i ? 'add' : 'remove'),
- e.classList[s](t),
- e.classList.contains(t)
- )
- }
- return !1
- }
- function hasClass(e, t) {
- return is.element(e) && e.classList.contains(t)
- }
- function matches(e, t) {
- var _Element = Element,
- i = _Element.prototype
- return (
- i.matches ||
- i.webkitMatchesSelector ||
- i.mozMatchesSelector ||
- i.msMatchesSelector ||
- function () {
- return Array.from(document.querySelectorAll(t)).includes(this)
- }
- ).call(e, t)
- }
- function closest$1(e, t) {
- var _Element2 = Element,
- i = _Element2.prototype
- return (
- i.closest ||
- function () {
- var e = this
- do {
- if (matches.matches(e, t)) return e
- e = e.parentElement || e.parentNode
- } while (null !== e && 1 === e.nodeType)
- return null
- }
- ).call(e, t)
- }
- function getElements(e) {
- return this.elements.container.querySelectorAll(e)
- }
- function getElement(e) {
- return this.elements.container.querySelector(e)
- }
- function setFocus() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : null
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- is.element(e) &&
- (e.focus({ preventScroll: !0 }),
- t && toggleClass(e, this.config.classNames.tabFocus))
- }
- var defaultCodecs = {
- 'audio/ogg': 'vorbis',
- 'audio/wav': '1',
- 'video/webm': 'vp8, vorbis',
- 'video/mp4': 'avc1.42E01E, mp4a.40.2',
- 'video/ogg': 'theora'
- },
- support = {
- audio: 'canPlayType' in document.createElement('audio'),
- video: 'canPlayType' in document.createElement('video'),
- check: function check(e, t, i) {
- var s = browser.isIPhone && i && support.playsinline,
- n = support[e] || 'html5' !== t
- return {
- api: n,
- ui:
- n &&
- support.rangeInput &&
- ('video' !== e || !browser.isIPhone || s)
- }
- },
- pip: !(
- browser.isIPhone ||
- (!is.function(
- createElement('video').webkitSetPresentationMode
- ) &&
- (!document.pictureInPictureEnabled ||
- createElement('video').disablePictureInPicture))
- ),
- airplay: is.function(
- window.WebKitPlaybackTargetAvailabilityEvent
- ),
- playsinline: 'playsInline' in document.createElement('video'),
- mime: function mime(e) {
- if (is.empty(e)) return !1
- var _e$split = e.split('/'),
- _e$split2 = _slicedToArray(_e$split, 1),
- t = _e$split2[0]
- var i = e
- if (!this.isHTML5 || t !== this.type) return !1
- Object.keys(defaultCodecs).includes(i) &&
- (i += '; codecs="'.concat(defaultCodecs[e], '"'))
- try {
- return Boolean(
- i && this.media.canPlayType(i).replace(/no/, '')
- )
- } catch (e) {
- return !1
- }
- },
- textTracks: 'textTracks' in document.createElement('video'),
- rangeInput: (function () {
- var e = document.createElement('input')
- return (e.type = 'range'), 'range' === e.type
- })(),
- touch: 'ontouchstart' in document.documentElement,
- transitions: !1 !== transitionEndEvent,
- reducedMotion:
- 'matchMedia' in window &&
- window.matchMedia('(prefers-reduced-motion)').matches
- },
- supportsPassiveListeners = (function () {
- var e = !1
- try {
- var t = Object.defineProperty({}, 'passive', {
- get: function get() {
- return (e = !0), null
- }
- })
- window.addEventListener('test', null, t),
- window.removeEventListener('test', null, t)
- } catch (e) {}
- return e
- })()
- function toggleListener(e, t, i) {
- var _this2 = this
- var s =
- arguments.length > 3 && arguments[3] !== undefined
- ? arguments[3]
- : !1
- var n =
- arguments.length > 4 && arguments[4] !== undefined
- ? arguments[4]
- : !0
- var r =
- arguments.length > 5 && arguments[5] !== undefined
- ? arguments[5]
- : !1
- if (
- !e ||
- !('addEventListener' in e) ||
- is.empty(t) ||
- !is.function(i)
- )
- return
- var a = t.split(' ')
- var o = r
- supportsPassiveListeners && (o = { passive: n, capture: r }),
- a.forEach(function (t) {
- _this2 &&
- _this2.eventListeners &&
- s &&
- _this2.eventListeners.push({
- element: e,
- type: t,
- callback: i,
- options: o
- }),
- e[s ? 'addEventListener' : 'removeEventListener'](t, i, o)
- })
- }
- function on(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : ''
- var i = arguments.length > 2 ? arguments[2] : undefined
- var s =
- arguments.length > 3 && arguments[3] !== undefined
- ? arguments[3]
- : !0
- var n =
- arguments.length > 4 && arguments[4] !== undefined
- ? arguments[4]
- : !1
- toggleListener.call(this, e, t, i, !0, s, n)
- }
- function off(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : ''
- var i = arguments.length > 2 ? arguments[2] : undefined
- var s =
- arguments.length > 3 && arguments[3] !== undefined
- ? arguments[3]
- : !0
- var n =
- arguments.length > 4 && arguments[4] !== undefined
- ? arguments[4]
- : !1
- toggleListener.call(this, e, t, i, !1, s, n)
- }
- function once(e) {
- var _this3 = this
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : ''
- var i = arguments.length > 2 ? arguments[2] : undefined
- var s =
- arguments.length > 3 && arguments[3] !== undefined
- ? arguments[3]
- : !0
- var n =
- arguments.length > 4 && arguments[4] !== undefined
- ? arguments[4]
- : !1
- var r = function r() {
- for (
- var _len2 = arguments.length, a = new Array(_len2), _key2 = 0;
- _key2 < _len2;
- _key2++
- ) {
- a[_key2] = arguments[_key2]
- }
- off(e, t, r, s, n), i.apply(_this3, a)
- }
- toggleListener.call(this, e, t, r, !0, s, n)
- }
- function triggerEvent(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : ''
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : !1
- var s =
- arguments.length > 3 && arguments[3] !== undefined
- ? arguments[3]
- : {}
- if (!is.element(e) || is.empty(t)) return
- var n = new CustomEvent(t, {
- bubbles: i,
- detail: _objectSpread(_objectSpread({}, s), {}, { plyr: this })
- })
- e.dispatchEvent(n)
- }
- function unbindListeners() {
- this &&
- this.eventListeners &&
- (this.eventListeners.forEach(function (e) {
- var t = e.element,
- i = e.type,
- s = e.callback,
- n = e.options
- t.removeEventListener(i, s, n)
- }),
- (this.eventListeners = []))
- }
- function ready() {
- var _this4 = this
- return new Promise(function (e) {
- return _this4.ready
- ? setTimeout(e, 0)
- : on.call(_this4, _this4.elements.container, 'ready', e)
- }).then(function () {})
- }
- function silencePromise(e) {
- is.promise(e) && e.then(null, function () {})
- }
- function dedupe(e) {
- return is.array(e)
- ? e.filter(function (t, i) {
- return e.indexOf(t) === i
- })
- : e
- }
- function closest(e, t) {
- return is.array(e) && e.length
- ? e.reduce(function (e, i) {
- return Math.abs(i - t) < Math.abs(e - t) ? i : e
- })
- : null
- }
- function supportsCSS(e) {
- return !(!window || !window.CSS) && window.CSS.supports(e)
- }
- var standardRatios = [
- [1, 1],
- [4, 3],
- [3, 4],
- [5, 4],
- [4, 5],
- [3, 2],
- [2, 3],
- [16, 10],
- [10, 16],
- [16, 9],
- [9, 16],
- [21, 9],
- [9, 21],
- [32, 9],
- [9, 32]
- ].reduce(function (e, _ref5) {
- var _ref6 = _slicedToArray(_ref5, 2),
- t = _ref6[0],
- i = _ref6[1]
- return _objectSpread(
- _objectSpread({}, e),
- {},
- _defineProperty2({}, t / i, [t, i])
- )
- }, {})
- function validateAspectRatio(e) {
- if (!(is.array(e) || (is.string(e) && e.includes(':')))) return !1
- return (is.array(e) ? e : e.split(':')).map(Number).every(is.number)
- }
- function reduceAspectRatio(e) {
- if (!is.array(e) || !e.every(is.number)) return null
- var _e2 = _slicedToArray(e, 2),
- t = _e2[0],
- i = _e2[1],
- s = function s(e, t) {
- return 0 === t ? e : s(t, e % t)
- },
- n = s(t, i)
- return [t / n, i / n]
- }
- function getAspectRatio(e) {
- var _this$embed
- var t = function t(e) {
- return validateAspectRatio(e) ? e.split(':').map(Number) : null
- }
- var i = t(e)
- if (
- (null === i && (i = t(this.config.ratio)),
- null === i &&
- !is.empty(this.embed) &&
- is.array(this.embed.ratio) &&
- ((_this$embed = this.embed),
- (i = _this$embed.ratio),
- _this$embed),
- null === i && this.isHTML5)
- ) {
- var _this$media = this.media,
- _e3 = _this$media.videoWidth,
- _t = _this$media.videoHeight
- i = [_e3, _t]
- }
- return reduceAspectRatio(i)
- }
- function setAspectRatio(e) {
- if (!this.isVideo) return {}
- var t = this.elements.wrapper,
- i = getAspectRatio.call(this, e)
- if (!is.array(i)) return {}
- var _reduceAspectRatio = reduceAspectRatio(i),
- _reduceAspectRatio2 = _slicedToArray(_reduceAspectRatio, 2),
- s = _reduceAspectRatio2[0],
- n = _reduceAspectRatio2[1],
- r = (100 / s) * n
- if (
- (supportsCSS('aspect-ratio: '.concat(s, '/').concat(n))
- ? (t.style.aspectRatio = ''.concat(s, '/').concat(n))
- : (t.style.paddingBottom = ''.concat(r, '%')),
- this.isVimeo && !this.config.vimeo.premium && this.supported.ui)
- ) {
- var _e4 =
- (100 / this.media.offsetWidth) *
- parseInt(
- window.getComputedStyle(this.media).paddingBottom,
- 10
- ),
- _i2 = (_e4 - r) / (_e4 / 50)
- this.fullscreen.active
- ? (t.style.paddingBottom = null)
- : (this.media.style.transform = 'translateY(-'.concat(
- _i2,
- '%)'
- ))
- } else
- this.isHTML5 &&
- t.classList.add(this.config.classNames.videoFixedRatio)
- return { padding: r, ratio: i }
- }
- function roundAspectRatio(e, t) {
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : 0.05
- var s = e / t,
- n = closest(Object.keys(standardRatios), s)
- return Math.abs(n - s) <= i ? standardRatios[n] : [e, t]
- }
- function getViewportSize() {
- return [
- Math.max(
- document.documentElement.clientWidth || 0,
- window.innerWidth || 0
- ),
- Math.max(
- document.documentElement.clientHeight || 0,
- window.innerHeight || 0
- )
- ]
- }
- var html5 = {
- getSources: function getSources() {
- var _this5 = this
- if (!this.isHTML5) return []
- return Array.from(this.media.querySelectorAll('source')).filter(
- function (e) {
- var t = e.getAttribute('type')
- return !!is.empty(t) || support.mime.call(_this5, t)
- }
- )
- },
- getQualityOptions: function getQualityOptions() {
- return this.config.quality.forced
- ? this.config.quality.options
- : html5.getSources
- .call(this)
- .map(function (e) {
- return Number(e.getAttribute('size'))
- })
- .filter(Boolean)
- },
- setup: function setup() {
- if (!this.isHTML5) return
- var e = this
- ;(e.options.speed = e.config.speed.options),
- is.empty(this.config.ratio) || setAspectRatio.call(e),
- Object.defineProperty(e.media, 'quality', {
- get: function get() {
- var t = html5.getSources.call(e).find(function (t) {
- return t.getAttribute('src') === e.source
- })
- return t && Number(t.getAttribute('size'))
- },
- set: function set(t) {
- if (e.quality !== t) {
- if (
- e.config.quality.forced &&
- is.function(e.config.quality.onChange)
- )
- e.config.quality.onChange(t)
- else {
- var i = html5.getSources.call(e).find(function (e) {
- return Number(e.getAttribute('size')) === t
- })
- if (!i) return
- var _e$media = e.media,
- s = _e$media.currentTime,
- n = _e$media.paused,
- r = _e$media.preload,
- a = _e$media.readyState,
- o = _e$media.playbackRate
- ;(e.media.src = i.getAttribute('src')),
- ('none' !== r || a) &&
- (e.once('loadedmetadata', function () {
- ;(e.speed = o),
- (e.currentTime = s),
- n || silencePromise(e.play())
- }),
- e.media.load())
- }
- triggerEvent.call(e, e.media, 'qualitychange', !1, {
- quality: t
- })
- }
- }
- })
- },
- cancelRequests: function cancelRequests() {
- this.isHTML5 &&
- (removeElement(html5.getSources.call(this)),
- this.media.setAttribute('src', this.config.blankVideo),
- this.media.load(),
- this.debug.log('Cancelled network requests'))
- }
- }
- function generateId(e) {
- return ''.concat(e, '-').concat(Math.floor(1e4 * Math.random()))
- }
- function format(e) {
- for (
- var _len3 = arguments.length,
- t = new Array(_len3 > 1 ? _len3 - 1 : 0),
- _key3 = 1;
- _key3 < _len3;
- _key3++
- ) {
- t[_key3 - 1] = arguments[_key3]
- }
- return is.empty(e)
- ? e
- : e.toString().replace(/{(\d+)}/g, function (e, i) {
- return t[i].toString()
- })
- }
- function getPercentage(e, t) {
- return 0 === e || 0 === t || Number.isNaN(e) || Number.isNaN(t)
- ? 0
- : ((e / t) * 100).toFixed(2)
- }
- var replaceAll = function replaceAll() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : ''
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : ''
- return e.replace(
- new RegExp(
- t.toString().replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1'),
- 'g'
- ),
- i.toString()
- )
- },
- toTitleCase = function toTitleCase() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- return e.toString().replace(/\w\S*/g, function (e) {
- return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase()
- })
- }
- function toPascalCase() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- var t = e.toString()
- return (
- (t = replaceAll(t, '-', ' ')),
- (t = replaceAll(t, '_', ' ')),
- (t = toTitleCase(t)),
- replaceAll(t, ' ', '')
- )
- }
- function toCamelCase() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- var t = e.toString()
- return (t = toPascalCase(t)), t.charAt(0).toLowerCase() + t.slice(1)
- }
- function stripHTML(e) {
- var t = document.createDocumentFragment(),
- i = document.createElement('div')
- return t.appendChild(i), (i.innerHTML = e), t.firstChild.innerText
- }
- function getHTML(e) {
- var t = document.createElement('div')
- return t.appendChild(e), t.innerHTML
- }
- var resources = {
- pip: 'PIP',
- airplay: 'AirPlay',
- html5: 'HTML5',
- vimeo: 'Vimeo',
- youtube: 'YouTube'
- },
- i18n = {
- get: function get() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : {}
- if (is.empty(e) || is.empty(t)) return ''
- var i = getDeep(t.i18n, e)
- if (is.empty(i))
- return Object.keys(resources).includes(e) ? resources[e] : ''
- var s = { '{seektime}': t.seekTime, '{title}': t.title }
- return (
- Object.entries(s).forEach(function (_ref7) {
- var _ref8 = _slicedToArray(_ref7, 2),
- e = _ref8[0],
- t = _ref8[1]
- i = replaceAll(i, e, t)
- }),
- i
- )
- }
- }
- var Storage = /*#__PURE__*/ (function () {
- function Storage(e) {
- var _this6 = this
- _classCallCheck2(this, Storage)
- _defineProperty$1(this, 'get', function (e) {
- if (!Storage.supported || !_this6.enabled) return null
- var t = window.localStorage.getItem(_this6.key)
- if (is.empty(t)) return null
- var i = JSON.parse(t)
- return is.string(e) && e.length ? i[e] : i
- }),
- _defineProperty$1(this, 'set', function (e) {
- if (!Storage.supported || !_this6.enabled) return
- if (!is.object(e)) return
- var t = _this6.get()
- is.empty(t) && (t = {}), extend(t, e)
- try {
- window.localStorage.setItem(_this6.key, JSON.stringify(t))
- } catch (e) {}
- }),
- (this.enabled = e.config.storage.enabled),
- (this.key = e.config.storage.key)
- }
- _createClass2(Storage, null, [
- {
- key: 'supported',
- get: function get() {
- try {
- if (!('localStorage' in window)) return !1
- var e = '___test'
- return (
- window.localStorage.setItem(e, e),
- window.localStorage.removeItem(e),
- !0
- )
- } catch (e) {
- return !1
- }
- }
- }
- ])
- return Storage
- })()
- function fetch(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : 'text'
- return new Promise(function (i, s) {
- try {
- var _s2 = new XMLHttpRequest()
- if (!('withCredentials' in _s2)) return
- _s2.addEventListener('load', function () {
- if ('text' === t)
- try {
- i(JSON.parse(_s2.responseText))
- } catch (e) {
- i(_s2.responseText)
- }
- else i(_s2.response)
- }),
- _s2.addEventListener('error', function () {
- throw new Error(_s2.status)
- }),
- _s2.open('GET', e, !0),
- (_s2.responseType = t),
- _s2.send()
- } catch (e) {
- s(e)
- }
- })
- }
- function _loadSprite(e, t) {
- if (!is.string(e)) return
- var i = is.string(t)
- var s = !1
- var n = function n() {
- return null !== document.getElementById(t)
- },
- r = function r(e, t) {
- ;(e.innerHTML = t),
- (i && n()) ||
- document.body.insertAdjacentElement('afterbegin', e)
- }
- if (!i || !n()) {
- var _n2 = Storage.supported,
- a = document.createElement('div')
- if (
- (a.setAttribute('hidden', ''),
- i && a.setAttribute('id', t),
- _n2)
- ) {
- var _e5 = window.localStorage.getItem('cache-'.concat(t))
- if (((s = null !== _e5), s)) {
- var _t2 = JSON.parse(_e5)
- r(a, _t2.content)
- }
- }
- fetch(e)
- .then(function (e) {
- if (!is.empty(e)) {
- if (_n2)
- try {
- window.localStorage.setItem(
- 'cache-'.concat(t),
- JSON.stringify({ content: e })
- )
- } catch (e) {}
- r(a, e)
- }
- })
- .catch(function () {})
- }
- }
- var getHours = function getHours(e) {
- return Math.trunc((e / 60 / 60) % 60, 10)
- },
- getSeconds = function getSeconds(e) {
- return Math.trunc(e % 60, 10)
- }
- function _formatTime() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : 0
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : !1
- if (!is.number(e)) return _formatTime(void 0, t, i)
- var s = function s(e) {
- return '0'.concat(e).slice(-2)
- }
- var n = getHours(e)
- var r = ((a = e), Math.trunc((a / 60) % 60, 10))
- var a
- var o = getSeconds(e)
- return (
- (n = t || n > 0 ? ''.concat(n, ':') : ''),
- ''
- .concat(i && e > 0 ? '-' : '')
- .concat(n)
- .concat(s(r), ':')
- .concat(s(o))
- )
- }
- var controls = {
- getIconUrl: function getIconUrl() {
- var e = new URL(this.config.iconUrl, window.location),
- t = window.location.host
- ? window.location.host
- : window.top.location.host,
- i = e.host !== t || (browser.isIE && !window.svg4everybody)
- return { url: this.config.iconUrl, cors: i }
- },
- findElements: function findElements() {
- try {
- return (
- (this.elements.controls = getElement.call(
- this,
- this.config.selectors.controls.wrapper
- )),
- (this.elements.buttons = {
- play: getElements.call(
- this,
- this.config.selectors.buttons.play
- ),
- pause: getElement.call(
- this,
- this.config.selectors.buttons.pause
- ),
- restart: getElement.call(
- this,
- this.config.selectors.buttons.restart
- ),
- rewind: getElement.call(
- this,
- this.config.selectors.buttons.rewind
- ),
- fastForward: getElement.call(
- this,
- this.config.selectors.buttons.fastForward
- ),
- mute: getElement.call(
- this,
- this.config.selectors.buttons.mute
- ),
- pip: getElement.call(
- this,
- this.config.selectors.buttons.pip
- ),
- airplay: getElement.call(
- this,
- this.config.selectors.buttons.airplay
- ),
- settings: getElement.call(
- this,
- this.config.selectors.buttons.settings
- ),
- captions: getElement.call(
- this,
- this.config.selectors.buttons.captions
- ),
- fullscreen: getElement.call(
- this,
- this.config.selectors.buttons.fullscreen
- )
- }),
- (this.elements.progress = getElement.call(
- this,
- this.config.selectors.progress
- )),
- (this.elements.inputs = {
- seek: getElement.call(
- this,
- this.config.selectors.inputs.seek
- ),
- volume: getElement.call(
- this,
- this.config.selectors.inputs.volume
- )
- }),
- (this.elements.display = {
- buffer: getElement.call(
- this,
- this.config.selectors.display.buffer
- ),
- currentTime: getElement.call(
- this,
- this.config.selectors.display.currentTime
- ),
- duration: getElement.call(
- this,
- this.config.selectors.display.duration
- )
- }),
- is.element(this.elements.progress) &&
- (this.elements.display.seekTooltip =
- this.elements.progress.querySelector(
- '.'.concat(this.config.classNames.tooltip)
- )),
- !0
- )
- } catch (e) {
- return (
- this.debug.warn(
- 'It looks like there is a problem with your custom controls HTML',
- e
- ),
- this.toggleNativeControls(!0),
- !1
- )
- }
- },
- createIcon: function createIcon(e, t) {
- var i = 'http://www.w3.org/2000/svg',
- s = controls.getIconUrl.call(this),
- n = ''
- .concat(s.cors ? '' : s.url, '#')
- .concat(this.config.iconPrefix),
- r = document.createElementNS(i, 'svg')
- setAttributes(
- r,
- extend(t, { 'aria-hidden': 'true', focusable: 'false' })
- )
- var a = document.createElementNS(i, 'use'),
- o = ''.concat(n, '-').concat(e)
- return (
- 'href' in a &&
- a.setAttributeNS('http://www.w3.org/1999/xlink', 'href', o),
- a.setAttributeNS(
- 'http://www.w3.org/1999/xlink',
- 'xlink:href',
- o
- ),
- r.appendChild(a),
- r
- )
- },
- createLabel: function createLabel(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : {}
- var i = i18n.get(e, this.config)
- return createElement(
- 'span',
- _objectSpread(
- _objectSpread({}, t),
- {},
- {
- class: [t.class, this.config.classNames.hidden]
- .filter(Boolean)
- .join(' ')
- }
- ),
- i
- )
- },
- createBadge: function createBadge(e) {
- if (is.empty(e)) return null
- var t = createElement('span', {
- class: this.config.classNames.menu.value
- })
- return (
- t.appendChild(
- createElement(
- 'span',
- { class: this.config.classNames.menu.badge },
- e
- )
- ),
- t
- )
- },
- createButton: function createButton(e, t) {
- var _this7 = this
- var i = extend({}, t)
- var s = toCamelCase(e)
- var n = {
- element: 'button',
- toggle: !1,
- label: null,
- icon: null,
- labelPressed: null,
- iconPressed: null
- }
- switch (
- (['element', 'icon', 'label'].forEach(function (e) {
- Object.keys(i).includes(e) && ((n[e] = i[e]), delete i[e])
- }),
- 'button' !== n.element ||
- Object.keys(i).includes('type') ||
- (i.type = 'button'),
- Object.keys(i).includes('class')
- ? i.class.split(' ').some(function (e) {
- return e === _this7.config.classNames.control
- }) ||
- extend(i, {
- class: ''
- .concat(i.class, ' ')
- .concat(this.config.classNames.control)
- })
- : (i.class = this.config.classNames.control),
- e)
- ) {
- case 'play':
- ;(n.toggle = !0),
- (n.label = 'play'),
- (n.labelPressed = 'pause'),
- (n.icon = 'play'),
- (n.iconPressed = 'pause')
- break
- case 'mute':
- ;(n.toggle = !0),
- (n.label = 'mute'),
- (n.labelPressed = 'unmute'),
- (n.icon = 'volume'),
- (n.iconPressed = 'muted')
- break
- case 'captions':
- ;(n.toggle = !0),
- (n.label = 'enableCaptions'),
- (n.labelPressed = 'disableCaptions'),
- (n.icon = 'captions-off'),
- (n.iconPressed = 'captions-on')
- break
- case 'fullscreen':
- ;(n.toggle = !0),
- (n.label = 'enterFullscreen'),
- (n.labelPressed = 'exitFullscreen'),
- (n.icon = 'enter-fullscreen'),
- (n.iconPressed = 'exit-fullscreen')
- break
- case 'play-large':
- ;(i.class += ' '.concat(
- this.config.classNames.control,
- '--overlaid'
- )),
- (s = 'play'),
- (n.label = 'play'),
- (n.icon = 'play')
- break
- default:
- is.empty(n.label) && (n.label = s),
- is.empty(n.icon) && (n.icon = e)
- }
- var r = createElement(n.element)
- return (
- n.toggle
- ? (r.appendChild(
- controls.createIcon.call(this, n.iconPressed, {
- class: 'icon--pressed'
- })
- ),
- r.appendChild(
- controls.createIcon.call(this, n.icon, {
- class: 'icon--not-pressed'
- })
- ),
- r.appendChild(
- controls.createLabel.call(this, n.labelPressed, {
- class: 'label--pressed'
- })
- ),
- r.appendChild(
- controls.createLabel.call(this, n.label, {
- class: 'label--not-pressed'
- })
- ))
- : (r.appendChild(controls.createIcon.call(this, n.icon)),
- r.appendChild(controls.createLabel.call(this, n.label))),
- extend(
- i,
- getAttributesFromSelector(this.config.selectors.buttons[s], i)
- ),
- setAttributes(r, i),
- 'play' === s
- ? (is.array(this.elements.buttons[s]) ||
- (this.elements.buttons[s] = []),
- this.elements.buttons[s].push(r))
- : (this.elements.buttons[s] = r),
- r
- )
- },
- createRange: function createRange(e, t) {
- var i = createElement(
- 'input',
- extend(
- getAttributesFromSelector(this.config.selectors.inputs[e]),
- {
- type: 'range',
- min: 0,
- max: 100,
- step: 0.01,
- value: 0,
- autocomplete: 'off',
- role: 'slider',
- 'aria-label': i18n.get(e, this.config),
- 'aria-valuemin': 0,
- 'aria-valuemax': 100,
- 'aria-valuenow': 0
- },
- t
- )
- )
- return (
- (this.elements.inputs[e] = i),
- controls.updateRangeFill.call(this, i),
- RangeTouch.setup(i),
- i
- )
- },
- createProgress: function createProgress(e, t) {
- var i = createElement(
- 'progress',
- extend(
- getAttributesFromSelector(this.config.selectors.display[e]),
- {
- min: 0,
- max: 100,
- value: 0,
- role: 'progressbar',
- 'aria-hidden': !0
- },
- t
- )
- )
- if ('volume' !== e) {
- i.appendChild(createElement('span', null, '0'))
- var _t3 = { played: 'played', buffer: 'buffered' }[e],
- s = _t3 ? i18n.get(_t3, this.config) : ''
- i.innerText = '% '.concat(s.toLowerCase())
- }
- return (this.elements.display[e] = i), i
- },
- createTime: function createTime(e, t) {
- var i = getAttributesFromSelector(
- this.config.selectors.display[e],
- t
- ),
- s = createElement(
- 'div',
- extend(i, {
- class: ''
- .concat(i.class ? i.class : '', ' ')
- .concat(this.config.classNames.display.time, ' ')
- .trim(),
- 'aria-label': i18n.get(e, this.config)
- }),
- '00:00'
- )
- return (this.elements.display[e] = s), s
- },
- bindMenuItemShortcuts: function bindMenuItemShortcuts(e, t) {
- var _this8 = this
- on.call(
- this,
- e,
- 'keydown keyup',
- function (i) {
- if (
- !['Space', 'ArrowUp', 'ArrowDown', 'ArrowRight'].includes(
- i.key
- )
- )
- return
- if (
- (i.preventDefault(),
- i.stopPropagation(),
- 'keydown' === i.type)
- )
- return
- var s = matches(e, '[role="menuitemradio"]')
- if (!s && ['Space', 'ArrowRight'].includes(i.key))
- controls.showMenuPanel.call(_this8, t, !0)
- else {
- var _t4
- 'Space' !== i.key &&
- ('ArrowDown' === i.key || (s && 'ArrowRight' === i.key)
- ? ((_t4 = e.nextElementSibling),
- is.element(_t4) ||
- (_t4 = e.parentNode.firstElementChild))
- : ((_t4 = e.previousElementSibling),
- is.element(_t4) ||
- (_t4 = e.parentNode.lastElementChild)),
- setFocus.call(_this8, _t4, !0))
- }
- },
- !1
- ),
- on.call(this, e, 'keyup', function (e) {
- 'Return' === e.key &&
- controls.focusFirstMenuItem.call(_this8, null, !0)
- })
- },
- createMenuItem: function createMenuItem(_ref9) {
- var _this9 = this
- var e = _ref9.value,
- t = _ref9.list,
- i = _ref9.type,
- s = _ref9.title,
- _ref9$badge = _ref9.badge,
- n = _ref9$badge === void 0 ? null : _ref9$badge,
- _ref9$checked = _ref9.checked,
- r = _ref9$checked === void 0 ? !1 : _ref9$checked
- var a = getAttributesFromSelector(
- this.config.selectors.inputs[i]
- ),
- o = createElement(
- 'button',
- extend(a, {
- type: 'button',
- role: 'menuitemradio',
- class: ''
- .concat(this.config.classNames.control, ' ')
- .concat(a.class ? a.class : '')
- .trim(),
- 'aria-checked': r,
- value: e
- })
- ),
- l = createElement('span')
- ;(l.innerHTML = s),
- is.element(n) && l.appendChild(n),
- o.appendChild(l),
- Object.defineProperty(o, 'checked', {
- enumerable: !0,
- get: function get() {
- return 'true' === o.getAttribute('aria-checked')
- },
- set: function set(e) {
- e &&
- Array.from(o.parentNode.children)
- .filter(function (e) {
- return matches(e, '[role="menuitemradio"]')
- })
- .forEach(function (e) {
- return e.setAttribute('aria-checked', 'false')
- }),
- o.setAttribute('aria-checked', e ? 'true' : 'false')
- }
- }),
- this.listeners.bind(
- o,
- 'click keyup',
- function (t) {
- if (!is.keyboardEvent(t) || 'Space' === t.key) {
- switch (
- (t.preventDefault(),
- t.stopPropagation(),
- (o.checked = !0),
- i)
- ) {
- case 'language':
- _this9.currentTrack = Number(e)
- break
- case 'quality':
- _this9.quality = e
- break
- case 'speed':
- _this9.speed = parseFloat(e)
- }
- controls.showMenuPanel.call(
- _this9,
- 'home',
- is.keyboardEvent(t)
- )
- }
- },
- i,
- !1
- ),
- controls.bindMenuItemShortcuts.call(this, o, i),
- t.appendChild(o)
- },
- formatTime: function formatTime() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : 0
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- if (!is.number(e)) return e
- return _formatTime(e, getHours(this.duration) > 0, t)
- },
- updateTimeDisplay: function updateTimeDisplay() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : null
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : 0
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : !1
- is.element(e) &&
- is.number(t) &&
- (e.innerText = controls.formatTime(t, i))
- },
- updateVolume: function updateVolume() {
- this.supported.ui &&
- (is.element(this.elements.inputs.volume) &&
- controls.setRange.call(
- this,
- this.elements.inputs.volume,
- this.muted ? 0 : this.volume
- ),
- is.element(this.elements.buttons.mute) &&
- (this.elements.buttons.mute.pressed =
- this.muted || 0 === this.volume))
- },
- setRange: function setRange(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : 0
- is.element(e) &&
- ((e.value = t), controls.updateRangeFill.call(this, e))
- },
- updateProgress: function updateProgress(e) {
- var _this10 = this
- if (!this.supported.ui || !is.event(e)) return
- var t = 0
- var i = function i(e, t) {
- var i = is.number(t) ? t : 0,
- s = is.element(e) ? e : _this10.elements.display.buffer
- if (is.element(s)) {
- s.value = i
- var _e6 = s.getElementsByTagName('span')[0]
- is.element(_e6) && (_e6.childNodes[0].nodeValue = i)
- }
- }
- if (e)
- switch (e.type) {
- case 'timeupdate':
- case 'seeking':
- case 'seeked':
- ;(t = getPercentage(this.currentTime, this.duration)),
- 'timeupdate' === e.type &&
- controls.setRange.call(
- this,
- this.elements.inputs.seek,
- t
- )
- break
- case 'playing':
- case 'progress':
- i(this.elements.display.buffer, 100 * this.buffered)
- }
- },
- updateRangeFill: function updateRangeFill(e) {
- var t = is.event(e) ? e.target : e
- if (is.element(t) && 'range' === t.getAttribute('type')) {
- if (matches(t, this.config.selectors.inputs.seek)) {
- t.setAttribute('aria-valuenow', this.currentTime)
- var _e7 = controls.formatTime(this.currentTime),
- i = controls.formatTime(this.duration),
- s = i18n.get('seekLabel', this.config)
- t.setAttribute(
- 'aria-valuetext',
- s.replace('{currentTime}', _e7).replace('{duration}', i)
- )
- } else if (matches(t, this.config.selectors.inputs.volume)) {
- var _e8 = 100 * t.value
- t.setAttribute('aria-valuenow', _e8),
- t.setAttribute(
- 'aria-valuetext',
- ''.concat(_e8.toFixed(1), '%')
- )
- } else t.setAttribute('aria-valuenow', t.value)
- browser.isWebkit &&
- t.style.setProperty('--value', (t.value / t.max) * 100 + '%')
- }
- },
- updateSeekTooltip: function updateSeekTooltip(e) {
- var t, i
- if (
- !this.config.tooltips.seek ||
- !is.element(this.elements.inputs.seek) ||
- !is.element(this.elements.display.seekTooltip) ||
- 0 === this.duration
- )
- return
- var s = this.elements.display.seekTooltip,
- n = ''.concat(this.config.classNames.tooltip, '--visible'),
- r = function r(e) {
- return toggleClass(s, n, e)
- }
- if (this.touch) return void r(!1)
- var a = 0
- var o = this.elements.progress.getBoundingClientRect()
- if (is.event(e)) a = (100 / o.width) * (e.pageX - o.left)
- else {
- if (!hasClass(s, n)) return
- a = parseFloat(s.style.left, 10)
- }
- a < 0 ? (a = 0) : a > 100 && (a = 100)
- var l = (this.duration / 100) * a
- s.innerText = controls.formatTime(l)
- var c =
- null === (t = this.config.markers) ||
- void 0 === t ||
- null === (i = t.points) ||
- void 0 === i
- ? void 0
- : i.find(function (_ref10) {
- var e = _ref10.time
- return e === Math.round(l)
- })
- c &&
- s.insertAdjacentHTML('afterbegin', ''.concat(c.label, '<br>')),
- (s.style.left = ''.concat(a, '%')),
- is.event(e) &&
- ['mouseenter', 'mouseleave'].includes(e.type) &&
- r('mouseenter' === e.type)
- },
- timeUpdate: function timeUpdate(e) {
- var t =
- !is.element(this.elements.display.duration) &&
- this.config.invertTime
- controls.updateTimeDisplay.call(
- this,
- this.elements.display.currentTime,
- t ? this.duration - this.currentTime : this.currentTime,
- t
- ),
- (e && 'timeupdate' === e.type && this.media.seeking) ||
- controls.updateProgress.call(this, e)
- },
- durationUpdate: function durationUpdate() {
- if (
- !this.supported.ui ||
- (!this.config.invertTime && this.currentTime)
- )
- return
- if (this.duration >= Math.pow(2, 32))
- return (
- toggleHidden(this.elements.display.currentTime, !0),
- void toggleHidden(this.elements.progress, !0)
- )
- is.element(this.elements.inputs.seek) &&
- this.elements.inputs.seek.setAttribute(
- 'aria-valuemax',
- this.duration
- )
- var e = is.element(this.elements.display.duration)
- !e &&
- this.config.displayDuration &&
- this.paused &&
- controls.updateTimeDisplay.call(
- this,
- this.elements.display.currentTime,
- this.duration
- ),
- e &&
- controls.updateTimeDisplay.call(
- this,
- this.elements.display.duration,
- this.duration
- ),
- this.config.markers.enabled && controls.setMarkers.call(this),
- controls.updateSeekTooltip.call(this)
- },
- toggleMenuButton: function toggleMenuButton(e, t) {
- toggleHidden(this.elements.settings.buttons[e], !t)
- },
- updateSetting: function updateSetting(e, t, i) {
- var s = this.elements.settings.panels[e]
- var n = null,
- r = t
- if ('captions' === e) n = this.currentTrack
- else {
- if (
- ((n = is.empty(i) ? this[e] : i),
- is.empty(n) && (n = this.config[e].default),
- !is.empty(this.options[e]) && !this.options[e].includes(n))
- )
- return void this.debug.warn(
- "Unsupported value of '".concat(n, "' for ").concat(e)
- )
- if (!this.config[e].options.includes(n))
- return void this.debug.warn(
- "Disabled value of '".concat(n, "' for ").concat(e)
- )
- }
- if (
- (is.element(r) || (r = s && s.querySelector('[role="menu"]')),
- !is.element(r))
- )
- return
- this.elements.settings.buttons[e].querySelector(
- '.'.concat(this.config.classNames.menu.value)
- ).innerHTML = controls.getLabel.call(this, e, n)
- var a = r && r.querySelector('[value="'.concat(n, '"]'))
- is.element(a) && (a.checked = !0)
- },
- getLabel: function getLabel(e, t) {
- switch (e) {
- case 'speed':
- return 1 === t
- ? i18n.get('normal', this.config)
- : ''.concat(t, '×')
- case 'quality':
- if (is.number(t)) {
- var _e9 = i18n.get('qualityLabel.'.concat(t), this.config)
- return _e9.length ? _e9 : ''.concat(t, 'p')
- }
- return toTitleCase(t)
- case 'captions':
- return captions.getLabel.call(this)
- default:
- return null
- }
- },
- setQualityMenu: function setQualityMenu(e) {
- var _this11 = this
- if (!is.element(this.elements.settings.panels.quality)) return
- var t = 'quality',
- i =
- this.elements.settings.panels.quality.querySelector(
- '[role="menu"]'
- )
- is.array(e) &&
- (this.options.quality = dedupe(e).filter(function (e) {
- return _this11.config.quality.options.includes(e)
- }))
- var s =
- !is.empty(this.options.quality) &&
- this.options.quality.length > 1
- if (
- (controls.toggleMenuButton.call(this, t, s),
- emptyElement(i),
- controls.checkMenu.call(this),
- !s)
- )
- return
- var n = function n(e) {
- var t = i18n.get('qualityBadge.'.concat(e), _this11.config)
- return t.length ? controls.createBadge.call(_this11, t) : null
- }
- this.options.quality
- .sort(function (e, t) {
- var i = _this11.config.quality.options
- return i.indexOf(e) > i.indexOf(t) ? 1 : -1
- })
- .forEach(function (e) {
- controls.createMenuItem.call(_this11, {
- value: e,
- list: i,
- type: t,
- title: controls.getLabel.call(_this11, 'quality', e),
- badge: n(e)
- })
- }),
- controls.updateSetting.call(this, t, i)
- },
- setCaptionsMenu: function setCaptionsMenu() {
- var _this12 = this
- if (!is.element(this.elements.settings.panels.captions)) return
- var e = 'captions',
- t =
- this.elements.settings.panels.captions.querySelector(
- '[role="menu"]'
- ),
- i = captions.getTracks.call(this),
- s = Boolean(i.length)
- if (
- (controls.toggleMenuButton.call(this, e, s),
- emptyElement(t),
- controls.checkMenu.call(this),
- !s)
- )
- return
- var n = i.map(function (e, i) {
- return {
- value: i,
- checked:
- _this12.captions.toggled && _this12.currentTrack === i,
- title: captions.getLabel.call(_this12, e),
- badge:
- e.language &&
- controls.createBadge.call(
- _this12,
- e.language.toUpperCase()
- ),
- list: t,
- type: 'language'
- }
- })
- n.unshift({
- value: -1,
- checked: !this.captions.toggled,
- title: i18n.get('disabled', this.config),
- list: t,
- type: 'language'
- }),
- n.forEach(controls.createMenuItem.bind(this)),
- controls.updateSetting.call(this, e, t)
- },
- setSpeedMenu: function setSpeedMenu() {
- var _this13 = this
- if (!is.element(this.elements.settings.panels.speed)) return
- var e = 'speed',
- t =
- this.elements.settings.panels.speed.querySelector(
- '[role="menu"]'
- )
- this.options.speed = this.options.speed.filter(function (e) {
- return e >= _this13.minimumSpeed && e <= _this13.maximumSpeed
- })
- var i =
- !is.empty(this.options.speed) && this.options.speed.length > 1
- controls.toggleMenuButton.call(this, e, i),
- emptyElement(t),
- controls.checkMenu.call(this),
- i &&
- (this.options.speed.forEach(function (i) {
- controls.createMenuItem.call(_this13, {
- value: i,
- list: t,
- type: e,
- title: controls.getLabel.call(_this13, 'speed', i)
- })
- }),
- controls.updateSetting.call(this, e, t))
- },
- checkMenu: function checkMenu() {
- var e = this.elements.settings.buttons,
- t =
- !is.empty(e) &&
- Object.values(e).some(function (e) {
- return !e.hidden
- })
- toggleHidden(this.elements.settings.menu, !t)
- },
- focusFirstMenuItem: function focusFirstMenuItem(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- if (this.elements.settings.popup.hidden) return
- var i = e
- is.element(i) ||
- (i = Object.values(this.elements.settings.panels).find(
- function (e) {
- return !e.hidden
- }
- ))
- var s = i.querySelector('[role^="menuitem"]')
- setFocus.call(this, s, t)
- },
- toggleMenu: function toggleMenu(e) {
- var t = this.elements.settings.popup,
- i = this.elements.buttons.settings
- if (!is.element(t) || !is.element(i)) return
- var s = t.hidden
- var n = s
- if (is.boolean(e)) n = e
- else if (is.keyboardEvent(e) && 'Escape' === e.key) n = !1
- else if (is.event(e)) {
- var _s3 = is.function(e.composedPath)
- ? e.composedPath()[0]
- : e.target,
- r = t.contains(_s3)
- if (r || (!r && e.target !== i && n)) return
- }
- i.setAttribute('aria-expanded', n),
- toggleHidden(t, !n),
- toggleClass(
- this.elements.container,
- this.config.classNames.menu.open,
- n
- ),
- n && is.keyboardEvent(e)
- ? controls.focusFirstMenuItem.call(this, null, !0)
- : n || s || setFocus.call(this, i, is.keyboardEvent(e))
- },
- getMenuSize: function getMenuSize(e) {
- var t = e.cloneNode(!0)
- ;(t.style.position = 'absolute'),
- (t.style.opacity = 0),
- t.removeAttribute('hidden'),
- e.parentNode.appendChild(t)
- var i = t.scrollWidth,
- s = t.scrollHeight
- return removeElement(t), { width: i, height: s }
- },
- showMenuPanel: function showMenuPanel() {
- var _this14 = this
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : ''
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- var i = this.elements.container.querySelector(
- '#plyr-settings-'.concat(this.id, '-').concat(e)
- )
- if (!is.element(i)) return
- var s = i.parentNode,
- n = Array.from(s.children).find(function (e) {
- return !e.hidden
- })
- if (support.transitions && !support.reducedMotion) {
- ;(s.style.width = ''.concat(n.scrollWidth, 'px')),
- (s.style.height = ''.concat(n.scrollHeight, 'px'))
- var _e10 = controls.getMenuSize.call(this, i),
- _t5 = function _t5(e) {
- e.target === s &&
- ['width', 'height'].includes(e.propertyName) &&
- ((s.style.width = ''),
- (s.style.height = ''),
- off.call(_this14, s, transitionEndEvent, _t5))
- }
- on.call(this, s, transitionEndEvent, _t5),
- (s.style.width = ''.concat(_e10.width, 'px')),
- (s.style.height = ''.concat(_e10.height, 'px'))
- }
- toggleHidden(n, !0),
- toggleHidden(i, !1),
- controls.focusFirstMenuItem.call(this, i, t)
- },
- setDownloadUrl: function setDownloadUrl() {
- var e = this.elements.buttons.download
- is.element(e) && e.setAttribute('href', this.download)
- },
- create: function create(e) {
- var _this15 = this
- var t = controls.bindMenuItemShortcuts,
- i = controls.createButton,
- s = controls.createProgress,
- n = controls.createRange,
- r = controls.createTime,
- a = controls.setQualityMenu,
- o = controls.setSpeedMenu,
- l = controls.showMenuPanel
- ;(this.elements.controls = null),
- is.array(this.config.controls) &&
- this.config.controls.includes('play-large') &&
- this.elements.container.appendChild(
- i.call(this, 'play-large')
- )
- var c = createElement(
- 'div',
- getAttributesFromSelector(
- this.config.selectors.controls.wrapper
- )
- )
- this.elements.controls = c
- var u = { class: 'plyr__controls__item' }
- return (
- dedupe(
- is.array(this.config.controls) ? this.config.controls : []
- ).forEach(function (a) {
- if (
- ('restart' === a &&
- c.appendChild(i.call(_this15, 'restart', u)),
- 'rewind' === a &&
- c.appendChild(i.call(_this15, 'rewind', u)),
- 'play' === a && c.appendChild(i.call(_this15, 'play', u)),
- 'fast-forward' === a &&
- c.appendChild(i.call(_this15, 'fast-forward', u)),
- 'progress' === a)
- ) {
- var _t6 = createElement('div', {
- class: ''.concat(u.class, ' plyr__progress__container')
- }),
- _i3 = createElement(
- 'div',
- getAttributesFromSelector(
- _this15.config.selectors.progress
- )
- )
- if (
- (_i3.appendChild(
- n.call(_this15, 'seek', {
- id: 'plyr-seek-'.concat(e.id)
- })
- ),
- _i3.appendChild(s.call(_this15, 'buffer')),
- _this15.config.tooltips.seek)
- ) {
- var _e11 = createElement(
- 'span',
- { class: _this15.config.classNames.tooltip },
- '00:00'
- )
- _i3.appendChild(_e11),
- (_this15.elements.display.seekTooltip = _e11)
- }
- ;(_this15.elements.progress = _i3),
- _t6.appendChild(_this15.elements.progress),
- c.appendChild(_t6)
- }
- if (
- ('current-time' === a &&
- c.appendChild(r.call(_this15, 'currentTime', u)),
- 'duration' === a &&
- c.appendChild(r.call(_this15, 'duration', u)),
- 'mute' === a || 'volume' === a)
- ) {
- var _t7 = _this15.elements.volume
- if (
- ((is.element(_t7) && c.contains(_t7)) ||
- ((_t7 = createElement(
- 'div',
- extend({}, u, {
- class: ''.concat(u.class, ' plyr__volume').trim()
- })
- )),
- (_this15.elements.volume = _t7),
- c.appendChild(_t7)),
- 'mute' === a && _t7.appendChild(i.call(_this15, 'mute')),
- 'volume' === a && !browser.isIos)
- ) {
- var _i4 = {
- max: 1,
- step: 0.05,
- value: _this15.config.volume
- }
- _t7.appendChild(
- n.call(
- _this15,
- 'volume',
- extend(_i4, { id: 'plyr-volume-'.concat(e.id) })
- )
- )
- }
- }
- if (
- ('captions' === a &&
- c.appendChild(i.call(_this15, 'captions', u)),
- 'settings' === a && !is.empty(_this15.config.settings))
- ) {
- var _s4 = createElement(
- 'div',
- extend({}, u, {
- class: ''.concat(u.class, ' plyr__menu').trim(),
- hidden: ''
- })
- )
- _s4.appendChild(
- i.call(_this15, 'settings', {
- 'aria-haspopup': !0,
- 'aria-controls': 'plyr-settings-'.concat(e.id),
- 'aria-expanded': !1
- })
- )
- var _n3 = createElement('div', {
- class: 'plyr__menu__container',
- id: 'plyr-settings-'.concat(e.id),
- hidden: ''
- }),
- _r2 = createElement('div'),
- _a = createElement('div', {
- id: 'plyr-settings-'.concat(e.id, '-home')
- }),
- _o = createElement('div', { role: 'menu' })
- _a.appendChild(_o),
- _r2.appendChild(_a),
- (_this15.elements.settings.panels.home = _a),
- _this15.config.settings.forEach(function (i) {
- var s = createElement(
- 'button',
- extend(
- getAttributesFromSelector(
- _this15.config.selectors.buttons.settings
- ),
- {
- type: 'button',
- class: ''
- .concat(_this15.config.classNames.control, ' ')
- .concat(
- _this15.config.classNames.control,
- '--forward'
- ),
- role: 'menuitem',
- 'aria-haspopup': !0,
- hidden: ''
- }
- )
- )
- t.call(_this15, s, i),
- on.call(_this15, s, 'click', function () {
- l.call(_this15, i, !1)
- })
- var n = createElement(
- 'span',
- null,
- i18n.get(i, _this15.config)
- ),
- a = createElement('span', {
- class: _this15.config.classNames.menu.value
- })
- ;(a.innerHTML = e[i]),
- n.appendChild(a),
- s.appendChild(n),
- _o.appendChild(s)
- var c = createElement('div', {
- id: 'plyr-settings-'.concat(e.id, '-').concat(i),
- hidden: ''
- }),
- u = createElement('button', {
- type: 'button',
- class: ''
- .concat(_this15.config.classNames.control, ' ')
- .concat(
- _this15.config.classNames.control,
- '--back'
- )
- })
- u.appendChild(
- createElement(
- 'span',
- { 'aria-hidden': !0 },
- i18n.get(i, _this15.config)
- )
- ),
- u.appendChild(
- createElement(
- 'span',
- { class: _this15.config.classNames.hidden },
- i18n.get('menuBack', _this15.config)
- )
- ),
- on.call(
- _this15,
- c,
- 'keydown',
- function (e) {
- 'ArrowLeft' === e.key &&
- (e.preventDefault(),
- e.stopPropagation(),
- l.call(_this15, 'home', !0))
- },
- !1
- ),
- on.call(_this15, u, 'click', function () {
- l.call(_this15, 'home', !1)
- }),
- c.appendChild(u),
- c.appendChild(createElement('div', { role: 'menu' })),
- _r2.appendChild(c),
- (_this15.elements.settings.buttons[i] = s),
- (_this15.elements.settings.panels[i] = c)
- }),
- _n3.appendChild(_r2),
- _s4.appendChild(_n3),
- c.appendChild(_s4),
- (_this15.elements.settings.popup = _n3),
- (_this15.elements.settings.menu = _s4)
- }
- if (
- ('pip' === a &&
- support.pip &&
- c.appendChild(i.call(_this15, 'pip', u)),
- 'airplay' === a &&
- support.airplay &&
- c.appendChild(i.call(_this15, 'airplay', u)),
- 'download' === a)
- ) {
- var _e12 = extend({}, u, {
- element: 'a',
- href: _this15.download,
- target: '_blank'
- })
- _this15.isHTML5 && (_e12.download = '')
- var _t8 = _this15.config.urls.download
- !is.url(_t8) &&
- _this15.isEmbed &&
- extend(_e12, {
- icon: 'logo-'.concat(_this15.provider),
- label: _this15.provider
- }),
- c.appendChild(i.call(_this15, 'download', _e12))
- }
- 'fullscreen' === a &&
- c.appendChild(i.call(_this15, 'fullscreen', u))
- }),
- this.isHTML5 &&
- a.call(this, html5.getQualityOptions.call(this)),
- o.call(this),
- c
- )
- },
- inject: function inject() {
- var _this16 = this
- if (this.config.loadSprite) {
- var _e13 = controls.getIconUrl.call(this)
- _e13.cors && _loadSprite(_e13.url, 'sprite-plyr')
- }
- this.id = Math.floor(1e4 * Math.random())
- var e = null
- this.elements.controls = null
- var t = {
- id: this.id,
- seektime: this.config.seekTime,
- title: this.config.title
- }
- var i = !0
- is.function(this.config.controls) &&
- (this.config.controls = this.config.controls.call(this, t)),
- this.config.controls || (this.config.controls = []),
- is.element(this.config.controls) ||
- is.string(this.config.controls)
- ? (e = this.config.controls)
- : ((e = controls.create.call(this, {
- id: this.id,
- seektime: this.config.seekTime,
- speed: this.speed,
- quality: this.quality,
- captions: captions.getLabel.call(this)
- })),
- (i = !1))
- var s
- i &&
- is.string(this.config.controls) &&
- (e = (function (e) {
- var i = e
- return (
- Object.entries(t).forEach(function (_ref11) {
- var _ref12 = _slicedToArray(_ref11, 2),
- e = _ref12[0],
- t = _ref12[1]
- i = replaceAll(i, '{'.concat(e, '}'), t)
- }),
- i
- )
- })(e)),
- is.string(this.config.selectors.controls.container) &&
- (s = document.querySelector(
- this.config.selectors.controls.container
- )),
- is.element(s) || (s = this.elements.container)
- if (
- (s[
- is.element(e) ? 'insertAdjacentElement' : 'insertAdjacentHTML'
- ]('afterbegin', e),
- is.element(this.elements.controls) ||
- controls.findElements.call(this),
- !is.empty(this.elements.buttons))
- ) {
- var _e14 = function _e14(e) {
- var t = _this16.config.classNames.controlPressed
- Object.defineProperty(e, 'pressed', {
- enumerable: !0,
- get: function get() {
- return hasClass(e, t)
- },
- set: function set() {
- var i =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- toggleClass(e, t, i)
- }
- })
- }
- Object.values(this.elements.buttons)
- .filter(Boolean)
- .forEach(function (t) {
- is.array(t) || is.nodeList(t)
- ? Array.from(t).filter(Boolean).forEach(_e14)
- : _e14(t)
- })
- }
- if (
- (browser.isEdge && repaint(s), this.config.tooltips.controls)
- ) {
- var _this$config = this.config,
- _e15 = _this$config.classNames,
- _t9 = _this$config.selectors,
- _i5 = ''
- .concat(_t9.controls.wrapper, ' ')
- .concat(_t9.labels, ' .')
- .concat(_e15.hidden),
- _s5 = getElements.call(this, _i5)
- Array.from(_s5).forEach(function (e) {
- toggleClass(e, _this16.config.classNames.hidden, !1),
- toggleClass(e, _this16.config.classNames.tooltip, !0)
- })
- }
- },
- setMediaMetadata: function setMediaMetadata() {
- try {
- 'mediaSession' in navigator &&
- (navigator.mediaSession.metadata = new window.MediaMetadata({
- title: this.config.mediaMetadata.title,
- artist: this.config.mediaMetadata.artist,
- album: this.config.mediaMetadata.album,
- artwork: this.config.mediaMetadata.artwork
- }))
- } catch (e) {}
- },
- setMarkers: function setMarkers() {
- var _this17 = this
- var e, t
- if (!this.duration || this.elements.markers) return
- var i =
- null === (e = this.config.markers) ||
- void 0 === e ||
- null === (t = e.points) ||
- void 0 === t
- ? void 0
- : t.filter(function (_ref13) {
- var e = _ref13.time
- return e > 0 && e < _this17.duration
- })
- if (null == i || !i.length) return
- var s = document.createDocumentFragment(),
- n = document.createDocumentFragment()
- var r = null
- var a = ''.concat(this.config.classNames.tooltip, '--visible'),
- o = function o(e) {
- return toggleClass(r, a, e)
- }
- i.forEach(function (e) {
- var t = createElement(
- 'span',
- { class: _this17.config.classNames.marker },
- ''
- ),
- i = (e.time / _this17.duration) * 100 + '%'
- r &&
- (t.addEventListener('mouseenter', function () {
- e.label ||
- ((r.style.left = i), (r.innerHTML = e.label), o(!0))
- }),
- t.addEventListener('mouseleave', function () {
- o(!1)
- })),
- t.addEventListener('click', function () {
- _this17.currentTime = e.time
- }),
- (t.style.left = i),
- n.appendChild(t)
- }),
- s.appendChild(n),
- this.config.tooltips.seek ||
- ((r = createElement(
- 'span',
- { class: this.config.classNames.tooltip },
- ''
- )),
- s.appendChild(r)),
- (this.elements.markers = { points: n, tip: r }),
- this.elements.progress.appendChild(s)
- }
- }
- function parseUrl(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- var i = e
- if (t) {
- var _e16 = document.createElement('a')
- ;(_e16.href = i), (i = _e16.href)
- }
- try {
- return new URL(i)
- } catch (e) {
- return null
- }
- }
- function buildUrlParams(e) {
- var t = new URLSearchParams()
- return (
- is.object(e) &&
- Object.entries(e).forEach(function (_ref14) {
- var _ref15 = _slicedToArray(_ref14, 2),
- e = _ref15[0],
- i = _ref15[1]
- t.set(e, i)
- }),
- t
- )
- }
- var captions = {
- setup: function setup() {
- var _e18, _e19, _this$config$captions
- if (!this.supported.ui) return
- if (
- !this.isVideo ||
- this.isYouTube ||
- (this.isHTML5 && !support.textTracks)
- )
- return void (
- is.array(this.config.controls) &&
- this.config.controls.includes('settings') &&
- this.config.settings.includes('captions') &&
- controls.setCaptionsMenu.call(this)
- )
- if (
- (is.element(this.elements.captions) ||
- ((this.elements.captions = createElement(
- 'div',
- getAttributesFromSelector(this.config.selectors.captions)
- )),
- insertAfter(this.elements.captions, this.elements.wrapper)),
- browser.isIE && window.URL)
- ) {
- var _e17 = this.media.querySelectorAll('track')
- Array.from(_e17).forEach(function (e) {
- var t = e.getAttribute('src'),
- i = parseUrl(t)
- null !== i &&
- i.hostname !== window.location.href.hostname &&
- ['http:', 'https:'].includes(i.protocol) &&
- fetch(t, 'blob')
- .then(function (t) {
- e.setAttribute('src', window.URL.createObjectURL(t))
- })
- .catch(function () {
- removeElement(e)
- })
- })
- }
- var e = dedupe(
- (
- navigator.languages || [
- navigator.language || navigator.userLanguage || 'en'
- ]
- ).map(function (e) {
- return e.split('-')[0]
- })
- )
- var t = (
- this.storage.get('language') ||
- this.config.captions.language ||
- 'auto'
- ).toLowerCase()
- 'auto' === t &&
- ((_e18 = e),
- (_e19 = _slicedToArray(_e18, 1)),
- (t = _e19[0]),
- _e18)
- var i = this.storage.get('captions')
- if (
- (is.boolean(i) ||
- ((_this$config$captions = this.config.captions),
- (i = _this$config$captions.active),
- _this$config$captions),
- Object.assign(this.captions, {
- toggled: !1,
- active: i,
- language: t,
- languages: e
- }),
- this.isHTML5)
- ) {
- var _e20 = this.config.captions.update
- ? 'addtrack removetrack'
- : 'removetrack'
- on.call(
- this,
- this.media.textTracks,
- _e20,
- captions.update.bind(this)
- )
- }
- setTimeout(captions.update.bind(this), 0)
- },
- update: function update() {
- var _this18 = this
- var e = captions.getTracks.call(this, !0),
- _this$captions = this.captions,
- t = _this$captions.active,
- i = _this$captions.language,
- s = _this$captions.meta,
- n = _this$captions.currentTrackNode,
- r = Boolean(
- e.find(function (e) {
- return e.language === i
- })
- )
- this.isHTML5 &&
- this.isVideo &&
- e
- .filter(function (e) {
- return !s.get(e)
- })
- .forEach(function (e) {
- _this18.debug.log('Track added', e),
- s.set(e, { default: 'showing' === e.mode }),
- 'showing' === e.mode && (e.mode = 'hidden'),
- on.call(_this18, e, 'cuechange', function () {
- return captions.updateCues.call(_this18)
- })
- }),
- ((r && this.language !== i) || !e.includes(n)) &&
- (captions.setLanguage.call(this, i),
- captions.toggle.call(this, t && r)),
- this.elements &&
- toggleClass(
- this.elements.container,
- this.config.classNames.captions.enabled,
- !is.empty(e)
- ),
- is.array(this.config.controls) &&
- this.config.controls.includes('settings') &&
- this.config.settings.includes('captions') &&
- controls.setCaptionsMenu.call(this)
- },
- toggle: function toggle(e) {
- var _this19 = this
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- if (!this.supported.ui) return
- var i = this.captions.toggled,
- s = this.config.classNames.captions.active,
- n = is.nullOrUndefined(e) ? !i : e
- if (n !== i) {
- if (
- (t ||
- ((this.captions.active = n),
- this.storage.set({ captions: n })),
- !this.language && n && !t)
- ) {
- var _e21 = captions.getTracks.call(this),
- _t10 = captions.findTrack.call(
- this,
- [this.captions.language].concat(
- _toConsumableArray(this.captions.languages)
- ),
- !0
- )
- return (
- (this.captions.language = _t10.language),
- void captions.set.call(this, _e21.indexOf(_t10))
- )
- }
- this.elements.buttons.captions &&
- (this.elements.buttons.captions.pressed = n),
- toggleClass(this.elements.container, s, n),
- (this.captions.toggled = n),
- controls.updateSetting.call(this, 'captions'),
- triggerEvent.call(
- this,
- this.media,
- n ? 'captionsenabled' : 'captionsdisabled'
- )
- }
- setTimeout(function () {
- n &&
- _this19.captions.toggled &&
- (_this19.captions.currentTrackNode.mode = 'hidden')
- })
- },
- set: function set(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- var i = captions.getTracks.call(this)
- if (-1 !== e) {
- if (is.number(e)) {
- if (e in i) {
- if (this.captions.currentTrack !== e) {
- this.captions.currentTrack = e
- var s = i[e],
- _ref16 = s || {},
- n = _ref16.language
- ;(this.captions.currentTrackNode = s),
- controls.updateSetting.call(this, 'captions'),
- t ||
- ((this.captions.language = n),
- this.storage.set({ language: n })),
- this.isVimeo && this.embed.enableTextTrack(n),
- triggerEvent.call(this, this.media, 'languagechange')
- }
- captions.toggle.call(this, !0, t),
- this.isHTML5 &&
- this.isVideo &&
- captions.updateCues.call(this)
- } else this.debug.warn('Track not found', e)
- } else this.debug.warn('Invalid caption argument', e)
- } else captions.toggle.call(this, !1, t)
- },
- setLanguage: function setLanguage(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- if (!is.string(e))
- return void this.debug.warn('Invalid language argument', e)
- var i = e.toLowerCase()
- this.captions.language = i
- var s = captions.getTracks.call(this),
- n = captions.findTrack.call(this, [i])
- captions.set.call(this, s.indexOf(n), t)
- },
- getTracks: function getTracks() {
- var _this20 = this
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- return Array.from((this.media || {}).textTracks || [])
- .filter(function (t) {
- return !_this20.isHTML5 || e || _this20.captions.meta.has(t)
- })
- .filter(function (e) {
- return ['captions', 'subtitles'].includes(e.kind)
- })
- },
- findTrack: function findTrack(e) {
- var _this21 = this
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- var i = captions.getTracks.call(this),
- s = function s(e) {
- return Number((_this21.captions.meta.get(e) || {}).default)
- },
- n = Array.from(i).sort(function (e, t) {
- return s(t) - s(e)
- })
- var r
- return (
- e.every(function (e) {
- return (
- (r = n.find(function (t) {
- return t.language === e
- })),
- !r
- )
- }),
- r || (t ? n[0] : void 0)
- )
- },
- getCurrentTrack: function getCurrentTrack() {
- return captions.getTracks.call(this)[this.currentTrack]
- },
- getLabel: function getLabel(e) {
- var t = e
- return (
- !is.track(t) &&
- support.textTracks &&
- this.captions.toggled &&
- (t = captions.getCurrentTrack.call(this)),
- is.track(t)
- ? is.empty(t.label)
- ? is.empty(t.language)
- ? i18n.get('enabled', this.config)
- : e.language.toUpperCase()
- : t.label
- : i18n.get('disabled', this.config)
- )
- },
- updateCues: function updateCues(e) {
- if (!this.supported.ui) return
- if (!is.element(this.elements.captions))
- return void this.debug.warn(
- 'No captions element to render to'
- )
- if (!is.nullOrUndefined(e) && !Array.isArray(e))
- return void this.debug.warn('updateCues: Invalid input', e)
- var t = e
- if (!t) {
- var _e22 = captions.getCurrentTrack.call(this)
- t = Array.from((_e22 || {}).activeCues || [])
- .map(function (e) {
- return e.getCueAsHTML()
- })
- .map(getHTML)
- }
- var i = t
- .map(function (e) {
- return e.trim()
- })
- .join('\n')
- if (i !== this.elements.captions.innerHTML) {
- emptyElement(this.elements.captions)
- var _e23 = createElement(
- 'span',
- getAttributesFromSelector(this.config.selectors.caption)
- )
- ;(_e23.innerHTML = i),
- this.elements.captions.appendChild(_e23),
- triggerEvent.call(this, this.media, 'cuechange')
- }
- }
- },
- defaults = {
- enabled: !0,
- title: '',
- debug: !1,
- autoplay: !1,
- autopause: !0,
- playsinline: !0,
- seekTime: 10,
- volume: 1,
- muted: !1,
- duration: null,
- displayDuration: !0,
- invertTime: !0,
- toggleInvert: !0,
- ratio: null,
- clickToPlay: !0,
- hideControls: !0,
- resetOnEnd: !1,
- disableContextMenu: !0,
- loadSprite: !0,
- iconPrefix: 'plyr',
- iconUrl: 'https://cdn.plyr.io/3.7.2/plyr.svg',
- blankVideo: 'https://cdn.plyr.io/static/blank.mp4',
- quality: {
- default: 576,
- options: [
- 4320, 2880, 2160, 1440, 1080, 720, 576, 480, 360, 240
- ],
- forced: !1,
- onChange: null
- },
- loop: { active: !1 },
- speed: {
- selected: 1,
- options: [0.5, 0.75, 1, 1.25, 1.5, 1.75, 2, 4]
- },
- keyboard: { focused: !0, global: !1 },
- tooltips: { controls: !1, seek: !0 },
- captions: { active: !1, language: 'auto', update: !1 },
- fullscreen: { enabled: !0, fallback: !0, iosNative: !1 },
- storage: { enabled: !0, key: 'plyr' },
- controls: [
- 'play-large',
- 'play',
- 'progress',
- 'current-time',
- 'mute',
- 'volume',
- 'captions',
- 'settings',
- 'pip',
- 'airplay',
- 'fullscreen'
- ],
- settings: ['captions', 'quality', 'speed'],
- i18n: {
- restart: 'Restart',
- rewind: 'Rewind {seektime}s',
- play: 'Play',
- pause: 'Pause',
- fastForward: 'Forward {seektime}s',
- seek: 'Seek',
- seekLabel: '{currentTime} of {duration}',
- played: 'Played',
- buffered: 'Buffered',
- currentTime: 'Current time',
- duration: 'Duration',
- volume: 'Volume',
- mute: 'Mute',
- unmute: 'Unmute',
- enableCaptions: 'Enable captions',
- disableCaptions: 'Disable captions',
- download: 'Download',
- enterFullscreen: 'Enter fullscreen',
- exitFullscreen: 'Exit fullscreen',
- frameTitle: 'Player for {title}',
- captions: 'Captions',
- settings: 'Settings',
- pip: 'PIP',
- menuBack: 'Go back to previous menu',
- speed: 'Speed',
- normal: 'Normal',
- quality: 'Quality',
- loop: 'Loop',
- start: 'Start',
- end: 'End',
- all: 'All',
- reset: 'Reset',
- disabled: 'Disabled',
- enabled: 'Enabled',
- advertisement: 'Ad',
- qualityBadge: {
- 2160: '4K',
- 1440: 'HD',
- 1080: 'HD',
- 720: 'HD',
- 576: 'SD',
- 480: 'SD'
- }
- },
- urls: {
- download: null,
- vimeo: {
- sdk: 'https://player.vimeo.com/api/player.js',
- iframe: 'https://player.vimeo.com/video/{0}?{1}',
- api: 'https://vimeo.com/api/oembed.json?url={0}'
- },
- youtube: {
- sdk: 'https://www.youtube.com/iframe_api',
- api: 'https://noembed.com/embed?url=https://www.youtube.com/watch?v={0}'
- },
- googleIMA: {
- sdk: 'https://imasdk.googleapis.com/js/sdkloader/ima3.js'
- }
- },
- listeners: {
- seek: null,
- play: null,
- pause: null,
- restart: null,
- rewind: null,
- fastForward: null,
- mute: null,
- volume: null,
- captions: null,
- download: null,
- fullscreen: null,
- pip: null,
- airplay: null,
- speed: null,
- quality: null,
- loop: null,
- language: null
- },
- events: [
- 'ended',
- 'progress',
- 'stalled',
- 'playing',
- 'waiting',
- 'canplay',
- 'canplaythrough',
- 'loadstart',
- 'loadeddata',
- 'loadedmetadata',
- 'timeupdate',
- 'volumechange',
- 'play',
- 'pause',
- 'error',
- 'seeking',
- 'seeked',
- 'emptied',
- 'ratechange',
- 'cuechange',
- 'download',
- 'enterfullscreen',
- 'exitfullscreen',
- 'captionsenabled',
- 'captionsdisabled',
- 'languagechange',
- 'controlshidden',
- 'controlsshown',
- 'ready',
- 'statechange',
- 'qualitychange',
- 'adsloaded',
- 'adscontentpause',
- 'adscontentresume',
- 'adstarted',
- 'adsmidpoint',
- 'adscomplete',
- 'adsallcomplete',
- 'adsimpression',
- 'adsclick'
- ],
- selectors: {
- editable: 'input, textarea, select, [contenteditable]',
- container: '.plyr',
- controls: { container: null, wrapper: '.plyr__controls' },
- labels: '[data-plyr]',
- buttons: {
- play: '[data-plyr="play"]',
- pause: '[data-plyr="pause"]',
- restart: '[data-plyr="restart"]',
- rewind: '[data-plyr="rewind"]',
- fastForward: '[data-plyr="fast-forward"]',
- mute: '[data-plyr="mute"]',
- captions: '[data-plyr="captions"]',
- download: '[data-plyr="download"]',
- fullscreen: '[data-plyr="fullscreen"]',
- pip: '[data-plyr="pip"]',
- airplay: '[data-plyr="airplay"]',
- settings: '[data-plyr="settings"]',
- loop: '[data-plyr="loop"]'
- },
- inputs: {
- seek: '[data-plyr="seek"]',
- volume: '[data-plyr="volume"]',
- speed: '[data-plyr="speed"]',
- language: '[data-plyr="language"]',
- quality: '[data-plyr="quality"]'
- },
- display: {
- currentTime: '.plyr__time--current',
- duration: '.plyr__time--duration',
- buffer: '.plyr__progress__buffer',
- loop: '.plyr__progress__loop',
- volume: '.plyr__volume--display'
- },
- progress: '.plyr__progress',
- captions: '.plyr__captions',
- caption: '.plyr__caption'
- },
- classNames: {
- type: 'plyr--{0}',
- provider: 'plyr--{0}',
- video: 'plyr__video-wrapper',
- embed: 'plyr__video-embed',
- videoFixedRatio: 'plyr__video-wrapper--fixed-ratio',
- embedContainer: 'plyr__video-embed__container',
- poster: 'plyr__poster',
- posterEnabled: 'plyr__poster-enabled',
- ads: 'plyr__ads',
- control: 'plyr__control',
- controlPressed: 'plyr__control--pressed',
- playing: 'plyr--playing',
- paused: 'plyr--paused',
- stopped: 'plyr--stopped',
- loading: 'plyr--loading',
- hover: 'plyr--hover',
- tooltip: 'plyr__tooltip',
- cues: 'plyr__cues',
- marker: 'plyr__progress__marker',
- hidden: 'plyr__sr-only',
- hideControls: 'plyr--hide-controls',
- isIos: 'plyr--is-ios',
- isTouch: 'plyr--is-touch',
- uiSupported: 'plyr--full-ui',
- noTransition: 'plyr--no-transition',
- display: { time: 'plyr__time' },
- menu: {
- value: 'plyr__menu__value',
- badge: 'plyr__badge',
- open: 'plyr--menu-open'
- },
- captions: {
- enabled: 'plyr--captions-enabled',
- active: 'plyr--captions-active'
- },
- fullscreen: {
- enabled: 'plyr--fullscreen-enabled',
- fallback: 'plyr--fullscreen-fallback'
- },
- pip: {
- supported: 'plyr--pip-supported',
- active: 'plyr--pip-active'
- },
- airplay: {
- supported: 'plyr--airplay-supported',
- active: 'plyr--airplay-active'
- },
- tabFocus: 'plyr__tab-focus',
- previewThumbnails: {
- thumbContainer: 'plyr__preview-thumb',
- thumbContainerShown: 'plyr__preview-thumb--is-shown',
- imageContainer: 'plyr__preview-thumb__image-container',
- timeContainer: 'plyr__preview-thumb__time-container',
- scrubbingContainer: 'plyr__preview-scrubbing',
- scrubbingContainerShown: 'plyr__preview-scrubbing--is-shown'
- }
- },
- attributes: {
- embed: {
- provider: 'data-plyr-provider',
- id: 'data-plyr-embed-id',
- hash: 'data-plyr-embed-hash'
- }
- },
- ads: { enabled: !1, publisherId: '', tagUrl: '' },
- previewThumbnails: { enabled: !1, src: '' },
- vimeo: {
- byline: !1,
- portrait: !1,
- title: !1,
- speed: !0,
- transparent: !1,
- customControls: !0,
- referrerPolicy: null,
- premium: !1
- },
- youtube: {
- rel: 0,
- showinfo: 0,
- iv_load_policy: 3,
- modestbranding: 1,
- customControls: !0,
- noCookie: !1
- },
- mediaMetadata: { title: '', artist: '', album: '', artwork: [] },
- markers: { enabled: !1, points: [] }
- },
- pip = { active: 'picture-in-picture', inactive: 'inline' },
- providers = { html5: 'html5', youtube: 'youtube', vimeo: 'vimeo' },
- types = { audio: 'audio', video: 'video' }
- function getProviderByUrl(e) {
- return /^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(
- e
- )
- ? providers.youtube
- : /^https?:\/\/player.vimeo.com\/video\/\d{0,9}(?=\b|\/)/.test(e)
- ? providers.vimeo
- : null
- }
- var noop = function noop() {}
- var Console = /*#__PURE__*/ (function () {
- function Console() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- _classCallCheck2(this, Console)
- ;(this.enabled = window.console && e),
- this.enabled && this.log('Debugging enabled')
- }
- _createClass2(Console, [
- {
- key: 'log',
- get: function get() {
- return this.enabled
- ? Function.prototype.bind.call(console.log, console)
- : noop
- }
- },
- {
- key: 'warn',
- get: function get() {
- return this.enabled
- ? Function.prototype.bind.call(console.warn, console)
- : noop
- }
- },
- {
- key: 'error',
- get: function get() {
- return this.enabled
- ? Function.prototype.bind.call(console.error, console)
- : noop
- }
- }
- ])
- return Console
- })()
- var Fullscreen = /*#__PURE__*/ (function () {
- function Fullscreen(e) {
- var _this22 = this
- _classCallCheck2(this, Fullscreen)
- _defineProperty$1(this, 'onChange', function () {
- if (!_this22.enabled) return
- var e = _this22.player.elements.buttons.fullscreen
- is.element(e) && (e.pressed = _this22.active)
- var t =
- _this22.target === _this22.player.media
- ? _this22.target
- : _this22.player.elements.container
- triggerEvent.call(
- _this22.player,
- t,
- _this22.active ? 'enterfullscreen' : 'exitfullscreen',
- !0
- )
- }),
- _defineProperty$1(this, 'toggleFallback', function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- if (
- (e
- ? (_this22.scrollPosition = {
- x: window.scrollX || 0,
- y: window.scrollY || 0
- })
- : window.scrollTo(
- _this22.scrollPosition.x,
- _this22.scrollPosition.y
- ),
- (document.body.style.overflow = e ? 'hidden' : ''),
- toggleClass(
- _this22.target,
- _this22.player.config.classNames.fullscreen.fallback,
- e
- ),
- browser.isIos)
- ) {
- var t = document.head.querySelector('meta[name="viewport"]')
- var i = 'viewport-fit=cover'
- t ||
- ((t = document.createElement('meta')),
- t.setAttribute('name', 'viewport'))
- var s = is.string(t.content) && t.content.includes(i)
- e
- ? ((_this22.cleanupViewport = !s),
- s || (t.content += ','.concat(i)))
- : _this22.cleanupViewport &&
- (t.content = t.content
- .split(',')
- .filter(function (e) {
- return e.trim() !== i
- })
- .join(','))
- }
- _this22.onChange()
- }),
- _defineProperty$1(this, 'trapFocus', function (e) {
- if (browser.isIos || !_this22.active || 'Tab' !== e.key)
- return
- var t = document.activeElement,
- i = getElements.call(
- _this22.player,
- 'a[href], button:not(:disabled), input:not(:disabled), [tabindex]'
- ),
- _i6 = _slicedToArray(i, 1),
- s = _i6[0],
- n = i[i.length - 1]
- t !== n || e.shiftKey
- ? t === s && e.shiftKey && (n.focus(), e.preventDefault())
- : (s.focus(), e.preventDefault())
- }),
- _defineProperty$1(this, 'update', function () {
- if (_this22.enabled) {
- var _e24
- ;(_e24 = _this22.forceFallback
- ? 'Fallback (forced)'
- : Fullscreen.native
- ? 'Native'
- : 'Fallback'),
- _this22.player.debug.log(
- ''.concat(_e24, ' fullscreen enabled')
- )
- } else _this22.player.debug.log('Fullscreen not supported and fallback disabled')
- toggleClass(
- _this22.player.elements.container,
- _this22.player.config.classNames.fullscreen.enabled,
- _this22.enabled
- )
- }),
- _defineProperty$1(this, 'enter', function () {
- _this22.enabled &&
- (browser.isIos && _this22.player.config.fullscreen.iosNative
- ? _this22.player.isVimeo
- ? _this22.player.embed.requestFullscreen()
- : _this22.target.webkitEnterFullscreen()
- : !Fullscreen.native || _this22.forceFallback
- ? _this22.toggleFallback(!0)
- : _this22.prefix
- ? is.empty(_this22.prefix) ||
- _this22.target[
- ''
- .concat(_this22.prefix, 'Request')
- .concat(_this22.property)
- ]()
- : _this22.target.requestFullscreen({
- navigationUI: 'hide'
- }))
- }),
- _defineProperty$1(this, 'exit', function () {
- if (_this22.enabled)
- if (
- browser.isIos &&
- _this22.player.config.fullscreen.iosNative
- )
- _this22.target.webkitExitFullscreen(),
- silencePromise(_this22.player.play())
- else if (!Fullscreen.native || _this22.forceFallback)
- _this22.toggleFallback(!1)
- else if (_this22.prefix) {
- if (!is.empty(_this22.prefix)) {
- var _e25 = 'moz' === _this22.prefix ? 'Cancel' : 'Exit'
- document[
- ''
- .concat(_this22.prefix)
- .concat(_e25)
- .concat(_this22.property)
- ]()
- }
- } else
- (
- document.cancelFullScreen || document.exitFullscreen
- ).call(document)
- }),
- _defineProperty$1(this, 'toggle', function () {
- _this22.active ? _this22.exit() : _this22.enter()
- }),
- (this.player = e),
- (this.prefix = Fullscreen.prefix),
- (this.property = Fullscreen.property),
- (this.scrollPosition = { x: 0, y: 0 }),
- (this.forceFallback = 'force' === e.config.fullscreen.fallback),
- (this.player.elements.fullscreen =
- e.config.fullscreen.container &&
- closest$1(
- this.player.elements.container,
- e.config.fullscreen.container
- )),
- on.call(
- this.player,
- document,
- 'ms' === this.prefix
- ? 'MSFullscreenChange'
- : ''.concat(this.prefix, 'fullscreenchange'),
- function () {
- _this22.onChange()
- }
- ),
- on.call(
- this.player,
- this.player.elements.container,
- 'dblclick',
- function (e) {
- ;(is.element(_this22.player.elements.controls) &&
- _this22.player.elements.controls.contains(e.target)) ||
- _this22.player.listeners.proxy(
- e,
- _this22.toggle,
- 'fullscreen'
- )
- }
- ),
- on.call(
- this,
- this.player.elements.container,
- 'keydown',
- function (e) {
- return _this22.trapFocus(e)
- }
- ),
- this.update()
- }
- _createClass2(
- Fullscreen,
- [
- {
- key: 'usingNative',
- get: function get() {
- return Fullscreen.native && !this.forceFallback
- }
- },
- {
- key: 'enabled',
- get: function get() {
- return (
- (Fullscreen.native ||
- this.player.config.fullscreen.fallback) &&
- this.player.config.fullscreen.enabled &&
- this.player.supported.ui &&
- this.player.isVideo
- )
- }
- },
- {
- key: 'active',
- get: function get() {
- if (!this.enabled) return !1
- if (!Fullscreen.native || this.forceFallback)
- return hasClass(
- this.target,
- this.player.config.classNames.fullscreen.fallback
- )
- var e = this.prefix
- ? this.target.getRootNode()[
- ''
- .concat(this.prefix)
- .concat(this.property, 'Element')
- ]
- : this.target.getRootNode().fullscreenElement
- return e && e.shadowRoot
- ? e === this.target.getRootNode().host
- : e === this.target
- }
- },
- {
- key: 'target',
- get: function get() {
- return browser.isIos &&
- this.player.config.fullscreen.iosNative
- ? this.player.media
- : this.player.elements.fullscreen ||
- this.player.elements.container
- }
- }
- ],
- [
- {
- key: 'native',
- get: function get() {
- return !!(
- document.fullscreenEnabled ||
- document.webkitFullscreenEnabled ||
- document.mozFullScreenEnabled ||
- document.msFullscreenEnabled
- )
- }
- },
- {
- key: 'prefix',
- get: function get() {
- if (is.function(document.exitFullscreen)) return ''
- var e = ''
- return (
- ['webkit', 'moz', 'ms'].some(function (t) {
- return (
- !(
- !is.function(
- document[''.concat(t, 'ExitFullscreen')]
- ) &&
- !is.function(
- document[''.concat(t, 'CancelFullScreen')]
- )
- ) && ((e = t), !0)
- )
- }),
- e
- )
- }
- },
- {
- key: 'property',
- get: function get() {
- return 'moz' === this.prefix ? 'FullScreen' : 'Fullscreen'
- }
- }
- ]
- )
- return Fullscreen
- })()
- function loadImage(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : 1
- return new Promise(function (i, s) {
- var n = new Image(),
- r = function r() {
- delete n.onload,
- delete n.onerror,
- (n.naturalWidth >= t ? i : s)(n)
- }
- Object.assign(n, { onload: r, onerror: r, src: e })
- })
- }
- var ui = {
- addStyleHook: function addStyleHook() {
- toggleClass(
- this.elements.container,
- this.config.selectors.container.replace('.', ''),
- !0
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.uiSupported,
- this.supported.ui
- )
- },
- toggleNativeControls: function toggleNativeControls() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- e && this.isHTML5
- ? this.media.setAttribute('controls', '')
- : this.media.removeAttribute('controls')
- },
- build: function build() {
- var _this23 = this
- if ((this.listeners.media(), !this.supported.ui))
- return (
- this.debug.warn(
- 'Basic support only for '
- .concat(this.provider, ' ')
- .concat(this.type)
- ),
- void ui.toggleNativeControls.call(this, !0)
- )
- is.element(this.elements.controls) ||
- (controls.inject.call(this), this.listeners.controls()),
- ui.toggleNativeControls.call(this),
- this.isHTML5 && captions.setup.call(this),
- (this.volume = null),
- (this.muted = null),
- (this.loop = null),
- (this.quality = null),
- (this.speed = null),
- controls.updateVolume.call(this),
- controls.timeUpdate.call(this),
- controls.durationUpdate.call(this),
- ui.checkPlaying.call(this),
- toggleClass(
- this.elements.container,
- this.config.classNames.pip.supported,
- support.pip && this.isHTML5 && this.isVideo
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.airplay.supported,
- support.airplay && this.isHTML5
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.isIos,
- browser.isIos
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.isTouch,
- this.touch
- ),
- (this.ready = !0),
- setTimeout(function () {
- triggerEvent.call(_this23, _this23.media, 'ready')
- }, 0),
- ui.setTitle.call(this),
- this.poster &&
- ui.setPoster
- .call(this, this.poster, !1)
- .catch(function () {}),
- this.config.duration && controls.durationUpdate.call(this),
- this.config.mediaMetadata &&
- controls.setMediaMetadata.call(this)
- },
- setTitle: function setTitle() {
- var e = i18n.get('play', this.config)
- if (
- (is.string(this.config.title) &&
- !is.empty(this.config.title) &&
- (e += ', '.concat(this.config.title)),
- Array.from(this.elements.buttons.play || []).forEach(function (
- t
- ) {
- t.setAttribute('aria-label', e)
- }),
- this.isEmbed)
- ) {
- var _e26 = getElement.call(this, 'iframe')
- if (!is.element(_e26)) return
- var t = is.empty(this.config.title)
- ? 'video'
- : this.config.title,
- i = i18n.get('frameTitle', this.config)
- _e26.setAttribute('title', i.replace('{title}', t))
- }
- },
- togglePoster: function togglePoster(e) {
- toggleClass(
- this.elements.container,
- this.config.classNames.posterEnabled,
- e
- )
- },
- setPoster: function setPoster(e) {
- var _this24 = this
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- return t && this.poster
- ? Promise.reject(new Error('Poster already set'))
- : (this.media.setAttribute('data-poster', e),
- this.elements.poster.removeAttribute('hidden'),
- ready
- .call(this)
- .then(function () {
- return loadImage(e)
- })
- .catch(function (t) {
- throw (
- (e === _this24.poster &&
- ui.togglePoster.call(_this24, !1),
- t)
- )
- })
- .then(function () {
- if (e !== _this24.poster)
- throw new Error(
- 'setPoster cancelled by later call to setPoster'
- )
- })
- .then(function () {
- return (
- Object.assign(_this24.elements.poster.style, {
- backgroundImage: "url('".concat(e, "')"),
- backgroundSize: ''
- }),
- ui.togglePoster.call(_this24, !0),
- e
- )
- }))
- },
- checkPlaying: function checkPlaying(e) {
- var _this25 = this
- toggleClass(
- this.elements.container,
- this.config.classNames.playing,
- this.playing
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.paused,
- this.paused
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.stopped,
- this.stopped
- ),
- Array.from(this.elements.buttons.play || []).forEach(function (
- e
- ) {
- Object.assign(e, { pressed: _this25.playing }),
- e.setAttribute(
- 'aria-label',
- i18n.get(
- _this25.playing ? 'pause' : 'play',
- _this25.config
- )
- )
- }),
- (is.event(e) && 'timeupdate' === e.type) ||
- ui.toggleControls.call(this)
- },
- checkLoading: function checkLoading(e) {
- var _this26 = this
- ;(this.loading = ['stalled', 'waiting'].includes(e.type)),
- clearTimeout(this.timers.loading),
- (this.timers.loading = setTimeout(
- function () {
- toggleClass(
- _this26.elements.container,
- _this26.config.classNames.loading,
- _this26.loading
- ),
- ui.toggleControls.call(_this26)
- },
- this.loading ? 250 : 0
- ))
- },
- toggleControls: function toggleControls(e) {
- var t = this.elements.controls
- if (t && this.config.hideControls) {
- var i = this.touch && this.lastSeekTime + 2e3 > Date.now()
- this.toggleControls(
- Boolean(
- e ||
- this.loading ||
- this.paused ||
- t.pressed ||
- t.hover ||
- i
- )
- )
- }
- },
- migrateStyles: function migrateStyles() {
- var _this27 = this
- Object.values(_objectSpread({}, this.media.style))
- .filter(function (e) {
- return !is.empty(e) && is.string(e) && e.startsWith('--plyr')
- })
- .forEach(function (e) {
- _this27.elements.container.style.setProperty(
- e,
- _this27.media.style.getPropertyValue(e)
- ),
- _this27.media.style.removeProperty(e)
- }),
- is.empty(this.media.style) &&
- this.media.removeAttribute('style')
- }
- }
- var Listeners = /*#__PURE__*/ (function () {
- function Listeners(e) {
- var _this28 = this
- _classCallCheck2(this, Listeners)
- _defineProperty$1(this, 'firstTouch', function () {
- var e = _this28.player,
- t = e.elements
- ;(e.touch = !0),
- toggleClass(t.container, e.config.classNames.isTouch, !0)
- }),
- _defineProperty$1(this, 'setTabFocus', function (e) {
- var t = _this28.player,
- i = t.elements,
- s = e.key,
- n = e.type,
- r = e.timeStamp
- if (
- (clearTimeout(_this28.focusTimer),
- 'keydown' === n && 'Tab' !== s)
- )
- return
- 'keydown' === n && (_this28.lastKeyDown = r)
- var a = r - _this28.lastKeyDown <= 20
- ;('focus' !== n || a) &&
- ((function () {
- var e = t.config.classNames.tabFocus
- toggleClass(getElements.call(t, '.'.concat(e)), e, !1)
- })(),
- 'focusout' !== n &&
- (_this28.focusTimer = setTimeout(function () {
- var e = document.activeElement
- i.container.contains(e) &&
- toggleClass(
- document.activeElement,
- t.config.classNames.tabFocus,
- !0
- )
- }, 10)))
- }),
- _defineProperty$1(this, 'global', function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !0
- var t = _this28.player
- t.config.keyboard.global &&
- toggleListener.call(
- t,
- window,
- 'keydown keyup',
- _this28.handleKey,
- e,
- !1
- ),
- toggleListener.call(
- t,
- document.body,
- 'click',
- _this28.toggleMenu,
- e
- ),
- once.call(
- t,
- document.body,
- 'touchstart',
- _this28.firstTouch
- ),
- toggleListener.call(
- t,
- document.body,
- 'keydown focus blur focusout',
- _this28.setTabFocus,
- e,
- !1,
- !0
- )
- }),
- _defineProperty$1(this, 'container', function () {
- var e = _this28.player,
- t = e.config,
- i = e.elements,
- s = e.timers
- !t.keyboard.global &&
- t.keyboard.focused &&
- on.call(
- e,
- i.container,
- 'keydown keyup',
- _this28.handleKey,
- !1
- ),
- on.call(
- e,
- i.container,
- 'mousemove mouseleave touchstart touchmove enterfullscreen exitfullscreen',
- function (t) {
- var n = i.controls
- n &&
- 'enterfullscreen' === t.type &&
- ((n.pressed = !1), (n.hover = !1))
- var r = 0
- ;['touchstart', 'touchmove', 'mousemove'].includes(
- t.type
- ) &&
- (ui.toggleControls.call(e, !0),
- (r = e.touch ? 3e3 : 2e3)),
- clearTimeout(s.controls),
- (s.controls = setTimeout(function () {
- return ui.toggleControls.call(e, !1)
- }, r))
- }
- )
- var n = function n() {
- if (!e.isVimeo || e.config.vimeo.premium) return
- var t = i.wrapper,
- s = e.fullscreen.active,
- _getAspectRatio$call = getAspectRatio.call(e),
- _getAspectRatio$call2 = _slicedToArray(
- _getAspectRatio$call,
- 2
- ),
- n = _getAspectRatio$call2[0],
- r = _getAspectRatio$call2[1],
- a = supportsCSS(
- 'aspect-ratio: '.concat(n, ' / ').concat(r)
- )
- if (!s)
- return void (a
- ? ((t.style.width = null), (t.style.height = null))
- : ((t.style.maxWidth = null),
- (t.style.margin = null)))
- var _getViewportSize = getViewportSize(),
- _getViewportSize2 = _slicedToArray(_getViewportSize, 2),
- o = _getViewportSize2[0],
- l = _getViewportSize2[1],
- c = o / l > n / r
- a
- ? ((t.style.width = c ? 'auto' : '100%'),
- (t.style.height = c ? '100%' : 'auto'))
- : ((t.style.maxWidth = c ? (l / r) * n + 'px' : null),
- (t.style.margin = c ? '0 auto' : null))
- },
- r = function r() {
- clearTimeout(s.resized), (s.resized = setTimeout(n, 50))
- }
- on.call(
- e,
- i.container,
- 'enterfullscreen exitfullscreen',
- function (t) {
- var s = e.fullscreen.target
- if (s !== i.container) return
- if (!e.isEmbed && is.empty(e.config.ratio)) return
- n()
- ;('enterfullscreen' === t.type ? on : off).call(
- e,
- window,
- 'resize',
- r
- )
- }
- )
- }),
- _defineProperty$1(this, 'media', function () {
- var e = _this28.player,
- t = e.elements
- if (
- (on.call(
- e,
- e.media,
- 'timeupdate seeking seeked',
- function (t) {
- return controls.timeUpdate.call(e, t)
- }
- ),
- on.call(
- e,
- e.media,
- 'durationchange loadeddata loadedmetadata',
- function (t) {
- return controls.durationUpdate.call(e, t)
- }
- ),
- on.call(e, e.media, 'ended', function () {
- e.isHTML5 &&
- e.isVideo &&
- e.config.resetOnEnd &&
- (e.restart(), e.pause())
- }),
- on.call(
- e,
- e.media,
- 'progress playing seeking seeked',
- function (t) {
- return controls.updateProgress.call(e, t)
- }
- ),
- on.call(e, e.media, 'volumechange', function (t) {
- return controls.updateVolume.call(e, t)
- }),
- on.call(
- e,
- e.media,
- 'playing play pause ended emptied timeupdate',
- function (t) {
- return ui.checkPlaying.call(e, t)
- }
- ),
- on.call(
- e,
- e.media,
- 'waiting canplay seeked playing',
- function (t) {
- return ui.checkLoading.call(e, t)
- }
- ),
- e.supported.ui && e.config.clickToPlay && !e.isAudio)
- ) {
- var _i7 = getElement.call(
- e,
- '.'.concat(e.config.classNames.video)
- )
- if (!is.element(_i7)) return
- on.call(e, t.container, 'click', function (s) {
- ;([t.container, _i7].includes(s.target) ||
- _i7.contains(s.target)) &&
- ((e.touch && e.config.hideControls) ||
- (e.ended
- ? (_this28.proxy(s, e.restart, 'restart'),
- _this28.proxy(
- s,
- function () {
- silencePromise(e.play())
- },
- 'play'
- ))
- : _this28.proxy(
- s,
- function () {
- silencePromise(e.togglePlay())
- },
- 'play'
- )))
- })
- }
- e.supported.ui &&
- e.config.disableContextMenu &&
- on.call(
- e,
- t.wrapper,
- 'contextmenu',
- function (e) {
- e.preventDefault()
- },
- !1
- ),
- on.call(e, e.media, 'volumechange', function () {
- e.storage.set({ volume: e.volume, muted: e.muted })
- }),
- on.call(e, e.media, 'ratechange', function () {
- controls.updateSetting.call(e, 'speed'),
- e.storage.set({ speed: e.speed })
- }),
- on.call(e, e.media, 'qualitychange', function (t) {
- controls.updateSetting.call(
- e,
- 'quality',
- null,
- t.detail.quality
- )
- }),
- on.call(e, e.media, 'ready qualitychange', function () {
- controls.setDownloadUrl.call(e)
- })
- var i = e.config.events.concat(['keyup', 'keydown']).join(' ')
- on.call(e, e.media, i, function (i) {
- var _i$detail = i.detail,
- s = _i$detail === void 0 ? {} : _i$detail
- 'error' === i.type && (s = e.media.error),
- triggerEvent.call(e, t.container, i.type, !0, s)
- })
- }),
- _defineProperty$1(this, 'proxy', function (e, t, i) {
- var s = _this28.player,
- n = s.config.listeners[i]
- var r = !0
- is.function(n) && (r = n.call(s, e)),
- !1 !== r && is.function(t) && t.call(s, e)
- }),
- _defineProperty$1(this, 'bind', function (e, t, i, s) {
- var n =
- arguments.length > 4 && arguments[4] !== undefined
- ? arguments[4]
- : !0
- var r = _this28.player,
- a = r.config.listeners[s],
- o = is.function(a)
- on.call(
- r,
- e,
- t,
- function (e) {
- return _this28.proxy(e, i, s)
- },
- n && !o
- )
- }),
- _defineProperty$1(this, 'controls', function () {
- var e = _this28.player,
- t = e.elements,
- i = browser.isIE ? 'change' : 'input'
- if (
- (t.buttons.play &&
- Array.from(t.buttons.play).forEach(function (t) {
- _this28.bind(
- t,
- 'click',
- function () {
- silencePromise(e.togglePlay())
- },
- 'play'
- )
- }),
- _this28.bind(
- t.buttons.restart,
- 'click',
- e.restart,
- 'restart'
- ),
- _this28.bind(
- t.buttons.rewind,
- 'click',
- function () {
- ;(e.lastSeekTime = Date.now()), e.rewind()
- },
- 'rewind'
- ),
- _this28.bind(
- t.buttons.fastForward,
- 'click',
- function () {
- ;(e.lastSeekTime = Date.now()), e.forward()
- },
- 'fastForward'
- ),
- _this28.bind(
- t.buttons.mute,
- 'click',
- function () {
- e.muted = !e.muted
- },
- 'mute'
- ),
- _this28.bind(t.buttons.captions, 'click', function () {
- return e.toggleCaptions()
- }),
- _this28.bind(
- t.buttons.download,
- 'click',
- function () {
- triggerEvent.call(e, e.media, 'download')
- },
- 'download'
- ),
- _this28.bind(
- t.buttons.fullscreen,
- 'click',
- function () {
- e.fullscreen.toggle()
- },
- 'fullscreen'
- ),
- _this28.bind(
- t.buttons.pip,
- 'click',
- function () {
- e.pip = 'toggle'
- },
- 'pip'
- ),
- _this28.bind(
- t.buttons.airplay,
- 'click',
- e.airplay,
- 'airplay'
- ),
- _this28.bind(
- t.buttons.settings,
- 'click',
- function (t) {
- t.stopPropagation(),
- t.preventDefault(),
- controls.toggleMenu.call(e, t)
- },
- null,
- !1
- ),
- _this28.bind(
- t.buttons.settings,
- 'keyup',
- function (t) {
- ;['Space', 'Enter'].includes(t.key) &&
- ('Enter' !== t.key
- ? (t.preventDefault(),
- t.stopPropagation(),
- controls.toggleMenu.call(e, t))
- : controls.focusFirstMenuItem.call(e, null, !0))
- },
- null,
- !1
- ),
- _this28.bind(t.settings.menu, 'keydown', function (t) {
- 'Escape' === t.key && controls.toggleMenu.call(e, t)
- }),
- _this28.bind(
- t.inputs.seek,
- 'mousedown mousemove',
- function (e) {
- var i = t.progress.getBoundingClientRect(),
- s = (100 / i.width) * (e.pageX - i.left)
- e.currentTarget.setAttribute('seek-value', s)
- }
- ),
- _this28.bind(
- t.inputs.seek,
- 'mousedown mouseup keydown keyup touchstart touchend',
- function (t) {
- var i = t.currentTarget,
- s = 'play-on-seeked'
- if (
- is.keyboardEvent(t) &&
- !['ArrowLeft', 'ArrowRight'].includes(t.key)
- )
- return
- e.lastSeekTime = Date.now()
- var n = i.hasAttribute(s),
- r = ['mouseup', 'touchend', 'keyup'].includes(t.type)
- n && r
- ? (i.removeAttribute(s), silencePromise(e.play()))
- : !r &&
- e.playing &&
- (i.setAttribute(s, ''), e.pause())
- }
- ),
- browser.isIos)
- ) {
- var _t11 = getElements.call(e, 'input[type="range"]')
- Array.from(_t11).forEach(function (e) {
- return _this28.bind(e, i, function (e) {
- return repaint(e.target)
- })
- })
- }
- _this28.bind(
- t.inputs.seek,
- i,
- function (t) {
- var i = t.currentTarget
- var s = i.getAttribute('seek-value')
- is.empty(s) && (s = i.value),
- i.removeAttribute('seek-value'),
- (e.currentTime = (s / i.max) * e.duration)
- },
- 'seek'
- ),
- _this28.bind(
- t.progress,
- 'mouseenter mouseleave mousemove',
- function (t) {
- return controls.updateSeekTooltip.call(e, t)
- }
- ),
- _this28.bind(
- t.progress,
- 'mousemove touchmove',
- function (t) {
- var i = e.previewThumbnails
- i && i.loaded && i.startMove(t)
- }
- ),
- _this28.bind(
- t.progress,
- 'mouseleave touchend click',
- function () {
- var t = e.previewThumbnails
- t && t.loaded && t.endMove(!1, !0)
- }
- ),
- _this28.bind(
- t.progress,
- 'mousedown touchstart',
- function (t) {
- var i = e.previewThumbnails
- i && i.loaded && i.startScrubbing(t)
- }
- ),
- _this28.bind(t.progress, 'mouseup touchend', function (t) {
- var i = e.previewThumbnails
- i && i.loaded && i.endScrubbing(t)
- }),
- browser.isWebkit &&
- Array.from(
- getElements.call(e, 'input[type="range"]')
- ).forEach(function (t) {
- _this28.bind(t, 'input', function (t) {
- return controls.updateRangeFill.call(e, t.target)
- })
- }),
- e.config.toggleInvert &&
- !is.element(t.display.duration) &&
- _this28.bind(t.display.currentTime, 'click', function () {
- 0 !== e.currentTime &&
- ((e.config.invertTime = !e.config.invertTime),
- controls.timeUpdate.call(e))
- }),
- _this28.bind(
- t.inputs.volume,
- i,
- function (t) {
- e.volume = t.target.value
- },
- 'volume'
- ),
- _this28.bind(
- t.controls,
- 'mouseenter mouseleave',
- function (i) {
- t.controls.hover = !e.touch && 'mouseenter' === i.type
- }
- ),
- t.fullscreen &&
- Array.from(t.fullscreen.children)
- .filter(function (e) {
- return !e.contains(t.container)
- })
- .forEach(function (i) {
- _this28.bind(
- i,
- 'mouseenter mouseleave',
- function (i) {
- t.controls &&
- (t.controls.hover =
- !e.touch && 'mouseenter' === i.type)
- }
- )
- }),
- _this28.bind(
- t.controls,
- 'mousedown mouseup touchstart touchend touchcancel',
- function (e) {
- t.controls.pressed = [
- 'mousedown',
- 'touchstart'
- ].includes(e.type)
- }
- ),
- _this28.bind(t.controls, 'focusin', function () {
- var i = e.config,
- s = e.timers
- toggleClass(t.controls, i.classNames.noTransition, !0),
- ui.toggleControls.call(e, !0),
- setTimeout(function () {
- toggleClass(t.controls, i.classNames.noTransition, !1)
- }, 0)
- var n = _this28.touch ? 3e3 : 4e3
- clearTimeout(s.controls),
- (s.controls = setTimeout(function () {
- return ui.toggleControls.call(e, !1)
- }, n))
- }),
- _this28.bind(
- t.inputs.volume,
- 'wheel',
- function (t) {
- var i = t.webkitDirectionInvertedFromDevice,
- _map = [t.deltaX, -t.deltaY].map(function (e) {
- return i ? -e : e
- }),
- _map2 = _slicedToArray(_map, 2),
- s = _map2[0],
- n = _map2[1],
- r = Math.sign(Math.abs(s) > Math.abs(n) ? s : n)
- e.increaseVolume(r / 50)
- var a = e.media.volume
- ;((1 === r && a < 1) || (-1 === r && a > 0)) &&
- t.preventDefault()
- },
- 'volume',
- !1
- )
- }),
- (this.player = e),
- (this.lastKey = null),
- (this.focusTimer = null),
- (this.lastKeyDown = null),
- (this.handleKey = this.handleKey.bind(this)),
- (this.toggleMenu = this.toggleMenu.bind(this)),
- (this.setTabFocus = this.setTabFocus.bind(this)),
- (this.firstTouch = this.firstTouch.bind(this))
- }
- _createClass2(Listeners, [
- {
- key: 'handleKey',
- value: function handleKey(e) {
- var t = this.player,
- i = t.elements,
- s = e.key,
- n = e.type,
- r = e.altKey,
- a = e.ctrlKey,
- o = e.metaKey,
- l = e.shiftKey,
- c = 'keydown' === n,
- u = c && s === this.lastKey
- if (r || a || o || l) return
- if (!s) return
- if (c) {
- var _n4 = document.activeElement
- if (is.element(_n4)) {
- var _s6 = t.config.selectors.editable,
- _r3 = i.inputs.seek
- if (_n4 !== _r3 && matches(_n4, _s6)) return
- if (
- 'Space' === e.key &&
- matches(_n4, 'button, [role^="menuitem"]')
- )
- return
- }
- switch (
- ([
- 'Space',
- 'ArrowLeft',
- 'ArrowUp',
- 'ArrowRight',
- 'ArrowDown',
- '0',
- '1',
- '2',
- '3',
- '4',
- '5',
- '6',
- '7',
- '8',
- '9',
- 'c',
- 'f',
- 'k',
- 'l',
- 'm'
- ].includes(s) &&
- (e.preventDefault(), e.stopPropagation()),
- s)
- ) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- case '9':
- u ||
- ((d = parseInt(s, 10)),
- (t.currentTime = (t.duration / 10) * d))
- break
- case 'Space':
- case 'k':
- u || silencePromise(t.togglePlay())
- break
- case 'ArrowUp':
- t.increaseVolume(0.1)
- break
- case 'ArrowDown':
- t.decreaseVolume(0.1)
- break
- case 'm':
- u || (t.muted = !t.muted)
- break
- case 'ArrowRight':
- t.forward()
- break
- case 'ArrowLeft':
- t.rewind()
- break
- case 'f':
- t.fullscreen.toggle()
- break
- case 'c':
- u || t.toggleCaptions()
- break
- case 'l':
- t.loop = !t.loop
- }
- 'Escape' === s &&
- !t.fullscreen.usingNative &&
- t.fullscreen.active &&
- t.fullscreen.toggle(),
- (this.lastKey = s)
- } else this.lastKey = null
- var d
- }
- },
- {
- key: 'toggleMenu',
- value: function toggleMenu(e) {
- controls.toggleMenu.call(this.player, e)
- }
- }
- ])
- return Listeners
- })()
- function createCommonjsModule(e, t) {
- return e((t = { exports: {} }), t.exports), t.exports
- }
- var loadjs_umd = createCommonjsModule(function (e, t) {
- e.exports = (function () {
- var e = function e() {},
- t = {},
- i = {},
- s = {}
- function n(e, t) {
- e = e.push ? e : [e]
- var n,
- r,
- a,
- o = [],
- l = e.length,
- c = l
- for (
- n = function n(e, i) {
- i.length && o.push(e), --c || t(o)
- };
- l--;
- ) {
- ;(r = e[l]),
- (a = i[r]) ? n(r, a) : (s[r] = s[r] || []).push(n)
- }
- }
- function r(e, t) {
- if (e) {
- var n = s[e]
- if (((i[e] = t), n))
- for (; n.length; ) {
- n[0](e, t), n.splice(0, 1)
- }
- }
- }
- function a(t, i) {
- t.call && (t = { success: t }),
- i.length ? (t.error || e)(i) : (t.success || e)(t)
- }
- function o(t, i, s, n) {
- var r,
- a,
- l = document,
- c = s.async,
- u = (s.numRetries || 0) + 1,
- d = s.before || e,
- h = t.replace(/[\?|#].*$/, ''),
- m = t.replace(/^(css|img)!/, '')
- ;(n = n || 0),
- /(^css!|\.css$)/.test(h)
- ? (((a = l.createElement('link')).rel = 'stylesheet'),
- (a.href = m),
- (r = 'hideFocus' in a) &&
- a.relList &&
- ((r = 0), (a.rel = 'preload'), (a.as = 'style')))
- : /(^img!|\.(png|gif|jpg|svg|webp)$)/.test(h)
- ? ((a = l.createElement('img')).src = m)
- : (((a = l.createElement('script')).src = t),
- (a.async = void 0 === c || c)),
- (a.onload =
- a.onerror =
- a.onbeforeload =
- function (e) {
- var l = e.type[0]
- if (r)
- try {
- a.sheet.cssText.length || (l = 'e')
- } catch (e) {
- 18 != e.code && (l = 'e')
- }
- if ('e' == l) {
- if ((n += 1) < u) return o(t, i, s, n)
- } else if ('preload' == a.rel && 'style' == a.as)
- return (a.rel = 'stylesheet')
- i(t, l, e.defaultPrevented)
- }),
- !1 !== d(t, a) && l.head.appendChild(a)
- }
- function l(e, t, i) {
- var s,
- n,
- r = (e = e.push ? e : [e]).length,
- a = r,
- l = []
- for (
- s = function s(e, i, _s7) {
- if (('e' == i && l.push(e), 'b' == i)) {
- if (!_s7) return
- l.push(e)
- }
- --r || t(l)
- },
- n = 0;
- n < a;
- n++
- ) {
- o(e[n], s, i)
- }
- }
- function c(e, i, s) {
- var n, o
- if ((i && i.trim && (n = i), (o = (n ? s : i) || {}), n)) {
- if (n in t) throw 'LoadJS'
- t[n] = !0
- }
- function c(t, i) {
- l(
- e,
- function (e) {
- a(o, e), t && a({ success: t, error: i }, e), r(n, e)
- },
- o
- )
- }
- if (o.returnPromise) return new Promise(c)
- c()
- }
- return (
- (c.ready = function (e, t) {
- return (
- n(e, function (e) {
- a(t, e)
- }),
- c
- )
- }),
- (c.done = function (e) {
- r(e, [])
- }),
- (c.reset = function () {
- ;(t = {}), (i = {}), (s = {})
- }),
- (c.isDefined = function (e) {
- return e in t
- }),
- c
- )
- })()
- })
- function loadScript(e) {
- return new Promise(function (t, i) {
- loadjs_umd(e, { success: t, error: i })
- })
- }
- function parseId$1(e) {
- if (is.empty(e)) return null
- if (is.number(Number(e))) return e
- return e.match(/^.*(vimeo.com\/|video\/)(\d+).*/) ? RegExp.$2 : e
- }
- function parseHash(e) {
- var t = e.match(
- /^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/
- )
- return t && 5 === t.length ? t[4] : null
- }
- function assurePlaybackState$1(e) {
- e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
- this.media.paused === e &&
- ((this.media.paused = !e),
- triggerEvent.call(this, this.media, e ? 'play' : 'pause'))
- }
- var vimeo = {
- setup: function setup() {
- var e = this
- toggleClass(e.elements.wrapper, e.config.classNames.embed, !0),
- (e.options.speed = e.config.speed.options),
- setAspectRatio.call(e),
- is.object(window.Vimeo)
- ? vimeo.ready.call(e)
- : loadScript(e.config.urls.vimeo.sdk)
- .then(function () {
- vimeo.ready.call(e)
- })
- .catch(function (t) {
- e.debug.warn('Vimeo SDK (player.js) failed to load', t)
- })
- },
- ready: function ready() {
- var _this29 = this
- var e = this,
- t = e.config.vimeo,
- i = t.premium,
- s = t.referrerPolicy,
- n = _objectWithoutProperties(t, _excluded)
- var r = e.media.getAttribute('src'),
- a = ''
- is.empty(r)
- ? ((r = e.media.getAttribute(e.config.attributes.embed.id)),
- (a = e.media.getAttribute(e.config.attributes.embed.hash)))
- : (a = parseHash(r))
- var o = a ? { h: a } : {}
- i && Object.assign(n, { controls: !1, sidedock: !1 })
- var l = buildUrlParams(
- _objectSpread(
- _objectSpread(
- {
- loop: e.config.loop.active,
- autoplay: e.autoplay,
- muted: e.muted,
- gesture: 'media',
- playsinline: !this.config.fullscreen.iosNative
- },
- o
- ),
- n
- )
- ),
- c = parseId$1(r),
- u = createElement('iframe'),
- d = format(e.config.urls.vimeo.iframe, c, l)
- if (
- (u.setAttribute('src', d),
- u.setAttribute('allowfullscreen', ''),
- u.setAttribute(
- 'allow',
- [
- 'autoplay',
- 'fullscreen',
- 'picture-in-picture',
- 'encrypted-media',
- 'accelerometer',
- 'gyroscope'
- ].join('; ')
- ),
- is.empty(s) || u.setAttribute('referrerPolicy', s),
- i || !t.customControls)
- )
- u.setAttribute('data-poster', e.poster),
- (e.media = replaceElement(u, e.media))
- else {
- var _t12 = createElement('div', {
- class: e.config.classNames.embedContainer,
- 'data-poster': e.poster
- })
- _t12.appendChild(u), (e.media = replaceElement(_t12, e.media))
- }
- t.customControls ||
- fetch(format(e.config.urls.vimeo.api, d)).then(function (t) {
- !is.empty(t) &&
- t.thumbnail_url &&
- ui.setPoster.call(e, t.thumbnail_url).catch(function () {})
- }),
- (e.embed = new window.Vimeo.Player(u, {
- autopause: e.config.autopause,
- muted: e.muted
- })),
- (e.media.paused = !0),
- (e.media.currentTime = 0),
- e.supported.ui && e.embed.disableTextTrack(),
- (e.media.play = function () {
- return assurePlaybackState$1.call(e, !0), e.embed.play()
- }),
- (e.media.pause = function () {
- return assurePlaybackState$1.call(e, !1), e.embed.pause()
- }),
- (e.media.stop = function () {
- e.pause(), (e.currentTime = 0)
- })
- var h = e.media.currentTime
- Object.defineProperty(e.media, 'currentTime', {
- get: function get() {
- return h
- },
- set: function set(t) {
- var i = e.embed,
- s = e.media,
- n = e.paused,
- r = e.volume,
- a = n && !i.hasPlayed
- ;(s.seeking = !0),
- triggerEvent.call(e, s, 'seeking'),
- Promise.resolve(a && i.setVolume(0))
- .then(function () {
- return i.setCurrentTime(t)
- })
- .then(function () {
- return a && i.pause()
- })
- .then(function () {
- return a && i.setVolume(r)
- })
- .catch(function () {})
- }
- })
- var m = e.config.speed.selected
- Object.defineProperty(e.media, 'playbackRate', {
- get: function get() {
- return m
- },
- set: function set(t) {
- e.embed
- .setPlaybackRate(t)
- .then(function () {
- ;(m = t), triggerEvent.call(e, e.media, 'ratechange')
- })
- .catch(function () {
- e.options.speed = [1]
- })
- }
- })
- var p = e.config.volume
- Object.defineProperty(e.media, 'volume', {
- get: function get() {
- return p
- },
- set: function set(t) {
- e.embed.setVolume(t).then(function () {
- ;(p = t), triggerEvent.call(e, e.media, 'volumechange')
- })
- }
- })
- var g = e.config.muted
- Object.defineProperty(e.media, 'muted', {
- get: function get() {
- return g
- },
- set: function set(t) {
- var i = !!is.boolean(t) && t
- e.embed.setVolume(i ? 0 : e.config.volume).then(function () {
- ;(g = i), triggerEvent.call(e, e.media, 'volumechange')
- })
- }
- })
- var f,
- y = e.config.loop
- Object.defineProperty(e.media, 'loop', {
- get: function get() {
- return y
- },
- set: function set(t) {
- var i = is.boolean(t) ? t : e.config.loop.active
- e.embed.setLoop(i).then(function () {
- y = i
- })
- }
- }),
- e.embed
- .getVideoUrl()
- .then(function (t) {
- ;(f = t), controls.setDownloadUrl.call(e)
- })
- .catch(function (e) {
- _this29.debug.warn(e)
- }),
- Object.defineProperty(e.media, 'currentSrc', {
- get: function get() {
- return f
- }
- }),
- Object.defineProperty(e.media, 'ended', {
- get: function get() {
- return e.currentTime === e.duration
- }
- }),
- Promise.all([
- e.embed.getVideoWidth(),
- e.embed.getVideoHeight()
- ]).then(function (t) {
- var _t13 = _slicedToArray(t, 2),
- i = _t13[0],
- s = _t13[1]
- ;(e.embed.ratio = roundAspectRatio(i, s)),
- setAspectRatio.call(_this29)
- }),
- e.embed.setAutopause(e.config.autopause).then(function (t) {
- e.config.autopause = t
- }),
- e.embed.getVideoTitle().then(function (t) {
- ;(e.config.title = t), ui.setTitle.call(_this29)
- }),
- e.embed.getCurrentTime().then(function (t) {
- ;(h = t), triggerEvent.call(e, e.media, 'timeupdate')
- }),
- e.embed.getDuration().then(function (t) {
- ;(e.media.duration = t),
- triggerEvent.call(e, e.media, 'durationchange')
- }),
- e.embed.getTextTracks().then(function (t) {
- ;(e.media.textTracks = t), captions.setup.call(e)
- }),
- e.embed.on('cuechange', function (_ref17) {
- var _ref17$cues = _ref17.cues,
- t = _ref17$cues === void 0 ? [] : _ref17$cues
- var i = t.map(function (e) {
- return stripHTML(e.text)
- })
- captions.updateCues.call(e, i)
- }),
- e.embed.on('loaded', function () {
- if (
- (e.embed.getPaused().then(function (t) {
- assurePlaybackState$1.call(e, !t),
- t || triggerEvent.call(e, e.media, 'playing')
- }),
- is.element(e.embed.element) && e.supported.ui)
- ) {
- e.embed.element.setAttribute('tabindex', -1)
- }
- }),
- e.embed.on('bufferstart', function () {
- triggerEvent.call(e, e.media, 'waiting')
- }),
- e.embed.on('bufferend', function () {
- triggerEvent.call(e, e.media, 'playing')
- }),
- e.embed.on('play', function () {
- assurePlaybackState$1.call(e, !0),
- triggerEvent.call(e, e.media, 'playing')
- }),
- e.embed.on('pause', function () {
- assurePlaybackState$1.call(e, !1)
- }),
- e.embed.on('timeupdate', function (t) {
- ;(e.media.seeking = !1),
- (h = t.seconds),
- triggerEvent.call(e, e.media, 'timeupdate')
- }),
- e.embed.on('progress', function (t) {
- ;(e.media.buffered = t.percent),
- triggerEvent.call(e, e.media, 'progress'),
- 1 === parseInt(t.percent, 10) &&
- triggerEvent.call(e, e.media, 'canplaythrough'),
- e.embed.getDuration().then(function (t) {
- t !== e.media.duration &&
- ((e.media.duration = t),
- triggerEvent.call(e, e.media, 'durationchange'))
- })
- }),
- e.embed.on('seeked', function () {
- ;(e.media.seeking = !1),
- triggerEvent.call(e, e.media, 'seeked')
- }),
- e.embed.on('ended', function () {
- ;(e.media.paused = !0), triggerEvent.call(e, e.media, 'ended')
- }),
- e.embed.on('error', function (t) {
- ;(e.media.error = t), triggerEvent.call(e, e.media, 'error')
- }),
- t.customControls &&
- setTimeout(function () {
- return ui.build.call(e)
- }, 0)
- }
- }
- function parseId(e) {
- if (is.empty(e)) return null
- return e.match(
- /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/
- )
- ? RegExp.$2
- : e
- }
- function assurePlaybackState(e) {
- e && !this.embed.hasPlayed && (this.embed.hasPlayed = !0),
- this.media.paused === e &&
- ((this.media.paused = !e),
- triggerEvent.call(this, this.media, e ? 'play' : 'pause'))
- }
- function getHost(e) {
- return e.noCookie
- ? 'https://www.youtube-nocookie.com'
- : 'http:' === window.location.protocol
- ? 'http://www.youtube.com'
- : void 0
- }
- var youtube = {
- setup: function setup() {
- var _this30 = this
- if (
- (toggleClass(
- this.elements.wrapper,
- this.config.classNames.embed,
- !0
- ),
- is.object(window.YT) && is.function(window.YT.Player))
- )
- youtube.ready.call(this)
- else {
- var e = window.onYouTubeIframeAPIReady
- ;(window.onYouTubeIframeAPIReady = function () {
- is.function(e) && e(), youtube.ready.call(_this30)
- }),
- loadScript(this.config.urls.youtube.sdk).catch(function (
- e
- ) {
- _this30.debug.warn('YouTube API failed to load', e)
- })
- }
- },
- getTitle: function getTitle(e) {
- var _this31 = this
- fetch(format(this.config.urls.youtube.api, e))
- .then(function (e) {
- if (is.object(e)) {
- var t = e.title,
- i = e.height,
- s = e.width
- ;(_this31.config.title = t),
- ui.setTitle.call(_this31),
- (_this31.embed.ratio = roundAspectRatio(s, i))
- }
- setAspectRatio.call(_this31)
- })
- .catch(function () {
- setAspectRatio.call(_this31)
- })
- },
- ready: function ready() {
- var e = this,
- t = e.config.youtube,
- i = e.media && e.media.getAttribute('id')
- if (!is.empty(i) && i.startsWith('youtube-')) return
- var s = e.media.getAttribute('src')
- is.empty(s) &&
- (s = e.media.getAttribute(this.config.attributes.embed.id))
- var n = parseId(s),
- r = createElement('div', {
- id: generateId(e.provider),
- 'data-poster': t.customControls ? e.poster : void 0
- })
- if (
- ((e.media = replaceElement(r, e.media)), t.customControls)
- ) {
- var _t14 = function _t14(e) {
- return 'https://i.ytimg.com/vi/'
- .concat(n, '/')
- .concat(e, 'default.jpg')
- }
- loadImage(_t14('maxres'), 121)
- .catch(function () {
- return loadImage(_t14('sd'), 121)
- })
- .catch(function () {
- return loadImage(_t14('hq'))
- })
- .then(function (t) {
- return ui.setPoster.call(e, t.src)
- })
- .then(function (t) {
- t.includes('maxres') ||
- (e.elements.poster.style.backgroundSize = 'cover')
- })
- .catch(function () {})
- }
- e.embed = new window.YT.Player(e.media, {
- videoId: n,
- host: getHost(t),
- playerVars: extend(
- {},
- {
- autoplay: e.config.autoplay ? 1 : 0,
- hl: e.config.hl,
- controls: e.supported.ui && t.customControls ? 0 : 1,
- disablekb: 1,
- playsinline: e.config.fullscreen.iosNative ? 0 : 1,
- cc_load_policy: e.captions.active ? 1 : 0,
- cc_lang_pref: e.config.captions.language,
- widget_referrer: window ? window.location.href : null
- },
- t
- ),
- events: {
- onError: function onError(t) {
- if (!e.media.error) {
- var _i8 = t.data,
- _s8 =
- {
- 2: 'The request contains an invalid parameter value. For example, this error occurs if you specify a video ID that does not have 11 characters, or if the video ID contains invalid characters, such as exclamation points or asterisks.',
- 5: 'The requested content cannot be played in an HTML5 player or another error related to the HTML5 player has occurred.',
- 100: 'The video requested was not found. This error occurs when a video has been removed (for any reason) or has been marked as private.',
- 101: 'The owner of the requested video does not allow it to be played in embedded players.',
- 150: 'The owner of the requested video does not allow it to be played in embedded players.'
- }[_i8] || 'An unknown error occured'
- ;(e.media.error = { code: _i8, message: _s8 }),
- triggerEvent.call(e, e.media, 'error')
- }
- },
- onPlaybackRateChange: function onPlaybackRateChange(t) {
- var i = t.target
- ;(e.media.playbackRate = i.getPlaybackRate()),
- triggerEvent.call(e, e.media, 'ratechange')
- },
- onReady: function onReady(i) {
- if (is.function(e.media.play)) return
- var s = i.target
- youtube.getTitle.call(e, n),
- (e.media.play = function () {
- assurePlaybackState.call(e, !0), s.playVideo()
- }),
- (e.media.pause = function () {
- assurePlaybackState.call(e, !1), s.pauseVideo()
- }),
- (e.media.stop = function () {
- s.stopVideo()
- }),
- (e.media.duration = s.getDuration()),
- (e.media.paused = !0),
- (e.media.currentTime = 0),
- Object.defineProperty(e.media, 'currentTime', {
- get: function get() {
- return Number(s.getCurrentTime())
- },
- set: function set(t) {
- e.paused && !e.embed.hasPlayed && e.embed.mute(),
- (e.media.seeking = !0),
- triggerEvent.call(e, e.media, 'seeking'),
- s.seekTo(t)
- }
- }),
- Object.defineProperty(e.media, 'playbackRate', {
- get: function get() {
- return s.getPlaybackRate()
- },
- set: function set(e) {
- s.setPlaybackRate(e)
- }
- })
- var r = e.config.volume
- Object.defineProperty(e.media, 'volume', {
- get: function get() {
- return r
- },
- set: function set(t) {
- ;(r = t),
- s.setVolume(100 * r),
- triggerEvent.call(e, e.media, 'volumechange')
- }
- })
- var a = e.config.muted
- Object.defineProperty(e.media, 'muted', {
- get: function get() {
- return a
- },
- set: function set(t) {
- var i = is.boolean(t) ? t : a
- ;(a = i),
- s[i ? 'mute' : 'unMute'](),
- s.setVolume(100 * r),
- triggerEvent.call(e, e.media, 'volumechange')
- }
- }),
- Object.defineProperty(e.media, 'currentSrc', {
- get: function get() {
- return s.getVideoUrl()
- }
- }),
- Object.defineProperty(e.media, 'ended', {
- get: function get() {
- return e.currentTime === e.duration
- }
- })
- var o = s.getAvailablePlaybackRates()
- ;(e.options.speed = o.filter(function (t) {
- return e.config.speed.options.includes(t)
- })),
- e.supported.ui &&
- t.customControls &&
- e.media.setAttribute('tabindex', -1),
- triggerEvent.call(e, e.media, 'timeupdate'),
- triggerEvent.call(e, e.media, 'durationchange'),
- clearInterval(e.timers.buffering),
- (e.timers.buffering = setInterval(function () {
- ;(e.media.buffered = s.getVideoLoadedFraction()),
- (null === e.media.lastBuffered ||
- e.media.lastBuffered < e.media.buffered) &&
- triggerEvent.call(e, e.media, 'progress'),
- (e.media.lastBuffered = e.media.buffered),
- 1 === e.media.buffered &&
- (clearInterval(e.timers.buffering),
- triggerEvent.call(e, e.media, 'canplaythrough'))
- }, 200)),
- t.customControls &&
- setTimeout(function () {
- return ui.build.call(e)
- }, 50)
- },
- onStateChange: function onStateChange(i) {
- var s = i.target
- clearInterval(e.timers.playing)
- switch (
- (e.media.seeking &&
- [1, 2].includes(i.data) &&
- ((e.media.seeking = !1),
- triggerEvent.call(e, e.media, 'seeked')),
- i.data)
- ) {
- case -1:
- triggerEvent.call(e, e.media, 'timeupdate'),
- (e.media.buffered = s.getVideoLoadedFraction()),
- triggerEvent.call(e, e.media, 'progress')
- break
- case 0:
- assurePlaybackState.call(e, !1),
- e.media.loop
- ? (s.stopVideo(), s.playVideo())
- : triggerEvent.call(e, e.media, 'ended')
- break
- case 1:
- t.customControls &&
- !e.config.autoplay &&
- e.media.paused &&
- !e.embed.hasPlayed
- ? e.media.pause()
- : (assurePlaybackState.call(e, !0),
- triggerEvent.call(e, e.media, 'playing'),
- (e.timers.playing = setInterval(function () {
- triggerEvent.call(e, e.media, 'timeupdate')
- }, 50)),
- e.media.duration !== s.getDuration() &&
- ((e.media.duration = s.getDuration()),
- triggerEvent.call(
- e,
- e.media,
- 'durationchange'
- )))
- break
- case 2:
- e.muted || e.embed.unMute(),
- assurePlaybackState.call(e, !1)
- break
- case 3:
- triggerEvent.call(e, e.media, 'waiting')
- }
- triggerEvent.call(
- e,
- e.elements.container,
- 'statechange',
- !1,
- { code: i.data }
- )
- }
- }
- })
- }
- },
- media = {
- setup: function setup() {
- this.media
- ? (toggleClass(
- this.elements.container,
- this.config.classNames.type.replace('{0}', this.type),
- !0
- ),
- toggleClass(
- this.elements.container,
- this.config.classNames.provider.replace(
- '{0}',
- this.provider
- ),
- !0
- ),
- this.isEmbed &&
- toggleClass(
- this.elements.container,
- this.config.classNames.type.replace('{0}', 'video'),
- !0
- ),
- this.isVideo &&
- ((this.elements.wrapper = createElement('div', {
- class: this.config.classNames.video
- })),
- wrap(this.media, this.elements.wrapper),
- (this.elements.poster = createElement('div', {
- class: this.config.classNames.poster
- })),
- this.elements.wrapper.appendChild(this.elements.poster)),
- this.isHTML5
- ? html5.setup.call(this)
- : this.isYouTube
- ? youtube.setup.call(this)
- : this.isVimeo && vimeo.setup.call(this))
- : this.debug.warn('No media element found!')
- }
- }
- var Ads = /*#__PURE__*/ (function () {
- function Ads(e) {
- var _this32 = this
- _classCallCheck2(this, Ads)
- _defineProperty$1(this, 'load', function () {
- _this32.enabled &&
- (is.object(window.google) && is.object(window.google.ima)
- ? _this32.ready()
- : loadScript(_this32.player.config.urls.googleIMA.sdk)
- .then(function () {
- _this32.ready()
- })
- .catch(function () {
- _this32.trigger(
- 'error',
- new Error('Google IMA SDK failed to load')
- )
- }))
- }),
- _defineProperty$1(this, 'ready', function () {
- var e
- _this32.enabled ||
- ((e = _this32).manager && e.manager.destroy(),
- e.elements.displayContainer &&
- e.elements.displayContainer.destroy(),
- e.elements.container.remove()),
- _this32.startSafetyTimer(12e3, 'ready()'),
- _this32.managerPromise.then(function () {
- _this32.clearSafetyTimer('onAdsManagerLoaded()')
- }),
- _this32.listeners(),
- _this32.setupIMA()
- }),
- _defineProperty$1(this, 'setupIMA', function () {
- ;(_this32.elements.container = createElement('div', {
- class: _this32.player.config.classNames.ads
- })),
- _this32.player.elements.container.appendChild(
- _this32.elements.container
- ),
- google.ima.settings.setVpaidMode(
- google.ima.ImaSdkSettings.VpaidMode.ENABLED
- ),
- google.ima.settings.setLocale(
- _this32.player.config.ads.language
- ),
- google.ima.settings.setDisableCustomPlaybackForIOS10Plus(
- _this32.player.config.playsinline
- ),
- (_this32.elements.displayContainer =
- new google.ima.AdDisplayContainer(
- _this32.elements.container,
- _this32.player.media
- )),
- (_this32.loader = new google.ima.AdsLoader(
- _this32.elements.displayContainer
- )),
- _this32.loader.addEventListener(
- google.ima.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
- function (e) {
- return _this32.onAdsManagerLoaded(e)
- },
- !1
- ),
- _this32.loader.addEventListener(
- google.ima.AdErrorEvent.Type.AD_ERROR,
- function (e) {
- return _this32.onAdError(e)
- },
- !1
- ),
- _this32.requestAds()
- }),
- _defineProperty$1(this, 'requestAds', function () {
- var e = _this32.player.elements.container
- try {
- var t = new google.ima.AdsRequest()
- ;(t.adTagUrl = _this32.tagUrl),
- (t.linearAdSlotWidth = e.offsetWidth),
- (t.linearAdSlotHeight = e.offsetHeight),
- (t.nonLinearAdSlotWidth = e.offsetWidth),
- (t.nonLinearAdSlotHeight = e.offsetHeight),
- (t.forceNonLinearFullSlot = !1),
- t.setAdWillPlayMuted(!_this32.player.muted),
- _this32.loader.requestAds(t)
- } catch (e) {
- _this32.onAdError(e)
- }
- }),
- _defineProperty$1(this, 'pollCountdown', function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- if (!e)
- return (
- clearInterval(_this32.countdownTimer),
- void _this32.elements.container.removeAttribute(
- 'data-badge-text'
- )
- )
- _this32.countdownTimer = setInterval(function () {
- var e = _formatTime(
- Math.max(_this32.manager.getRemainingTime(), 0)
- ),
- t = ''
- .concat(
- i18n.get('advertisement', _this32.player.config),
- ' - '
- )
- .concat(e)
- _this32.elements.container.setAttribute(
- 'data-badge-text',
- t
- )
- }, 100)
- }),
- _defineProperty$1(this, 'onAdsManagerLoaded', function (e) {
- if (!_this32.enabled) return
- var t = new google.ima.AdsRenderingSettings()
- ;(t.restoreCustomPlaybackStateOnAdBreakComplete = !0),
- (t.enablePreloading = !0),
- (_this32.manager = e.getAdsManager(_this32.player, t)),
- (_this32.cuePoints = _this32.manager.getCuePoints()),
- _this32.manager.addEventListener(
- google.ima.AdErrorEvent.Type.AD_ERROR,
- function (e) {
- return _this32.onAdError(e)
- }
- ),
- Object.keys(google.ima.AdEvent.Type).forEach(function (e) {
- _this32.manager.addEventListener(
- google.ima.AdEvent.Type[e],
- function (e) {
- return _this32.onAdEvent(e)
- }
- )
- }),
- _this32.trigger('loaded')
- }),
- _defineProperty$1(this, 'addCuePoints', function () {
- is.empty(_this32.cuePoints) ||
- _this32.cuePoints.forEach(function (e) {
- if (0 !== e && -1 !== e && e < _this32.player.duration) {
- var t = _this32.player.elements.progress
- if (is.element(t)) {
- var i = (100 / _this32.player.duration) * e,
- s = createElement('span', {
- class: _this32.player.config.classNames.cues
- })
- ;(s.style.left = ''.concat(i.toString(), '%')),
- t.appendChild(s)
- }
- }
- })
- }),
- _defineProperty$1(this, 'onAdEvent', function (e) {
- var t = _this32.player.elements.container,
- i = e.getAd(),
- s = e.getAdData()
- switch (
- ((function (e) {
- triggerEvent.call(
- _this32.player,
- _this32.player.media,
- 'ads'.concat(e.replace(/_/g, '').toLowerCase())
- )
- })(e.type),
- e.type)
- ) {
- case google.ima.AdEvent.Type.LOADED:
- _this32.trigger('loaded'),
- _this32.pollCountdown(!0),
- i.isLinear() ||
- ((i.width = t.offsetWidth),
- (i.height = t.offsetHeight))
- break
- case google.ima.AdEvent.Type.STARTED:
- _this32.manager.setVolume(_this32.player.volume)
- break
- case google.ima.AdEvent.Type.ALL_ADS_COMPLETED:
- _this32.player.ended
- ? _this32.loadAds()
- : _this32.loader.contentComplete()
- break
- case google.ima.AdEvent.Type.CONTENT_PAUSE_REQUESTED:
- _this32.pauseContent()
- break
- case google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED:
- _this32.pollCountdown(), _this32.resumeContent()
- break
- case google.ima.AdEvent.Type.LOG:
- s.adError &&
- _this32.player.debug.warn(
- 'Non-fatal ad error: '.concat(s.adError.getMessage())
- )
- }
- }),
- _defineProperty$1(this, 'onAdError', function (e) {
- _this32.cancel(), _this32.player.debug.warn('Ads error', e)
- }),
- _defineProperty$1(this, 'listeners', function () {
- var e = _this32.player.elements.container
- var t
- _this32.player.on('canplay', function () {
- _this32.addCuePoints()
- }),
- _this32.player.on('ended', function () {
- _this32.loader.contentComplete()
- }),
- _this32.player.on('timeupdate', function () {
- t = _this32.player.currentTime
- }),
- _this32.player.on('seeked', function () {
- var e = _this32.player.currentTime
- is.empty(_this32.cuePoints) ||
- _this32.cuePoints.forEach(function (i, s) {
- t < i &&
- i < e &&
- (_this32.manager.discardAdBreak(),
- _this32.cuePoints.splice(s, 1))
- })
- }),
- window.addEventListener('resize', function () {
- _this32.manager &&
- _this32.manager.resize(
- e.offsetWidth,
- e.offsetHeight,
- google.ima.ViewMode.NORMAL
- )
- })
- }),
- _defineProperty$1(this, 'play', function () {
- var e = _this32.player.elements.container
- _this32.managerPromise || _this32.resumeContent(),
- _this32.managerPromise
- .then(function () {
- _this32.manager.setVolume(_this32.player.volume),
- _this32.elements.displayContainer.initialize()
- try {
- _this32.initialized ||
- (_this32.manager.init(
- e.offsetWidth,
- e.offsetHeight,
- google.ima.ViewMode.NORMAL
- ),
- _this32.manager.start()),
- (_this32.initialized = !0)
- } catch (e) {
- _this32.onAdError(e)
- }
- })
- .catch(function () {})
- }),
- _defineProperty$1(this, 'resumeContent', function () {
- ;(_this32.elements.container.style.zIndex = ''),
- (_this32.playing = !1),
- silencePromise(_this32.player.media.play())
- }),
- _defineProperty$1(this, 'pauseContent', function () {
- ;(_this32.elements.container.style.zIndex = 3),
- (_this32.playing = !0),
- _this32.player.media.pause()
- }),
- _defineProperty$1(this, 'cancel', function () {
- _this32.initialized && _this32.resumeContent(),
- _this32.trigger('error'),
- _this32.loadAds()
- }),
- _defineProperty$1(this, 'loadAds', function () {
- _this32.managerPromise
- .then(function () {
- _this32.manager && _this32.manager.destroy(),
- (_this32.managerPromise = new Promise(function (e) {
- _this32.on('loaded', e),
- _this32.player.debug.log(_this32.manager)
- })),
- (_this32.initialized = !1),
- _this32.requestAds()
- })
- .catch(function () {})
- }),
- _defineProperty$1(this, 'trigger', function (e) {
- for (
- var _len4 = arguments.length,
- t = new Array(_len4 > 1 ? _len4 - 1 : 0),
- _key4 = 1;
- _key4 < _len4;
- _key4++
- ) {
- t[_key4 - 1] = arguments[_key4]
- }
- var i = _this32.events[e]
- is.array(i) &&
- i.forEach(function (e) {
- is.function(e) && e.apply(_this32, t)
- })
- }),
- _defineProperty$1(this, 'on', function (e, t) {
- return (
- is.array(_this32.events[e]) || (_this32.events[e] = []),
- _this32.events[e].push(t),
- _this32
- )
- }),
- _defineProperty$1(this, 'startSafetyTimer', function (e, t) {
- _this32.player.debug.log(
- 'Safety timer invoked from: '.concat(t)
- ),
- (_this32.safetyTimer = setTimeout(function () {
- _this32.cancel(),
- _this32.clearSafetyTimer('startSafetyTimer()')
- }, e))
- }),
- _defineProperty$1(this, 'clearSafetyTimer', function (e) {
- is.nullOrUndefined(_this32.safetyTimer) ||
- (_this32.player.debug.log(
- 'Safety timer cleared from: '.concat(e)
- ),
- clearTimeout(_this32.safetyTimer),
- (_this32.safetyTimer = null))
- }),
- (this.player = e),
- (this.config = e.config.ads),
- (this.playing = !1),
- (this.initialized = !1),
- (this.elements = { container: null, displayContainer: null }),
- (this.manager = null),
- (this.loader = null),
- (this.cuePoints = null),
- (this.events = {}),
- (this.safetyTimer = null),
- (this.countdownTimer = null),
- (this.managerPromise = new Promise(function (e, t) {
- _this32.on('loaded', e), _this32.on('error', t)
- })),
- this.load()
- }
- _createClass2(Ads, [
- {
- key: 'enabled',
- get: function get() {
- var e = this.config
- return (
- this.player.isHTML5 &&
- this.player.isVideo &&
- e.enabled &&
- (!is.empty(e.publisherId) || is.url(e.tagUrl))
- )
- }
- },
- {
- key: 'tagUrl',
- get: function get() {
- var e = this.config
- if (is.url(e.tagUrl)) return e.tagUrl
- return 'https://go.aniview.com/api/adserver6/vast/?'.concat(
- buildUrlParams({
- AV_PUBLISHERID: '58c25bb0073ef448b1087ad6',
- AV_CHANNELID: '5a0458dc28a06145e4519d21',
- AV_URL: window.location.hostname,
- cb: Date.now(),
- AV_WIDTH: 640,
- AV_HEIGHT: 480,
- AV_CDIM2: e.publisherId
- })
- )
- }
- }
- ])
- return Ads
- })()
- function clamp() {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : 0
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : 0
- var i =
- arguments.length > 2 && arguments[2] !== undefined
- ? arguments[2]
- : 255
- return Math.min(Math.max(e, t), i)
- }
- var parseVtt = function parseVtt(e) {
- var t = []
- return (
- e.split(/\r\n\r\n|\n\n|\r\r/).forEach(function (e) {
- var i = {}
- e.split(/\r\n|\n|\r/).forEach(function (e) {
- if (is.number(i.startTime)) {
- if (!is.empty(e.trim()) && is.empty(i.text)) {
- var _t16, _t17, _t15$1$split, _t15$1$split2
- var _t15 = e.trim().split('#xywh=')
- ;((_t16 = _t15),
- (_t17 = _slicedToArray(_t16, 1)),
- (i.text = _t17[0]),
- _t16),
- _t15[1] &&
- ((_t15$1$split = _t15[1].split(',')),
- (_t15$1$split2 = _slicedToArray(_t15$1$split, 4)),
- (i.x = _t15$1$split2[0]),
- (i.y = _t15$1$split2[1]),
- (i.w = _t15$1$split2[2]),
- (i.h = _t15$1$split2[3]),
- _t15$1$split)
- }
- } else {
- var _t18 = e.match(
- /([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})( ?--> ?)([0-9]{2})?:?([0-9]{2}):([0-9]{2}).([0-9]{2,3})/
- )
- _t18 &&
- ((i.startTime =
- 60 * Number(_t18[1] || 0) * 60 +
- 60 * Number(_t18[2]) +
- Number(_t18[3]) +
- Number('0.'.concat(_t18[4]))),
- (i.endTime =
- 60 * Number(_t18[6] || 0) * 60 +
- 60 * Number(_t18[7]) +
- Number(_t18[8]) +
- Number('0.'.concat(_t18[9]))))
- }
- }),
- i.text && t.push(i)
- }),
- t
- )
- },
- fitRatio = function fitRatio(e, t) {
- var i = {}
- return (
- e > t.width / t.height
- ? ((i.width = t.width), (i.height = (1 / e) * t.width))
- : ((i.height = t.height), (i.width = e * t.height)),
- i
- )
- }
- var PreviewThumbnails = /*#__PURE__*/ (function () {
- function PreviewThumbnails(e) {
- var _this33 = this
- _classCallCheck2(this, PreviewThumbnails)
- _defineProperty$1(this, 'load', function () {
- _this33.player.elements.display.seekTooltip &&
- (_this33.player.elements.display.seekTooltip.hidden =
- _this33.enabled),
- _this33.enabled &&
- _this33.getThumbnails().then(function () {
- _this33.enabled &&
- (_this33.render(),
- _this33.determineContainerAutoSizing(),
- (_this33.loaded = !0))
- })
- }),
- _defineProperty$1(this, 'getThumbnails', function () {
- return new Promise(function (e) {
- var t = _this33.player.config.previewThumbnails.src
- if (is.empty(t))
- throw new Error(
- 'Missing previewThumbnails.src config attribute'
- )
- var i = function i() {
- _this33.thumbnails.sort(function (e, t) {
- return e.height - t.height
- }),
- _this33.player.debug.log(
- 'Preview thumbnails',
- _this33.thumbnails
- ),
- e()
- }
- if (is.function(t))
- t(function (e) {
- ;(_this33.thumbnails = e), i()
- })
- else {
- var _e27 = (is.string(t) ? [t] : t).map(function (e) {
- return _this33.getThumbnail(e)
- })
- Promise.all(_e27).then(i)
- }
- })
- }),
- _defineProperty$1(this, 'getThumbnail', function (e) {
- return new Promise(function (t) {
- fetch(e).then(function (i) {
- var s = {
- frames: parseVtt(i),
- height: null,
- urlPrefix: ''
- }
- s.frames[0].text.startsWith('/') ||
- s.frames[0].text.startsWith('http://') ||
- s.frames[0].text.startsWith('https://') ||
- (s.urlPrefix = e.substring(0, e.lastIndexOf('/') + 1))
- var n = new Image()
- ;(n.onload = function () {
- ;(s.height = n.naturalHeight),
- (s.width = n.naturalWidth),
- _this33.thumbnails.push(s),
- t()
- }),
- (n.src = s.urlPrefix + s.frames[0].text)
- })
- })
- }),
- _defineProperty$1(this, 'startMove', function (e) {
- if (
- _this33.loaded &&
- is.event(e) &&
- ['touchmove', 'mousemove'].includes(e.type) &&
- _this33.player.media.duration
- ) {
- if ('touchmove' === e.type)
- _this33.seekTime =
- _this33.player.media.duration *
- (_this33.player.elements.inputs.seek.value / 100)
- else {
- var t, i
- var s =
- _this33.player.elements.progress.getBoundingClientRect(),
- n = (100 / s.width) * (e.pageX - s.left)
- ;(_this33.seekTime =
- _this33.player.media.duration * (n / 100)),
- _this33.seekTime < 0 && (_this33.seekTime = 0),
- _this33.seekTime > _this33.player.media.duration - 1 &&
- (_this33.seekTime =
- _this33.player.media.duration - 1),
- (_this33.mousePosX = e.pageX),
- (_this33.elements.thumb.time.innerText = _formatTime(
- _this33.seekTime
- ))
- var r =
- null === (t = _this33.player.config.markers) ||
- void 0 === t ||
- null === (i = t.points) ||
- void 0 === i
- ? void 0
- : i.find(function (_ref18) {
- var e = _ref18.time
- return e === Math.round(_this33.seekTime)
- })
- r &&
- _this33.elements.thumb.time.insertAdjacentHTML(
- 'afterbegin',
- ''.concat(r.label, '<br>')
- )
- }
- _this33.showImageAtCurrentTime()
- }
- }),
- _defineProperty$1(this, 'endMove', function () {
- _this33.toggleThumbContainer(!1, !0)
- }),
- _defineProperty$1(this, 'startScrubbing', function (e) {
- ;(is.nullOrUndefined(e.button) ||
- !1 === e.button ||
- 0 === e.button) &&
- ((_this33.mouseDown = !0),
- _this33.player.media.duration &&
- (_this33.toggleScrubbingContainer(!0),
- _this33.toggleThumbContainer(!1, !0),
- _this33.showImageAtCurrentTime()))
- }),
- _defineProperty$1(this, 'endScrubbing', function () {
- ;(_this33.mouseDown = !1),
- Math.ceil(_this33.lastTime) ===
- Math.ceil(_this33.player.media.currentTime)
- ? _this33.toggleScrubbingContainer(!1)
- : once.call(
- _this33.player,
- _this33.player.media,
- 'timeupdate',
- function () {
- _this33.mouseDown ||
- _this33.toggleScrubbingContainer(!1)
- }
- )
- }),
- _defineProperty$1(this, 'listeners', function () {
- _this33.player.on('play', function () {
- _this33.toggleThumbContainer(!1, !0)
- }),
- _this33.player.on('seeked', function () {
- _this33.toggleThumbContainer(!1)
- }),
- _this33.player.on('timeupdate', function () {
- _this33.lastTime = _this33.player.media.currentTime
- })
- }),
- _defineProperty$1(this, 'render', function () {
- ;(_this33.elements.thumb.container = createElement('div', {
- class:
- _this33.player.config.classNames.previewThumbnails
- .thumbContainer
- })),
- (_this33.elements.thumb.imageContainer = createElement(
- 'div',
- {
- class:
- _this33.player.config.classNames.previewThumbnails
- .imageContainer
- }
- )),
- _this33.elements.thumb.container.appendChild(
- _this33.elements.thumb.imageContainer
- )
- var e = createElement('div', {
- class:
- _this33.player.config.classNames.previewThumbnails
- .timeContainer
- })
- ;(_this33.elements.thumb.time = createElement(
- 'span',
- {},
- '00:00'
- )),
- e.appendChild(_this33.elements.thumb.time),
- _this33.elements.thumb.imageContainer.appendChild(e),
- is.element(_this33.player.elements.progress) &&
- _this33.player.elements.progress.appendChild(
- _this33.elements.thumb.container
- ),
- (_this33.elements.scrubbing.container = createElement(
- 'div',
- {
- class:
- _this33.player.config.classNames.previewThumbnails
- .scrubbingContainer
- }
- )),
- _this33.player.elements.wrapper.appendChild(
- _this33.elements.scrubbing.container
- )
- }),
- _defineProperty$1(this, 'destroy', function () {
- _this33.elements.thumb.container &&
- _this33.elements.thumb.container.remove(),
- _this33.elements.scrubbing.container &&
- _this33.elements.scrubbing.container.remove()
- }),
- _defineProperty$1(this, 'showImageAtCurrentTime', function () {
- _this33.mouseDown
- ? _this33.setScrubbingContainerSize()
- : _this33.setThumbContainerSizeAndPos()
- var e = _this33.thumbnails[0].frames.findIndex(function (e) {
- return (
- _this33.seekTime >= e.startTime &&
- _this33.seekTime <= e.endTime
- )
- }),
- t = e >= 0
- var i = 0
- _this33.mouseDown || _this33.toggleThumbContainer(t),
- t &&
- (_this33.thumbnails.forEach(function (t, s) {
- _this33.loadedImages.includes(t.frames[e].text) &&
- (i = s)
- }),
- e !== _this33.showingThumb &&
- ((_this33.showingThumb = e), _this33.loadImage(i)))
- }),
- _defineProperty$1(this, 'loadImage', function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : 0
- var t = _this33.showingThumb,
- i = _this33.thumbnails[e],
- s = i.urlPrefix,
- n = i.frames[t],
- r = i.frames[t].text,
- a = s + r
- if (
- _this33.currentImageElement &&
- _this33.currentImageElement.dataset.filename === r
- )
- _this33.showImage(
- _this33.currentImageElement,
- n,
- e,
- t,
- r,
- !1
- ),
- (_this33.currentImageElement.dataset.index = t),
- _this33.removeOldImages(_this33.currentImageElement)
- else {
- _this33.loadingImage &&
- _this33.usingSprites &&
- (_this33.loadingImage.onload = null)
- var _i9 = new Image()
- ;(_i9.src = a),
- (_i9.dataset.index = t),
- (_i9.dataset.filename = r),
- (_this33.showingThumbFilename = r),
- _this33.player.debug.log('Loading image: '.concat(a)),
- (_i9.onload = function () {
- return _this33.showImage(_i9, n, e, t, r, !0)
- }),
- (_this33.loadingImage = _i9),
- _this33.removeOldImages(_i9)
- }
- }),
- _defineProperty$1(this, 'showImage', function (e, t, i, s, n) {
- var r =
- arguments.length > 5 && arguments[5] !== undefined
- ? arguments[5]
- : !0
- _this33.player.debug.log(
- 'Showing thumb: '
- .concat(n, '. num: ')
- .concat(s, '. qual: ')
- .concat(i, '. newimg: ')
- .concat(r)
- ),
- _this33.setImageSizeAndOffset(e, t),
- r &&
- (_this33.currentImageContainer.appendChild(e),
- (_this33.currentImageElement = e),
- _this33.loadedImages.includes(n) ||
- _this33.loadedImages.push(n)),
- _this33
- .preloadNearby(s, !0)
- .then(_this33.preloadNearby(s, !1))
- .then(_this33.getHigherQuality(i, e, t, n))
- }),
- _defineProperty$1(this, 'removeOldImages', function (e) {
- Array.from(_this33.currentImageContainer.children).forEach(
- function (t) {
- if ('img' !== t.tagName.toLowerCase()) return
- var i = _this33.usingSprites ? 500 : 1e3
- if (
- t.dataset.index !== e.dataset.index &&
- !t.dataset.deleting
- ) {
- t.dataset.deleting = !0
- var _e28 = _this33.currentImageContainer
- setTimeout(function () {
- _e28.removeChild(t),
- _this33.player.debug.log(
- 'Removing thumb: '.concat(t.dataset.filename)
- )
- }, i)
- }
- }
- )
- }),
- _defineProperty$1(this, 'preloadNearby', function (e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !0
- return new Promise(function (i) {
- setTimeout(function () {
- var s = _this33.thumbnails[0].frames[e].text
- if (_this33.showingThumbFilename === s) {
- var n
- n = t
- ? _this33.thumbnails[0].frames.slice(e)
- : _this33.thumbnails[0].frames.slice(0, e).reverse()
- var r = !1
- n.forEach(function (e) {
- var t = e.text
- if (t !== s && !_this33.loadedImages.includes(t)) {
- ;(r = !0),
- _this33.player.debug.log(
- 'Preloading thumb filename: '.concat(t)
- )
- var _e29 = _this33.thumbnails[0].urlPrefix,
- _s9 = _e29 + t,
- _n5 = new Image()
- ;(_n5.src = _s9),
- (_n5.onload = function () {
- _this33.player.debug.log(
- 'Preloaded thumb filename: '.concat(t)
- ),
- _this33.loadedImages.includes(t) ||
- _this33.loadedImages.push(t),
- i()
- })
- }
- }),
- r || i()
- }
- }, 300)
- })
- }),
- _defineProperty$1(
- this,
- 'getHigherQuality',
- function (e, t, i, s) {
- if (e < _this33.thumbnails.length - 1) {
- var n = t.naturalHeight
- _this33.usingSprites && (n = i.h),
- n < _this33.thumbContainerHeight &&
- setTimeout(function () {
- _this33.showingThumbFilename === s &&
- (_this33.player.debug.log(
- 'Showing higher quality thumb for: '.concat(s)
- ),
- _this33.loadImage(e + 1))
- }, 300)
- }
- }
- ),
- _defineProperty$1(this, 'toggleThumbContainer', function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- var i =
- _this33.player.config.classNames.previewThumbnails
- .thumbContainerShown
- _this33.elements.thumb.container.classList.toggle(i, e),
- !e &&
- t &&
- ((_this33.showingThumb = null),
- (_this33.showingThumbFilename = null))
- }),
- _defineProperty$1(
- this,
- 'toggleScrubbingContainer',
- function () {
- var e =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : !1
- var t =
- _this33.player.config.classNames.previewThumbnails
- .scrubbingContainerShown
- _this33.elements.scrubbing.container.classList.toggle(t, e),
- e ||
- ((_this33.showingThumb = null),
- (_this33.showingThumbFilename = null))
- }
- ),
- _defineProperty$1(
- this,
- 'determineContainerAutoSizing',
- function () {
- ;(_this33.elements.thumb.imageContainer.clientHeight > 20 ||
- _this33.elements.thumb.imageContainer.clientWidth > 20) &&
- (_this33.sizeSpecifiedInCSS = !0)
- }
- ),
- _defineProperty$1(
- this,
- 'setThumbContainerSizeAndPos',
- function () {
- var e = _this33.elements.thumb.imageContainer
- if (_this33.sizeSpecifiedInCSS) {
- if (e.clientHeight > 20 && e.clientWidth < 20) {
- var t = Math.floor(
- e.clientHeight * _this33.thumbAspectRatio
- )
- e.style.width = ''.concat(t, 'px')
- } else if (e.clientHeight < 20 && e.clientWidth > 20) {
- var _t19 = Math.floor(
- e.clientWidth / _this33.thumbAspectRatio
- )
- e.style.height = ''.concat(_t19, 'px')
- }
- } else {
- var _t20 = Math.floor(
- _this33.thumbContainerHeight * _this33.thumbAspectRatio
- )
- ;(e.style.height = ''.concat(
- _this33.thumbContainerHeight,
- 'px'
- )),
- (e.style.width = ''.concat(_t20, 'px'))
- }
- _this33.setThumbContainerPos()
- }
- ),
- _defineProperty$1(this, 'setThumbContainerPos', function () {
- var e =
- _this33.player.elements.progress.getBoundingClientRect(),
- t =
- _this33.player.elements.container.getBoundingClientRect(),
- i = _this33.elements.thumb.container,
- s = t.left - e.left + 10,
- n = t.right - e.left - i.clientWidth - 10,
- r = _this33.mousePosX - e.left - i.clientWidth / 2,
- a = clamp(r, s, n)
- ;(i.style.left = ''.concat(a, 'px')),
- i.style.setProperty('--preview-arrow-offset', r - a + 'px')
- }),
- _defineProperty$1(
- this,
- 'setScrubbingContainerSize',
- function () {
- var _fitRatio = fitRatio(_this33.thumbAspectRatio, {
- width: _this33.player.media.clientWidth,
- height: _this33.player.media.clientHeight
- }),
- e = _fitRatio.width,
- t = _fitRatio.height
- ;(_this33.elements.scrubbing.container.style.width =
- ''.concat(e, 'px')),
- (_this33.elements.scrubbing.container.style.height =
- ''.concat(t, 'px'))
- }
- ),
- _defineProperty$1(
- this,
- 'setImageSizeAndOffset',
- function (e, t) {
- if (!_this33.usingSprites) return
- var i = _this33.thumbContainerHeight / t.h
- ;(e.style.height = e.naturalHeight * i + 'px'),
- (e.style.width = e.naturalWidth * i + 'px'),
- (e.style.left = '-'.concat(t.x * i, 'px')),
- (e.style.top = '-'.concat(t.y * i, 'px'))
- }
- ),
- (this.player = e),
- (this.thumbnails = []),
- (this.loaded = !1),
- (this.lastMouseMoveTime = Date.now()),
- (this.mouseDown = !1),
- (this.loadedImages = []),
- (this.elements = { thumb: {}, scrubbing: {} }),
- this.load()
- }
- _createClass2(PreviewThumbnails, [
- {
- key: 'enabled',
- get: function get() {
- return (
- this.player.isHTML5 &&
- this.player.isVideo &&
- this.player.config.previewThumbnails.enabled
- )
- }
- },
- {
- key: 'currentImageContainer',
- get: function get() {
- return this.mouseDown
- ? this.elements.scrubbing.container
- : this.elements.thumb.imageContainer
- }
- },
- {
- key: 'usingSprites',
- get: function get() {
- return Object.keys(this.thumbnails[0].frames[0]).includes('w')
- }
- },
- {
- key: 'thumbAspectRatio',
- get: function get() {
- return this.usingSprites
- ? this.thumbnails[0].frames[0].w /
- this.thumbnails[0].frames[0].h
- : this.thumbnails[0].width / this.thumbnails[0].height
- }
- },
- {
- key: 'thumbContainerHeight',
- get: function get() {
- if (this.mouseDown) {
- var _fitRatio2 = fitRatio(this.thumbAspectRatio, {
- width: this.player.media.clientWidth,
- height: this.player.media.clientHeight
- }),
- e = _fitRatio2.height
- return e
- }
- return this.sizeSpecifiedInCSS
- ? this.elements.thumb.imageContainer.clientHeight
- : Math.floor(
- this.player.media.clientWidth /
- this.thumbAspectRatio /
- 4
- )
- }
- },
- {
- key: 'currentImageElement',
- get: function get() {
- return this.mouseDown
- ? this.currentScrubbingImageElement
- : this.currentThumbnailImageElement
- },
- set: function set(e) {
- this.mouseDown
- ? (this.currentScrubbingImageElement = e)
- : (this.currentThumbnailImageElement = e)
- }
- }
- ])
- return PreviewThumbnails
- })()
- var source = {
- insertElements: function insertElements(e, t) {
- var _this34 = this
- is.string(t)
- ? insertElement(e, this.media, { src: t })
- : is.array(t) &&
- t.forEach(function (t) {
- insertElement(e, _this34.media, t)
- })
- },
- change: function change(e) {
- var _this35 = this
- getDeep(e, 'sources.length')
- ? (html5.cancelRequests.call(this),
- this.destroy.call(
- this,
- function () {
- ;(_this35.options.quality = []),
- removeElement(_this35.media),
- (_this35.media = null),
- is.element(_this35.elements.container) &&
- _this35.elements.container.removeAttribute('class')
- var t = e.sources,
- i = e.type,
- _t21 = _slicedToArray(t, 1),
- _t21$ = _t21[0],
- _t21$$provider = _t21$.provider,
- s =
- _t21$$provider === void 0
- ? providers.html5
- : _t21$$provider,
- n = _t21$.src,
- r = 'html5' === s ? i : 'div',
- a = 'html5' === s ? {} : { src: n }
- Object.assign(_this35, {
- provider: s,
- type: i,
- supported: support.check(
- i,
- s,
- _this35.config.playsinline
- ),
- media: createElement(r, a)
- }),
- _this35.elements.container.appendChild(_this35.media),
- is.boolean(e.autoplay) &&
- (_this35.config.autoplay = e.autoplay),
- _this35.isHTML5 &&
- (_this35.config.crossorigin &&
- _this35.media.setAttribute('crossorigin', ''),
- _this35.config.autoplay &&
- _this35.media.setAttribute('autoplay', ''),
- is.empty(e.poster) || (_this35.poster = e.poster),
- _this35.config.loop.active &&
- _this35.media.setAttribute('loop', ''),
- _this35.config.muted &&
- _this35.media.setAttribute('muted', ''),
- _this35.config.playsinline &&
- _this35.media.setAttribute('playsinline', '')),
- ui.addStyleHook.call(_this35),
- _this35.isHTML5 &&
- source.insertElements.call(_this35, 'source', t),
- (_this35.config.title = e.title),
- media.setup.call(_this35),
- _this35.isHTML5 &&
- Object.keys(e).includes('tracks') &&
- source.insertElements.call(
- _this35,
- 'track',
- e.tracks
- ),
- (_this35.isHTML5 ||
- (_this35.isEmbed && !_this35.supported.ui)) &&
- ui.build.call(_this35),
- _this35.isHTML5 && _this35.media.load(),
- is.empty(e.previewThumbnails) ||
- (Object.assign(
- _this35.config.previewThumbnails,
- e.previewThumbnails
- ),
- _this35.previewThumbnails &&
- _this35.previewThumbnails.loaded &&
- (_this35.previewThumbnails.destroy(),
- (_this35.previewThumbnails = null)),
- _this35.config.previewThumbnails.enabled &&
- (_this35.previewThumbnails = new PreviewThumbnails(
- _this35
- ))),
- _this35.fullscreen.update()
- },
- !0
- ))
- : this.debug.warn('Invalid source format')
- }
- }
- var Plyr = /*#__PURE__*/ (function () {
- function Plyr(e, t) {
- var _this36 = this
- _classCallCheck2(this, Plyr)
- if (
- (_defineProperty$1(this, 'play', function () {
- return is.function(_this36.media.play)
- ? (_this36.ads &&
- _this36.ads.enabled &&
- _this36.ads.managerPromise
- .then(function () {
- return _this36.ads.play()
- })
- .catch(function () {
- return silencePromise(_this36.media.play())
- }),
- _this36.media.play())
- : null
- }),
- _defineProperty$1(this, 'pause', function () {
- return _this36.playing && is.function(_this36.media.pause)
- ? _this36.media.pause()
- : null
- }),
- _defineProperty$1(this, 'togglePlay', function (e) {
- return (is.boolean(e) ? e : !_this36.playing)
- ? _this36.play()
- : _this36.pause()
- }),
- _defineProperty$1(this, 'stop', function () {
- _this36.isHTML5
- ? (_this36.pause(), _this36.restart())
- : is.function(_this36.media.stop) && _this36.media.stop()
- }),
- _defineProperty$1(this, 'restart', function () {
- _this36.currentTime = 0
- }),
- _defineProperty$1(this, 'rewind', function (e) {
- _this36.currentTime -= is.number(e)
- ? e
- : _this36.config.seekTime
- }),
- _defineProperty$1(this, 'forward', function (e) {
- _this36.currentTime += is.number(e)
- ? e
- : _this36.config.seekTime
- }),
- _defineProperty$1(this, 'increaseVolume', function (e) {
- var t = _this36.media.muted ? 0 : _this36.volume
- _this36.volume = t + (is.number(e) ? e : 0)
- }),
- _defineProperty$1(this, 'decreaseVolume', function (e) {
- _this36.increaseVolume(-e)
- }),
- _defineProperty$1(this, 'airplay', function () {
- support.airplay &&
- _this36.media.webkitShowPlaybackTargetPicker()
- }),
- _defineProperty$1(this, 'toggleControls', function (e) {
- if (_this36.supported.ui && !_this36.isAudio) {
- var _t22 = hasClass(
- _this36.elements.container,
- _this36.config.classNames.hideControls
- ),
- _i10 = void 0 === e ? void 0 : !e,
- _s10 = toggleClass(
- _this36.elements.container,
- _this36.config.classNames.hideControls,
- _i10
- )
- if (
- (_s10 &&
- is.array(_this36.config.controls) &&
- _this36.config.controls.includes('settings') &&
- !is.empty(_this36.config.settings) &&
- controls.toggleMenu.call(_this36, !1),
- _s10 !== _t22)
- ) {
- var _e30 = _s10 ? 'controlshidden' : 'controlsshown'
- triggerEvent.call(_this36, _this36.media, _e30)
- }
- return !_s10
- }
- return !1
- }),
- _defineProperty$1(this, 'on', function (e, t) {
- on.call(_this36, _this36.elements.container, e, t)
- }),
- _defineProperty$1(this, 'once', function (e, t) {
- once.call(_this36, _this36.elements.container, e, t)
- }),
- _defineProperty$1(this, 'off', function (e, t) {
- off(_this36.elements.container, e, t)
- }),
- _defineProperty$1(this, 'destroy', function (e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : !1
- if (!_this36.ready) return
- var i = function i() {
- ;(document.body.style.overflow = ''),
- (_this36.embed = null),
- t
- ? (Object.keys(_this36.elements).length &&
- (removeElement(_this36.elements.buttons.play),
- removeElement(_this36.elements.captions),
- removeElement(_this36.elements.controls),
- removeElement(_this36.elements.wrapper),
- (_this36.elements.buttons.play = null),
- (_this36.elements.captions = null),
- (_this36.elements.controls = null),
- (_this36.elements.wrapper = null)),
- is.function(e) && e())
- : (unbindListeners.call(_this36),
- html5.cancelRequests.call(_this36),
- replaceElement(
- _this36.elements.original,
- _this36.elements.container
- ),
- triggerEvent.call(
- _this36,
- _this36.elements.original,
- 'destroyed',
- !0
- ),
- is.function(e) && e.call(_this36.elements.original),
- (_this36.ready = !1),
- setTimeout(function () {
- ;(_this36.elements = null), (_this36.media = null)
- }, 200))
- }
- _this36.stop(),
- clearTimeout(_this36.timers.loading),
- clearTimeout(_this36.timers.controls),
- clearTimeout(_this36.timers.resized),
- _this36.isHTML5
- ? (ui.toggleNativeControls.call(_this36, !0), i())
- : _this36.isYouTube
- ? (clearInterval(_this36.timers.buffering),
- clearInterval(_this36.timers.playing),
- null !== _this36.embed &&
- is.function(_this36.embed.destroy) &&
- _this36.embed.destroy(),
- i())
- : _this36.isVimeo &&
- (null !== _this36.embed &&
- _this36.embed.unload().then(i),
- setTimeout(i, 200))
- }),
- _defineProperty$1(this, 'supports', function (e) {
- return support.mime.call(_this36, e)
- }),
- (this.timers = {}),
- (this.ready = !1),
- (this.loading = !1),
- (this.failed = !1),
- (this.touch = support.touch),
- (this.media = e),
- is.string(this.media) &&
- (this.media = document.querySelectorAll(this.media)),
- ((window.jQuery && this.media instanceof jQuery) ||
- is.nodeList(this.media) ||
- is.array(this.media)) &&
- (this.media = this.media[0]),
- (this.config = extend(
- {},
- defaults,
- Plyr.defaults,
- t || {},
- (function () {
- try {
- return JSON.parse(
- _this36.media.getAttribute('data-plyr-config')
- )
- } catch (e) {
- return {}
- }
- })()
- )),
- (this.elements = {
- container: null,
- fullscreen: null,
- captions: null,
- buttons: {},
- display: {},
- progress: {},
- inputs: {},
- settings: { popup: null, menu: null, panels: {}, buttons: {} }
- }),
- (this.captions = {
- active: null,
- currentTrack: -1,
- meta: new WeakMap()
- }),
- (this.fullscreen = { active: !1 }),
- (this.options = { speed: [], quality: [] }),
- (this.debug = new Console(this.config.debug)),
- this.debug.log('Config', this.config),
- this.debug.log('Support', support),
- is.nullOrUndefined(this.media) || !is.element(this.media))
- )
- return void this.debug.error(
- 'Setup failed: no suitable element passed'
- )
- if (this.media.plyr)
- return void this.debug.warn('Target already setup')
- if (!this.config.enabled)
- return void this.debug.error('Setup failed: disabled by config')
- if (!support.check().api)
- return void this.debug.error('Setup failed: no support')
- var i = this.media.cloneNode(!0)
- ;(i.autoplay = !1), (this.elements.original = i)
- var s = this.media.tagName.toLowerCase()
- var n = null,
- r = null
- switch (s) {
- case 'div':
- if (
- ((n = this.media.querySelector('iframe')), is.element(n))
- ) {
- if (
- ((r = parseUrl(n.getAttribute('src'))),
- (this.provider = getProviderByUrl(r.toString())),
- (this.elements.container = this.media),
- (this.media = n),
- (this.elements.container.className = ''),
- r.search.length)
- ) {
- var _e31 = ['1', 'true']
- _e31.includes(r.searchParams.get('autoplay')) &&
- (this.config.autoplay = !0),
- _e31.includes(r.searchParams.get('loop')) &&
- (this.config.loop.active = !0),
- this.isYouTube
- ? ((this.config.playsinline = _e31.includes(
- r.searchParams.get('playsinline')
- )),
- (this.config.youtube.hl = r.searchParams.get('hl')))
- : (this.config.playsinline = !0)
- }
- } else
- (this.provider = this.media.getAttribute(
- this.config.attributes.embed.provider
- )),
- this.media.removeAttribute(
- this.config.attributes.embed.provider
- )
- if (
- is.empty(this.provider) ||
- !Object.values(providers).includes(this.provider)
- )
- return void this.debug.error(
- 'Setup failed: Invalid provider'
- )
- this.type = types.video
- break
- case 'video':
- case 'audio':
- ;(this.type = s),
- (this.provider = providers.html5),
- this.media.hasAttribute('crossorigin') &&
- (this.config.crossorigin = !0),
- this.media.hasAttribute('autoplay') &&
- (this.config.autoplay = !0),
- (this.media.hasAttribute('playsinline') ||
- this.media.hasAttribute('webkit-playsinline')) &&
- (this.config.playsinline = !0),
- this.media.hasAttribute('muted') &&
- (this.config.muted = !0),
- this.media.hasAttribute('loop') &&
- (this.config.loop.active = !0)
- break
- default:
- return void this.debug.error('Setup failed: unsupported type')
- }
- ;(this.supported = support.check(
- this.type,
- this.provider,
- this.config.playsinline
- )),
- this.supported.api
- ? ((this.eventListeners = []),
- (this.listeners = new Listeners(this)),
- (this.storage = new Storage(this)),
- (this.media.plyr = this),
- is.element(this.elements.container) ||
- ((this.elements.container = createElement('div', {
- tabindex: 0
- })),
- wrap(this.media, this.elements.container)),
- ui.migrateStyles.call(this),
- ui.addStyleHook.call(this),
- media.setup.call(this),
- this.config.debug &&
- on.call(
- this,
- this.elements.container,
- this.config.events.join(' '),
- function (e) {
- _this36.debug.log('event: '.concat(e.type))
- }
- ),
- (this.fullscreen = new Fullscreen(this)),
- (this.isHTML5 || (this.isEmbed && !this.supported.ui)) &&
- ui.build.call(this),
- this.listeners.container(),
- this.listeners.global(),
- this.config.ads.enabled && (this.ads = new Ads(this)),
- this.isHTML5 &&
- this.config.autoplay &&
- this.once('canplay', function () {
- return silencePromise(_this36.play())
- }),
- (this.lastSeekTime = 0),
- this.config.previewThumbnails.enabled &&
- (this.previewThumbnails = new PreviewThumbnails(this)))
- : this.debug.error('Setup failed: no support')
- }
- _createClass2(
- Plyr,
- [
- {
- key: 'isHTML5',
- get: function get() {
- return this.provider === providers.html5
- }
- },
- {
- key: 'isEmbed',
- get: function get() {
- return this.isYouTube || this.isVimeo
- }
- },
- {
- key: 'isYouTube',
- get: function get() {
- return this.provider === providers.youtube
- }
- },
- {
- key: 'isVimeo',
- get: function get() {
- return this.provider === providers.vimeo
- }
- },
- {
- key: 'isVideo',
- get: function get() {
- return this.type === types.video
- }
- },
- {
- key: 'isAudio',
- get: function get() {
- return this.type === types.audio
- }
- },
- {
- key: 'playing',
- get: function get() {
- return Boolean(this.ready && !this.paused && !this.ended)
- }
- },
- {
- key: 'paused',
- get: function get() {
- return Boolean(this.media.paused)
- }
- },
- {
- key: 'stopped',
- get: function get() {
- return Boolean(this.paused && 0 === this.currentTime)
- }
- },
- {
- key: 'ended',
- get: function get() {
- return Boolean(this.media.ended)
- }
- },
- {
- key: 'currentTime',
- get: function get() {
- return Number(this.media.currentTime)
- },
- set: function set(e) {
- if (!this.duration) return
- var t = is.number(e) && e > 0
- ;(this.media.currentTime = t
- ? Math.min(e, this.duration)
- : 0),
- this.debug.log(
- 'Seeking to '.concat(this.currentTime, ' seconds')
- )
- }
- },
- {
- key: 'buffered',
- get: function get() {
- var e = this.media.buffered
- return is.number(e)
- ? e
- : e && e.length && this.duration > 0
- ? e.end(0) / this.duration
- : 0
- }
- },
- {
- key: 'seeking',
- get: function get() {
- return Boolean(this.media.seeking)
- }
- },
- {
- key: 'duration',
- get: function get() {
- var e = parseFloat(this.config.duration),
- t = (this.media || {}).duration,
- i = is.number(t) && t !== 1 / 0 ? t : 0
- return e || i
- }
- },
- {
- key: 'volume',
- get: function get() {
- return Number(this.media.volume)
- },
- set: function set(e) {
- var _this$config2
- var t = e
- is.string(t) && (t = Number(t)),
- is.number(t) || (t = this.storage.get('volume')),
- is.number(t) ||
- ((_this$config2 = this.config),
- (t = _this$config2.volume),
- _this$config2),
- t > 1 && (t = 1),
- t < 0 && (t = 0),
- (this.config.volume = t),
- (this.media.volume = t),
- !is.empty(e) && this.muted && t > 0 && (this.muted = !1)
- }
- },
- {
- key: 'muted',
- get: function get() {
- return Boolean(this.media.muted)
- },
- set: function set(e) {
- var t = e
- is.boolean(t) || (t = this.storage.get('muted')),
- is.boolean(t) || (t = this.config.muted),
- (this.config.muted = t),
- (this.media.muted = t)
- }
- },
- {
- key: 'hasAudio',
- get: function get() {
- return (
- !this.isHTML5 ||
- !!this.isAudio ||
- Boolean(this.media.mozHasAudio) ||
- Boolean(this.media.webkitAudioDecodedByteCount) ||
- Boolean(
- this.media.audioTracks && this.media.audioTracks.length
- )
- )
- }
- },
- {
- key: 'speed',
- get: function get() {
- return Number(this.media.playbackRate)
- },
- set: function set(e) {
- var _this37 = this
- var t = null
- is.number(e) && (t = e),
- is.number(t) || (t = this.storage.get('speed')),
- is.number(t) || (t = this.config.speed.selected)
- var i = this.minimumSpeed,
- s = this.maximumSpeed
- ;(t = clamp(t, i, s)),
- (this.config.speed.selected = t),
- setTimeout(function () {
- _this37.media && (_this37.media.playbackRate = t)
- }, 0)
- }
- },
- {
- key: 'minimumSpeed',
- get: function get() {
- return this.isYouTube
- ? Math.min.apply(
- Math,
- _toConsumableArray(this.options.speed)
- )
- : this.isVimeo
- ? 0.5
- : 0.0625
- }
- },
- {
- key: 'maximumSpeed',
- get: function get() {
- return this.isYouTube
- ? Math.max.apply(
- Math,
- _toConsumableArray(this.options.speed)
- )
- : this.isVimeo
- ? 2
- : 16
- }
- },
- {
- key: 'quality',
- get: function get() {
- return this.media.quality
- },
- set: function set(e) {
- var t = this.config.quality,
- i = this.options.quality
- if (!i.length) return
- var s = [
- !is.empty(e) && Number(e),
- this.storage.get('quality'),
- t.selected,
- t.default
- ].find(is.number),
- n = !0
- if (!i.includes(s)) {
- var _e32 = closest(i, s)
- this.debug.warn(
- 'Unsupported quality option: '
- .concat(s, ', using ')
- .concat(_e32, ' instead')
- ),
- (s = _e32),
- (n = !1)
- }
- ;(t.selected = s),
- (this.media.quality = s),
- n && this.storage.set({ quality: s })
- }
- },
- {
- key: 'loop',
- get: function get() {
- return Boolean(this.media.loop)
- },
- set: function set(e) {
- var t = is.boolean(e) ? e : this.config.loop.active
- ;(this.config.loop.active = t), (this.media.loop = t)
- }
- },
- {
- key: 'source',
- get: function get() {
- return this.media.currentSrc
- },
- set: function set(e) {
- source.change.call(this, e)
- }
- },
- {
- key: 'download',
- get: function get() {
- var e = this.config.urls.download
- return is.url(e) ? e : this.source
- },
- set: function set(e) {
- is.url(e) &&
- ((this.config.urls.download = e),
- controls.setDownloadUrl.call(this))
- }
- },
- {
- key: 'poster',
- get: function get() {
- return this.isVideo
- ? this.media.getAttribute('poster') ||
- this.media.getAttribute('data-poster')
- : null
- },
- set: function set(e) {
- this.isVideo
- ? ui.setPoster.call(this, e, !1).catch(function () {})
- : this.debug.warn('Poster can only be set for video')
- }
- },
- {
- key: 'ratio',
- get: function get() {
- if (!this.isVideo) return null
- var e = reduceAspectRatio(getAspectRatio.call(this))
- return is.array(e) ? e.join(':') : e
- },
- set: function set(e) {
- this.isVideo
- ? is.string(e) && validateAspectRatio(e)
- ? ((this.config.ratio = reduceAspectRatio(e)),
- setAspectRatio.call(this))
- : this.debug.error(
- 'Invalid aspect ratio specified ('.concat(e, ')')
- )
- : this.debug.warn(
- 'Aspect ratio can only be set for video'
- )
- }
- },
- {
- key: 'autoplay',
- get: function get() {
- return Boolean(this.config.autoplay)
- },
- set: function set(e) {
- this.config.autoplay = is.boolean(e)
- ? e
- : this.config.autoplay
- }
- },
- {
- key: 'toggleCaptions',
- value: function toggleCaptions(e) {
- captions.toggle.call(this, e, !1)
- }
- },
- {
- key: 'currentTrack',
- get: function get() {
- var _this$captions2 = this.captions,
- e = _this$captions2.toggled,
- t = _this$captions2.currentTrack
- return e ? t : -1
- },
- set: function set(e) {
- captions.set.call(this, e, !1), captions.setup.call(this)
- }
- },
- {
- key: 'language',
- get: function get() {
- return (captions.getCurrentTrack.call(this) || {}).language
- },
- set: function set(e) {
- captions.setLanguage.call(this, e, !1)
- }
- },
- {
- key: 'pip',
- get: function get() {
- return support.pip
- ? is.empty(this.media.webkitPresentationMode)
- ? this.media === document.pictureInPictureElement
- : this.media.webkitPresentationMode === pip.active
- : null
- },
- set: function set(e) {
- if (!support.pip) return
- var t = is.boolean(e) ? e : !this.pip
- is.function(this.media.webkitSetPresentationMode) &&
- this.media.webkitSetPresentationMode(
- t ? pip.active : pip.inactive
- ),
- is.function(this.media.requestPictureInPicture) &&
- (!this.pip && t
- ? this.media.requestPictureInPicture()
- : this.pip && !t && document.exitPictureInPicture())
- }
- },
- {
- key: 'setPreviewThumbnails',
- value: function setPreviewThumbnails(e) {
- this.previewThumbnails &&
- this.previewThumbnails.loaded &&
- (this.previewThumbnails.destroy(),
- (this.previewThumbnails = null)),
- Object.assign(this.config.previewThumbnails, e),
- this.config.previewThumbnails.enabled &&
- (this.previewThumbnails = new PreviewThumbnails(this))
- }
- }
- ],
- [
- {
- key: 'supported',
- value: function supported(e, t, i) {
- return support.check(e, t, i)
- }
- },
- {
- key: 'loadSprite',
- value: function loadSprite(e, t) {
- return _loadSprite(e, t)
- }
- },
- {
- key: 'setup',
- value: function setup(e) {
- var t =
- arguments.length > 1 && arguments[1] !== undefined
- ? arguments[1]
- : {}
- var i = null
- return (
- is.string(e)
- ? (i = Array.from(document.querySelectorAll(e)))
- : is.nodeList(e)
- ? (i = Array.from(e))
- : is.array(e) && (i = e.filter(is.element)),
- is.empty(i)
- ? null
- : i.map(function (e) {
- return new Plyr(e, t)
- })
- )
- }
- }
- ]
- )
- return Plyr
- })()
- Plyr.defaults = cloneDeep(defaults)
- var plyr = ''
- var iconVideoPlay =
- 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFIAAABSCAMAAADw8nOpAAAAAXNSR0IArs4c6QAAAapQTFRFAAAA////////////2NjY2dnZ9vb2////9vb23Nzc3d3d3t7e39/f////4+Pj4+Pj6+vr7Ozs5+fn6Ojo7u7u6enp6enp7+/v8fHx7Ozs8fHx7e3t7+/v8/Pz8PDw8/Pz9PT0+/v78PDw8PDw9PT09PT0////9fX1/Pz89fX19fX19fX18vLy/Pz89vb29vb2/Pz8+fn59/f3////9/f3+vr69/f3+vr6////+Pj4+/v7////+/v7+/v7+Pj4+fn5/////f39+/v7+/v7+/v7+fn5+/v7+/v7/f39////+/v7////+/v7/f39/Pz8/Pz8/////Pz8/////Pz8/f39/f39/Pz8/f39/v7+/Pz8/v7+/////Pz8/v7+/v7+/v7+/v7+/Pz8/v7+/////v7+/v7+/v7+/v7+/v7+/v7+/////v7+/v7+/v7+/////v7+/////v7+/v7+/////v7+/////v7+/////////////////v7+/////v7+/////////////v7+/////////////////////v7+////////////////////////lZ+FUgAAAI10Uk5TAAYSFRobGxscHR4fICMkJScpKywsLi8vNTY2OD5BQkJDQ0RGRkhISktMTlBRUlNVWFlbXF1gY29wcXJyc3R1d3p7fH+AgoSFhoaHj5CTlJWXmJifn6WoqKusr6+0tLi5ury/v8LDyMvMzdTV1tjY2trb3ODh4eLj5ejs7e3u7u/w8vT19vj5+vr7/P3+n1NMJwAAA5RJREFUWMO1metfEkEUhg86lrZZRBeVitJSsVIkKym7KFqYqJGXLiplCWUYBKllRiaQa7Lz/s998Bqyu7ML+37eeX47t3Pec4ZIR9VuX2gutpSW5fRSbC7kc1dTKaroHEtyFIgnxzorzPFs7VMbADLRCb/X5XRIksPp8vonohkAG1PtNsPAysFVIB8JtNawAtW0BiJ5YHWw0hDwaDALxAbqmIrqBmJANnhEfMq9OfDZNqaptlmOXK/g9Bvj4DNNTFdNMxzxRpFfHOFIeZiQPCnwEd0frZ2HPCQxQUlDMuZrtYkt61hsZgbUvIj1Fi1i1ybCdmZI9jA2u9SJPQpGmWGNQulRJULpZybUr0CF2aUo3cyUuhWl6NxbNtHPTKofm0X2qHbdzDrur+f6obNkm0eYlaAw5gvP/AgW7aUg7YsYKbjXXG5mJalZ5v/dd1sCQ6xEDSFxcOp9SEmlIqUU+g5E3Bz3sJLl4bn9mBzEDCuDZhDcyzNZrhpxT104Loxs4tndfDSIWbX1mdzCr8fHRJmzGNzZ7lWo5ZlhAMDna4LINqxub3o7YmrffN12A8qkQ4wZQzsREU1jQO2TH7sW4+ddIeQApomIKuR8nS4S+HBRAFmX36ggok5EmAASf5+d0GdG0ElEYwgIIYHvt3WRAYwRURKtgkjgbb0OshVJomqeqRFGIhfQPqQ1GV5Nbo2lPIwEEjd0FtNNPowbQoK/PKOBHIePQvAbQwJrD6pUR/gRojl4jSKBj5fVRngxRwtwGUdi6/nJ4iNcWKBlNJhAAis3i45owDKl4TCFRL6j2AgH0iRDMocsnvclyCUg36shTU8c99QmvgSnKWR+uOgIJ5YoZuoQ4dOV4iMuIWbuqP9+VKVx1E1cSP7qrOaFNBw28KVDI2xMwEduRA0h/2hXRVG4DYZgvDuvH4INJYqVOyKJwkA6Uw0/helMNOlqBMnCpCtoDdbuVwlbAyEDw1+cFjMwU3o269sOMX7dmM3SMIOvt5P3E0GHuWcGNSzruTiAN/VMUHuWVctYS7ceXjVjrC2w/1YUKdRbnlKq92DBFy9HwRe3WVuWWlE8W1HiW9CIsKJdYkVTx4rWkxUNMivaeFY0G61oiVrRuCWixoR4eznRKNgE7xNtgveJvwEcKXernoio8mmZHxS2nz2mZQCZyLjf62pwSJKjweX1j0cyAORpE88eljzOHHxCWlhOy3J6eUHoCekfdmynrwwsFL4AAAAASUVORK5CYII='
- var ColVideo = exports(
- 'C',
- defineComponent({
- name: 'col-video',
- props: {
- trySee: {
- // 是否试看
- type: Boolean,
- default: false
- },
- freeTitleStatus: { type: Boolean, default: true }, // 试看比例
- freeRate: { type: Number, default: 100 },
- setting: { type: Object, default: function _default() {} },
- controls: Boolean,
- height: String,
- src: { type: String, default: '' },
- poster: { type: String, default: '' },
- styleValue: {
- type: Object,
- default: function _default() {
- return {}
- }
- },
- preload: { type: String, default: 'auto' },
- currentTime: { type: Boolean, default: true },
- playsinline: { type: Boolean, default: true },
- onPlay: { type: Function, default: function _default() {} }
- },
- data: function data() {
- return {
- player: null, // playTime: 0,
- loading: true, // 首次进入加载中
- trySeeOver: false, // 试看是否结束
- showSeeStatus: true // 是否显示试看状态
- }
- },
- mounted: function mounted() {
- var _this38 = this
- this._init()
- listenerMessage('setVideoPlayer', function (result) {
- var content =
- result === null || result === void 0
- ? void 0
- : result.content
- if (content.status === 'pause') {
- _this38.player.pause()
- }
- })
- },
- computed: {
- computedSeeStatus: function computedSeeStatus() {
- console.log(
- this.showSeeStatus,
- this.trySee,
- this.trySeeOver,
- 'this.showSeeStatus, this.trySee'
- )
- return this.showSeeStatus && this.trySee
- },
- playTime: function playTime() {
- // 允许播放时间
- var player = this.player
- var playTime = (player.duration * this.freeRate) / 100
- return playTime || 0
- }
- },
- methods: {
- _init: function _init() {
- var _this39 = this // controls: [
- // 'play-large' , // 中间的大播放按钮
- // 'restart' , // 重新开始播放
- // 'rewind' , // 按寻道时间倒带(默认 10 秒)
- // 'play' , // 播放/暂停播放
- // 'fast-forward' , // 快进查找时间(默认 10 秒)
- // 'progress' , // 播放和缓冲的进度条和滑动条
- // 'current-time' , // 播放的当前时间
- // ' duration' , // 媒体的完整持续时间
- // 'mute' , // 切换静音
- // 'volume', // 音量控制
- // 'captions' , // 切换字幕
- // 'settings' , // 设置菜单
- // 'pip' , // 画中画(当前仅 Safari)
- // 'airplay' , // Airplay(当前仅 Safari)
- // 'download ' , // 显示一个下载按钮,其中包含指向当前源或您在选项中指定的自定义 URL 的链接
- // 'fullscreen' , // 切换全屏
- // ] ;
- var controls = [
- 'play-large',
- 'play',
- 'progress',
- 'captions',
- 'fullscreen'
- ]
- if (this.currentTime) {
- controls.push('current-time')
- }
- var params = _objectSpread(
- _objectSpread({ controls: controls }, this.setting),
- {},
- { invertTime: false }
- )
- if (browser$1().iPhone) {
- params.fullscreen = {
- enabled: true,
- fallback: 'force',
- iosNative: true
- }
- }
- this.player = new Plyr(this.$refs.video, params) // fullscreen: {
- // enabled: true,
- // fallback: 'force',
- // iosNative: true
- // }
- this.player.elements.container
- ? (this.player.elements.container.style.height =
- this.height || '210px')
- : null
- if (this.preload === 'none') {
- this.loading = false
- }
- this.player.on('loadedmetadata', function () {
- _this39.loading = false
- console.log('loading 1111')
- if (_this39.trySee) {
- _this39.domPlayVisibility()
- } else {
- _this39.domPlayVisibility(false)
- } // 监听播放事件
- var _this = _this39
- _this39.player.on('timeupdate', function () {
- var players = _this.player
- if (
- players.currentTime >= _this39.playTime &&
- _this.trySee
- ) {
- players.pause()
- _this.trySeeOver = true
- _this.showSeeStatus = true
- _this.domPlayVisibility() // 试看结束后隐藏播放按钮
- }
- })
- })
- this.player.on('play', function () {
- postMessage(
- { api: 'getDeviceStatus', content: { type: 'video' } },
- function (res) {
- // 判断是否在录屏中, 如果在录屏则不允许播放
- if (res.content.status == '1') {
- Toast('为了保证数据安全,请不要录屏')
- _this39.player.pause()
- }
- }
- )
- _this39.onPlay && _this39.onPlay()
- })
- this.player.on('enterfullscreen', function () {
- console.log('fullscreen')
- var i = document.createElement('i')
- i.id = 'fullscreen-back'
- i.className = 'van-icon van-icon-arrow-left video-back'
- i.addEventListener('click', function () {
- _this39.player.fullscreen.exit()
- })
- console.log(document.getElementsByClassName('plyr'))
- document.getElementsByClassName('plyr')[0].appendChild(i)
- })
- this.player.on('exitfullscreen', function () {
- console.log('exitfullscreen')
- var i = document.getElementById('fullscreen-back')
- i && i.remove()
- })
- }, // 操作功能
- domPlayVisibility: function domPlayVisibility() {
- var hide =
- arguments.length > 0 && arguments[0] !== undefined
- ? arguments[0]
- : true
- var controls = document.querySelector('.plyr__controls')
- var controls2 = document.querySelector(
- '.plyr__control--overlaid'
- )
- if (hide) {
- controls === null || controls === void 0
- ? void 0
- : controls.setAttribute('style', 'display:none')
- controls2 === null || controls2 === void 0
- ? void 0
- : controls2.setAttribute('style', 'display:none')
- } else {
- controls === null || controls === void 0
- ? void 0
- : controls.removeAttribute('style')
- setTimeout(function () {
- controls2 === null || controls2 === void 0
- ? void 0
- : controls2.removeAttribute('style')
- }, 200)
- }
- },
- onClickPlay: function onClickPlay() {
- this.player.play()
- this.domPlayVisibility(false)
- this.showSeeStatus = false
- },
- onBuy: function onBuy() {
- this.$router.back()
- },
- onReplay: function onReplay() {
- this.player.restart()
- this.player.play()
- this.domPlayVisibility(false)
- this.trySeeOver = false
- this.showSeeStatus = false
- }
- },
- unmounted: function unmounted() {
- var _this$player
- ;(_this$player = this.player) === null ||
- _this$player === void 0
- ? void 0
- : _this$player.destroy()
- },
- render: function render() {
- var _this40 = this
- return createVNode(
- 'div',
- { class: styles['video-container'] },
- [
- createVNode(
- 'video',
- {
- ref: 'video',
- class: styles['video'],
- src: this.src,
- playsinline: this.playsinline,
- poster: this.poster,
- preload: this.preload,
- style: _objectSpread({}, this.styleValue)
- },
- null
- ),
- this.loading &&
- createVNode(
- 'div',
- {
- class: styles.loadingVideo,
- style: { height: this.height || '210px' }
- },
- [
- createVNode(
- Loading,
- {
- size: 36,
- color: '#01C1B5',
- vertical: true,
- style: {
- height: '100%',
- justifyContent: 'center'
- }
- },
- {
- default: function _default() {
- return [
- createTextVNode('\u52A0\u8F7D\u4E2D...')
- ]
- }
- }
- )
- ]
- ),
- this.trySee &&
- this.computedSeeStatus &&
- !this.loading &&
- createVNode(
- 'div',
- {
- class: [styles.loadingVideo, styles.playOver],
- style: { height: this.height || '210px' }
- },
- [
- !this.trySeeOver
- ? createVNode(Fragment, null, [
- createVNode(
- Icon,
- {
- name: iconVideoPlay,
- size: 50,
- onClick: this.onClickPlay
- },
- null
- ),
- createVNode('p', { class: styles.freeTxt }, [
- createTextVNode('\u514D\u8D39'),
- this.freeTitleStatus ? '试看' : '领取'
- ])
- ])
- : createVNode(Fragment, null, [
- createVNode('p', { class: styles.tips }, [
- this.freeTitleStatus
- ? '免费试看结束,购买完整课程后继续学习'
- : '试看结束,领取课程后继续学习'
- ]),
- createVNode(
- Button,
- {
- class: styles.btn,
- type: 'primary',
- round: true,
- size: 'small',
- onClick: this.onBuy
- },
- {
- default: function _default() {
- return [
- state.platformType === 'STUDENT'
- ? _this40.freeTitleStatus
- ? '立即购买'
- : '免费领取'
- : '返回'
- ]
- }
- }
- ),
- createVNode(
- 'div',
- {
- class: styles.replay,
- onClick: this.onReplay
- },
- [
- createVNode(
- Icon,
- {
- name: 'replay',
- style: { marginRight: '5px' },
- size: 16
- },
- null
- ),
- createTextVNode('\u91CD\u64AD')
- ]
- )
- ])
- ]
- )
- ]
- )
- }
- })
- )
- }
- }
- }
- )
- })()
|