zy.media.min.js 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508
  1. !function() {
  2. function b(a, b) {
  3. return parseInt(a.style[b] || getComputedStyle(a, null).getPropertyValue(b))
  4. }
  5. function c(a, b) {
  6. return new RegExp("(\\s|^)" + b + "(\\s|$)").test(a.className)
  7. }
  8. function d(a, b) {
  9. a.classList ? a.classList.add(b) : c(a, b) || (a.className += "" + b)
  10. }
  11. function e(a, b) {
  12. a.classList ? a.classList.remove(b) : c(a, b) && (a.className = a.className.replace(new RegExp("(\\s|^)" + b + "(\\s|$)"), " ").replace(/^\s+|\s+$/g, ""))
  13. }
  14. function f(a, b) { (!isFinite(a) || 0 > a) && (a = 0);
  15. var c = b.alwaysShowHours ? [0] : [];
  16. return Math.floor(a / 3600) % 24 && c.push(Math.floor(a / 3600) % 24),
  17. c.push(Math.floor(a / 60) % 60),
  18. c.push(Math.floor(a % 60)),
  19. c = c.join(":"),
  20. 1 == b.timeFormatType && (c = c.replace(/(:|^)([0-9])(?=:|$)/g, "$10$2")),
  21. c
  22. }
  23. function g() {
  24. return document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen
  25. }
  26. function h(a) {
  27. var b, c;
  28. switch (a = a.toLowerCase().split("?")[0], b = a.substring(a.lastIndexOf(".") + 1), c = /mp4|m4v|ogg|ogv|m3u8|webm|webmv|wmv|mpeg|mov/gi.test(b) ? "video/": "audio/", b) {
  29. case "mp4":
  30. case "m4v":
  31. case "m4a":
  32. return c + "mp4";
  33. case "webm":
  34. case "webma":
  35. case "webmv":
  36. return c + "webm";
  37. case "ogg":
  38. case "oga":
  39. case "ogv":
  40. return c + "ogg";
  41. case "m3u8":
  42. return "application/x-mpegurl";
  43. case "ts":
  44. return c + "mp2t";
  45. default:
  46. return c + b
  47. }
  48. }
  49. function i(a, b) {
  50. return a && !b ? h(a) : b && ~b.indexOf(";") ? b.substr(0, b.indexOf(";")) : b
  51. }
  52. function j(b, c, d) {
  53. var f, g, h, e = [];
  54. if (c.type) if ("string" == typeof c.type) e.push({
  55. type: c.type,
  56. url: d
  57. });
  58. else for (f = 0; f < c.type.length; f++) e.push({
  59. type: c.type[f],
  60. url: d
  61. });
  62. else if (null !== d) e.push({
  63. type: i(d, b.getAttribute("type")),
  64. url: d
  65. });
  66. else for (f = 0; f < b.children.length; f++) g = b.children[f],
  67. 1 == g.nodeType && "source" == g.tagName.toLowerCase() && (d = g.getAttribute("src"), e.push({
  68. type: i(d, g.getAttribute("type")),
  69. url: d
  70. }));
  71. if (a.features.isBustedAndroid && (b.canPlayType = function(a) {
  72. return /video\/(mp4|m4v)/i.test(a) ? "maybe": ""
  73. }), a.features.isChromium && (b.canPlayType = function(a) {
  74. return /video\/(webm|ogv|ogg)/i.test(a) ? "maybe": ""
  75. }), a.features.supportsCanPlayType) for (f = 0; f < e.length; f++) if ("video/m3u8" == e[f].type || "" !== b.canPlayType(e[f].type).replace(/no/, "") || "" !== b.canPlayType(e[f].type.replace(/mp3/, "mpeg")).replace(/no/, "") || "" !== b.canPlayType(e[f].type.replace(/m4a/, "mp4")).replace(/no/, "")) {
  76. h = !0;
  77. break
  78. }
  79. return h
  80. }
  81. var k, a = {};
  82. var owfts,owft = true,wof = document.getElementsByClassName("zy_media"); //2019-3-23 添加开关
  83. a.config = {
  84. type: "",
  85. mediaTitle: "",
  86. nativeControls: !1,
  87. autoplay: !1,
  88. preload: "none",
  89. videoWidth: "100%",
  90. videoHeight: "auto",
  91. aspectRation: 16 / 9,
  92. audioWidth: "100%",
  93. audioHeight: 44,
  94. autoLoop: !1,
  95. timeFormatType: 1,
  96. alwaysShowHours: !1,
  97. alwaysShowControls: !1,
  98. hideVideoControlsOnLoad: !1,
  99. enableFullscreen: !0,
  100. pauseOtherPlayers: !0,
  101. duration: 0,
  102. success: null,
  103. error: null
  104. },
  105. function(a) {
  106. var b = window.navigator.userAgent.toLowerCase(),
  107. c = document.createElement("video");
  108. a.isiOS = /iphone|ipod|ipad/i.test(b) && !window.MSStream,
  109. a.isAndroid = /android/i.test(b) && !window.MSStream,
  110. a.isBustedAndroid = /android 2\.[12]/i.test(b),
  111. a.isChromium = /chromium/i.test(b),
  112. a.hasTouch = "ontouchstart" in window,
  113. a.supportsCanPlayType = "undefined" != typeof c.canPlayType,
  114. a.isVendorBigPlay = /iphone/i.test(b) && !window.MSStream,
  115. a.isVendorControls = /baidu/i.test(b),
  116. a.isVendorFullscreen = /micromessenger|weibo/i.test(b),
  117. a.isVendorAutoplay = /v819mini/i.test(b) || a.isiOS,
  118. a.nativeFullscreenPrefix = function() {
  119. return c.requestFullScreen ? "": c.webkitRequestFullScreen ? "webkit": c.mozRequestFullScreen ? "moz": c.msRequestFullScreen ? "ms": "-"
  120. } (),
  121. a.hasOldNativeFullScreen = "-" == a.nativeFullscreenPrefix && c.webkitEnterFullscreen,
  122. a.hasOldNativeFullScreen && /mac os x 10_5/i.test(b) && (a.nativeFullscreenPrefix = "-", a.hasOldNativeFullScreen = !1)
  123. } (a.features = {}),
  124. k = 0,
  125. a.players = {},
  126. a.MediaPlayer = function(b, c) {
  127. var e, f, g, i, d = this;
  128. if (!b.isInstantiated && (b.isInstantiated = !0, d.media = b, f = d.media.tagName.toLowerCase(), /audio|video/.test(f))) {
  129. d.isVideo = "video" === f,
  130. d.options = {};
  131. for (e in a.config) d.options[e] = a.config[e];
  132. try {
  133. for (e in c) d.options[e] = c[e];
  134. g = JSON.parse(d.media.getAttribute("data-config"));
  135. for (e in g) d.options[e] = g[e]
  136. } catch(h) {}
  137. d.options.autoplay && (d.options.autoplay = !a.features.isVendorAutoplay),
  138. d.isVideo || (d.options.alwaysShowControls = !0),
  139. d.options.nativeControls || a.features.isVendorControls ? d.media.setAttribute("controls", "controls") : (i = d.media.getAttribute("src"), i = "" === i ? null: i, j(d.media, d.options, i) ? (d.id = "zym_" + k++, a.players[d.id] = d, d.init()) : alert("不支持此" + (d.isVideo ? "视": "音") + "频"))
  140. }
  141. },
  142. a.MediaPlayer.prototype = {
  143. isControlsVisible: !0,
  144. isFullScreen: !1,
  145. setPlayerSize: function(a) {
  146. var f, g, d = this,
  147. e = b(d.container, "width");
  148. a > e && (d.width = e),
  149. d.enableAutoSize && (f = d.media.videoWidth, g = d.media.videoHeight, f && g && Math.abs(d.options.aspectRation - f / g) < .1 && (d.options.aspectRation = f / g), d.height = parseInt(e / d.options.aspectRation)),
  150. d.container.style.width = d.width + "px",
  151. // d.media.style.height = d.container.style.height = d.height + "px" //2019-3-23 原插件代码
  152. d.media.style.height = d.container.style.height = 250 + "px" //2019-3-23 修改视频高度
  153. },
  154. showControls: function() {
  155. var a = this;
  156. a.isControlsVisible || (a.controls.style.bottom = "-45px", a.options.mediaTitle && (a.title.style.top = "-35px"), a.isControlsVisible = !0)
  157. },
  158. hideControls: function() {
  159. var a = this;
  160. a.isControlsVisible && !a.options.alwaysShowControls && (a.controls.style.bottom = "0px", a.options.mediaTitle && (a.title.style.top = "0px"), a.isControlsVisible = !1)
  161. },
  162. setControlsTimer: function(a) {
  163. var b = this;
  164. clearTimeout(b.controlsTimer),
  165. b.controlsTimer = setTimeout(function() {
  166. b.hideControls()
  167. },
  168. a)
  169. },
  170. updateTimeline: function(a) {
  171. var g, c = this,
  172. d = void 0 !== a ? a.target: c.media,
  173. e = null,
  174. f = b(c.slider, "width");
  175. d.buffered && d.buffered.length > 0 && d.buffered.end && d.duration ? e = d.buffered.end(d.buffered.length - 1) / d.duration: void 0 !== d.bytesTotal && d.bytesTotal > 0 && void 0 !== d.bufferedBytes ? e = d.bufferedBytes / d.bytesTotal: a && a.lengthComputable && 0 !== a.total && (e = a.loaded / a.total),
  176. null !== e && (e = Math.min(1, Math.max(0, e)), c.loaded.style.width = f * e + "px", c.media.paused && setTimeout(function() {
  177. c.loaded.style.width = f * e + "px",
  178. c.updateTimeline()
  179. },
  180. 300)),
  181. void 0 !== c.media.currentTime && c.media.duration && (g = Math.round(f * c.media.currentTime / c.media.duration), c.current.style.width = g + "px", c.handle.style.left = g - Math.round(b(c.handle, "width") / 2) + "px")
  182. },
  183. updateTime: function() {
  184. var a = this;
  185. // console.log(a.media.currentTime) //2019-3-23 视频当前播放时间
  186. /* 2019-3-23
  187. * 播放时,判断data-off 属性值是否为0,如果为0时,当不执行弹出报名窗口;
  188. */
  189. if(wof[0].getAttribute("data-off") == 0){ owft = false; }
  190. // if(owft){
  191. // if(a.media.currentTime >= 10){
  192. // document.getElementsByClassName("zy_playpause_btn")[0].click();
  193. // wpopup(); //当播放视频时,观看10秒后暂停,弹出报名窗口;
  194. // owft=false;
  195. // }
  196. // }
  197. a.currentTime.innerHTML = f(a.media.currentTime, a.options),
  198. (a.options.duration > 1 || a.media.duration > 1) && (a.durationDuration.innerHTML = f(a.options.duration > 1 ? a.options.duration: a.media.duration, a.options))
  199. },
  200. buildPlaypause: function() {
  201. function c(c) { (a.media.isUserClick || a.options.autoplay) && ("play" === c ? (e(b, "zy_play"), d(b, "zy_pause")) : (e(b, "zy_pause"), d(b, "zy_play")))
  202. }
  203. var a = this,
  204. b = document.createElement("div");
  205. var poay = document.getElementsByClassName("poay")[0]; //2019-3-24 获取大的播放按钮
  206. b.className = "zy_playpause_btn zy_play",
  207. a.controls.appendChild(b),
  208. //2019-3-24 监听大的播放按钮
  209. poay.addEventListener("click",
  210. function() {
  211. /* 2019-3-23
  212. * 这里处理播放按钮事件,当未报名时,观看到十秒后再次点击播放按钮时,弹出报名窗口;
  213. * 如果报名后 data-off 属性值为 0 时,点击播放按钮,只起到暂停及播放功能
  214. */
  215. (wof[0].getAttribute("data-off") == 0) ? (owfts = true) : (owfts = owft);
  216. if(owfts){
  217. a.media.isUserClick = !0,
  218. a.media.paused ? (a.media.play(), a.media.paused || a.options.alwaysShowControls || a.setControlsTimer(3e3)) : a.media.pause()
  219. }else{
  220. wpopup(); //当未报名时,点击播放按钮继续弹出报名窗口;
  221. }
  222. }),
  223. b.addEventListener("click",
  224. function() {
  225. /* 2019-3-23
  226. * 这里处理播放按钮事件,当未报名时,观看到十秒后再次点击播放按钮时,弹出报名窗口;
  227. * 如果报名后 data-off 属性值为 0 时,点击播放按钮,只起到暂停及播放功能
  228. */
  229. (wof[0].getAttribute("data-off") == 0) ? (owfts = true) : (owfts = owft);
  230. if(owfts){
  231. a.media.isUserClick = !0,
  232. a.media.paused ? (a.media.play(), a.media.paused || a.options.alwaysShowControls || a.setControlsTimer(3e3)) : a.media.pause()
  233. }else{
  234. wpopup(); //当未报名时,点击播放按钮继续弹出报名窗口;
  235. }
  236. }),
  237. a.media.addEventListener("play",
  238. function() {
  239. c("play")
  240. poay.style.display="none"; //2019-3-24 当播放时,大的播放按钮直接隐藏
  241. }),
  242. a.media.addEventListener("playing",
  243. function() {
  244. c("play")
  245. }),
  246. a.media.addEventListener("pause",
  247. function() {
  248. c("pse")
  249. }),
  250. a.media.addEventListener("paused",
  251. function() {
  252. c("pse")
  253. })
  254. },
  255. enterFullScreen: function() {
  256. var c = this;
  257. if (c.normalHeight = b(c.container, "height"), c.normalWidth = b(c.container, "width"), "-" != a.features.nativeFullscreenPrefix) c.container[a.features.nativeFullscreenPrefix + "RequestFullScreen"]();
  258. else if (a.features.hasOldNativeFullScreen) return c.media.webkitEnterFullscreen(),
  259. void 0;
  260. d(document.documentElement, "zy_fullscreen"),
  261. c.media.style.width = c.container.style.width = "100%",
  262. c.media.style.height = c.container.style.height = "100%",
  263. d(c.fullscreenBtn, "zy_unfullscreen"),
  264. c.isFullScreen = !0
  265. },
  266. exitFullScreen: function() {
  267. var b = this; (g() || b.isFullScreen) && ("-" != a.features.nativeFullscreenPrefix ? document[a.features.nativeFullscreenPrefix + "CancelFullScreen"]() : a.features.hasOldNativeFullScreen && document.webkitExitFullscreen()),
  268. e(document.documentElement, "zy_fullscreen"),
  269. b.media.style.width = b.container.style.width = b.normalWidth + "px",
  270. b.media.style.height = b.container.style.height = b.normalHeight + "px",
  271. e(b.fullscreenBtn, "zy_unfullscreen"),
  272. b.isFullScreen = !1
  273. },
  274. buildContainer: function() {
  275. var a = this;
  276. a.container = a.media.parentNode,
  277. a.container.style.overflow = "hidden",
  278. a.container.style.height = (a.isVideo ? b(a.container, "width") / a.options.aspectRation: a.options.audioHeight) + "px",
  279. a.container.innerHTML = '<div class="zy_wrap"></div><div class="zy_controls"></div>' + (a.options.mediaTitle ? '<div class="zy_title">' + a.options.mediaTitle + "</div>": ""),
  280. a.title = a.container.querySelector(".zy_title"),
  281. a.media.setAttribute("preload", a.options.preload),
  282. a.container.querySelector(".zy_wrap").appendChild(a.media),
  283. a.controls = a.container.querySelector(".zy_controls"),
  284. a.isVideo && (a.width = a.options.videoWidth, a.height = a.options.videoHeight, "100%" == a.width && "auto" == a.height && (a.enableAutoSize = !0), a.setPlayerSize(a.width, a.height))
  285. },
  286. buildTime: function() {
  287. var a = this,
  288. b = document.createElement("div");
  289. b.className = "zy_time",
  290. b.innerHTML = '<span class="zy_currenttime">' + f(0, a.options) + "</span>/" + '<span class="zy_duration">' + f(a.options.duration, a.options) + "</span>",
  291. a.controls.appendChild(b),
  292. a.currentTime = b.children[0],
  293. a.durationDuration = b.children[1],
  294. a.media.addEventListener("timeupdate",
  295. function() {
  296. a.updateTime()
  297. })
  298. },
  299. buildTimeline: function() {
  300. var e, g, h, i, j, c = this,
  301. d = document.createElement("div");
  302. d.className = "zy_timeline",
  303. d.innerHTML = '<div class="zy_timeline_slider"><div class="zy_timeline_buffering" style="display:none"></div><div class="zy_timeline_loaded"></div><div class="zy_timeline_current"></div><div class="zy_timeline_handle"></div></div>',
  304. c.controls.appendChild(d),
  305. c.slider = d.children[0],
  306. c.buffering = c.slider.children[0],
  307. c.loaded = c.slider.children[1],
  308. c.current = c.slider.children[2],
  309. c.handle = c.slider.children[3],
  310. e = !1,
  311. g = c.slider.offsetLeft,
  312. h = b(c.slider, "width"),
  313. i = b(c.handle, "width") / 2,
  314. j = function(a) {
  315. var d, b = 0;
  316. d = a.changedTouches ? a.changedTouches[0].pageX: a.pageX,
  317. c.media.duration && (g > d ? d = g: d > h + g && (d = h + g), c.handle.style.left = d - i - g + "px", b = (d - g) / h * c.media.duration, c.currentTime.innerHTML = f(c.media.currentTime, c.options), e && b !== c.media.currentTime && (c.media.currentTime = b))
  318. },
  319. a.features.hasTouch ? c.slider.addEventListener("touchstart",
  320. function(a) {
  321. e = !0,
  322. j(a),
  323. g = c.slider.offsetLeft,
  324. h = b(c.slider, "width"),
  325. c.slider.addEventListener("touchmove", j),
  326. c.slider.addEventListener("touchend",
  327. function() {
  328. e = !1,
  329. c.slider.removeEventListener("touchmove", j)
  330. })
  331. }) : c.slider.addEventListener("mousedown",
  332. function(a) {
  333. e = !0,
  334. j(a),
  335. g = c.slider.offsetLeft,
  336. h = b(c.slider, "width"),
  337. c.slider.addEventListener("mousemove", j),
  338. c.slider.addEventListener("mouseup",
  339. function() {
  340. e = !1,
  341. c.slider.addEventListener("mousemove", j)
  342. })
  343. }),
  344. c.slider.addEventListener("mouseenter",
  345. function() {
  346. c.slider.addEventListener("mousemove", j)
  347. }),
  348. c.slider.addEventListener("mouseleave",
  349. function() {
  350. e || c.slider.removeEventListener("mousemove", j)
  351. }),
  352. c.media.addEventListener("timeupdate",
  353. function(a) {
  354. c.updateTimeline(a)
  355. })
  356. },
  357. buildFullscreen: function() {
  358. var c, b = this;
  359. "-" != a.features.nativeFullscreenPrefix && (c = function() {
  360. b.isFullScreen && (g() || b.exitFullScreen())
  361. },
  362. document.addEventListener(a.features.nativeFullscreenPrefix + "fullscreenchange", c)),
  363. b.fullscreenBtn = document.createElement("div"),
  364. b.fullscreenBtn.className = "zy_fullscreen_btn",
  365. b.controls.appendChild(b.fullscreenBtn),
  366. b.fullscreenBtn.addEventListener("click",
  367. function() {
  368. "-" != a.features.nativeFullscreenPrefix && g() || b.isFullScreen ? b.exitFullScreen() : b.enterFullScreen()
  369. })
  370. },
  371. buildDec: function() {
  372. var d, e, b = this,
  373. c = document.createElement("div");
  374. c.className = "dec_loading",
  375. c.style.display = "none",
  376. b.container.appendChild(c),
  377. d = document.createElement("div"),
  378. d.className = "dec_error",
  379. d.style.display = "none",
  380. d.innerHTML = "播放异常",
  381. b.container.appendChild(d),
  382. e = document.createElement("div"),
  383. a.features.isVendorBigPlay || (e.className = "dec_play", b.container.appendChild(e), e.addEventListener("click",
  384. function() {
  385. b.media.isUserClick = !0,
  386. b.media.play(),
  387. b.media.paused || b.options.alwaysShowControls || b.setControlsTimer(3e3)
  388. })),
  389. b.media.addEventListener("play",
  390. function() {
  391. b.media.isUserClick && (e.style.display = "none", c.style.display = "", b.buffering.style.display = "none")
  392. }),
  393. b.media.addEventListener("playing",
  394. function() {
  395. e.style.display = "none",
  396. c.style.display = "none",
  397. b.buffering.style.display = "none",
  398. d.style.display = "none"
  399. }),
  400. b.media.addEventListener("seeking",
  401. function() {
  402. c.style.display = "",
  403. e.style.display = "none",
  404. b.buffering.style.display = ""
  405. }),
  406. b.media.addEventListener("seeked",
  407. function() {
  408. c.style.display = "none",
  409. b.buffering.style.display = "none"
  410. }),
  411. b.media.addEventListener("pause",
  412. function() {
  413. e.style.display = ""
  414. }),
  415. b.media.addEventListener("waiting",
  416. function() {
  417. c.style.display = "",
  418. e.style.display = "none",
  419. b.buffering.style.display = ""
  420. }),
  421. b.media.addEventListener("error",
  422. function(a) {
  423. c.style.display = "none",
  424. e.style.display = "",
  425. b.buffering.style.display = "none",
  426. b.media.pause(),
  427. d.style.display = "",
  428. "function" == typeof b.options.error && b.options.error(a)
  429. })
  430. },
  431. init: function() {
  432. var d, b = this,
  433. c = ["Container", "Playpause", "Timeline", "Time"];
  434. for (b.options.enableFullscreen && !a.features.isVendorFullscreen && b.isVideo && c.push("Fullscreen"), b.isVideo && c.push("Dec"), d = 0; d < c.length; d++) try {
  435. b["build" + c[d]]()
  436. } catch(e) {}
  437. b.isVideo && (a.features.hasTouch ? b.media.addEventListener("click",
  438. function() {
  439. b.isControlsVisible ? b.hideControls() : (b.showControls(), b.media.paused || b.options.alwaysShowControls || b.setControlsTimer(3e3))
  440. }) : (b.media.addEventListener("click",
  441. function() {
  442. b.media.paused ? b.media.play() : b.media.pause()
  443. }), b.container.addEventListener("mouseenter",
  444. function() {
  445. b.showControls(),
  446. b.options.alwaysShowControls || b.setControlsTimer(3e3)
  447. }), b.container.addEventListener("mousemove",
  448. function() {
  449. b.showControls(),
  450. b.options.alwaysShowControls || b.setControlsTimer(3e3)
  451. })), b.options.hideVideoControlsOnLoad && b.hideControls(), b.media.addEventListener("loadedmetadata",
  452. function() {
  453. b.enableAutoSize && setTimeout(function() {
  454. isNaN(b.media.videoHeight) || b.setPlayerSize()
  455. },
  456. 50)
  457. })),
  458. b.media.addEventListener("play",
  459. function() {
  460. var c, d;
  461. for (d in a.players) if (c = a.players[d], c.id != b.id && b.options.pauseOtherPlayers && !c.paused && !c.ended) try {
  462. c.media.pause()
  463. } catch(e) {}
  464. }),
  465. window.addEventListener("orientationchange",
  466. function() {
  467. setTimeout(function() {
  468. b.setPlayerSize()
  469. },
  470. 500)
  471. }),
  472. b.media.addEventListener("ended",
  473. function(a) {
  474. b.media.currentTime = 0,
  475. b.options.autoLoop ? b.media.play() : (b.isVideo && setTimeout(function() {
  476. b.container.querySelector(".dec_loading").style.display = "none"
  477. },
  478. 20), b.media.pause()),
  479. b.updateTimeline(a)
  480. }),
  481. b.media.addEventListener("loadedmetadata",
  482. function() {
  483. b.updateTime()
  484. }),
  485. b.options.autoplay && (b.media.isUserClick = !1, b.media.play()),
  486. "function" == typeof b.options.success && b.options.success(b.media)
  487. }
  488. },
  489. window.zymedia = function(b, c) {
  490. "string" == typeof b ? [].forEach.call(document.querySelectorAll(b),
  491. function(b) {
  492. new a.MediaPlayer(b, c)
  493. }) : new a.MediaPlayer(b, c)
  494. }
  495. } ();
  496. // 报名弹窗方法
  497. function wpopup(){
  498. $(".lpapply").animate({top:"0px"},300);
  499. $('.keep').show();
  500. }