mui-player.min.js 139 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450
  1. /*!
  2. * Mui Player Javascript Library v1.7.0
  3. * Date:2022-07-30
  4. * Released under GPL-3.0 license
  5. * https://muiplayer.js.org <svg viewBox="25 25 50 50"class="mplayer-loading__circular"><circle cx="50"cy="50"r="20"fill="none"></circle></svg>/
  6. */
  7. "use strict";
  8. function _toConsumableArray(e) {
  9. return (
  10. _arrayWithoutHoles(e) ||
  11. _iterableToArray(e) ||
  12. _unsupportedIterableToArray(e) ||
  13. _nonIterableSpread()
  14. );
  15. }
  16. function _nonIterableSpread() {
  17. throw new TypeError(
  18. "Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
  19. );
  20. }
  21. function _iterableToArray(e) {
  22. if (
  23. ("undefined" != typeof Symbol && null != e[Symbol.iterator]) ||
  24. null != e["@@iterator"]
  25. )
  26. return Array.from(e);
  27. }
  28. function _arrayWithoutHoles(e) {
  29. if (Array.isArray(e)) return _arrayLikeToArray(e);
  30. }
  31. function _createForOfIteratorHelper(e, t) {
  32. var o =
  33. ("undefined" != typeof Symbol && e[Symbol.iterator]) || e["@@iterator"];
  34. if (!o) {
  35. if (
  36. Array.isArray(e) ||
  37. (o = _unsupportedIterableToArray(e)) ||
  38. (t && e && "number" == typeof e.length)
  39. ) {
  40. o && (e = o);
  41. var r = 0,
  42. t = function () { };
  43. return {
  44. s: t,
  45. n: function () {
  46. return r >= e.length
  47. ? { done: !0 }
  48. : { done: !1, value: e[r++] };
  49. },
  50. e: function (e) {
  51. throw e;
  52. },
  53. f: t,
  54. };
  55. }
  56. throw new TypeError(
  57. "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."
  58. );
  59. }
  60. var n,
  61. i = !0,
  62. l = !1;
  63. return {
  64. s: function () {
  65. o = o.call(e);
  66. },
  67. n: function () {
  68. var e = o.next();
  69. return (i = e.done), e;
  70. },
  71. e: function (e) {
  72. (l = !0), (n = e);
  73. },
  74. f: function () {
  75. try {
  76. i || null == o.return || o.return();
  77. } finally {
  78. if (l) throw n;
  79. }
  80. },
  81. };
  82. }
  83. function _unsupportedIterableToArray(e, t) {
  84. if (e) {
  85. if ("string" == typeof e) return _arrayLikeToArray(e, t);
  86. var o = Object.prototype.toString.call(e).slice(8, -1);
  87. return "Map" ===
  88. (o = "Object" === o && e.constructor ? e.constructor.name : o) ||
  89. "Set" === o
  90. ? Array.from(e)
  91. : "Arguments" === o ||
  92. /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)
  93. ? _arrayLikeToArray(e, t)
  94. : void 0;
  95. }
  96. }
  97. function _arrayLikeToArray(e, t) {
  98. (null == t || t > e.length) && (t = e.length);
  99. for (var o = 0, r = new Array(t); o < t; o++) r[o] = e[o];
  100. return r;
  101. }
  102. function _typeof(e) {
  103. return (_typeof =
  104. "function" == typeof Symbol && "symbol" == typeof Symbol.iterator
  105. ? function (e) {
  106. return typeof e;
  107. }
  108. : function (e) {
  109. return e &&
  110. "function" == typeof Symbol &&
  111. e.constructor === Symbol &&
  112. e !== Symbol.prototype
  113. ? "symbol"
  114. : typeof e;
  115. })(e);
  116. }
  117. !(function (e, t) {
  118. "object" ==
  119. ("undefined" == typeof exports ? "undefined" : _typeof(exports)) &&
  120. "object" == ("undefined" == typeof module ? "undefined" : _typeof(module))
  121. ? (module.exports = t())
  122. : "function" == typeof define && _typeof(define.amd)
  123. ? define(t)
  124. : (e.MuiPlayer = t());
  125. })(window, function () {
  126. var MuiPlayer = function MuiPlayer(config) {
  127. var _this = this;
  128. _this._global_ = {};
  129. var webpagePlugin = "",
  130. mobilePlugin = "",
  131. hls = null,
  132. flv = null,
  133. option = config || {},
  134. plugins = option.plugins || [];
  135. this._event_ = {};
  136. var con =
  137. "string" == typeof option.container
  138. ? document.querySelector(option.container)
  139. : option.container,
  140. $CONSTANT,
  141. $habit,
  142. $node,
  143. $global,
  144. element,
  145. $el,
  146. variable,
  147. $data,
  148. $method;
  149. con &&
  150. (($CONSTANT = {
  151. unitLengthReg:
  152. /^(auto|inherit|initial|\d+(\.\d+)?(\%|px|cm|mm|em|rem|vw|vh|)?)$/i,
  153. encodeKey: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ",
  154. }),
  155. ($habit = { themeColor: "#1e98d4" }),
  156. ($node = {
  157. video: '\x3c!-- HTML5 Video --\x3e<div class="video-wrapper"><video width="100%" height="100%"></video></div>',
  158. mplayerPoster:
  159. '<div class="mplayer-poster" id="mplayer-poster"></div>',
  160. mplayerCover:
  161. '\x3c!-- 媒体播放遮罩层 --\x3e<div class="mplayer-cover" id="mplayer-cover"></div>',
  162. mplayerLoading:
  163. '\x3c!-- Mplayer加载Loading --\x3e<div class="mplayer-loading"id="mplayer-loading"control> <img src="https://static.9169kkxstzsjkdd222.app/static/web/img/loading2.gif"> </div>',
  164. mplayerError:
  165. '\x3c!-- 视频加载错误显示 --\x3e<div class="mplayer-error"id="mplayer-error"control><div class="errop-tip">视频加载失败,点击刷新</div><svg t="1575125481608"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="5893"width="28"height="28"><path d="M513.34 831.74C337.03 831.74 193.6 688.31 193.6 512c0-71.09 23.31-138.85 65.53-194.03v51.61c0 17.67 14.33 32 32 32s32-14.33 32-32V239.45c0-5.87-1.59-11.36-4.34-16.09-0.06-0.1-0.11-0.2-0.17-0.3-0.16-0.28-0.34-0.55-0.51-0.82-0.13-0.2-0.26-0.41-0.39-0.61-0.08-0.13-0.17-0.25-0.26-0.37a35.5 35.5 0 0 0-1.58-2.13c-6.81-8.35-16.96-12.35-26.95-11.69h-130c-17.67 0-32 14.33-32 32s14.33 32 32 32h55.35C159.8 339 129.6 423.35 129.6 512c0 51.79 10.15 102.05 30.17 149.38 19.33 45.7 46.99 86.74 82.23 121.97 35.23 35.23 76.27 62.9 121.97 82.23 47.33 20.02 97.59 30.17 149.38 30.17 17.67 0 32-14.33 32-32s-14.34-32.01-32.01-32.01zM855.38 762.3h-51.23c19.81-23 36.93-48.3 50.75-75.22 27.6-53.74 42.18-114.28 42.18-175.08 0-51.79-10.15-102.05-30.17-149.38-19.33-45.7-46.99-86.73-82.23-121.97-35.23-35.23-76.27-62.9-121.97-82.23-47.33-20.02-97.59-30.17-149.38-30.17-17.67 0-32 14.33-32 32s14.33 32 32 32c176.31 0 319.74 143.44 319.74 319.74 0 78.31-27.68 151.61-77.6 209.05l0.24-56.04c0.08-17.67-14.19-32.06-31.86-32.14h-0.14c-17.61 0-31.92 14.24-32 31.86l-0.55 129.43a31.988 31.988 0 0 0 9.32 22.71 31.68 31.68 0 0 0 5.33 4.3c0.02 0.01 0.04 0.02 0.06 0.04 0.48 0.31 0.97 0.61 1.47 0.89l0.15 0.09c0.5 0.28 1 0.54 1.51 0.8 0.03 0.01 0.05 0.03 0.08 0.04 1.64 0.8 3.34 1.46 5.1 1.98 0.01 0 0.02 0.01 0.03 0.01 0.55 0.16 1.1 0.3 1.66 0.43 0.07 0.02 0.15 0.03 0.22 0.05 0.5 0.11 1 0.21 1.5 0.3 0.1 0.02 0.2 0.04 0.3 0.05 0.48 0.08 0.96 0.15 1.44 0.21 0.11 0.01 0.23 0.03 0.34 0.04 0.48 0.05 0.95 0.09 1.43 0.12l0.34 0.03c0.53 0.03 1.07 0.04 1.61 0.05h132.31c17.67 0 32-14.33 32-32s-14.31-31.99-31.98-31.99z"p-id="5894"fill="#ffffff"></path></svg></div>',
  166. // mplayerHeader:
  167. // '\x3c!-- Mplayer 顶部导航 --\x3e<div class="mplayer-header"id="mplayer-header"><div class="title-groupt"id="title-groupt"><button class="player-btn header-control back-button keyboard-input"id="back-button"control><svg id="back-icon-svg"t="1573891955387"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="4550"width="18"height="18"><path d="M305.519192 557.640404c-11.636364 0-23.40202-4.39596-32.323232-13.317172-17.842424-17.842424-17.842424-46.674747 0-64.517171L683.830303 69.30101c17.842424-17.842424 46.674747-17.842424 64.517172 0 17.842424 17.842424 17.842424 46.674747 0 64.517172L337.713131 544.323232c-8.921212 8.921212-20.557576 13.317172-32.193939 13.317172z m0 0"fill="#ffffff"p-id="4551"></path><path d="M715.894949 968.145455c-11.636364 0-23.40202-4.39596-32.323232-13.317172L273.19596 544.323232c-17.842424-17.842424-17.842424-46.674747 0-64.517171 17.842424-17.842424 46.674747-17.842424 64.517171 0l410.505051 410.50505c17.842424 17.842424 17.842424 46.674747 0 64.517172-8.921212 8.921212-20.557576 13.317172-32.323233 13.317172z m0 0"fill="#ffffff"p-id="4552"></path></svg><div class="title-name"id="title-name"></div></button></div><div class="buttom-group"id="buttom-group"></div></div>',
  168. mplayerHeader:
  169. '\x3c!-- Mplayer 顶部导航 --\x3e<div class="mplayer-header"id="mplayer-header"><div class="title-groupt"id="title-groupt"><path d="M305.519192 557.640404c-11.636364 0-23.40202-4.39596-32.323232-13.317172-17.842424-17.842424-17.842424-46.674747 0-64.517171L683.830303 69.30101c17.842424-17.842424 46.674747-17.842424 64.517172 0 17.842424 17.842424 17.842424 46.674747 0 64.517172L337.713131 544.323232c-8.921212 8.921212-20.557576 13.317172-32.193939 13.317172z m0 0"fill="#ffffff"p-id="4551"></path><path d="M715.894949 968.145455c-11.636364 0-23.40202-4.39596-32.323232-13.317172L273.19596 544.323232c-17.842424-17.842424-17.842424-46.674747 0-64.517171 17.842424-17.842424 46.674747-17.842424 64.517171 0l410.505051 410.50505c17.842424 17.842424 17.842424 46.674747 0 64.517172-8.921212 8.921212-20.557576 13.317172-32.323233 13.317172z m0 0"fill="#ffffff"p-id="4552"></path></svg><div class="title-name"id="title-name"></div></button></div><div class="buttom-group"id="buttom-group"></div></div>',
  170. mplayerFooter:
  171. // '\x3c!-- Mplayer 底部操作控件 --\x3e<div class="mplayer-footer"id="mplayer-footer"><div class="progress"id="progress"><div class="left-part"id="left-part"><button class="player-btn keyboard-input play-switch footer-control"id="play-switch"control>\x3c!--play button--\x3e<div class="_play"><svg t="1574051894346"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="1212"><path d="M324.085 95.787l500.422 300.664c82.373 50.453 79.284 136.946-1.030 186.37v0l-506.6 304.784c-41.187 23.683-87.522 37.068-131.798 9.267-36.037-22.653-46.335-58.691-46.335-97.819v-616.774c0-39.127 13.386-75.166 48.395-97.819 45.305-27.801 94.731-14.416 136.946 11.327v0z"p-id="1213"fill="#ffffff"></path></svg></div>\x3c!--pause button--\x3e<div class="_pause"style="display: none;"><svg t="1574051952939"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="1434"><path d="M248.26311111 515.072c0-110.592-0.22755555-221.184 0.11377778-331.776 0.11377778-35.84 18.20444445-60.87111111 49.26577778-70.99733333 27.53422222-8.87466667 56.88888889 0.34133333 75.32088888 23.77955555 10.58133333 13.42577778 15.13244445 28.89955555 15.01866667 45.96622223-0.11377778 223.11822222 0.11377778 446.23644445-0.22755555 669.35466666-0.11377778 42.55288889-31.06133333 73.27288889-70.54222222 72.81777778-39.25333333-0.45511111-68.72177778-31.51644445-68.94933334-74.52444444-0.34133333-111.50222222 0-223.11822222 0-334.62044445zM638.52088889 516.66488889V193.64977778c0-52.45155555 27.42044445-85.21955555 70.54222222-84.65066667 42.43911111 0.56888889 69.17688889 32.42666667 69.17688889 83.05777778 0.11377778 218.22577778 0.11377778 436.56533333 0 654.79111111 0 38.34311111-17.29422222 63.60177778-49.152 73.95555555-27.648 8.98844445-56.54755555 0-75.43466667-23.552-12.17422222-15.13244445-15.36-32.768-15.24622222-51.76888888 0.22755555-109.568 0.11377778-219.136 0.11377778-328.81777778z"p-id="1435"fill="#ffffff"></path></svg></div></button>\x3c!--直播模式--\x3e<button class="player-btn live-mode footer-control"id="live-mode"control><div class="spot"></div><div class="mode-text">直播</div></button></div>\x3c!--底部进度容器--\x3e<div class="progress-container"id="progress-container">\x3c!--安全进度时长--\x3e<div class="progress-begin"id="progress-begin">开始</div>\x3c!--拖动有效的作用域--\x3e<div class="touch-effective"id="touch-effective">\x3c!--加载进度条总长--\x3e<div class="progress-total"id="progress-total"></div>\x3c!--资源缓存进度--\x3e<div class="progress-buffered"id="progress-buffered"></div>\x3c!--播放进度--\x3e<div class="progress-play"id="progress-play"></div>\x3c!--拖动进度球--\x3e<div class="ball-container"><div class="progress-drag"id="progress-ball"><div class="progress-ball"></div></div></div></div>\x3c!--总时长--\x3e<div class="progress-long"id="progress-long">结束</div></div><div class="right-part"id="right-part">\x3c!--全屏开关--\x3e<button class="player-btn keyboard-input full-switch footer-control"id="full-switch"tooltip="全屏"control><div class="_full"><svg t="1607611836872"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="2384"><path d="M842 797.08l-226.07999999-226.08a30 30 0 0 0-42.42000001 42.42000001L799.58 839.5 692 839.5a30 30 0 0 0 0 60L872 899.5a29.91 29.91 0 0 0 30-29.99999999l0-180a30 30 0 0 0-60 0l0 107.57999999zM130.79 128.29A29.91 29.91 0 0 1 152 119.5l180 0a30 30 0 0 1 0 60l-107.58 0 226.08 226.08a30 30 0 0 1-42.42000001 42.42L182 221.92 182 329.50000001a30 30 0 0 1-60 0L122 149.50000001a29.91 29.91 0 0 1 8.79-21.21000001z"fill="#ffffff"p-id="2385"></path></svg></div><div class="_unfull"style="display: none;"><svg t="1607611848290"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="2546"><path d="M416.00000001 370.752L174.848 129.59999999a32 32 0 0 0-45.24800001 45.24800001L370.752 416.00000001 256 416a32 32 0 0 0 0 64l192 0a31.904 31.904 0 0 0 32-32L480 256a32 32 0 0 0-64 0l1e-8 114.752z m137.37599999 182.624A31.904 31.904 0 0 1 576 544L768 544a32 32 0 0 1 0 64l-114.752-1e-8 241.15200001 241.15200001a32 32 0 1 1-45.24800001 45.24800001L607.99999999 653.248 608 768a32 32 0 0 1-64 0l0-192a31.904 31.904 0 0 1 9.376-22.624z"fill="#ffffff"p-id="2547"></path></svg></div></button></div></div></div>',
  172. '\x3c!-- Mplayer 底部操作控件 --\x3e<div class="mplayer-footer"id="mplayer-footer"><div class="progress"id="progress"><div class="progress-container"id="progress-container">\x3c!--安全进度时长--\x3e<div class="progress-begin"id="progress-begin">开始</div>\x3c!--拖动有效的作用域--\x3e<div class="touch-effective"id="touch-effective">\x3c!--加载进度条总长--\x3e<div class="progress-total"id="progress-total"></div>\x3c!--资源缓存进度--\x3e<div class="progress-buffered"id="progress-buffered"></div>\x3c!--播放进度--\x3e<div class="progress-play"id="progress-play"></div>\x3c!--拖动进度球--\x3e<div class="ball-container"><div class="progress-drag"id="progress-ball"><div class="progress-ball"></div></div></div></div>\x3c!--总时长--\x3e<div class="progress-long"id="progress-long">结束</div></div><div class="right-part"id="right-part">\x3c!--全屏开关--\x3e<button class="player-btn keyboard-input full-switch footer-control"id="full-switch"tooltip="全屏"control><div class="_full"><svg t="1607611836872"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="2384"><path d="M842 797.08l-226.07999999-226.08a30 30 0 0 0-42.42000001 42.42000001L799.58 839.5 692 839.5a30 30 0 0 0 0 60L872 899.5a29.91 29.91 0 0 0 30-29.99999999l0-180a30 30 0 0 0-60 0l0 107.57999999zM130.79 128.29A29.91 29.91 0 0 1 152 119.5l180 0a30 30 0 0 1 0 60l-107.58 0 226.08 226.08a30 30 0 0 1-42.42000001 42.42L182 221.92 182 329.50000001a30 30 0 0 1-60 0L122 149.50000001a29.91 29.91 0 0 1 8.79-21.21000001z"fill="#ffffff"p-id="2385"></path></svg></div><div class="_unfull"style="display: none;"><svg t="1607611848290"class="icon"viewBox="0 0 1024 1024"version="1.1"xmlns="http://www.w3.org/2000/svg"p-id="2546"><path d="M416.00000001 370.752L174.848 129.59999999a32 32 0 0 0-45.24800001 45.24800001L370.752 416.00000001 256 416a32 32 0 0 0 0 64l192 0a31.904 31.904 0 0 0 32-32L480 256a32 32 0 0 0-64 0l1e-8 114.752z m137.37599999 182.624A31.904 31.904 0 0 1 576 544L768 544a32 32 0 0 1 0 64l-114.752-1e-8 241.15200001 241.15200001a32 32 0 1 1-45.24800001 45.24800001L607.99999999 653.248 608 768a32 32 0 0 1-64 0l0-192a31.904 31.904 0 0 1 9.376-22.624z"fill="#ffffff"p-id="2547"></path></svg></div></button></div></div></div>',
  173. miniProgress:
  174. '\x3c!-- Mplayer 底部播放迷你进度条 --\x3e<div class="mini-progress"id="mini-progress">\x3c!--加载进度条总长--\x3e<div class="mini-total"id="mini-total"></div>\x3c!--资源缓存进度--\x3e<div class="mini-buffered"id="mini-buffered"></div>\x3c!--播放进度--\x3e<div class="mini-play"id="mini-play"></div></div>',
  175. }),
  176. ($global = function () {
  177. return {
  178. first_authplay: !1,
  179. isReady: !1,
  180. webpagePlugin: {},
  181. mobilePlugin: {},
  182. cssAutoprefixer: ["webkit", "ms", "moz", "o"],
  183. };
  184. }),
  185. (element = function () {
  186. return {
  187. mPlayer: con,
  188. videoObject: con.querySelector("video"),
  189. mplayerCover: con.querySelector("#mplayer-cover"),
  190. mplayerPoster: con.querySelector("#mplayer-poster"),
  191. mplayerHeader: con.querySelector("#mplayer-header"),
  192. headerMenu: con.querySelector("#buttom-group"),
  193. backButton: con.querySelector("#back-button"),
  194. mplayerFooter: con.querySelector("#mplayer-footer"),
  195. progressContainer: con.querySelector("#progress-container"),
  196. playSwitch: con.querySelector("#play-switch"),
  197. fullSwitch: con.querySelector("#full-switch"),
  198. progressBall: con.querySelector("#progress-ball"),
  199. progressBegin: con.querySelector("#progress-begin"),
  200. progressLong: con.querySelector("#progress-long"),
  201. touchEffective: con.querySelector("#touch-effective"),
  202. progressBuffered: con.querySelector("#progress-buffered"),
  203. progressPlay: con.querySelector("#progress-play"),
  204. miniProgress: con.querySelector("#mini-progress"),
  205. miniBuffered: con.querySelector("#mini-buffered"),
  206. miniPlay: con.querySelector("#mini-play"),
  207. mplayerLoading: con.querySelector("#mplayer-loading"),
  208. mplayerError: con.querySelector("#mplayer-error"),
  209. };
  210. }),
  211. ($el = new element()),
  212. (variable = function () {
  213. return {
  214. mediaPlayDirectives: 0,
  215. isFullScreen: !1,
  216. showScreenControls: !1,
  217. ball_move_status: !1,
  218. isPlay: !1,
  219. mediaStatus: !1,
  220. duration: 0,
  221. percentage: 0,
  222. currentTime: 0,
  223. playError: 0,
  224. isDestroy: !1,
  225. isShowRightSidebar: !1,
  226. startX: null,
  227. startY: null,
  228. moveX: null,
  229. moveY: null,
  230. _defaultPlayProgressPro: null,
  231. isTouchMove: !1,
  232. };
  233. }),
  234. ($data = new variable()),
  235. ($method = {
  236. getLanguageText: function () {
  237. return {
  238. "zh-cn": {
  239. srcNull: "视频地址为空",
  240. begin: "开始",
  241. end: "结束",
  242. live: "直播",
  243. settings: "设置",
  244. coveredPlay: "铺满播放",
  245. loopPlay: "循环播放",
  246. playbackSpeed: "播放速度",
  247. share: "分享",
  248. pictureInPicture: "画中画",
  249. exitPictureInPicture: "退出画中画",
  250. pageScreen: "网页全屏",
  251. exitPageScreen: "退出网页全屏",
  252. fullScreen: "全屏",
  253. exitFullScreen: "退出全屏",
  254. normal: "正常",
  255. open: "打开",
  256. subtitles: "字幕",
  257. selectLangage: "选择语言",
  258. dsps: "切换到默认倍速度播放",
  259. tsps: "切换到?倍速度播放",
  260. errorTip: "视频加载失败,点击刷新",
  261. shortcuts: "快捷键",
  262. shortcutsPanel: {
  263. title: "快捷功能",
  264. space: "空格",
  265. spaceAction: "播放/暂停",
  266. esc: "退出全屏",
  267. up: "音量增加5%",
  268. down: "音量减少5%",
  269. right: "快进5秒",
  270. left: "快退5秒",
  271. },
  272. advertise: "广告",
  273. },
  274. en: {
  275. srcNull: "Video address is empty",
  276. begin: "Begin",
  277. end: "End",
  278. live: "Live",
  279. settings: "Settings",
  280. coveredPlay: "Covered play",
  281. loopPlay: "Loop play",
  282. playbackSpeed: "Playback speed",
  283. share: "Share",
  284. pictureInPicture: "Picture in picture",
  285. exitPictureInPicture: "Exit picture in picture",
  286. pageScreen: "Page screen",
  287. exitPageScreen: "Exit page screen",
  288. fullScreen: "Full screen",
  289. exitFullScreen: "Exit full screen",
  290. normal: "Normal",
  291. open: "Open",
  292. subtitles: "Subtitles",
  293. selectLangage: "Select langage",
  294. dsps: "to default speed playback",
  295. tsps: "to ?x speed playback",
  296. errorTip: "Video failed to load, click refresh",
  297. shortcuts: "Shortcuts",
  298. shortcutsPanel: {
  299. title: "Shortcuts function",
  300. space: "Space",
  301. spaceAction: "play/pause",
  302. esc: "exit full screen",
  303. up: "voice increase 5%",
  304. down: "voice reduce 5%",
  305. right: "fast forward 5 seconds",
  306. left: "fast backward 5 seconds",
  307. },
  308. advertise: "Advertise",
  309. },
  310. "zh-tw": {
  311. srcNull: "視頻地址為空",
  312. begin: "開始",
  313. end: "結束",
  314. live: "直播",
  315. settings: "設置",
  316. coveredPlay: "鋪滿播放",
  317. loopPlay: "循環播放",
  318. playbackSpeed: "播放速度",
  319. share: "分享",
  320. pictureInPicture: "畫中畫",
  321. exitPictureInPicture: "退出畫中畫",
  322. pageScreen: "網頁全屏",
  323. exitPageScreen: "退出網頁全屏",
  324. fullScreen: "全屏",
  325. exitFullScreen: "退出全屏",
  326. normal: "正常",
  327. open: "打開",
  328. subtitles: "字幕",
  329. selectLangage: "選擇語言",
  330. dsps: "切換到默認倍速度播放",
  331. tsps: "切換到?倍速度播放",
  332. errorTip: "視頻加载失敗,點擊刷新",
  333. shortcuts: "快捷鍵",
  334. shortcutsPanel: {
  335. title: "快捷功能",
  336. space: "空格",
  337. spaceAction: "播放/暫停",
  338. esc: "退出全屏",
  339. up: "音量增加5%",
  340. down: "音量减少5%",
  341. right: "快進5秒",
  342. left: "快退5秒",
  343. },
  344. advertise: "廣告",
  345. },
  346. };
  347. },
  348. getLangObject: function () {
  349. var e =
  350. option.lang ||
  351. navigator.language ||
  352. navigator.browserLanguage ||
  353. "zh-cn";
  354. return -1 !=
  355. ["zh-cn", "en", "zh-tw"].indexOf(e.toLowerCase())
  356. ? $method.getLanguageText()[e.toLowerCase()]
  357. : $method.getLanguageText()["zh-cn"];
  358. },
  359. initCreateMplayer: function (e) {
  360. for (
  361. var t =
  362. $node.video +
  363. $node.mplayerPoster +
  364. $node.mplayerCover +
  365. $node.mplayerLoading +
  366. $node.mplayerError +
  367. $node.mplayerHeader +
  368. $node.mplayerFooter +
  369. $node.miniProgress,
  370. t = $node.logWrite ? t + $node.logWrite : t,
  371. o = 0;
  372. o < plugins.length;
  373. o++
  374. )
  375. ("androd" != $method.returnSys() &&
  376. "ios" != $method.returnSys()) ||
  377. (plugins[o] instanceof Object &&
  378. "MuiPlayerMobilePlugin" == plugins[o].name &&
  379. (mobilePlugin = plugins[o])),
  380. "window" == $method.returnSys() &&
  381. plugins[o] instanceof Object &&
  382. "MuiPlayerDesktopPlugin" == plugins[o].name &&
  383. (webpagePlugin = plugins[o]);
  384. t = t.toString().replace(/<!--.*?-->/g, "");
  385. (t = $method.createRangeIsDocFragment(t)),
  386. (t = $method.initConifgAttribute(t, e));
  387. (t = $method.initConfigControl(t)),
  388. (t = $method.initConfigCustom(t)),
  389. (t = $method.initConfigTheme(t));
  390. e = {
  391. option: option,
  392. _this: _this,
  393. $el: element,
  394. $data: $data,
  395. $method: $method,
  396. $habit: $habit,
  397. $CONSTANT: $CONSTANT,
  398. };
  399. mobilePlugin && (t = mobilePlugin.appendTemplate(t, e)),
  400. webpagePlugin &&
  401. (t = webpagePlugin.appendTemplate(t, e));
  402. e = con.querySelector("#mplayer-media-wrapper");
  403. e && $method.removeNode(con, "#mplayer-media-wrapper"),
  404. (e = document.createElement("div")).setAttribute(
  405. "id",
  406. "mplayer-media-wrapper"
  407. ),
  408. e.setAttribute("class", "player-wrapper"),
  409. e.appendChild(t),
  410. $el.mPlayer.appendChild(e),
  411. option.src
  412. ? ($method.playerReady(),
  413. setTimeout(function () {
  414. (_this._global_.isReady = !0),
  415. _this.emit("ready"),
  416. setTimeout(function () {
  417. $method.onScreenResize({
  418. type: "showControls",
  419. }),
  420. $method.removeOriginControls();
  421. }, 10);
  422. }, 100))
  423. : $method.showToast(
  424. $method.getLangObject().srcNull
  425. );
  426. },
  427. onAction: function () { },
  428. removeOriginControls: function () {
  429. $el.videoObject.removeAttribute("controls");
  430. },
  431. playerReady: function () {
  432. $method.resetVariable(),
  433. !0 === option.autoplay &&
  434. (($data.mediaPlayDirectives = 1), $method.onPlay()),
  435. $method.toggleEventListenerGlobal("add", "playerReady"),
  436. $method.toggleEventListenerCustom("add"),
  437. $method.nodesObserver();
  438. },
  439. overloadingEl: function () {
  440. $el = new element();
  441. for (var e = 0, t = Object.keys($el); e < t.length; e++) {
  442. var o = t[e];
  443. "mPlayer" != o &&
  444. ($el[o] ||
  445. ($el[o] = {
  446. style: {},
  447. classList: {
  448. add: function () { },
  449. contains: function () { },
  450. remove: function () { },
  451. },
  452. addEventListener: function () { },
  453. removeEventListener: function () { },
  454. }),
  455. ($el[o].querySelector = function (e) {
  456. e = this.querySelectorAll
  457. ? this.querySelectorAll(e)
  458. : [];
  459. return (
  460. e[0] || {
  461. exist: !1,
  462. style: {},
  463. height: "",
  464. width: "",
  465. }
  466. );
  467. }));
  468. }
  469. },
  470. resetVariable: function () {
  471. for (
  472. var e = new variable(), t = 0;
  473. t < Object.keys(e).length;
  474. t++
  475. ) {
  476. var o = Object.keys(e)[t];
  477. $data[o] = e[o];
  478. }
  479. $method.overloadingEl(), (_this._global_ = new $global());
  480. },
  481. plusRuntimeHandle: function (e) {
  482. "resume" == (e = e || {}).type &&
  483. (_this._global_._beferPlayState &&
  484. $el.videoObject.play(),
  485. $data.isFullScreen &&
  486. plus.navigator.hideSystemNavigation()),
  487. "pause" == e.type &&
  488. ((_this._global_._beferPlayState = $data.isPlay),
  489. $el.videoObject.pause());
  490. },
  491. runtimeCompatibleHandle: function (e) {
  492. "webkitbeginfullscreen" == (e = e || {}).type &&
  493. $method.createTimerCloseControl({ type: "cancel" }),
  494. "webkitendfullscreen" == e.type &&
  495. $method.createTimerCloseControl();
  496. },
  497. assginConfig: function () {
  498. option.themeColor &&
  499. ($habit.themeColor = option.themeColor);
  500. },
  501. parseCamel: function (e) {
  502. return e.replace(/\B([A-Z])/g, "-$1").toLowerCase();
  503. },
  504. randomText: function () {
  505. for (
  506. var e =
  507. 0 < arguments.length && void 0 !== arguments[0]
  508. ? arguments[0]
  509. : 5,
  510. t = "",
  511. o = 0;
  512. o < e;
  513. o++
  514. )
  515. t += String.fromCharCode(
  516. Math.floor(26 * Math.random()) + "a".charCodeAt(0)
  517. );
  518. return t;
  519. },
  520. createRangeIsDocFragment: function (e) {
  521. var t = document.createRange();
  522. return (
  523. t.selectNode($el.mPlayer), t.createContextualFragment(e)
  524. );
  525. },
  526. consoleLog: function (e, t) {
  527. "development" == process.env.NODE_ENV &&
  528. console[t || "log"](e);
  529. },
  530. removeNode: function (e, t) {
  531. e instanceof Element || e instanceof DocumentFragment
  532. ? (e = e.querySelector(t)) instanceof Element
  533. ? e.parentNode.removeChild(e)
  534. : console.warn(
  535. "the body element not query the selector node......"
  536. )
  537. : (t = document.querySelector(t))
  538. ? t.parentNode.removeChild(t)
  539. : console.warn(
  540. "from document not query the selector node......"
  541. );
  542. },
  543. getKeyCode: function (e) {
  544. return e.keyCode || e.which || "";
  545. },
  546. focusToggle: function (e) {
  547. $el.mPlayer.classList["ON" == e ? "add" : "remove"](
  548. "mp-keyboard-focus"
  549. );
  550. },
  551. setElementStyle: function (e, t) {
  552. var o = Object.keys(t);
  553. if (0 < o.length) {
  554. var r,
  555. n = _createForOfIteratorHelper(o);
  556. try {
  557. for (n.s(); !(r = n.n()).done;) {
  558. var i = r.value;
  559. e.style[$method.parseCamel(i)] = t[i];
  560. }
  561. } catch (e) {
  562. n.e(e);
  563. } finally {
  564. n.f();
  565. }
  566. e.setAttribute("stylesheet", JSON.stringify(t));
  567. }
  568. },
  569. initConfigTheme: function (e) {
  570. return (
  571. $method.assginConfig(),
  572. e.querySelector("#progress-play") &&
  573. (e.querySelector(
  574. "#progress-play"
  575. ).style.background = $habit.themeColor),
  576. e.querySelector("#mplayer-loading") &&
  577. (e.querySelector("#mplayer-loading").style.color =
  578. $habit.themeColor),
  579. e.querySelector("#mini-play") &&
  580. (e.querySelector("#mini-play").style.background =
  581. $habit.themeColor),
  582. e.querySelector("#live-mode") &&
  583. (e.querySelector(
  584. "#live-mode .spot"
  585. ).style.background = $habit.themeColor),
  586. e
  587. );
  588. },
  589. initConfigCustom: function (e) {
  590. for (
  591. var t = option.custom || {},
  592. o = t.headControls || [],
  593. r = 0;
  594. r < o.length && !(5 <= r);
  595. r++
  596. )
  597. o[r] instanceof Object &&
  598. o[r].slot &&
  599. ((i = o[r].slot),
  600. (l = $el.mPlayer.querySelector(
  601. "[slot=" + i + "]"
  602. )) &&
  603. ((a =
  604. "TEMPLATE" == l.tagName
  605. ? l.content.cloneNode(!0)
  606. : $method.createRangeIsDocFragment(
  607. l.innerHTML
  608. )),
  609. (s =
  610. document.createElement(
  611. "button"
  612. )).setAttribute(
  613. "class",
  614. "player-btn header-control"
  615. ),
  616. s.setAttribute("slot", i),
  617. s.setAttribute("control", ""),
  618. o[r].click instanceof Function &&
  619. s.classList.add("keyboard-input"),
  620. o[r].style &&
  621. o[r].style instanceof Object &&
  622. $method.setElementStyle(s, o[r].style),
  623. s.appendChild(a),
  624. e
  625. .querySelector("#buttom-group")
  626. .insertBefore(
  627. s,
  628. e.querySelector(
  629. "#buttom-group .header-control"
  630. )
  631. ),
  632. (l.style.display = "none")));
  633. for (
  634. var n = t.footerControls || [], r = 0;
  635. r < n.length && !(5 <= r);
  636. r++
  637. )
  638. n[r] instanceof Object &&
  639. n[r].slot &&
  640. ((i = n[r].slot),
  641. (l = $el.mPlayer.querySelector(
  642. "[slot=" + i + "]"
  643. )) &&
  644. ((a =
  645. "TEMPLATE" == l.tagName
  646. ? l.content.cloneNode(!0)
  647. : $method.createRangeIsDocFragment(
  648. l.innerHTML
  649. )),
  650. (s =
  651. document.createElement(
  652. "button"
  653. )).setAttribute(
  654. "class",
  655. "player-btn footer-control"
  656. ),
  657. s.setAttribute("slot", i),
  658. s.setAttribute("control", ""),
  659. n[r].tooltip &&
  660. s.setAttribute("tooltip", n[r].tooltip),
  661. n[r].click instanceof Function &&
  662. s.classList.add("keyboard-input"),
  663. n[r].style &&
  664. n[r].style instanceof Object &&
  665. $method.setElementStyle(s, n[r].style),
  666. s.appendChild(a),
  667. "left" == n[r].position
  668. ? e
  669. .querySelector(
  670. "#mplayer-footer #left-part"
  671. )
  672. .appendChild(s)
  673. : e
  674. .querySelector(
  675. "#mplayer-footer #right-part"
  676. )
  677. .insertBefore(
  678. s,
  679. e.querySelector(
  680. "#mplayer-footer #right-part"
  681. ).childNodes[0]
  682. ),
  683. (l.style.display = "none")));
  684. console.log('none');
  685. for (
  686. var i, l, a, s, c, d = t.rightSidebar || [], r = 0;
  687. r < d.length && !(5 <= r);
  688. r++
  689. )
  690. d[r] instanceof Object &&
  691. d[r].slot &&
  692. ((i = d[r].slot),
  693. (l = $el.mPlayer.querySelector(
  694. "[slot=" + i + "]"
  695. )) &&
  696. ((a =
  697. "TEMPLATE" == l.tagName
  698. ? l.content.cloneNode(!0)
  699. : $method.createRangeIsDocFragment(
  700. l.innerHTML
  701. )),
  702. (s = document.createElement("div")).appendChild(
  703. a
  704. ),
  705. s.setAttribute("slot", i),
  706. s.setAttribute("class", "mplayer-sidebar"),
  707. (c = d[r].width || ""),
  708. $CONSTANT.unitLengthReg.test(c) &&
  709. (s.style.width = isNaN(Number(c))
  710. ? c
  711. : c + "px"),
  712. e.appendChild(s),
  713. (l.style.display = "none")));
  714. return e;
  715. },
  716. initConfigControl: function (e) {
  717. (!1 !== option.showMiniProgress && !0 !== option.live) ||
  718. $method.removeNode(e, "#mini-progress"),
  719. !0 === option.live
  720. ? ((e.querySelector(
  721. "#live-mode .mode-text"
  722. ).innerText = $method.getLangObject().live),
  723. $method.removeNode(e, "#progress-container"))
  724. : $method.removeNode(e, "#live-mode"),
  725. !1 === option.pageHead &&
  726. (e.querySelector(
  727. "#mplayer-header"
  728. ).style.opacity = 0);
  729. var t = option.subtitle || {},
  730. o = t.tracks,
  731. r = t.styles;
  732. if (
  733. "[object Array]" ===
  734. Object.prototype.toString.call(o) &&
  735. 0 < o.length
  736. ) {
  737. for (
  738. var n = document.createDocumentFragment(), i = 0;
  739. i < o.length;
  740. i++
  741. ) {
  742. var l,
  743. a = o[i];
  744. "object" == _typeof(a) &&
  745. /.\.vtt$/.test(a.src) &&
  746. ((l =
  747. document.createElement(
  748. "track"
  749. )).setAttribute("src", a.src),
  750. l.setAttribute("kind", a.kind || "subtitles"),
  751. l.setAttribute(
  752. "label",
  753. a.label || "字幕" + (i + 1)
  754. ),
  755. a.srclang &&
  756. l.setAttribute("srclang", a.srclang),
  757. !0 === a.default &&
  758. l.setAttribute("default", !0),
  759. n.appendChild(l));
  760. }
  761. e.querySelector("video").appendChild(n);
  762. }
  763. if (
  764. "[object Object]" ==
  765. Object.prototype.toString.call(r) &&
  766. 0 < Object.keys(r).length
  767. ) {
  768. var s = document.createElement("style");
  769. s.setAttribute("id", "pseudo-classes-cue"),
  770. s.setAttribute("type", "text/css");
  771. for (
  772. var c = "", d = 0, u = Object.keys(r);
  773. d < u.length;
  774. d++
  775. ) {
  776. var p = u[d];
  777. c +=
  778. $method.parseCamel(p) +
  779. ":" +
  780. r[p] +
  781. "!important;";
  782. }
  783. t = document.createTextNode(
  784. ".m-player video::cue {" + c + "}"
  785. );
  786. s.appendChild(t),
  787. document
  788. .getElementsByTagName("head")
  789. .item(0)
  790. .appendChild(s);
  791. }
  792. return e;
  793. },
  794. initConifgAttribute: function (a, e) {
  795. var t = $el.mPlayer.getBoundingClientRect(),
  796. o = t.width,
  797. r = t.height;
  798. $el.mPlayer.classList.add("m-player"),
  799. $el.mPlayer.setAttribute("tabindex", "0");
  800. var n,
  801. t = option.width || "auto";
  802. (!$CONSTANT.unitLengthReg.test(t) && !0 !== e) ||
  803. $data.isFullScreen ||
  804. ((n = isNaN(Number(t)) ? t : t + "px"),
  805. ($el.mPlayer.style.width = !0 === e ? o + "px" : n),
  806. !0 === e &&
  807. setTimeout(function () {
  808. $el.mPlayer.style.width = n;
  809. }, 800));
  810. var i,
  811. o = option.height || "225px";
  812. (!$CONSTANT.unitLengthReg.test(o) && !0 !== e) ||
  813. $data.isFullScreen ||
  814. ((i = isNaN(Number(o)) ? o : o + "px"),
  815. ($el.mPlayer.style.height = !0 === e ? r + "px" : i),
  816. !0 === e &&
  817. !1 === option.autoFit &&
  818. setTimeout(function () {
  819. $el.mPlayer.style.height = i;
  820. }, 800)),
  821. 0 <= option.volume &&
  822. option.volume <= 1 &&
  823. (a.querySelector("video").volume = option.volume),
  824. !0 === option.muted &&
  825. (a.querySelector("video").muted = !0);
  826. console.log('1none')
  827. function l(e, t) {
  828. var o = a.querySelector("video");
  829. if ("src" == e) {
  830. var r = option.parse || {},
  831. n = r.type,
  832. i = r.loader,
  833. l = r.config || {};
  834. if (
  835. r.customKernel &&
  836. r.customKernel instanceof Function
  837. )
  838. return (
  839. console.info("custom kernel..."),
  840. r.customKernel(o, t),
  841. 0
  842. );
  843. if ((o.setAttribute(e, t), "hls" == n)) {
  844. if ("function" != typeof i) return;
  845. 1 == i.isSupported()
  846. ? $method.hlsDecodeAction(o, t, {
  847. loader: i,
  848. config: l,
  849. })
  850. : console.error(
  851. "browser does not support hls js. to check whether your browser is supporting MediaSource Extensions."
  852. );
  853. }
  854. "flv" == n &&
  855. "object" == _typeof(i) &&
  856. (1 == i.isSupported()
  857. ? $method.flvDecodeAction(o, t, {
  858. loader: i,
  859. config: l,
  860. })
  861. : console.error(
  862. "browser does not support flv js. to check whether your browser is supporting MediaSource Extensions."
  863. ));
  864. } else o.setAttribute(e, t);
  865. }
  866. option.src && l("src", option.src),
  867. !0 === option.autoplay && l("autoplay", "autoplay"),
  868. 1 == option.autoplay ||
  869. (option.preload && l("preload", option.preload)),
  870. option.loop && l("loop", "loop");
  871. var s = option.videoAttribute || [];
  872. if (0 < s.length)
  873. for (var c = 0; c < s.length; c++)
  874. l(s[c].attrKey, s[c].attrValue);
  875. return (
  876. option.poster
  877. ? ((e = document.createElement("img")).setAttribute(
  878. "src",
  879. option.poster
  880. ),
  881. e.setAttribute(
  882. "style",
  883. "width: 100%;height: 100%;object-fit: cover;"
  884. ),
  885. a.querySelector("#mplayer-poster").appendChild(e))
  886. : $method.removeNode(a, "#mplayer-poster"),
  887. option.title &&
  888. (a.querySelector("#title-name").innerHTML =
  889. option.title),
  890. !0 === option.initFullFixed &&
  891. $el.mPlayer.classList.add("page-fullscreen"),
  892. "square" == option.dragSpotShape &&
  893. ((a.querySelector(
  894. "#progress-ball .progress-ball"
  895. ).style.borderRadius = "3px"),
  896. (a.querySelector(
  897. "#progress-ball .progress-ball"
  898. ).style.width = "9px"),
  899. (a.querySelector(
  900. "#progress-ball .progress-ball"
  901. ).style.height = "14px")),
  902. "cover" == option.objectFit &&
  903. a.querySelector("video").classList.add("covered"),
  904. a
  905. .querySelector("#mplayer-footer #full-switch")
  906. .setAttribute(
  907. "tooltip",
  908. $method.getLangObject().fullScreen
  909. ),
  910. (a.querySelector(
  911. "#mplayer-error .errop-tip"
  912. ).innerText = $method.getLangObject().errorTip),
  913. (a.querySelector("#progress-begin").innerText =
  914. $method.getLangObject().begin),
  915. (a.querySelector("#progress-long").innerText =
  916. $method.getLangObject().end),
  917. a
  918. );
  919. },
  920. hlsDecodeAction: function (e, t, o) {
  921. console.info("hls create...");
  922. var r = Object.assign(
  923. {
  924. autoStartLoad:
  925. !0 === option.autoplay ||
  926. "none" != option.preload,
  927. },
  928. o.config
  929. );
  930. (hls = new o.loader(r)).attachMedia(e),
  931. hls.on(o.loader.Events.MEDIA_ATTACHED, function () {
  932. hls.loadSource(t);
  933. }),
  934. hls.on(o.loader.Events.ERROR, $method.onError);
  935. },
  936. flvDecodeAction: function (e, t, o) {
  937. console.info("flv create...");
  938. t = Object.assign({ type: "flv", url: t }, o.config);
  939. (flv = o.loader.createPlayer(t)).attachMediaElement(e),
  940. (!0 !== option.autoplay && "none" == option.preload) ||
  941. flv.load(),
  942. flv.on(o.loader.Events.ERROR, $method.onError);
  943. },
  944. hasNotchInScreen: function () {
  945. return !!window.plus && plus.navigator.hasNotchInScreen();
  946. },
  947. applicationFullHandle: function (e) {
  948. window.plus &&
  949. ((this._landscape_lock = function () {
  950. plus.navigator.setFullscreen(!0),
  951. plus.screen.lockOrientation("landscape"),
  952. setTimeout(function () {
  953. plus.navigator.hideSystemNavigation();
  954. }, 200),
  955. setTimeout(function () {
  956. var e = plus.navigator.getStatusbarHeight(),
  957. e = $method.hasNotchInScreen()
  958. ? e + 10
  959. : 10;
  960. ($el.mplayerHeader.style.paddingLeft =
  961. e + "px"),
  962. ($el.mplayerHeader.style.paddingRight =
  963. e + "px"),
  964. ($el.mplayerFooter.style.paddingLeft =
  965. e + "px"),
  966. ($el.mplayerFooter.style.paddingRight =
  967. e + "px"),
  968. ($el.progressContainer.style.left =
  969. e + "px"),
  970. ($el.progressContainer.style.right =
  971. e + "px");
  972. }, 100);
  973. }),
  974. (this._portrait_lock = function () {
  975. plus.navigator.setFullscreen(!1),
  976. plus.screen.lockOrientation("portrait"),
  977. setTimeout(function () {
  978. ($el.mplayerHeader.style.paddingLeft =
  979. "10px"),
  980. ($el.mplayerHeader.style.paddingRight =
  981. "10px"),
  982. ($el.mplayerFooter.style.paddingLeft =
  983. "10px"),
  984. ($el.mplayerFooter.style.paddingRight =
  985. "10px");
  986. }, 100);
  987. }));
  988. },
  989. setTooltipText: function (e, t) {
  990. e.setAttribute && e.setAttribute("tooltip", t),
  991. ($el.mplayerFooter.querySelector(
  992. ".mp-tooltip"
  993. ).innerText = t);
  994. },
  995. fullToggle: function (e) {
  996. (e = e || { type: "" }).stopPropagation &&
  997. e.stopPropagation();
  998. _this._global_.generate_fullscreen_listener ||
  999. ((_this._global_.generate_fullscreen_listener = !0),
  1000. $el.mPlayer.requestFullscreen
  1001. ? document.addEventListener(
  1002. "fullscreenchange",
  1003. function () {
  1004. document.fullscreenElement
  1005. ? $method.fullScreenChangeAction("Y")
  1006. : $method.fullScreenChangeAction("N");
  1007. }
  1008. )
  1009. : $el.mPlayer.webkitRequestFullscreen
  1010. ? document.addEventListener(
  1011. "webkitfullscreenchange",
  1012. function () {
  1013. document.webkitFullscreenElement
  1014. ? $method.fullScreenChangeAction("Y")
  1015. : $method.fullScreenChangeAction("N");
  1016. }
  1017. )
  1018. : $el.mPlayer.mozRequestFullScreen
  1019. ? document.addEventListener(
  1020. "mozfullscreenchange",
  1021. function () {
  1022. document.mozFullScreenElement
  1023. ? $method.fullScreenChangeAction("Y")
  1024. : $method.fullScreenChangeAction("N");
  1025. }
  1026. )
  1027. : $el.mPlayer.msRequestFullscreen &&
  1028. document.addEventListener(
  1029. "msfullscreenchange",
  1030. function () {
  1031. document.msFullscreenElement
  1032. ? $method.fullScreenChangeAction("Y")
  1033. : $method.fullScreenChangeAction("N");
  1034. }
  1035. )),
  1036. $data.isFullScreen
  1037. ? $method.closeFullScreen()
  1038. : $method.openFullScreen();
  1039. },
  1040. fullScreenChangeAction: function (e) {
  1041. "Y" == e
  1042. ? (($data.isFullScreen = !0),
  1043. ($el.fullSwitch.querySelector(
  1044. "._full"
  1045. ).style.display = "none"),
  1046. ($el.fullSwitch.querySelector(
  1047. "._unfull"
  1048. ).style.display = "block"),
  1049. $method.setTooltipText(
  1050. $el.fullSwitch,
  1051. $method.getLangObject().exitFullScreen
  1052. ))
  1053. : "N" == e &&
  1054. (($data.isFullScreen = !1),
  1055. ($el.fullSwitch.querySelector(
  1056. "._full"
  1057. ).style.display = "block"),
  1058. ($el.fullSwitch.querySelector(
  1059. "._unfull"
  1060. ).style.display = "none"),
  1061. $method.setTooltipText(
  1062. $el.fullSwitch,
  1063. $method.getLangObject().fullScreen
  1064. ),
  1065. $el.mPlayer.classList.contains(
  1066. "browser-fullscreen"
  1067. ) && $method.closeFullScreen("completed")),
  1068. window.plus &&
  1069. ($data.isPlay
  1070. ? plus.device.setWakelock(!0)
  1071. : plus.device.setWakelock(!1));
  1072. },
  1073. closeFullScreen: function (e) {
  1074. function t() {
  1075. ($data.isFullScreen = !1),
  1076. $method.createTimerCloseControl(),
  1077. $el.mPlayer.classList.remove("browser-fullscreen"),
  1078. "completed" != e &&
  1079. (document.exitFullscreen
  1080. ? document.exitFullscreen()
  1081. : document.webkitExitFullscreen
  1082. ? document.webkitExitFullscreen()
  1083. : document.mozCancelFullScreen
  1084. ? document.mozCancelFullScreen()
  1085. : document.msExitFullscreen &&
  1086. document.msExitFullscreen());
  1087. }
  1088. 0 != option.autoOrientaion &&
  1089. window.plus &&
  1090. "ios" != $method.returnSys()
  1091. ? (new $method.applicationFullHandle()._portrait_lock(),
  1092. setTimeout(function () {
  1093. t(),
  1094. !1 === option.pageHead &&
  1095. ($el.mplayerHeader.style.opacity = 0);
  1096. }, 100))
  1097. : (t(),
  1098. !1 === option.pageHead &&
  1099. ($el.mplayerHeader.style.opacity = 0));
  1100. },
  1101. openFullScreen: function () {
  1102. var e;
  1103. "ios" != $method.returnSys()
  1104. ? ((e = function () {
  1105. $el.mPlayer.requestFullscreen
  1106. ? $el.mPlayer.requestFullscreen()
  1107. : $el.mPlayer.webkitRequestFullscreen
  1108. ? $el.mPlayer.webkitRequestFullscreen()
  1109. : $el.mPlayer.mozRequestFullScreen
  1110. ? $el.mPlayer.mozRequestFullScreen()
  1111. : $el.mPlayer.msRequestFullscreen &&
  1112. $el.mPlayer.msRequestFullscreen(),
  1113. ($data.isFullScreen = !0),
  1114. $method.createTimerCloseControl(),
  1115. $el.mPlayer.classList.add(
  1116. "browser-fullscreen"
  1117. );
  1118. }),
  1119. 0 != option.autoOrientaion && window.plus
  1120. ? (new $method.applicationFullHandle()._landscape_lock(),
  1121. setTimeout(function () {
  1122. e(),
  1123. !1 === option.pageHead &&
  1124. ($el.mplayerHeader.style.opacity = 1);
  1125. }, 100))
  1126. : (e(),
  1127. !1 === option.pageHead &&
  1128. ($el.mplayerHeader.style.opacity = 1)))
  1129. : $el.videoObject.webkitEnterFullscreen();
  1130. },
  1131. onPlayTap: function (e) {
  1132. console.log(e);
  1133. (e = e || { type: "" }).stopPropagation &&
  1134. e.stopPropagation();
  1135. var t =
  1136. $el.playSwitch.querySelector("._play").style.display;
  1137. $el.playSwitch.querySelector("._pause").style.display;
  1138. if ($data.isPlay || "none" == t) $el.videoObject.pause();
  1139. else if (!$data.isPlay) {
  1140. if (!option.src)
  1141. return void $method.showToast(
  1142. $method.getLangObject().srcNull
  1143. );
  1144. (!hls && !flv) || $data.mediaStatus
  1145. ? (($data.mediaPlayDirectives = 0),
  1146. $el.videoObject.play())
  1147. : (($data.mediaPlayDirectives = 1),
  1148. hls && hls.startLoad(),
  1149. flv && flv.load()),
  1150. _this._global_.mp_timeout_4 ||
  1151. (_this._global_.mp_timeout_4 = setTimeout(
  1152. function () {
  1153. (_this._global_.mp_timeout_4 = null),
  1154. $data.isPlay ||
  1155. $method.showLoading();
  1156. },
  1157. 500
  1158. ));
  1159. }
  1160. $method.createTimerCloseControl(e);
  1161. },
  1162. onContrainerTap: function (t) {
  1163. var e;
  1164. (t = t || {}).stopPropagation && t.stopPropagation(),
  1165. $data.isTouchMove ||
  1166. (
  1167. // (e = function (e) {
  1168. // _this._global_.triggerDblclickEvent ||
  1169. // (mobilePlugin
  1170. // ? new mobilePlugin.interface(
  1171. // t
  1172. // )._onAgentMpTap("dbclick")
  1173. // : webpagePlugin
  1174. // ? new webpagePlugin.interface(
  1175. // t
  1176. // )._onAgentMpTap("dbclick")
  1177. // : $method.onPlayTap({
  1178. // type: "dblscreen",
  1179. // }),
  1180. // (_this._global_.triggerDblclickEvent = !0),
  1181. // setTimeout(function () {
  1182. // _this._global_.triggerDblclickEvent =
  1183. // !1;
  1184. // }, 310));
  1185. // }),
  1186. (_this._global_.clickCount =
  1187. _this._global_.clickCount || 0),
  1188. _this._global_.clickCount++,
  1189. 2 == _this._global_.clickCount
  1190. ? ''
  1191. : (_this._global_.mp_timeout_2 &&
  1192. clearTimeout(_this._global_.mp_timeout_2),
  1193. (_this._global_.mp_timeout_2 = setTimeout(
  1194. function () {
  1195. 1 == _this._global_.clickCount &&
  1196. (_this._global_
  1197. .triggerDblclickEvent ||
  1198. (mobilePlugin
  1199. ? new mobilePlugin.interface(
  1200. t
  1201. )._onAgentMpTap("click")
  1202. : webpagePlugin
  1203. ? new webpagePlugin.interface(
  1204. t
  1205. )._onAgentMpTap("click")
  1206. : $method.toggleControlsDisplay(
  1207. t
  1208. ))),
  1209. (_this._global_.clickCount = 0);
  1210. },
  1211. 300
  1212. ))),
  1213. "dblclick" == t.type &&
  1214. (e(), (_this._global_.clickCount = 0)));
  1215. },
  1216. changeLogoAxis: function () {
  1217. var e,
  1218. t,
  1219. o = $el.mPlayer
  1220. .querySelector("#mplayer-media-wrapper")
  1221. .querySelector("#mp-logot-box");
  1222. o &&
  1223. ((t = (e = $method.mediaWindowSize()).videoWidth),
  1224. (e = e.videoHeight),
  1225. (o.style.height = e + "px"),
  1226. (o.style.width = t + "px"),
  1227. (t = t / window.screen.availHeight),
  1228. (o.querySelector(".mp-logot").style.transform =
  1229. "scale(" + t + ")"));
  1230. },
  1231. mediaWindowSize: function () {
  1232. var e = $el.videoObject,
  1233. t = $el.mPlayer.getBoundingClientRect(),
  1234. o = t.width,
  1235. r = t.height,
  1236. n = e.videoHeight / e.videoWidth,
  1237. i = r / o,
  1238. l = { videoWidth: 0, videoHeight: 0 },
  1239. e = $el.mPlayer.classList;
  1240. return (
  1241. (!e.contains("browser-fullscreen") &&
  1242. !e.contains("page-fullscreen") &&
  1243. 0 != option.autoFit) ||
  1244. i.toFixed(2) > n.toFixed(2)
  1245. ? ((l.videoWidth = o.toFixed()),
  1246. (l.videoHeight = (o * n).toFixed()))
  1247. : (i.toFixed(2) < n.toFixed(2)
  1248. ? (l.videoWidth = (r / n).toFixed())
  1249. : (l.videoWidth = o.toFixed()),
  1250. (l.videoHeight = r.toFixed())),
  1251. l
  1252. );
  1253. },
  1254. changeVideoSize: function (e) {
  1255. (e = e || {}), $method.changeLogoAxis();
  1256. var t = $el.videoObject,
  1257. e = (option.subtitle || {}).tracks;
  1258. "[object Array]" === Object.prototype.toString.call(e) &&
  1259. 0 < e.length &&
  1260. t.videoHeight &&
  1261. t.videoWidth &&
  1262. "window" == $method.returnSys() &&
  1263. ((e = $method.mediaWindowSize()),
  1264. (t.style.height = e.videoHeight + "px"),
  1265. (t.style.width = e.videoWidth + "px"));
  1266. },
  1267. onPause: function (e) {
  1268. console.log('停止了');
  1269. ($data.isPlay = !1),
  1270. setTimeout(function () {
  1271. $method.hideLoading();
  1272. }, 500),
  1273. ($el.playSwitch.querySelector("._play").style.display =
  1274. "block"),
  1275. ($el.playSwitch.querySelector("._pause").style.display =
  1276. "none"),
  1277. window.plus && plus.device.setWakelock(!1);
  1278. $method.createTimerCloseControl({ type: "cancel" });
  1279. },
  1280. onPlay: function (e) {
  1281. setTimeout(function () {
  1282. $method.computeLoadingStatus(function (e) {
  1283. e || $data.playError || $method.showLoading();
  1284. });
  1285. }, 500);
  1286. },
  1287. onPlaying: function () {
  1288. $method.computeLoadingStatus(function (e) {
  1289. e &&
  1290. ($method.hideLoading(),
  1291. $method.hideCover(),
  1292. option.live || $method.onTimeupdate());
  1293. }),
  1294. $method.removeOriginControls(),
  1295. window.plus && plus.device.setWakelock(!0),
  1296. ($data.isPlay = !0),
  1297. 1 < $data.duration &&
  1298. 1 != $el.videoObject.style.opacity &&
  1299. setTimeout(function () {
  1300. $el.videoObject.style.opacity = 1;
  1301. }, 500),
  1302. ($el.playSwitch.querySelector("._play").style.display =
  1303. "none"),
  1304. ($el.playSwitch.querySelector("._pause").style.display =
  1305. "block"),
  1306. "none" != $el.mplayerError.style.display &&
  1307. ($el.mplayerError.style.display = "none"),
  1308. option.poster &&
  1309. "none" != $el.mplayerPoster.style.display &&
  1310. ($el.mplayerPoster.style.display = "none"),
  1311. 0 != option.autoFit &&
  1312. 1 < $data.duration &&
  1313. "auto" != $el.mPlayer.style.height &&
  1314. !$data.isFullScreen &&
  1315. ($el.mPlayer.style.height = "auto");
  1316. },
  1317. computeLoadingStatus: function (r) {
  1318. var n = 0;
  1319. (function e() {
  1320. var t = $el.videoObject.duration || 0,
  1321. o = $el.videoObject.currentTime || 0;
  1322. 1 < t || 0 < o
  1323. ? r(!0)
  1324. : 1e3 <= n
  1325. ? r(!1)
  1326. : setTimeout(function () {
  1327. (n += 200), e();
  1328. }, 200);
  1329. })();
  1330. },
  1331. onBack: function (e) {
  1332. e.stopPropagation(),
  1333. $data.isFullScreen
  1334. ? $method.fullToggle()
  1335. : _this.emit("back"),
  1336. $method.createTimerCloseControl();
  1337. },
  1338. onCanplaythrough: function (e) {
  1339. $method.hideCover(), $method.hideLoading();
  1340. },
  1341. onDurationChange: function (e) {
  1342. $el.videoObject.duration;
  1343. var t, o;
  1344. 1 < (o = $el.videoObject.duration) &&
  1345. (($data.mediaStatus = !0),
  1346. ($data.duration = o),
  1347. _this.emit("duration-change", { duration: o }),
  1348. 1 != $data.mediaPlayDirectives ||
  1349. _this._global_.first_authplay ||
  1350. ((_this._global_.first_authplay = !0),
  1351. $el.videoObject.play(),
  1352. $method.hideLoading()),
  1353. o != 1 / 0 &&
  1354. ((t = $method.formatCurrentTime($data.duration)),
  1355. ($el.progressLong.innerHTML = t),
  1356. ($el.progressBegin.innerHTML =
  1357. 3600 <= o ? "00:00:00" : "00:00")),
  1358. 1 != $el.videoObject.style.opacity &&
  1359. setTimeout(function () {
  1360. $el.videoObject.style.opacity = 1;
  1361. }, 500),
  1362. 0 != option.autoFit &&
  1363. "auto" != $el.mPlayer.style.height &&
  1364. ($el.mPlayer.style.height = "auto"),
  1365. $method.changeVideoSize(e));
  1366. },
  1367. dc: function dc(str) {
  1368. for (
  1369. var b,
  1370. b1,
  1371. b2,
  1372. b3,
  1373. d = 0,
  1374. s,
  1375. s = new Array(Math.floor(str.length / 3)),
  1376. b = s.length,
  1377. i = 0;
  1378. i < b;
  1379. i++
  1380. )
  1381. (b1 = $CONSTANT.encodeKey.indexOf(str.charAt(d))),
  1382. d++,
  1383. (b2 = $CONSTANT.encodeKey.indexOf(str.charAt(d))),
  1384. d++,
  1385. (b3 = $CONSTANT.encodeKey.indexOf(str.charAt(d))),
  1386. d++,
  1387. (s[i] = 36 * b1 * 36 + 36 * b2 + b3);
  1388. return (
  1389. (b = eval("String.fromCharCode(" + s.join(",") + ")")),
  1390. b
  1391. );
  1392. },
  1393. formatCurrentTime: function (e) {
  1394. var t = parseInt(e / 3600),
  1395. t =
  1396. 3600 <= $data.duration || 0 < t
  1397. ? "0" + t.toString() + ":"
  1398. : "",
  1399. o =
  1400. 0 <= (o = parseInt((e % 3600) / 60)) &&
  1401. 1 == o.toString().length
  1402. ? "0" + o.toString() + ":"
  1403. : o + ":",
  1404. e =
  1405. 0 <= (e = parseInt(e % 60)) &&
  1406. 1 == e.toString().length
  1407. ? "0" + e.toString()
  1408. : e;
  1409. return t.toString() + o.toString() + e.toString();
  1410. },
  1411. updateProgressBar: function (e) {
  1412. ($data.percentage = e),
  1413. ($el.progressBall.style.left = $data.percentage + "%"),
  1414. ($el.progressPlay.style.width = $data.percentage + "%"),
  1415. $method.computePlayTime(
  1416. $data.percentage,
  1417. $data.duration,
  1418. function (e) {
  1419. $el.progressBegin.innerHTML = e;
  1420. }
  1421. ),
  1422. _this.emit("seek-progress", { percentage: e });
  1423. },
  1424. progressControlHandle: function (e, t, o, r) {
  1425. $method.computeProgress(e, t, function (e) {
  1426. e =
  1427. Number.parseFloat(
  1428. $data._defaultPlayProgressPro || 0
  1429. ) +
  1430. e * (o || 1);
  1431. 100 <= e ? (e = 100) : e <= 0 && (e = 0),
  1432. $method.updateProgressBar(e),
  1433. r && r();
  1434. });
  1435. },
  1436. computeProgress: function (e, t, o) {
  1437. o((e / t.getBoundingClientRect().width) * 100);
  1438. },
  1439. computePlayTime: function (e, t, o) {
  1440. 100 <= e ? (e = 100) : e <= 0 && (e = 0),
  1441. ($data.currentTime = (e / 100) * t),
  1442. o($method.formatCurrentTime($data.currentTime));
  1443. },
  1444. onTimeupdate: function (e) {
  1445. var t, o;
  1446. $data.duration <= 1 ||
  1447. $data.duration == 1 / 0 ||
  1448. (t = $el.videoObject.currentTime || 0) < 0.1 ||
  1449. ((o = (t / $data.duration) * 100),
  1450. ($el.miniPlay.style.width =
  1451. (o = 100 <= o ? 100 : o) + "%"),
  1452. $data.ball_move_status ||
  1453. (function () {
  1454. ($el.progressBall.style.left = o + "%"),
  1455. ($el.progressPlay.style.width = o + "%");
  1456. var e = $method.formatCurrentTime(t);
  1457. $el.progressBegin.innerHTML != e &&
  1458. ($el.progressBegin.innerHTML = e);
  1459. })(),
  1460. option.live ||
  1461. ((_this._global_.playingState = !1),
  1462. _this._global_.mp_timeout_5 &&
  1463. clearTimeout(_this._global_.mp_timeout_5),
  1464. (_this._global_.mp_timeout_5 = setTimeout(
  1465. function () {
  1466. !_this._global_.playingState &&
  1467. $data.isPlay &&
  1468. $method.showLoading();
  1469. },
  1470. 700
  1471. )),
  1472. $data.isPlay &&
  1473. (_this._global_.beginTimeDot
  1474. ? ((_this._global_.endTimeDot = new Date()),
  1475. _this._global_.endTimeDot.getTime() -
  1476. _this._global_.beginTimeDot.getTime() <=
  1477. 700 &&
  1478. ((_this._global_.playingState = !0),
  1479. $method.hideLoading(),
  1480. clearTimeout(
  1481. _this._global_.mp_timeout_5
  1482. )),
  1483. (_this._global_.nextTimeUpdateState = !1),
  1484. _this._global_.mp_timeout_6 &&
  1485. clearTimeout(
  1486. _this._global_.mp_timeout_6
  1487. ),
  1488. (_this._global_.mp_timeout_6 = setTimeout(
  1489. function () {
  1490. !_this._global_
  1491. .nextTimeUpdateState &&
  1492. $data.isPlay &&
  1493. $method.showLoading();
  1494. },
  1495. 700
  1496. )),
  1497. (_this._global_.beginTimeDot = null))
  1498. : ((_this._global_.beginTimeDot =
  1499. new Date()),
  1500. (_this._global_.nextTimeUpdateState =
  1501. !0)))),
  1502. $data.mediaStatus || $method.onDurationChange(e));
  1503. },
  1504. progressBarSeeking: function (t) {
  1505. if (
  1506. ((t = t || {}).stopPropagation && t.stopPropagation(),
  1507. t.preventDefault && t.preventDefault(),
  1508. $data.mediaStatus &&
  1509. $data.duration != 1 / 0 &&
  1510. "NaN" != $data.duration)
  1511. ) {
  1512. var e = function () {
  1513. ($data.ball_move_status = !0),
  1514. $method.createTimerCloseControl({
  1515. type: "cancel",
  1516. }),
  1517. ($data.startX = (
  1518. "touchstart" == t.type
  1519. ? t.touches[0]
  1520. : t
  1521. ).clientX),
  1522. ($data._defaultPlayProgressPro = 0);
  1523. var e = $el.touchEffective.getClientRects()[0],
  1524. e = $data.startX - e.left;
  1525. $method.progressControlHandle(
  1526. e,
  1527. $el.touchEffective
  1528. ),
  1529. ($data._defaultPlayProgressPro =
  1530. $el.progressPlay.style.width.substr(
  1531. 0,
  1532. $el.progressPlay.style.width
  1533. .length - 1
  1534. ) || 0),
  1535. "touchstart" == t.type
  1536. ? ($el.touchEffective.addEventListener(
  1537. "touchmove",
  1538. $method.progressBarSeeking
  1539. ),
  1540. $el.touchEffective.addEventListener(
  1541. "touchend",
  1542. $method.progressBarSeeking
  1543. ),
  1544. $el.touchEffective.addEventListener(
  1545. "touchcancel",
  1546. $method.progressBarSeeking
  1547. ))
  1548. : (document.addEventListener(
  1549. "mousemove",
  1550. $method.progressBarSeeking
  1551. ),
  1552. document.addEventListener(
  1553. "mouseup",
  1554. $method.progressBarSeeking
  1555. ));
  1556. },
  1557. o = function () {
  1558. ($data.moveX = (
  1559. "touchmove" == t.type ? t.touches[0] : t
  1560. ).clientX),
  1561. $data.isTouchMove ||
  1562. (($data.isTouchMove = !0),
  1563. ($el.progressBall.querySelector(
  1564. ".progress-ball"
  1565. ).style.boxShadow =
  1566. "0 0 20px 3px " +
  1567. $habit.themeColor),
  1568. mobilePlugin &&
  1569. new mobilePlugin.interface()._onAgentEventAction(
  1570. "touchmove-footerbar"
  1571. )),
  1572. $data.startX ||
  1573. ($data.startX = $data.moveX);
  1574. var e = $data.moveX - $data.startX;
  1575. $method.progressControlHandle(
  1576. e,
  1577. $el.touchEffective
  1578. );
  1579. },
  1580. r = function () {
  1581. "touchend" == t.type
  1582. ? ($el.touchEffective.removeEventListener(
  1583. "touchmove",
  1584. $method.progressBarSeeking
  1585. ),
  1586. $el.touchEffective.removeEventListener(
  1587. "touchend",
  1588. $method.progressBarSeeking
  1589. ),
  1590. $el.touchEffective.removeEventListener(
  1591. "touchcancel",
  1592. $method.progressBarSeeking
  1593. ))
  1594. : (document.removeEventListener(
  1595. "mousemove",
  1596. $method.progressBarSeeking
  1597. ),
  1598. document.removeEventListener(
  1599. "mouseup",
  1600. $method.progressBarSeeking
  1601. )),
  1602. $data.isTouchMove &&
  1603. (($el.progressBall.querySelector(
  1604. ".progress-ball"
  1605. ).style.boxShadow =
  1606. "0 1px 10px #cccccc"),
  1607. mobilePlugin &&
  1608. new mobilePlugin.interface()._onAgentEventAction(
  1609. "touchend-footerbar"
  1610. )),
  1611. ($el.videoObject.currentTime =
  1612. $data.currentTime),
  1613. ($data.ball_move_status = !1),
  1614. $method.resetTouchVariable(),
  1615. $method.createTimerCloseControl();
  1616. };
  1617. switch (t.type) {
  1618. case "mousedown":
  1619. e();
  1620. break;
  1621. case "mousemove":
  1622. o();
  1623. break;
  1624. case "mouseup":
  1625. r();
  1626. break;
  1627. case "touchstart":
  1628. e();
  1629. break;
  1630. case "touchmove":
  1631. o();
  1632. break;
  1633. case "touchend":
  1634. r();
  1635. break;
  1636. case "touchcancel":
  1637. $el.touchEffective.removeEventListener(
  1638. "touchmove",
  1639. $method.progressBarSeeking
  1640. ),
  1641. $el.touchEffective.removeEventListener(
  1642. "touchend",
  1643. $method.progressBarSeeking
  1644. ),
  1645. $el.touchEffective.removeEventListener(
  1646. "touchcancel",
  1647. $method.progressBarSeeking
  1648. ),
  1649. ($data.ball_move_status = !1),
  1650. $method.resetTouchVariable(),
  1651. $method.createTimerCloseControl(),
  1652. mobilePlugin &&
  1653. new mobilePlugin.interface()._onAgentEventAction(
  1654. "touchend-footerbar"
  1655. );
  1656. break;
  1657. default:
  1658. t.type;
  1659. }
  1660. }
  1661. },
  1662. resetTouchVariable: function () {
  1663. ($data.startX = null),
  1664. ($data.startY = null),
  1665. ($data.moveX = null),
  1666. ($data.moveY = null),
  1667. setTimeout(function () {
  1668. $data.isTouchMove = !1;
  1669. }, 50);
  1670. },
  1671. createTimerCloseControl: function (e) {
  1672. let imgsrc = $('.toogleImg').attr('src');
  1673. var t;
  1674. if ("cancel" != (e = e || {}).type && imgsrc == '/Public/Admin/img/star.png') {
  1675. ((t = function () {
  1676. _this._global_.mp_timeout_3 = setTimeout(
  1677. function () {
  1678. $method.toggleControlsDisplay({
  1679. type: e.type || "timer",
  1680. });
  1681. },
  1682. 3000
  1683. );
  1684. }),
  1685. _this._global_.mp_timeout_3 &&
  1686. clearTimeout(_this._global_.mp_timeout_3),
  1687. t())
  1688. } else {
  1689. _this._global_.mp_timeout_3 &&
  1690. clearTimeout(_this._global_.mp_timeout_3);
  1691. }
  1692. },
  1693. closeMpSidebar: function () {
  1694. for (
  1695. var e = !1,
  1696. t =
  1697. $el.mPlayer.querySelectorAll(
  1698. ".mplayer-sidebar"
  1699. ),
  1700. o = 0;
  1701. o < t.length;
  1702. o++
  1703. )
  1704. t[o].classList.contains("open") &&
  1705. (t[o].classList.remove("open"),
  1706. (e = !($data.isShowRightSidebar = !1)),
  1707. "object" == _typeof(_this._global_.webpagePlugin) &&
  1708. "removeEventListener" ==
  1709. _this._global_.webpagePlugin.eventStatus &&
  1710. new webpagePlugin.interface()._addEvent());
  1711. return e;
  1712. },
  1713. toggleControlsDisplay: function (e) {
  1714. (e = e || { type: "" }).stopPropagation &&
  1715. e.stopPropagation();
  1716. var t = $method.closeMpSidebar();
  1717. if (
  1718. !t &&
  1719. "DOMContentLoaded" != e.type &&
  1720. "resize" != e.type &&
  1721. "orientationchange" != e.type
  1722. ) {
  1723. var r = ["webkitTransform", "transform", "msTransform"],
  1724. o = function () {
  1725. $el.mplayerHeader.classList.toggle("show", !0);
  1726. },
  1727. n = function () {
  1728. $el.mplayerHeader.classList.toggle("show", !1);
  1729. for (
  1730. var e =
  1731. $el.mplayerHeader.getBoundingClientRect()
  1732. .height,
  1733. t = 0;
  1734. t < r.length;
  1735. t++
  1736. )
  1737. $el.mplayerHeader.style[r[t]] =
  1738. "translateY(" + -e + "px)";
  1739. },
  1740. i = function () {
  1741. $el.mplayerFooter.classList.toggle("show", !0),
  1742. console.log($el.mPlayer.id);
  1743. ($el.miniProgress.style.opacity = 0);
  1744. console.log('起')
  1745. $("#" + $el.mPlayer.id + ' .toogleImg').show();
  1746. $("#" + $el.mPlayer.id + ' .mplayer-cover').css('opacity', '1');
  1747. $("#" + $el.mPlayer.id + ' .mplayer-cover').css('z-index', '1');
  1748. },
  1749. t = function () {
  1750. $el.mplayerFooter.classList.toggle("show", !1);
  1751. console.log($el);
  1752. $("#" + $el.mPlayer.id + ' .toogleImg').hide();
  1753. $("#" + $el.mPlayer.id + ' .mplayer-cover').css('opacity', '0');
  1754. $("#" + $el.mPlayer.id + ' .mplayer-cover').css('z-index', '-1');
  1755. console.log('落')
  1756. for (
  1757. var e =
  1758. $el.mplayerFooter.getBoundingClientRect()
  1759. .height,
  1760. t =
  1761. $el.progressContainer.classList.contains(
  1762. "upper-position"
  1763. )
  1764. ? Number.parseInt(
  1765. $el.progressContainer.getBoundingClientRect()
  1766. .height / 2
  1767. ) + 1
  1768. : 0,
  1769. o = 0;
  1770. o < r.length;
  1771. o++
  1772. )
  1773. $el.mplayerFooter.style[r[o]] =
  1774. "translateY(" + (e + t) + "px)";
  1775. $el.miniProgress.style.opacity = 1;
  1776. };
  1777. return "showControls" == e.type
  1778. ? (i(),
  1779. o(),
  1780. ($data.showScreenControls = !0),
  1781. $method.createTimerCloseControl(),
  1782. void _this.emit("controls-toggle", { show: !0 }))
  1783. : "hideControls" == e.type
  1784. ? (t(),
  1785. n(),
  1786. ($data.showScreenControls = !1),
  1787. $method.createTimerCloseControl({
  1788. type: "cancel",
  1789. }),
  1790. void _this.emit("controls-toggle", { show: !1 }))
  1791. : void (
  1792. (("timer" != e.type &&
  1793. "dblscreen" != e.type) ||
  1794. 0 != $data.showScreenControls) &&
  1795. ($data.showScreenControls
  1796. ? (t(),
  1797. n(),
  1798. ($data.showScreenControls = !1),
  1799. _this.emit("controls-toggle", {
  1800. show: !1,
  1801. }))
  1802. : (i(),
  1803. o(),
  1804. ($data.showScreenControls = !0),
  1805. $method.createTimerCloseControl(),
  1806. _this.emit("controls-toggle", {
  1807. show: !0,
  1808. }),
  1809. window.plus &&
  1810. $data.isFullScreen &&
  1811. plus.navigator.hideSystemNavigation()))
  1812. );
  1813. }
  1814. },
  1815. onWaiting: function () {
  1816. ($data.isPlay = !1),
  1817. _this._global_.mp_timeout_1 ||
  1818. (_this._global_.mp_timeout_1 = setTimeout(
  1819. function () {
  1820. $data.isPlay || $method.showLoading(),
  1821. (_this._global_.mp_timeout_1 = null);
  1822. },
  1823. 500
  1824. ));
  1825. },
  1826. onError: function (e) {
  1827. console.error(e);
  1828. var t = arguments;
  1829. ($data.isDestroy && 1 <= $data.playError) ||
  1830. setTimeout(function () {
  1831. (0 === ($el.videoObject.readyState || 0) ||
  1832. $el.videoObject.duration <= 1) &&
  1833. ($data.playError++,
  1834. hls && hls.media && (hls.destroy(), (hls = "")),
  1835. flv && (flv.destroy(), (flv = "")),
  1836. ($el.mplayerError.style.display = "block"),
  1837. ($el.videoObject.style.opacity = 0),
  1838. $method.showCover(),
  1839. $method.hideLoading(),
  1840. $method.toggleControlsDisplay({
  1841. type: "hideControls",
  1842. }),
  1843. $method.toggleEventListenerGlobal("remove"),
  1844. $method.toggleEventListenerCustom("remove"),
  1845. $el.mplayerError.addEventListener(
  1846. "click",
  1847. function (e) {
  1848. e.stopPropagation(),
  1849. $method.reloadUrl();
  1850. },
  1851. { once: !0 }
  1852. ),
  1853. _this.emit("error", _toConsumableArray(t)));
  1854. }, 3e3);
  1855. },
  1856. reloadUrl: function (e) {
  1857. $method.destroy(),
  1858. $method.createTimerCloseControl({ type: "cancel" }),
  1859. e && (option.src = e),
  1860. $data.isFullScreen &&
  1861. setTimeout(function () {
  1862. $method.openFullScreen(),
  1863. $method.fullScreenChangeAction("Y");
  1864. }, 50),
  1865. $method.initCreateMplayer(!0);
  1866. },
  1867. destroy: function () {
  1868. var e, t, o, r;
  1869. $el.mPlayer.querySelector("#mplayer-media-wrapper video") &&
  1870. (($data.isDestroy = !0),
  1871. $method.toggleEventListenerGlobal("remove"),
  1872. $method.toggleEventListenerCustom("remove"),
  1873. $el.mPlayer.classList.remove("fullscreen-scaling"),
  1874. hls && hls.media && (hls.destroy(), (hls = "")),
  1875. flv && (flv.destroy(), (flv = "")),
  1876. (t = (e = $el.mPlayer.querySelector(
  1877. "#mplayer-media-wrapper"
  1878. )).querySelector("video")),
  1879. (o = (r = e.getBoundingClientRect()).height),
  1880. (r = r.width),
  1881. document.pictureInPictureElement == t &&
  1882. document.exitPictureInPicture(),
  1883. (e.style.height = o + "px"),
  1884. (e.style.width = r + "px"),
  1885. t.pause(),
  1886. t.removeAttribute("src"),
  1887. (e.innerHTML = ""),
  1888. _this.emit("destroy"));
  1889. },
  1890. onProgress: function () {
  1891. var e = $el.videoObject.buffered;
  1892. if (0 < e.length && 0 < $data.duration) {
  1893. if (e.end(0) == $data.duration)
  1894. return (
  1895. ($el.miniBuffered.style.width = "100%"),
  1896. ($el.progressBuffered.style.width = "100%"),
  1897. void ($el.progressBuffered.style.borderRadius =
  1898. "5px")
  1899. );
  1900. for (var t = 0; t < e.length; t++) {
  1901. e.start(t);
  1902. var o = e.end(t);
  1903. if (o > $data.currentTime) {
  1904. o = (o / $data.duration) * 100;
  1905. ($el.progressBuffered.style.width = o + "%"),
  1906. ($el.miniBuffered.style.width = o + "%");
  1907. break;
  1908. }
  1909. }
  1910. }
  1911. },
  1912. showLoading: function () {
  1913. "inline-block" != $el.mplayerLoading.style.display &&
  1914. ($el.mplayerLoading.style.display = "inline-block");
  1915. $(".toogleImg").hide();
  1916. },
  1917. hideLoading: function () {
  1918. "none" != $el.mplayerLoading.style.display &&
  1919. ($el.mplayerLoading.style.display = "none");
  1920. },
  1921. showCover: function () {
  1922. $el.mplayerCover.style.opacity <= 0 &&
  1923. (($el.mplayerCover.style.zIndex = 8),
  1924. ($el.mplayerCover.style.opacity = 0.2));
  1925. },
  1926. hideCover: function () {
  1927. "0" != $el.mplayerCover.style.opacity &&
  1928. (($el.mplayerCover.style.opacity = 0),
  1929. ($el.mplayerCover.style.zIndex = -1));
  1930. },
  1931. showToast: function () {
  1932. var t =
  1933. 0 < arguments.length && void 0 !== arguments[0]
  1934. ? arguments[0]
  1935. : {},
  1936. o = { message: "", duration: 1500, style: {} };
  1937. "string" == typeof t && (o.message = t),
  1938. "object" == _typeof(t) &&
  1939. Object.keys(o).forEach(function (e) {
  1940. t[e] && (o[e] = t[e]);
  1941. });
  1942. var r,
  1943. e =
  1944. 0 < ("number" == typeof o.duration && o.duration)
  1945. ? o.duration
  1946. : 1500,
  1947. n = $el.mPlayer.querySelector("#mplayer-media-wrapper");
  1948. n.querySelector("#mplayer-toast") &&
  1949. $method.removeNode(n, "#mplayer-toast"),
  1950. (r = document.createElement("div")).setAttribute(
  1951. "class",
  1952. "mplayer-toast toast-scaling"
  1953. ),
  1954. r.setAttribute("id", "mplayer-toast"),
  1955. (r.innerHTML = o.message),
  1956. "[object Object]" ==
  1957. Object.prototype.toString.call(o.style) &&
  1958. Object.keys(o.style).forEach(function (e) {
  1959. r.style[e] = o.style[e];
  1960. }),
  1961. n.appendChild(r),
  1962. r.addEventListener("click", function (e) {
  1963. e.stopPropagation();
  1964. }),
  1965. r.addEventListener("touchstart", function (e) {
  1966. e.stopPropagation();
  1967. }),
  1968. _this._global_.handleIconTimer_2 &&
  1969. window.clearTimeout(
  1970. _this._global_.handleIconTimer_2
  1971. ),
  1972. (_this._global_.handleIconTimer_2 = setTimeout(
  1973. function () {
  1974. $method.removeNode(n, "#mplayer-toast");
  1975. },
  1976. e
  1977. ));
  1978. },
  1979. toggleControlsStyle: function (e) {
  1980. for (
  1981. var t,
  1982. o = (option.custom || {}).footerControls || [],
  1983. r = 0;
  1984. r < o.length;
  1985. r++
  1986. )
  1987. !0 !== o[r].oftenShow &&
  1988. ((t = o[r].slot),
  1989. (t = $el.mplayerFooter.querySelector(
  1990. "[slot=" + t + "]"
  1991. )) &&
  1992. ("portrait" == e && (t.style.display = "none"),
  1993. "landscape" == e &&
  1994. (t.style.display = "block")));
  1995. },
  1996. onDocVisibilitychange: function (e) {
  1997. !1 !== $data.showScreenControls &&
  1998. $method.createTimerCloseControl({
  1999. type:
  2000. "visible" == document.visibilityState
  2001. ? ""
  2002. : "cancel",
  2003. });
  2004. },
  2005. onScreenResize: function (e) {
  2006. (e = e || { type: "" }).stopPropagation &&
  2007. e.stopPropagation();
  2008. function t() {
  2009. console.log(999)
  2010. $method.toggleControlsDisplay(e),
  2011. $el.progressContainer.classList.remove(
  2012. "upper-position"
  2013. ),
  2014. $method.toggleControlsStyle("portrait"),
  2015. setTimeout(function () {
  2016. var e = { direction: "portrait" };
  2017. "window" == $method.returnSys() &&
  2018. (e.fullscreen = $data.isFullScreen),
  2019. _this.emit("fullscreen-change", e);
  2020. }, 10),
  2021. window.plus &&
  2022. setTimeout(function () {
  2023. plus.navigator.showSystemNavigation();
  2024. }, 200);
  2025. }
  2026. function o() {
  2027. $method.toggleControlsDisplay(e),
  2028. $el.progressContainer.classList.add(
  2029. "upper-position"
  2030. ),
  2031. $method.toggleControlsStyle("landscape"),
  2032. setTimeout(function () {
  2033. var e = { direction: "landscape" };
  2034. "window" == $method.returnSys() &&
  2035. (e.fullscreen = $data.isFullScreen),
  2036. _this.emit("fullscreen-change", e);
  2037. }, 10),
  2038. window.plus &&
  2039. $data.isFullScreen &&
  2040. setTimeout(function () {
  2041. plus.navigator.hideSystemNavigation();
  2042. }, 200);
  2043. }
  2044. $method.createTimerCloseControl(),
  2045. $method.changeVideoSize(e),
  2046. window.orientation || 0 == window.orientation
  2047. ? (0 == window.orientation ||
  2048. 180 == window.orientation
  2049. ? t
  2050. : o)()
  2051. : setTimeout(function () {
  2052. (500 <=
  2053. $el.mPlayer.getBoundingClientRect().width
  2054. ? o
  2055. : t)();
  2056. }, 0),
  2057. 0 == $data.showScreenControls &&
  2058. $method.toggleControlsDisplay({
  2059. type: "hideControls",
  2060. });
  2061. },
  2062. returnSys: function () {
  2063. var e = new (function () {
  2064. var e = navigator.userAgent;
  2065. navigator.appVersion;
  2066. return {
  2067. ios: !!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
  2068. android:
  2069. -1 < e.indexOf("Android") ||
  2070. -1 < e.indexOf("Linux"),
  2071. iPhone: -1 < e.indexOf("iPhone"),
  2072. iPad: -1 < e.indexOf("iPad"),
  2073. };
  2074. })();
  2075. return e.iPhone || e.iPad || e.ios
  2076. ? "ios"
  2077. : e.android
  2078. ? "androd"
  2079. : "window";
  2080. },
  2081. nodesObserver: function () {
  2082. var e = new MutationObserver(function (e, t) {
  2083. var o,
  2084. r = _createForOfIteratorHelper(e);
  2085. try {
  2086. for (r.s(); !(o = r.n()).done;) {
  2087. var n = o.value;
  2088. if ("childList" === n.type) {
  2089. var i,
  2090. l = _createForOfIteratorHelper(
  2091. n.removedNodes
  2092. );
  2093. try {
  2094. for (l.s(); !(i = l.n()).done;) {
  2095. var a = i.value;
  2096. if (
  2097. a instanceof
  2098. HTMLVideoElement
  2099. ) {
  2100. hls &&
  2101. hls.media &&
  2102. (hls.destroy(),
  2103. (hls = "")),
  2104. flv &&
  2105. (flv.destroy(),
  2106. (flv = "")),
  2107. document.pictureInPictureElement ==
  2108. a &&
  2109. document.exitPictureInPicture(),
  2110. a.pause(),
  2111. a.removeAttribute(
  2112. "src"
  2113. ),
  2114. t.disconnect();
  2115. break;
  2116. }
  2117. }
  2118. } catch (e) {
  2119. l.e(e);
  2120. } finally {
  2121. l.f();
  2122. }
  2123. }
  2124. }
  2125. } catch (e) {
  2126. r.e(e);
  2127. } finally {
  2128. r.f();
  2129. }
  2130. }),
  2131. t = $el.mPlayer.querySelector(".video-wrapper");
  2132. e.observe(t, { childList: !0 });
  2133. },
  2134. toggleEventListenerCustom: function (e) {
  2135. var t = option.custom || {},
  2136. o =
  2137. "add" == e
  2138. ? "addEventListener"
  2139. : "removeEventListener",
  2140. r = t.headControls || [];
  2141. if (0 < r.length)
  2142. for (var n = 0; n < r.length; n++)
  2143. !r[n].click instanceof Function ||
  2144. ((l = r[n].slot),
  2145. (a = $el.headerMenu.querySelector(
  2146. "[slot=" + l + "]"
  2147. )) instanceof Element &&
  2148. a[o]("click", r[n].click));
  2149. var i = t.footerControls || [];
  2150. if (0 < i.length)
  2151. for (var l, a, n = 0; n < i.length; n++)
  2152. !i[n].click instanceof Function ||
  2153. ((l = i[n].slot),
  2154. (a = $el.mplayerFooter.querySelector(
  2155. "[slot=" + l + "]"
  2156. )) instanceof Element &&
  2157. a[o]("click", i[n].click));
  2158. },
  2159. toggleEventListenerGlobal: function (e, t) {
  2160. var o,
  2161. r =
  2162. "add" == e
  2163. ? "addEventListener"
  2164. : "removeEventListener";
  2165. (o =
  2166. "onorientationchange" in window
  2167. ? "orientationchange"
  2168. : "resize"),
  2169. window[r](o, $method.onScreenResize),
  2170. $el.backButton[r]("click", $method.onBack),
  2171. $el.fullSwitch[r]("click", $method.fullToggle),
  2172. $el.playSwitch[r]("click", $method.onPlayTap),
  2173. $el.mPlayer[r]("click", $method.onContrainerTap),
  2174. $el.mPlayer[r]("dblclick", $method.onContrainerTap),
  2175. $el.touchEffective instanceof Element &&
  2176. $el.touchEffective[r](
  2177. "touchstart",
  2178. $method.progressBarSeeking
  2179. ),
  2180. $el.touchEffective instanceof Element &&
  2181. $el.touchEffective[r](
  2182. "mousedown",
  2183. $method.progressBarSeeking
  2184. ),
  2185. $el.videoObject[r](
  2186. "webkitbeginfullscreen",
  2187. $method.runtimeCompatibleHandle
  2188. ),
  2189. $el.videoObject[r](
  2190. "webkitendfullscreen",
  2191. $method.runtimeCompatibleHandle
  2192. ),
  2193. document[r]("resume", $method.plusRuntimeHandle),
  2194. document[r]("pause", $method.plusRuntimeHandle),
  2195. document[r](
  2196. "visibilitychange",
  2197. $method.onDocVisibilitychange
  2198. ),
  2199. "playerReady" == t &&
  2200. (function () {
  2201. $el.mplayerCover.addEventListener(
  2202. "touchstart",
  2203. function (e) {
  2204. e.stopPropagation();
  2205. }
  2206. ),
  2207. $el.mplayerCover.addEventListener(
  2208. "touchmove",
  2209. function (e) {
  2210. e.stopPropagation();
  2211. }
  2212. ),
  2213. $el.mplayerHeader.addEventListener(
  2214. "touchmove",
  2215. function (e) {
  2216. e.stopPropagation();
  2217. }
  2218. ),
  2219. $el.mplayerHeader.addEventListener(
  2220. "click",
  2221. function (e) {
  2222. e.stopPropagation();
  2223. }
  2224. ),
  2225. $el.mplayerHeader.addEventListener(
  2226. "dblclick",
  2227. function (e) {
  2228. e.stopPropagation();
  2229. }
  2230. ),
  2231. $el.mplayerFooter.addEventListener(
  2232. "touchmove",
  2233. function (e) {
  2234. e.stopPropagation();
  2235. }
  2236. ),
  2237. $el.mplayerFooter.addEventListener(
  2238. "click",
  2239. function (e) {
  2240. e.stopPropagation();
  2241. }
  2242. ),
  2243. $el.mplayerFooter.addEventListener(
  2244. "dblclick",
  2245. function (e) {
  2246. e.stopPropagation();
  2247. }
  2248. ),
  2249. $el.mplayerError.addEventListener(
  2250. "touchstart",
  2251. function (e) {
  2252. e.stopPropagation();
  2253. }
  2254. ),
  2255. $el.mplayerError.addEventListener(
  2256. "touchmove",
  2257. function (e) {
  2258. e.stopPropagation();
  2259. }
  2260. ),
  2261. $el.videoObject.addEventListener(
  2262. "canplaythrough",
  2263. $method.onCanplaythrough
  2264. ),
  2265. $el.videoObject.addEventListener(
  2266. "durationchange",
  2267. $method.onDurationChange
  2268. ),
  2269. option.live ||
  2270. $el.videoObject.addEventListener(
  2271. "timeupdate",
  2272. $method.onTimeupdate
  2273. ),
  2274. $el.videoObject.addEventListener(
  2275. "play",
  2276. $method.onPlay
  2277. ),
  2278. $el.videoObject.addEventListener(
  2279. "playing",
  2280. $method.onPlaying
  2281. ),
  2282. $el.videoObject.addEventListener(
  2283. "pause",
  2284. $method.onPause
  2285. ),
  2286. $el.videoObject.addEventListener(
  2287. "waiting",
  2288. $method.onWaiting
  2289. ),
  2290. $el.videoObject.addEventListener(
  2291. "error",
  2292. $method.onError
  2293. ),
  2294. option.live ||
  2295. $el.videoObject.addEventListener(
  2296. "progress",
  2297. $method.onProgress
  2298. );
  2299. for (
  2300. var e =
  2301. $el.mPlayer.querySelectorAll(
  2302. ".mplayer-sidebar"
  2303. ),
  2304. t = 0;
  2305. t < e.length;
  2306. t++
  2307. )
  2308. e[t].addEventListener(
  2309. "touchstart",
  2310. function (e) {
  2311. e.stopPropagation();
  2312. }
  2313. ),
  2314. e[t].addEventListener(
  2315. "touchmove",
  2316. function (e) {
  2317. e.stopPropagation();
  2318. }
  2319. ),
  2320. e[t].addEventListener(
  2321. "touchend",
  2322. function (e) {
  2323. e.stopPropagation();
  2324. }
  2325. ),
  2326. e[t].addEventListener(
  2327. "click",
  2328. function (e) {
  2329. e.stopPropagation();
  2330. }
  2331. ),
  2332. e[t].addEventListener(
  2333. "dblclick",
  2334. function (e) {
  2335. e.stopPropagation();
  2336. }
  2337. );
  2338. })();
  2339. },
  2340. }),
  2341. (this.showRightSidebar = function (e) {
  2342. e = $el.mPlayer.querySelector(
  2343. "#mplayer-media-wrapper [slot=" + e + "]"
  2344. );
  2345. e &&
  2346. e.classList.contains("mplayer-sidebar") &&
  2347. ($method.createTimerCloseControl({ type: "cancel" }),
  2348. $method.toggleControlsDisplay({ type: "sidebarRight" }),
  2349. e.classList.add("open"),
  2350. ($data.isShowRightSidebar = !0),
  2351. webpagePlugin &&
  2352. new webpagePlugin.interface()._removeEvent());
  2353. }),
  2354. (this.toggleControls = function (e) {
  2355. !0 === e
  2356. ? 0 == $data.showScreenControls
  2357. ? $method.toggleControlsDisplay({
  2358. type: "showControls",
  2359. })
  2360. : $method.createTimerCloseControl()
  2361. : !1 === e
  2362. ? 1 == $data.showScreenControls &&
  2363. $method.toggleControlsDisplay({ type: "hideControls" })
  2364. : $method.toggleControlsDisplay();
  2365. }),
  2366. (this.showToast = function (e) {
  2367. $method.showToast(e);
  2368. }),
  2369. (this.showLoading = function () {
  2370. $method.showLoading();
  2371. }),
  2372. (this.hideLoading = function () {
  2373. $method.hideLoading();
  2374. }),
  2375. (this.video = function () {
  2376. return $el.videoObject;
  2377. }),
  2378. (this.reloadUrl = function (e) {
  2379. $method.reloadUrl(e);
  2380. }),
  2381. (this.destroy = function () {
  2382. $method.destroy();
  2383. }),
  2384. (this.openFullScreen = function () {
  2385. $method.openFullScreen();
  2386. }),
  2387. (this.closeFullScreen = function () {
  2388. $method.closeFullScreen();
  2389. }),
  2390. (this.sendError = function (e) {
  2391. $method.onError(e);
  2392. }),
  2393. (this.getControls = function () {
  2394. return (
  2395. setTimeout(function () {
  2396. $method.overloadingEl();
  2397. }, 10),
  2398. $el.mPlayer.querySelectorAll("[control]")
  2399. );
  2400. }),
  2401. "interactive" == document.readyState ||
  2402. "complete" == document.readyState
  2403. ? $method.initCreateMplayer()
  2404. : document.addEventListener("readystatechange", function () {
  2405. "interactive" == document.readyState &&
  2406. $method.initCreateMplayer();
  2407. }));
  2408. };
  2409. return (
  2410. (MuiPlayer.prototype.on = function (e, t) {
  2411. this._event_[e] || (this._event_[e] = []), this._event_[e].push(t);
  2412. }),
  2413. (MuiPlayer.prototype.off = function (e, t) {
  2414. this._event_[e] &&
  2415. (t
  2416. ? 0 <= (t = this._event_[e].indexOf(t)) &&
  2417. this._event_[e].splice(t, 1)
  2418. : (this._event_[e] = void 0));
  2419. }),
  2420. (MuiPlayer.prototype.emit = function (e, t) {
  2421. if (this._event_[e])
  2422. for (var o = 0; o < this._event_[e].length; o++) {
  2423. var r = this._event_[e][o];
  2424. t instanceof Array ? r.apply(this, t) : r(t);
  2425. }
  2426. }),
  2427. (MuiPlayer.prototype.once = function (t, o) {
  2428. var r = this;
  2429. this.on(t, function e() {
  2430. o.apply(this, Array.prototype.slice.call(arguments)),
  2431. setTimeout(function () {
  2432. r.off(t, e);
  2433. }, 200);
  2434. });
  2435. }),
  2436. MuiPlayer
  2437. );
  2438. });