Files
ArtPlayer/packages/artplayer/dist/artplayer.js
T
2018-11-28 10:58:25 +08:00

9 lines
86 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*!
* artplayer.js v1.0.3
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2018 Harvey Zack
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.artplayer={})}(this,function(t){"use strict";var zt=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function i(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}var r=function(t,e,n){return e&&i(t.prototype,e),n&&i(t,n),t},o="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}var a=n(function(e){function n(t){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t){return"function"==typeof Symbol&&"symbol"===n(Symbol.iterator)?e.exports=i=function(t){return n(t)}:e.exports=i=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":n(t)},i(t)}e.exports=i});var s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var c=function(t,e){return!e||"object"!==a(e)&&"function"!=typeof e?s(t):e},u=n(function(e){function n(t){return e.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},n(t)}e.exports=n}),l=n(function(n){function i(t,e){return n.exports=i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},i(t,e)}n.exports=i});var d=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)};function f(){}f.prototype={on:function(t,e,n){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var i=this;function r(){i.off(t,r),e.apply(n,arguments)}return r._=e,this.on(t,r,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),i=0,r=n.length;i<r;i++)n[i].fn.apply(n[i].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),i=n[t],r=[];if(i&&e)for(var o=0,a=i.length;o<a;o++)i[o].fn!==e&&i[o].fn._!==e&&r.push(i[o]);return r.length?n[t]=r:delete n[t],this}};var h=f,p=n(function(t,e){t.exports=function(){function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var u=Object.prototype.toString,a=function(t){if(void 0===t)return"undefined";if(null===t)return"null";var e,n,i,r,o,a,s=c(t);if("boolean"===s)return"boolean";if("string"===s)return"string";if("number"===s)return"number";if("symbol"===s)return"symbol";if("function"===s)return"GeneratorFunction"===l(t)?"generatorfunction":"function";if(e=t,Array.isArray?Array.isArray(e):e instanceof Array)return"array";if((a=t).constructor&&"function"==typeof a.constructor.isBuffer&&a.constructor.isBuffer(a))return"buffer";if(function(t){try{if("number"==typeof t.length&&"function"==typeof t.callee)return!0}catch(t){if(-1!==t.message.indexOf("callee"))return!0}return!1}(t))return"arguments";if((n=t)instanceof Date||"function"==typeof n.toDateString&&"function"==typeof n.getDate&&"function"==typeof n.setDate)return"date";if((i=t)instanceof Error||"string"==typeof i.message&&i.constructor&&"number"==typeof i.constructor.stackTraceLimit)return"error";if((r=t)instanceof RegExp||"string"==typeof r.flags&&"boolean"==typeof r.ignoreCase&&"boolean"==typeof r.multiline&&"boolean"==typeof r.global)return"regexp";switch(l(t)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if("function"==typeof(o=t).throw&&"function"==typeof o.return&&"function"==typeof o.next)return"generator";switch(s=u.call(t)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return s.slice(8,-1).toLowerCase().replace(/\s/g,"")};function l(t){return t.constructor?t.constructor.name:null}function o(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:["option"];for(var i in d(t,e,n),f(t,e,n),h(t,e,n),e)if(e.hasOwnProperty(i)){var r=t[i],o=e[i],a=n.concat(i);if(s(t,i,o,a))continue;d(r,o,a),f(r,o,a),h(r,o,a)}}function s(t,e,n,i){if(!Object.prototype.hasOwnProperty.call(t,e)){if(!0===n.__required__||!0===n.required)throw new TypeError("'".concat(i.join("."),"' is required"));return!0}}function d(t,e,n){var i;if("string"===a(e)?i=e:"function"===a(e)?e.___validator__=e:e.__type__?i=e.__type__:e.type&&(i=e.type),i&&"string"===a(i)){i=i.trim().toLowerCase();var r=a(t),o=r===i;if(-1<i.indexOf("|")&&(o=i.split("|").filter(Boolean).some(function(t){return r===t.trim()})),!o)throw new TypeError("'".concat(n.join("."),"' require '").concat(i,"' type, but got '").concat(r,"'"))}}function f(t,e,n){var i;if(e.___validator__?i=e.___validator__:e.validator&&(i=e.validator),"function"===a(i)){var r=i(n,t,a(t));if(!0!==r)throw new TypeError("The scheme for '".concat(n.join("."),"' validator function require return true, but got '").concat(r,"'"))}}function h(t,e,n){var i;if(e.___child__?i=e.___child__:e.child&&(i=e.child),"object"===a(i)){var r=a(t);"object"===r?o(t,i,n):"array"===r&&t.forEach(function(t,e){o(t,i,n.concat(e))})}}return o.kindOf=a,window.optionValidator=o}()}),v=function(t){return!(!(i=t)||"object"!=typeof i||(e=t,"[object RegExp]"===(n=Object.prototype.toString.call(e))||"[object Date]"===n||e.$$typeof===y));var e,n,i};var y="function"==typeof Symbol&&Symbol.for?Symbol.for("react.element"):60103;function m(t,e){return!1!==e.clone&&e.isMergeableObject(t)?b((n=t,Array.isArray(n)?[]:{}),t,e):t;var n}function g(t,e,n){return t.concat(e).map(function(t){return m(t,n)})}function b(t,e,n){(n=n||{}).arrayMerge=n.arrayMerge||g,n.isMergeableObject=n.isMergeableObject||v;var i,r,o,a,s=Array.isArray(e);return s===Array.isArray(t)?s?n.arrayMerge(t,e,n):(i=t,r=e,a={},(o=n).isMergeableObject(i)&&Object.keys(i).forEach(function(t){a[t]=m(i[t],o)}),Object.keys(r).forEach(function(t){o.isMergeableObject(r[t])&&i[t]?a[t]=b(i[t],r[t],o):a[t]=m(r[t],o)}),a):m(e,n)}b.all=function(t,n){if(!Array.isArray(t))throw new Error("first argument should be an array");return t.reduce(function(t,e){return b(t,e,n)},{})};var w=b;var x=function(t){return-1!==Function.toString.call(t).indexOf("[native code]")},k=n(function(i){function r(t,e,n){return!function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(t){return!1}}()?i.exports=r=function(t,e,n){var i=[null];i.push.apply(i,e);var r=new(Function.bind.apply(t,i));return n&&l(r,n.prototype),r}:i.exports=r=Reflect.construct,r.apply(null,arguments)}i.exports=r}),E=function(t){function i(t,e){var n;return zt(this,i),n=c(this,u(i).call(this,t)),"function"==typeof Error.captureStackTrace&&Error.captureStackTrace(s(s(n)),e||n.constructor),n.name="ArtPlayerError",n}return d(i,t),i}(n(function(e){function i(t){var n="function"==typeof Map?new Map:void 0;return e.exports=i=function(t){if(null===t||!x(t))return t;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==n){if(n.has(t))return n.get(t);n.set(t,e)}function e(){return k(t,arguments,u(this).constructor)}return e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),l(e,t)},i(t)}e.exports=i})(Error));function Bt(t,e){var n="function"==typeof t;if(n?!n():!t)throw new E(e)}function S(t,e){return e instanceof Element?t.appendChild(e):t.insertAdjacentHTML("beforeend",e),t.lastElementChild}function $(t,e,n){var i=Array.from(t.children);e.dataset.index=n;var r=i.find(function(t){return Number(t.dataset.index)>=Number(n)});return r?r.insertAdjacentElement("beforebegin",e):S(t,e),e}function Wt(t,e,n){return t.style[e]=n,t}function P(e,n){return Object.keys(n).forEach(function(t){Wt(e,t,n[t])}),e}function O(t,e){var n=!(2<arguments.length&&void 0!==arguments[2])||arguments[2],i=window.getComputedStyle(t,null).getPropertyValue(e);return n?parseFloat(i):i}function R(e){return Array.from(e.parentElement.children).filter(function(t){return t!==e})}function C(t,e){R(t).forEach(function(t){return t.classList.remove(e)}),t.classList.add(e)}function T(t,e){var n=2<arguments.length&&void 0!==arguments[2]?arguments[2]:"up";t.setAttribute("data-balloon",e),t.setAttribute("data-balloon-pos",n)}function _(t){return"WEBVTT \r\n\r\n".concat(t.replace(/\{\\([ibu])\}/g,"</$1>").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"</$1>").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function j(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function qt(t,e,n){return Math.max(Math.min(t,Math.max(e,n)),Math.min(e,n))}function Dt(t){return t.includes("?")?Dt(t.split("?")[0]):t.includes("#")?Dt(t.split("#")[0]):t.trim().toLowerCase().split(".").pop()}function Ht(t){var e=Math.floor(t/3600),n=Math.floor((t-3600*e)/60),i=Math.floor(t-3600*e-60*n);return(0<e?[e,n,i]:[n,i]).map(function(t){return t<10?"0".concat(t):String(t)}).join(":")}function Ft(){var e=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0;return new Promise(function(t){return setTimeout(t,e)})}function L(i,r,o){var a;function t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];clearTimeout(a),a=setTimeout(function(){a=null,i.apply(o,e)},r)}return t.clearTimeout=function(){clearTimeout(a)},t}var M=Object.freeze({clamp:qt,getExt:Dt,secondToTime:Ht,sleep:Ft,debounce:L,ArtPlayerError:E,errorHandle:Bt,append:S,insertByIndex:$,setStyle:Wt,setStyles:P,getStyle:O,sublings:R,inverseClass:C,tooltip:T,srtToVtt:_,vttToBlob:j});function A(t,e,n){if("string"===n){if(""===e.trim())throw new E("".concat(t.join(".")," can not be empty"));return!0}if(e instanceof Element)return!0;throw new E("".concat(t.join(".")," require 'string' or 'Element' type, but got '").concat(n,"'"))}var z={container:{validator:A,required:!0},url:{type:"string",required:!0,validator:function(t,e,n){if("string"!==n)throw new E("".concat(t.join(".")," required 'string' type."));if(""===e.trim())throw new E("".concat(t.join(".")," can not be empty"));return!0}},poster:"string",title:"string",type:{type:"string"},mimeCodec:"string",theme:"string",volume:"number",isLive:"boolean",mse:"boolean",muted:"boolean",autoplay:"boolean",autoSize:"boolean",loop:"boolean",playbackRate:"boolean",aspectRatio:"boolean",screenshot:"boolean",setting:"boolean",hotkey:"boolean",pip:"boolean",mutex:"boolean",fullscreen:"boolean",fullscreenWeb:"boolean",plugins:{type:"array",child:{type:"function"}},whitelist:{type:"array",child:{type:"string|function|regexp"}},layers:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:A,style:"object",click:"function"}},contextmenu:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:A,style:"object",click:"function"}},quality:{type:"array",child:{default:"boolean",name:"string",url:"string"}},controls:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:A,style:"object",click:"function",position:function(t,e){return["top","left","right"].includes(e)}}},highlight:{type:"array",child:{type:"object",time:"number",text:"string"}},thumbnails:{type:"object",child:{type:"object",url:"string",number:"number",width:"number",height:"number",column:"number"}},subtitle:{type:"object",child:{type:"object",url:"string",style:"object"}},moreVideoAttr:"object",icons:"object",customType:"object",lang:"string"},It={mimeCodec:{mp4:'video/mp4; codecs="avc1.42E01E, mp4a.40.2"',webm:'video/webm; codecs="vorbis, vp8"',ts:'video/mp2t; codecs="avc1.42E01E, mp4a.40.2"'},mse:{mediaSource:{propertys:["activeSourceBuffers","duration","readyState","sourceBuffers"],methods:["addSourceBuffer","endOfStream","removeSourceBuffer","clearLiveSeekableRange","setLiveSeekableRange"],events:["sourceclose","sourceended","sourceopen"]},sourceBuffer:{propertys:["mode","updating","buffered","timestampOffset","audioTracks","videoTracks","textTracks","appendWindowStart","appendWindowEnd","trackDefaults"],methods:["appendBuffer","appendStream","abort","remove"],events:["abort","error","update","updateend","updatestart"]},sourceBufferList:{propertys:["length"],events:["addsourcebuffer","removesourcebuffer"]}},video:{propertys:["audioTracks","autoplay","buffered","controller","controls","crossOrigin","currentSrc","currentTime","defaultMuted","defaultPlaybackRate","duration","ended","error","loop","mediaGroup","muted","networkState","paused","playbackRate","played","preload","readyState","seekable","seeking","src","startDate","textTracks","videoTracks","volume"],methods:["addTextTrack","canPlayType","load","play","pause"],events:["abort","canplay","canplaythrough","durationchange","emptied","ended","error","loadeddata","loadedmetadata","loadstart","pause","play","playing","progress","ratechange","seeked","seeking","stalled","suspend","timeupdate","volumechange","waiting"]}},B=function t(e){var n=this;zt(this,t);var i=e.option.whitelist;this.userAgent=window.navigator.userAgent,this.isMobile=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.userAgent),this.state=!this.isMobile||i.some(function(t){var e=!1;switch(p.kindOf(t)){case"string":e=-1<n.userAgent.indexOf(t);break;case"function":e=t(n.userAgent);break;case"regexp":e=t.test(n.userAgent)}return e})},W=function t(e){zt(this,t);var n=e.refs;n.$container.innerHTML='\n <div class="artplayer-video-player">\n <video data-index="10" class="artplayer-video"></video>\n <div data-index="20" class="artplayer-subtitle"></div>\n <div data-index="30" class="artplayer-layers"></div>\n <div data-index="40" class="artplayer-mask"></div>\n <div data-index="50" class="artplayer-bottom">\n <div class="artplayer-progress"></div>\n <div class="artplayer-controls">\n <div class="artplayer-controls-left"></div>\n <div class="artplayer-controls-right"></div>\n </div>\n </div>\n <div data-index="60" class="artplayer-loading"></div>\n <div data-index="70" class="artplayer-notice">\n <div class="artplayer-notice-inner"></div>\n </div>\n <div data-index="80" class="artplayer-setting">\n <div class="artplayer-setting-inner">\n <div class="artplayer-setting-body"></div>\n <div class="artplayer-setting-close">×</div>\n </div>\n </div>\n <div data-index="90" class="artplayer-info">\n <div class="artplayer-info-panel"></div>\n <div class="artplayer-info-close">[x]</div>\n </div>\n <div data-index="100" class="artplayer-pip-header">\n <div class="artplayer-pip-title"></div>\n <div class="artplayer-pip-close">×</div>\n </div>\n <div data-index="110" class="artplayer-contextmenu"></div>\n </div>\n ',n.$player=n.$container.querySelector(".artplayer-video-player"),n.$video=n.$container.querySelector(".artplayer-video"),n.$subtitle=n.$container.querySelector(".artplayer-subtitle"),n.$bottom=n.$container.querySelector(".artplayer-bottom"),n.$progress=n.$container.querySelector(".artplayer-progress"),n.$controls=n.$container.querySelector(".artplayer-controls"),n.$controlsLeft=n.$container.querySelector(".artplayer-controls-left"),n.$controlsRight=n.$container.querySelector(".artplayer-controls-right"),n.$layers=n.$container.querySelector(".artplayer-layers"),n.$loading=n.$container.querySelector(".artplayer-loading"),n.$notice=n.$container.querySelector(".artplayer-notice"),n.$noticeInner=n.$container.querySelector(".artplayer-notice-inner"),n.$mask=n.$container.querySelector(".artplayer-mask"),n.$setting=n.$container.querySelector(".artplayer-setting"),n.$settingInner=n.$container.querySelector(".artplayer-setting-inner"),n.$settingBody=n.$container.querySelector(".artplayer-setting-body"),n.$settingClose=n.$container.querySelector(".artplayer-setting-close"),n.$info=n.$container.querySelector(".artplayer-info"),n.$infoPanel=n.$container.querySelector(".artplayer-info-panel"),n.$infoClose=n.$container.querySelector(".artplayer-info-close"),n.$pipHeader=n.$container.querySelector(".artplayer-pip-header"),n.$pipTitle=n.$container.querySelector(".artplayer-pip-title"),n.$pipClose=n.$container.querySelector(".artplayer-pip-close"),n.$contextmenu=n.$container.querySelector(".artplayer-contextmenu")},q={"zh-cn":{"About author":"关于作者","Video info":"视频统计信息",Close:"关闭","Video load failed":"视频加载失败","Video loading is aborted":"视频加载被中止",Volume:"音量",Play:"播放",Pause:"暂停",Rate:"速度",Mute:"静音",Flip:"视频翻转",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新连接","Hide subtitle":"隐藏字幕","Show subtitle":"显示字幕","Hide danmu":"隐藏弹幕","Show danmu":"显示弹幕","Show setting":"显示设置","Hide setting":"隐藏设置",Screenshot:"截图","Play speed":"播放速度","Aspect ratio":"画面比例",Default:"默认",Normal:"正常","Switch video":"切换","Switch subtitle":"切换字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"网页全屏","Exit web fullscreen":"退出网页全屏","Mini player":"迷你播放器"},"zh-tw":{"About author":"關於作者","Video info":"影片統計訊息",Close:"關閉","Video load failed":"影片載入失敗","Video loading is aborted":"影片加載被中止",Volume:"音量",Play:"播放",Pause:"暫停",Rate:"速度",Mute:"靜音",Flip:"影片翻轉",Horizontal:"水平",Vertical:"垂直",Reconnect:"重新連接","Hide subtitle":"隱藏字幕","Show subtitle":"顯示字幕","Show setting":"顯示设置","Hide setting":"隱藏设置","Hide danmu":"隱藏彈幕","Show danmu":"顯示彈幕",Screenshot:"截圖","Play speed":"播放速度","Aspect ratio":"畫面比例",Default:"默認",Normal:"正常","Switch video":"切換","Switch subtitle":"切換字幕",Fullscreen:"全屏","Exit fullscreen":"退出全屏","Web fullscreen":"網頁全屏","Exit web fullscreen":"退出網頁全屏","Mini player":"迷你播放器"}},D=function(){function e(t){zt(this,e),this.art=t,this.init()}return r(e,[{key:"init",value:function(){this.language=q[this.art.option.lang.toLowerCase()]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){q=w(q,t),this.init()}}]),e}();function Ut(e,t){var i=e.option,n=e.notice,r=e.refs.$video;Object.defineProperty(t,"screenshot",{value:function(){try{var t=function(){var t=document.createElement("canvas");t.width=r.videoWidth,t.height=r.videoHeight,t.getContext("2d").drawImage(r,0,0);var e=t.toDataURL("image/png"),n=document.createElement("a");return Wt(n,"display","none"),n.href=e,n.download="".concat(i.title||"artplayer","_").concat(Ht(r.currentTime),".png"),document.body.appendChild(n),n.click(),document.body.removeChild(n),e}();e.emit("screenshot",t)}catch(t){n.show(t),console.warn(t)}}})}var Nt=n(function(t){var o,e,n,i,r,a;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,n="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,i=function(){for(var t,e=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],n=0,i=e.length,r={};n<i;n++)if((t=e[n])&&t[1]in o){for(n=0;n<t.length;n++)r[e[0][n]]=t[n];return r}return!1}(),r={change:i.fullscreenchange,error:i.fullscreenerror},a={request:function(t){var e=i.requestFullscreen;t=t||o.documentElement,/ Version\/5\.1(?:\.\d+)? Safari\//.test(navigator.userAgent)?t[e]():t[e](n?Element.ALLOW_KEYBOARD_INPUT:{})},exit:function(){o[i.exitFullscreen]()},toggle:function(t){this.isFullscreen?this.exit():this.request(t)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,e){var n=r[t];n&&o.addEventListener(n,e,!1)},off:function(t,e){var n=r[t];n&&o.removeEventListener(n,e,!1)},raw:i},i?(Object.defineProperties(a,{isFullscreen:{get:function(){return Boolean(o[i.fullscreenElement])}},element:{enumerable:!0,get:function(){return o[i.fullscreenElement]}},enabled:{enumerable:!0,get:function(){return Boolean(o[i.fullscreenEnabled])}}}),e?t.exports=a:window.screenfull=a):e?t.exports=!1:window.screenfull=!1});var H=n(function(t){var e,n;e=window,n=function(){function m(t){var e=parseFloat(t);return-1==t.indexOf("%")&&!isNaN(e)&&e}var n="undefined"==typeof console?function(){}:function(t){console.error(t)},g=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"],b=g.length;function w(t){var e=getComputedStyle(t);return e||n("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? See https://bit.ly/getsizebug1"),e}var x,k=!1;function E(t){if(function(){if(!k){k=!0;var t=document.createElement("div");t.style.width="200px",t.style.padding="1px 2px 3px 4px",t.style.borderStyle="solid",t.style.borderWidth="1px 2px 3px 4px",t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var n=w(t);x=200==Math.round(m(n.width)),E.isBoxSizeOuter=x,e.removeChild(t)}}(),"string"==typeof t&&(t=document.querySelector(t)),t&&"object"==typeof t&&t.nodeType){var e=w(t);if("none"==e.display)return function(){for(var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0},e=0;e<b;e++)t[g[e]]=0;return t}();var n={};n.width=t.offsetWidth,n.height=t.offsetHeight;for(var i=n.isBorderBox="border-box"==e.boxSizing,r=0;r<b;r++){var o=g[r],a=e[o],s=parseFloat(a);n[o]=isNaN(s)?0:s}var c=n.paddingLeft+n.paddingRight,u=n.paddingTop+n.paddingBottom,l=n.marginLeft+n.marginRight,d=n.marginTop+n.marginBottom,f=n.borderLeftWidth+n.borderRightWidth,h=n.borderTopWidth+n.borderBottomWidth,p=i&&x,v=m(e.width);!1!==v&&(n.width=v+(p?0:c+f));var y=m(e.height);return!1!==y&&(n.height=y+(p?0:u+h)),n.innerWidth=n.width-(c+f),n.innerHeight=n.height-(u+h),n.outerWidth=n.width+l,n.outerHeight=n.height+d,n}}return E},t.exports?t.exports=n():e.getSize=n()}),F=n(function(t){var e,n;e="undefined"!=typeof window?window:o,n=function(){function t(){}var e=t.prototype;return e.on=function(t,e){if(t&&e){var n=this._events=this._events||{},i=n[t]=n[t]||[];return-1==i.indexOf(e)&&i.push(e),this}},e.once=function(t,e){if(t&&e){this.on(t,e);var n=this._onceEvents=this._onceEvents||{};return(n[t]=n[t]||{})[e]=!0,this}},e.off=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){var i=n.indexOf(e);return-1!=i&&n.splice(i,1),this}},e.emitEvent=function(t,e){var n=this._events&&this._events[t];if(n&&n.length){n=n.slice(0),e=e||[];for(var i=this._onceEvents&&this._onceEvents[t],r=0;r<n.length;r++){var o=n[r];i&&i[o]&&(this.off(t,o),delete i[o]),o.apply(this,e)}return this}},e.allOff=function(){delete this._events,delete this._onceEvents},t},t.exports?t.exports=n():e.EvEmitter=n()}),I=n(function(t){var e,n;e=window,n=function(r,t){function e(){}var n=e.prototype=Object.create(t.prototype);n.bindStartEvent=function(t){this._bindStartEvent(t,!0)},n.unbindStartEvent=function(t){this._bindStartEvent(t,!1)},n._bindStartEvent=function(t,e){var n=(e=void 0===e||e)?"addEventListener":"removeEventListener",i="mousedown";r.PointerEvent?i="pointerdown":"ontouchstart"in r&&(i="touchstart"),t[n](i,this)},n.handleEvent=function(t){var e="on"+t.type;this[e]&&this[e](t)},n.getTouch=function(t){for(var e=0;e<t.length;e++){var n=t[e];if(n.identifier==this.pointerIdentifier)return n}},n.onmousedown=function(t){var e=t.button;e&&0!==e&&1!==e||this._pointerDown(t,t)},n.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])},n.onpointerdown=function(t){this._pointerDown(t,t)},n._pointerDown=function(t,e){t.button||this.isPointerDown||(this.isPointerDown=!0,this.pointerIdentifier=void 0!==e.pointerId?e.pointerId:e.identifier,this.pointerDown(t,e))},n.pointerDown=function(t,e){this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e])};var i={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};return n._bindPostStartEvents=function(t){if(t){var e=i[t.type];e.forEach(function(t){r.addEventListener(t,this)},this),this._boundPointerEvents=e}},n._unbindPostStartEvents=function(){this._boundPointerEvents&&(this._boundPointerEvents.forEach(function(t){r.removeEventListener(t,this)},this),delete this._boundPointerEvents)},n.onmousemove=function(t){this._pointerMove(t,t)},n.onpointermove=function(t){t.pointerId==this.pointerIdentifier&&this._pointerMove(t,t)},n.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerMove(t,e)},n._pointerMove=function(t,e){this.pointerMove(t,e)},n.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])},n.onmouseup=function(t){this._pointerUp(t,t)},n.onpointerup=function(t){t.pointerId==this.pointerIdentifier&&this._pointerUp(t,t)},n.ontouchend=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerUp(t,e)},n._pointerUp=function(t,e){this._pointerDone(),this.pointerUp(t,e)},n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])},n._pointerDone=function(){this._pointerReset(),this._unbindPostStartEvents(),this.pointerDone()},n._pointerReset=function(){this.isPointerDown=!1,delete this.pointerIdentifier},n.pointerDone=function(){},n.onpointercancel=function(t){t.pointerId==this.pointerIdentifier&&this._pointerCancel(t,t)},n.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);e&&this._pointerCancel(t,e)},n._pointerCancel=function(t,e){this._pointerDone(),this.pointerCancel(t,e)},n.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])},e.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}},e},t.exports?t.exports=n(e,F):e.Unipointer=n(e,e.EvEmitter)}),U=n(function(t){var e,n;e=window,n=function(o,t){function e(){}var n=e.prototype=Object.create(t.prototype);n.bindHandles=function(){this._bindHandles(!0)},n.unbindHandles=function(){this._bindHandles(!1)},n._bindHandles=function(t){for(var e=(t=void 0===t||t)?"addEventListener":"removeEventListener",n=t?this._touchActionValue:"",i=0;i<this.handles.length;i++){var r=this.handles[i];this._bindStartEvent(r,t),r[e]("click",this),o.PointerEvent&&(r.style.touchAction=n)}},n._touchActionValue="none",n.pointerDown=function(t,e){this.okayPointerDown(t)&&(this.pointerDownPointer=e,t.preventDefault(),this.pointerDownBlur(),this._bindPostStartEvents(t),this.emitEvent("pointerDown",[t,e]))};var r={TEXTAREA:!0,INPUT:!0,SELECT:!0,OPTION:!0},a={radio:!0,checkbox:!0,button:!0,submit:!0,image:!0,file:!0};return n.okayPointerDown=function(t){var e=r[t.target.nodeName],n=a[t.target.type],i=!e||n;return i||this._pointerReset(),i},n.pointerDownBlur=function(){var t=document.activeElement;t&&t.blur&&t!=document.body&&t.blur()},n.pointerMove=function(t,e){var n=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,n]),this._dragMove(t,e,n)},n._dragPointerMove=function(t,e){var n={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};return!this.isDragging&&this.hasDragStarted(n)&&this._dragStart(t,e),n},n.hasDragStarted=function(t){return 3<Math.abs(t.x)||3<Math.abs(t.y)},n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]),this._dragPointerUp(t,e)},n._dragPointerUp=function(t,e){this.isDragging?this._dragEnd(t,e):this._staticClick(t,e)},n._dragStart=function(t,e){this.isDragging=!0,this.isPreventingClicks=!0,this.dragStart(t,e)},n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])},n._dragMove=function(t,e,n){this.isDragging&&this.dragMove(t,e,n)},n.dragMove=function(t,e,n){t.preventDefault(),this.emitEvent("dragMove",[t,e,n])},n._dragEnd=function(t,e){this.isDragging=!1,setTimeout(function(){delete this.isPreventingClicks}.bind(this)),this.dragEnd(t,e)},n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])},n.onclick=function(t){this.isPreventingClicks&&t.preventDefault()},n._staticClick=function(t,e){this.isIgnoringMouseUp&&"mouseup"==t.type||(this.staticClick(t,e),"mouseup"!=t.type&&(this.isIgnoringMouseUp=!0,setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)))},n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])},e.getPointerPoint=t.getPointerPoint,e},t.exports?t.exports=n(e,I):e.Unidragger=n(e,e.Unipointer)}),N=n(function(t){var e,n;e=window,n=function(o,c,t){function n(t,e){for(var n in e)t[n]=e[n];return t}var i=o.jQuery;function e(t,e){this.element="string"==typeof t?document.querySelector(t):t,i&&(this.$element=i(this.element)),this.options=n({},this.constructor.defaults),this.option(e),this._create()}var r=e.prototype=Object.create(t.prototype);e.defaults={},r.option=function(t){n(this.options,t)};var a={relative:!0,absolute:!0,fixed:!0};function u(t,e,n){return n=n||"round",e?Math[n](t/e)*e:t}return r._create=function(){this.position={},this._getPosition(),this.startPoint={x:0,y:0},this.dragPoint={x:0,y:0},this.startPosition=n({},this.position);var t=getComputedStyle(this.element);a[t.position]||(this.element.style.position="relative"),this.on("pointerDown",this.onPointerDown),this.on("pointerMove",this.onPointerMove),this.on("pointerUp",this.onPointerUp),this.enable(),this.setHandles()},r.setHandles=function(){this.handles=this.options.handle?this.element.querySelectorAll(this.options.handle):[this.element],this.bindHandles()},r.dispatchEvent=function(t,e,n){var i=[e].concat(n);this.emitEvent(t,i),this.dispatchJQueryEvent(t,e,n)},r.dispatchJQueryEvent=function(t,e,n){var i=o.jQuery;if(i&&this.$element){var r=i.Event(e);r.type=t,this.$element.trigger(r,n)}},r._getPosition=function(){var t=getComputedStyle(this.element),e=this._getPositionCoord(t.left,"width"),n=this._getPositionCoord(t.top,"height");this.position.x=isNaN(e)?0:e,this.position.y=isNaN(n)?0:n,this._addTransformPosition(t)},r._getPositionCoord=function(t,e){if(-1==t.indexOf("%"))return parseInt(t,10);var n=c(this.element.parentNode);return n?parseFloat(t)/100*n[e]:0},r._addTransformPosition=function(t){var e=t.transform;if(0===e.indexOf("matrix")){var n=e.split(","),i=0===e.indexOf("matrix3d")?12:4,r=parseInt(n[i],10),o=parseInt(n[i+1],10);this.position.x+=r,this.position.y+=o}},r.onPointerDown=function(t,e){this.element.classList.add("is-pointer-down"),this.dispatchJQueryEvent("pointerDown",t,[e])},r.dragStart=function(t,e){this.isEnabled&&(this._getPosition(),this.measureContainment(),this.startPosition.x=this.position.x,this.startPosition.y=this.position.y,this.setLeftTop(),this.dragPoint.x=0,this.dragPoint.y=0,this.element.classList.add("is-dragging"),this.dispatchEvent("dragStart",t,[e]),this.animate())},r.measureContainment=function(){var t=this.getContainer();if(t){var e=c(this.element),n=c(t),i=this.element.getBoundingClientRect(),r=t.getBoundingClientRect(),o=n.borderLeftWidth+n.borderRightWidth,a=n.borderTopWidth+n.borderBottomWidth,s=this.relativeStartPosition={x:i.left-(r.left+n.borderLeftWidth),y:i.top-(r.top+n.borderTopWidth)};this.containSize={width:n.width-o-s.x-e.width,height:n.height-a-s.y-e.height}}},r.getContainer=function(){var t=this.options.containment;if(t)return t instanceof HTMLElement?t:"string"==typeof t?document.querySelector(t):this.element.parentNode},r.onPointerMove=function(t,e,n){this.dispatchJQueryEvent("pointerMove",t,[e,n])},r.dragMove=function(t,e,n){if(this.isEnabled){var i=n.x,r=n.y,o=this.options.grid,a=o&&o[0],s=o&&o[1];i=u(i,a),r=u(r,s),i=this.containDrag("x",i,a),r=this.containDrag("y",r,s),i="y"==this.options.axis?0:i,r="x"==this.options.axis?0:r,this.position.x=this.startPosition.x+i,this.position.y=this.startPosition.y+r,this.dragPoint.x=i,this.dragPoint.y=r,this.dispatchEvent("dragMove",t,[e,n])}},r.containDrag=function(t,e,n){if(!this.options.containment)return e;var i="x"==t?"width":"height",r=u(-this.relativeStartPosition[t],n,"ceil"),o=this.containSize[i];return o=u(o,n,"floor"),Math.max(r,Math.min(o,e))},r.onPointerUp=function(t,e){this.element.classList.remove("is-pointer-down"),this.dispatchJQueryEvent("pointerUp",t,[e])},r.dragEnd=function(t,e){this.isEnabled&&(this.element.style.transform="",this.setLeftTop(),this.element.classList.remove("is-dragging"),this.dispatchEvent("dragEnd",t,[e]))},r.animate=function(){if(this.isDragging){this.positionDrag();var t=this;requestAnimationFrame(function(){t.animate()})}},r.setLeftTop=function(){this.element.style.left=this.position.x+"px",this.element.style.top=this.position.y+"px"},r.positionDrag=function(){this.element.style.transform="translate3d( "+this.dragPoint.x+"px, "+this.dragPoint.y+"px, 0)"},r.staticClick=function(t,e){this.dispatchEvent("staticClick",t,[e])},r.setPosition=function(t,e){this.position.x=t,this.position.y=e,this.setLeftTop()},r.enable=function(){this.isEnabled=!0},r.disable=function(){this.isEnabled=!1,this.isDragging&&this.dragEnd()},r.destroy=function(){this.disable(),this.element.style.transform="",this.element.style.left="",this.element.style.top="",this.element.style.position="",this.unbindHandles(),this.$element&&this.$element.removeData("draggabilly")},r._init=function(){},i&&i.bridget&&i.bridget("draggabilly",e),e},t.exports?t.exports=n(e,H,U):e.Draggabilly=n(e,e.getSize,e.Unidragger)});function Vt(t,e){var n,i,r,o,a,s,c,u,l,d,f,h,p,v,y,m,g,b;document.pictureInPictureEnabled?(y=e,m=(v=t).notice,g=v.refs.$video,b=v.events.proxy,g.disablePictureInPicture=!1,Object.defineProperty(y,"pipState",{get:function(){return document.pictureInPictureElement}}),Object.defineProperty(y,"pipEnabled",{value:function(){g.requestPictureInPicture().catch(function(t){m.show(t,!0,3e3),console.warn(t)})}}),Object.defineProperty(y,"pipExit",{value:function(){document.exitPictureInPicture().catch(function(t){m.show(t,!0,3e3),console.warn(t)})}}),b(g,"enterpictureinpicture",function(){v.emit("pipEnabled")}),b(g,"leavepictureinpicture",function(){v.emit("pipExit"),v.isPlaying&&y.play()}),v.on("destroy",function(){y.pipState&&y.pipExit()})):(i=e,r=(n=t).option,o=n.i18n,a=n.refs,s=a.$player,c=a.$pipClose,u=a.$pipTitle,l=n.events,d=l.destroyEvents,f=l.proxy,p=h=null,Object.defineProperty(i,"pipState",{get:function(){return s.classList.contains("artplayer-pip")}}),Object.defineProperty(i,"pipEnabled",{value:function(){i.autoSizeState&&i.autoSizeRemove(),p?(Wt(s,"left","".concat(h.x,"px")),Wt(s,"top","".concat(h.y,"px"))):(p=new N(s,{handle:".artplayer-pip-header"}),S(u,r.title||o.get("Mini player")),f(c,"click",function(){i.pipExit()}),d.push(function(){p.destroy()})),s.classList.add("artplayer-pip"),i.fullscreenExit(),i.fullscreenWebExit(),i.aspectRatioRemove(),i.playbackRateRemove(),n.emit("pipEnabled")}}),Object.defineProperty(i,"pipExit",{value:function(){i.pipState&&(s.classList.remove("artplayer-pip"),h=p.position,Wt(s,"left",null),Wt(s,"top",null),i.fullscreenExit(),i.fullscreenWebExit(),i.aspectRatioRemove(),i.playbackRateRemove(),n.emit("pipExit"))}})),Object.defineProperty(e,"pipToggle",{value:function(){e.pipState?e.pipExit():e.pipEnabled()}})}var V=function t(e){var i,r,n,o,a,s,c,u,l,d,f,h,p,v,y,m,g,b,w,x,k,E,S,$,P,O,R,C,T,_,j,L,M,A,z,B,W,q,D,H,F,I,U,N,V,Q,Y,J,X,Z,G,K,tt,et,nt,it,rt,ot,at,st,ct,ut,lt,dt,ft,ht,pt,vt,yt,mt,gt,bt,wt,xt,kt,Et,St,$t,Pt,Ot,Rt,Ct,Tt,_t,jt,Lt,Mt,At;zt(this,t),r=this,n=(i=e).option,o=n.type,a=n.customType,s=i.refs.$video,Object.defineProperty(r,"returnUrl",{writable:!0,value:function(t){return t}}),Object.defineProperty(r,"attachUrl",{value:function(t){var e=o||Dt(t),n=a[e];e&&n?(i.emit("beforeCustomType",e),n(s,r.returnUrl(t),i),i.emit("afterCustomType",e)):(i.emit("beforeAttachUrl",t),s.src=r.returnUrl(t),i.emit("afterAttachUrl",s.src))}}),u=this,l=(c=e).option,d=c.events.proxy,f=c.refs,h=f.$player,p=f.$video,v=c.i18n,y=c.notice,m=!1,g=0,d(p,"click",function(){u.toggle()}),It.video.events.forEach(function(t){d(p,t,function(t){c.emit("video:".concat(t.type),t)})}),c.on("video:abort",function(){y.show("".concat(v.get("Video loading is aborted")))}),c.on("video:canplay",function(){m||(m=!0,l.autoplay&&u.play(),c.emit("firstCanplay")),g=0,c.controls.show(),c.mask.show(),c.loading.hide()}),c.on("video:ended",function(){c.isPlaying=!1,c.controls.show(),c.mask.show(),l.loop&&(u.seek(0),u.play())}),c.on("video:error",function(){g<5?Ft(1e3).then(function(){g+=1,u.attachUrl(l.url),y.show("".concat(v.get("Reconnect"),": ").concat(g))}):(c.isPlaying=!1,c.loading.hide(),c.controls.hide(),h.classList.add("artplayer-error"),Ft(1e3).then(function(){y.show(v.get("Video load failed"),!1),c.destroy()}))}),c.on("video:loadedmetadata",function(){l.autoSize&&u.autoSize()}),c.on("video:loadstart",function(){c.loading.show()}),c.on("video:pause",function(){c.isPlaying=!1,c.controls.show(),c.mask.show()}),c.on("video:play",function(){c.isPlaying=!0,c.controls.hide(),c.mask.hide()}),c.on("video:playing",function(){c.isPlaying=!0,c.controls.hide(),c.mask.hide()}),c.on("video:seeked",function(){c.loading.hide()}),c.on("video:seeking",function(){c.loading.show()}),c.on("video:timeupdate",function(){c.isPlaying=!0,c.controls.hide(),c.mask.hide()}),c.on("video:waiting",function(){c.loading.show()}),w=this,x=(b=e).option,k=b.refs.$video,Object.keys(x.moreVideoAttr).forEach(function(t){k[t]=x.moreVideoAttr[t]}),x.muted&&(k.muted=x.muted),x.volume&&(k.volume=qt(x.volume,0,1)),x.poster&&(k.poster=x.poster),x.autoplay&&(k.autoplay=x.autoplay),Ft().then(function(){w.attachUrl(x.url)}),S=this,$=(E=e).refs.$video,P=E.i18n,O=E.notice,R=E.option.mutex,Object.defineProperty(S,"play",{value:function(){var t=$.play();void 0!==t&&t.then().catch(function(t){O.show(t,!0,3e3),console.warn(t)}),R&&E.constructor.instances.filter(function(t){return t!==E}).forEach(function(t){return t.player.pause()}),O.show(P.get("Play")),E.emit("play")}}),T=this,_=(C=e).refs.$video,j=C.i18n,L=C.notice,Object.defineProperty(T,"pause",{value:function(){_.pause(),L.show(j.get("Pause")),C.emit("pause")}}),M=e,A=this,Object.defineProperty(A,"toggle",{value:function(){M.isPlaying?A.pause():A.play()}}),B=this,W=(z=e).notice,Object.defineProperty(B,"seek",{value:function(t){var e=Math.max(t,0);B.duration&&(e=Math.min(e,B.duration)),B.currentTime=e,W.show("".concat(Ht(e)," / ").concat(Ht(B.duration))),z.emit("seek",e)}}),D=this,H=(q=e).refs.$video,F=q.i18n,I=q.notice,U=q.storage,Object.defineProperty(D,"volume",{get:function(){return H.volume||0},set:function(t){void 0!==t&&(H.volume=qt(t,0,1),I.show("".concat(F.get("Volume"),": ").concat(parseInt(100*H.volume,10))),0!==H.volume&&U.set("volume",H.volume),q.emit("volumeChange",H.volume))}}),Object.defineProperty(D,"muted",{get:function(){return H.muted},set:function(t){H.muted=t,q.emit("volumeChange",H.volume)}}),N=e,V=this,Object.defineProperty(V,"currentTime",{get:function(){return N.refs.$video.currentTime||0},set:function(t){N.refs.$video.currentTime=t}}),Q=e,Y=this,Object.defineProperty(Y,"duration",{get:function(){return Q.refs.$video.duration||0}}),X=this,Z=(J=e).i18n,G=J.notice,K=J.option,Object.defineProperty(X,"switchQuality",{value:function(t){var e=1<arguments.length&&void 0!==arguments[1]?arguments[1]:"unknown";if(t!==K.url){var n=J.isPlaying,i=X.currentTime;X.attachUrl(t),K.url=t,X.playbackRateRemove(),X.aspectRatioRemove(),X.seek(i),n&&X.play(),G.show("".concat(Z.get("Switch video"),": ").concat(e)),J.emit("switch",t)}}}),et=this,nt=(tt=e).refs,it=nt.$video,rt=nt.$player,ot=tt.i18n,at=tt.notice,Object.defineProperty(et,"playbackRateState",{get:function(){return rt.dataset.playbackRate}}),Object.defineProperty(et,"playbackRate",{value:function(t){var e=[.5,.75,1,1.25,1.5,2];Bt(e.includes(t),"'playbackRate' only accept ".concat(e.toString()," as parameters")),t!==rt.dataset.playbackRate&&(it.playbackRate=t,rt.dataset.playbackRate=t,at.show("".concat(ot.get("Rate"),": ").concat(t,"x")),tt.emit("playbackRateChange",t))}}),Object.defineProperty(et,"playbackRateRemove",{value:function(){et.$playbackRateState&&(et.playbackRate(1),delete rt.dataset.playbackRate,tt.emit("playbackRateRemove"))}}),Object.defineProperty(et,"playbackRateReset",{value:function(){var t=rt.dataset.playbackRate;t&&(et.playbackRate(Number(t)),tt.emit("playbackRateReset"))}}),ct=this,ut=(st=e).refs,lt=ut.$video,dt=ut.$player,ft=st.i18n,ht=st.notice,Object.defineProperty(ct,"aspectRatioState",{get:function(){return dt.dataset.aspectRatio||""}}),Object.defineProperty(ct,"aspectRatio",{value:function(t){var e=["default","4:3","16:9"];if(Bt(e.includes(t),"'aspectRatio' only accept ".concat(e.toString()," as parameters")),t!==dt.dataset.aspectRatio){if("default"===t)ct.aspectRatioRemove();else{var n=t.split(":"),i=lt.videoWidth,r=lt.videoHeight,o=dt.clientWidth,a=dt.clientHeight,s=i/r,c=n[0]/n[1];if(c<s){var u=c*r/i;Wt(lt,"width","".concat(100*u,"%")),Wt(lt,"height","100%"),Wt(lt,"padding","0 ".concat((o-o*u)/2,"px"))}else{var l=i/c/r;Wt(lt,"width","100%"),Wt(lt,"height","".concat(100*l,"%")),Wt(lt,"padding","".concat((a-a*l)/2,"px 0"))}}dt.dataset.aspectRatio=t,ht.show("".concat(ft.get("Aspect ratio"),": ").concat(t)),st.emit("aspectRatioChange",t)}}}),Object.defineProperty(ct,"aspectRatioRemove",{value:function(){ct.aspectRatioState&&(Wt(lt,"width",null),Wt(lt,"height",null),Wt(lt,"padding",null),delete dt.dataset.aspectRatio,st.emit("aspectRatioRemove"))}}),Object.defineProperty(ct,"aspectRatioReset",{value:function(){var t=dt.dataset.aspectRatio;t&&(ct.aspectRatio(t),st.emit("aspectRatioReset"))}}),Ut(e,this),vt=this,yt=(pt=e).notice,mt=pt.events.destroyEvents,gt=pt.refs.$player,bt=function(){pt.emit("fullscreen",Nt.isFullscreen)},wt=function(){yt.show("Your browser does not seem to support full screen functionality.")},Nt.on("change",bt),Nt.on("error",wt),mt.push(function(){Nt.off("change",bt),Nt.off("error",wt)}),Object.defineProperty(vt,"fullscreenState",{get:function(){return Nt.isFullscreen}}),Object.defineProperty(vt,"fullscreenEnabled",{value:function(){vt.fullscreenWebState&&vt.fullscreenWebExit(),gt.classList.add("artplayer-fullscreen"),Nt.request(gt),pt.emit("fullscreen:enabled")}}),Object.defineProperty(vt,"fullscreenExit",{value:function(){vt.fullscreenState&&(vt.fullscreenWebExit(),gt.classList.remove("artplayer-fullscreen"),Nt.exit(),pt.emit("fullscreen:exit"))}}),Object.defineProperty(vt,"fullscreenToggle",{value:function(){vt.fullscreenState?vt.fullscreenExit():vt.fullscreenEnabled()}}),kt=this,Et=(xt=e).refs.$player,Object.defineProperty(kt,"fullscreenWebState",{get:function(){return Et.classList.contains("artplayer-web-fullscreen")}}),Object.defineProperty(kt,"fullscreenWebEnabled",{value:function(){kt.fullscreenState&&kt.fullscreenExit(),Et.classList.add("artplayer-web-fullscreen"),xt.emit("fullscreenWeb:enabled")}}),Object.defineProperty(kt,"fullscreenWebExit",{value:function(){kt.fullscreenWebState&&(kt.fullscreenExit(),Et.classList.remove("artplayer-web-fullscreen"),xt.emit("fullscreenWeb:exit"))}}),Object.defineProperty(kt,"fullscreenWebToggle",{value:function(){kt.fullscreenWebState?kt.fullscreenWebExit():kt.fullscreenWebEnabled()}}),Vt(e,this),St=e,$t=this,Object.defineProperty($t,"loaded",{get:function(){return St.refs.$video.buffered.length?St.refs.$video.buffered.end(St.refs.$video.buffered.length-1)/St.refs.$video.duration:0}}),Pt=e,Ot=this,Object.defineProperty(Ot,"played",{get:function(){return Pt.refs.$video.currentTime/Pt.refs.$video.duration}}),Ct=this,Tt=(Rt=e).refs,_t=Tt.$container,jt=Tt.$player,Lt=Tt.$video,Object.defineProperty(Ct,"autoSizeState",{get:function(){return _t.classList.contains("artplayer-auto-size")}}),Object.defineProperty(Ct,"autoSize",{value:function(){var t=Lt.videoWidth,e=Lt.videoHeight,n=_t.getBoundingClientRect(),i=n.width,r=n.height,o=t/e,a=i/r;if(_t.classList.add("artplayer-auto-size"),o<a)Wt(jt,"width","".concat(r*o/i*100,"%")),Wt(jt,"height","100%");else{var s=i/o/r*100;Wt(jt,"width","100%"),Wt(jt,"height","".concat(s,"%"))}Rt.emit("autoSizeChange")}}),Object.defineProperty(Ct,"autoSizeRemove",{value:function(){_t.classList.remove("artplayer-auto-size"),Wt(jt,"width",null),Wt(jt,"height",null),Rt.emit("autoSizeRemove")}}),Mt=e,At=this,Object.defineProperty(At,"flipState",{get:function(){return Mt.refs.$player.dataset.flip}}),Object.defineProperty(At,"flip",{value:function(t){var e=["normal","horizontal","vertical"];Bt(e.includes(t),"'flip' only accept ".concat(e.toString()," as parameters")),Mt.refs.$player.dataset.flip=t,Mt.emit("flipChange",t)}}),Object.defineProperty(At,"flipRemove",{value:function(){delete Mt.refs.$player.dataset.flip,Mt.emit("flipRemove")}})},Q=function(){function e(t){zt(this,e),(this.art=t).option.mse&&this.init()}return r(e,[{key:"init",value:function(){var e=this,t=this.art,n=t.player,i=t.events;this.setMimeCodec(),Object.defineProperty(n,"returnUrl",{value:function(){e.mediaSource=new MediaSource;var t=URL.createObjectURL(e.mediaSource);return e.eventBind(),i.destroyEvents.push(function(){URL.revokeObjectURL(t)}),t}})}},{key:"setMimeCodec",value:function(){var t=this.art.option;if(!t.type){var e=Dt(t.url);Bt(Object.keys(It.mimeCodec).includes(e),"Can't find video's type '".concat(e,"' from '").concat(t.url,"'")),t.type=e}if(!t.mimeCodec){var n=It.mimeCodec[t.type];Bt(n,"Can't find video's mimeCodec from ".concat(t.type)),t.mimeCodec=n}Bt("MediaSource"in window&&MediaSource.isTypeSupported(t.mimeCodec),"Unsupported MIME type or codec: ".concat(t.mimeCodec))}},{key:"eventBind",value:function(){var e=this,t=this.art,n=t.option,i=t.events.proxy,r=It.mse,o=r.mediaSource,a=r.sourceBufferList,s=r.sourceBuffer;o.events.forEach(function(t){i(e.mediaSource,t,function(t){e.art.emit("mediaSource:".concat(t.type),t)})}),a.events.forEach(function(t){i(e.mediaSource.sourceBuffers,t,function(t){e.art.emit("sourceBuffers:".concat(t.type),t)}),i(e.mediaSource.activeSourceBuffers,t,function(t){e.art.emit("activeSourceBuffers:".concat(t.type),t)})}),this.art.on("mediaSource:sourceopen",function(){e.sourceBuffer=e.mediaSource.addSourceBuffer(n.mimeCodec),s.events.forEach(function(t){i(e.sourceBuffer,t,function(t){e.art.emit("sourceBuffer:".concat(t.type),t)})})}),this.art.on("sourceBuffer:updateend",function(){e.mediaSource.endOfStream()})}}]),e}();function Y(e,n,t,i,r,o){var a="function"==typeof i?i(e):i;if(!a.disable){n.id+=1;var s=a.name||"".concat(o).concat(n.id),c=document.createElement("div");c.classList.value="art-".concat(o," art-").concat(o,"-").concat(s),a.html&&S(c,a.html),a.style&&P(c,a.style),a.click&&e.events.proxy(c,"click",function(t){t.preventDefault(),a.click.call(n,t),e.emit("".concat(o,":click"),c)}),Object.defineProperty(a,"$ref",{get:function(){return c}}),Object.defineProperty(a,"hide",{value:function(){Wt(c,"display","none"),e.emit("".concat(o,":hide"),c)}}),Object.defineProperty(a,"show",{value:function(){Wt(c,"display","block"),e.emit("".concat(o,":show"),c)}}),$(t,c,a.index||n.id),a.mounted&&a.mounted(c),r&&r(c),n[s]=a,e.emit("".concat(o,":add"),a)}}var J=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};var X=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},i=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(i=i.concat(Object.getOwnPropertySymbols(n).filter(function(t){return Object.getOwnPropertyDescriptor(n,t).enumerable}))),i.forEach(function(t){J(e,t,n[t])})}return e};var Z=function(t){if(Array.isArray(t))return t};var G=function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var a,s=t[Symbol.iterator]();!(i=(a=s.next()).done)&&(n.push(a.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{i||null==s.return||s.return()}finally{if(r)throw o}}return n};var K=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var tt=function(t,e){return Z(t)||G(t,e)||K()};var et,nt,it=(et={loading:'<svg xmlns="http://www.w3.org/2000/svg" width="50px" height="50px" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="uil-default">\n <rect x="0" y="0" width="100" height="100" fill="none" class="bk"/>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(0 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-1s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(30 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.9166666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(60 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.8333333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(90 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.75s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(120 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.6666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(150 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5833333333333334s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(180 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.5s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(210 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.4166666666666667s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(240 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.3333333333333333s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(270 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.25s" repeatCount="indefinite"/></rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(300 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.16666666666666666s" repeatCount="indefinite"/>\n </rect>\n <rect x="47" y="40" width="6" height="20" rx="5" ry="5" fill="#ffffff" transform="rotate(330 50 50) translate(0 -30)">\n <animate attributeName="opacity" from="1" to="0" dur="1s" begin="-0.08333333333333333s" repeatCount="indefinite"/>\n </rect>\n</svg>',playBig:'<svg xmlns="http://www.w3.org/2000/svg" height="60" width="60" style="filter: drop-shadow(0px 1px 1px black);" viewBox="0 0 24 24">\n <path d="M20,2H4C1.8,2,0,3.8,0,6v12c0,2.2,1.8,4,4,4h16c2.2,0,4-1.8,4-4V6C24,3.8,22.2,2,20,2z M15.6,12.8L10.5,16 C9.9,16.5,9,16,9,15.2V8.8C9,8,9.9,7.5,10.5,8l5.1,3.2C16.3,11.5,16.3,12.5,15.6,12.8z"/>\n</svg>',play:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M17.982 9.275L8.06 3.27A2.013 2.013 0 0 0 5 4.994v12.011a2.017 2.017 0 0 0 3.06 1.725l9.922-6.005a2.017 2.017 0 0 0 0-3.45z"></path>\n</svg>',pause:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M7 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2zM15 3a2 2 0 0 0-2 2v12a2 2 0 1 0 4 0V5a2 2 0 0 0-2-2z"></path>\n</svg>',volume:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M10.188 4.65L6 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39V5.04a.498.498 0 0 0-.812-.39zM14.446 3.778a1 1 0 0 0-.862 1.804 6.002 6.002 0 0 1-.007 10.838 1 1 0 0 0 .86 1.806A8.001 8.001 0 0 0 19 11a8.001 8.001 0 0 0-4.554-7.222z"></path>\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v6.93A3.998 3.998 0 0 0 15 11z"></path>\n</svg>',volumeClose:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <path d="M15 11a3.998 3.998 0 0 0-2-3.465v2.636l1.865 1.865A4.02 4.02 0 0 0 15 11z"></path>\n <path d="M13.583 5.583A5.998 5.998 0 0 1 17 11a6 6 0 0 1-.585 2.587l1.477 1.477a8.001 8.001 0 0 0-3.446-11.286 1 1 0 0 0-.863 1.805zM18.778 18.778l-2.121-2.121-1.414-1.414-1.415-1.415L13 13l-2-2-3.889-3.889-3.889-3.889a.999.999 0 1 0-1.414 1.414L5.172 8H5a2 2 0 0 0-2 2v2a2 2 0 0 0 2 2h1l4.188 3.35a.5.5 0 0 0 .812-.39v-3.131l2.587 2.587-.01.005a1 1 0 0 0 .86 1.806c.215-.102.424-.214.627-.333l2.3 2.3a1.001 1.001 0 0 0 1.414-1.416zM11 5.04a.5.5 0 0 0-.813-.39L8.682 5.854 11 8.172V5.04z"></path>\n</svg>',subtitle:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 48 48">\n <path d="M0 0h48v48H0z" fill="none"/>\n <path d="M40 8H8c-2.21 0-4 1.79-4 4v24c0 2.21 1.79 4 4 4h32c2.21 0 4-1.79 4-4V12c0-2.21-1.79-4-4-4zM8 24h8v4H8v-4zm20 12H8v-4h20v4zm12 0h-8v-4h8v4zm0-8H20v-4h20v4z"/>\n</svg>',screenshot:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 50 50">\n\t<path d="M 19.402344 6 C 17.019531 6 14.96875 7.679688 14.5 10.011719 L 14.097656 12 L 9 12 C 6.238281 12 4 14.238281 4 17 L 4 38 C 4 40.761719 6.238281 43 9 43 L 41 43 C 43.761719 43 46 40.761719 46 38 L 46 17 C 46 14.238281 43.761719 12 41 12 L 35.902344 12 L 35.5 10.011719 C 35.03125 7.679688 32.980469 6 30.597656 6 Z M 25 17 C 30.519531 17 35 21.480469 35 27 C 35 32.519531 30.519531 37 25 37 C 19.480469 37 15 32.519531 15 27 C 15 21.480469 19.480469 17 25 17 Z M 25 19 C 20.589844 19 17 22.589844 17 27 C 17 31.410156 20.589844 35 25 35 C 29.410156 35 33 31.410156 33 27 C 33 22.589844 29.410156 19 25 19 Z "/>\n</svg>\n',setting:'<svg xmlns="http://www.w3.org/2000/svg" height="22" width="22" viewBox="0 0 22 22">\n <circle cx="11" cy="11" r="2"></circle>\n <path d="M19.164 8.861L17.6 8.6a6.978 6.978 0 0 0-1.186-2.099l.574-1.533a1 1 0 0 0-.436-1.217l-1.997-1.153a1.001 1.001 0 0 0-1.272.23l-1.008 1.225a7.04 7.04 0 0 0-2.55.001L8.716 2.829a1 1 0 0 0-1.272-.23L5.447 3.751a1 1 0 0 0-.436 1.217l.574 1.533A6.997 6.997 0 0 0 4.4 8.6l-1.564.261A.999.999 0 0 0 2 9.847v2.306c0 .489.353.906.836.986l1.613.269a7 7 0 0 0 1.228 2.075l-.558 1.487a1 1 0 0 0 .436 1.217l1.997 1.153c.423.244.961.147 1.272-.23l1.04-1.263a7.089 7.089 0 0 0 2.272 0l1.04 1.263a1 1 0 0 0 1.272.23l1.997-1.153a1 1 0 0 0 .436-1.217l-.557-1.487c.521-.61.94-1.31 1.228-2.075l1.613-.269a.999.999 0 0 0 .835-.986V9.847a.999.999 0 0 0-.836-.986zM11 15a4 4 0 1 1 0-8 4 4 0 0 1 0 8z"></path>\n</svg>',fullscreen:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n\t<path d="m 10,16 2,0 0,-4 4,0 0,-2 L 10,10 l 0,6 0,0 z"></path>\n\t<path d="m 20,10 0,2 4,0 0,4 2,0 L 26,10 l -6,0 0,0 z"></path>\n\t<path d="m 24,24 -4,0 0,2 L 26,26 l 0,-6 -2,0 0,4 0,0 z"></path>\n\t<path d="M 12,20 10,20 10,26 l 6,0 0,-2 -4,0 0,-4 0,0 z"></path>\n</svg>',fullscreenWeb:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="36" width="36">\n\t<path d="m 28,11 0,14 -20,0 0,-14 z m -18,2 16,0 0,10 -16,0 0,-10 z" fill-rule="evenodd"></path>\n</svg>',pip:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 36 36" height="32" width="32">\n <path d="M25,17 L17,17 L17,23 L25,23 L25,17 L25,17 Z M29,25 L29,10.98 C29,9.88 28.1,9 27,9 L9,9 C7.9,9 7,9.88 7,10.98 L7,25 C7,26.1 7.9,27 9,27 L27,27 C28.1,27 29,26.1 29,25 L29,25 Z M27,25.02 L9,25.02 L9,10.97 L27,10.97 L27,25.02 L27,25.02 Z"></path>\n</svg>',prev:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="m 12,12 h 2 v 12 h -2 z m 3.5,6 8.5,6 V 12 z"></path>\n</svg>',next:'<svg xmlns="http://www.w3.org/2000/svg" height="36" width="36" viewBox="0 0 36 36">\n <path d="M 12,24 20.5,18 12,12 V 24 z M 22,12 v 12 h 2 V 12 h -2 z"></path>\n</svg>'},nt={},Object.keys(et).forEach(function(t){var e=document.createElement("div");e.innerHTML='<i class="art-icon art-icon-'.concat(t,'">').concat(et[t],"</i>");var n=tt(e.childNodes,1);nt[t]=n[0]}),nt);function rt(t,e){var n=t.refs.$progress,i=t.player,r=n.getBoundingClientRect().left,o=qt(e.x-r,0,n.clientWidth),a=o/n.clientWidth*i.duration;return{second:a,time:Ht(a),width:o,percentage:qt(o/n.clientWidth,0,1)}}function ot(i){return function(l){var t=l.option,e=t.highlight,n=t.theme,d=l.events.proxy,f=l.player;return X({},i,{html:'\n <div class="art-control-progress-inner">\n <div class="art-progress-loaded"></div>\n <div class="art-progress-played" style="background: '.concat(n,'"></div>\n <div class="art-progress-highlight"></div>\n <div class="art-progress-indicator" style="background: ').concat(n,'"></div>\n <div class="art-progress-tip art-tip"></div>\n </div>\n '),mounted:function(o){var r=!1,n=o.querySelector(".art-progress-loaded"),i=o.querySelector(".art-progress-played"),a=o.querySelector(".art-progress-highlight"),s=o.querySelector(".art-progress-indicator"),c=o.querySelector(".art-progress-tip");function u(t,e){"loaded"===t&&Wt(n,"width","".concat(100*e,"%")),"played"===t&&(Wt(i,"width","".concat(100*e,"%")),Wt(s,"left","calc(".concat(100*e,"% - ").concat(O(s,"width")/2,"px)")))}e.forEach(function(t){var e=qt(t.time,0,f.duration)/f.duration*100;S(a,'<span data-text="'.concat(t.text,'" data-time="').concat(t.time,'" style="left: ').concat(e,'%"></span>'))}),u("loaded",f.loaded),l.on("video:progress",function(){u("loaded",f.loaded)}),l.on("video:timeupdate",function(){u("played",f.played)}),l.on("video:ended",function(){u("played",1)}),d(o,"mousemove",function(t){var e,n,i,r;Wt(c,"display","block"),-1<t.composedPath().indexOf(a)?function(t){var e=t.target.dataset,n=e.text,i=e.time;c.innerHTML=n;var r=Number(i)/l.player.duration*o.clientWidth+t.target.clientWidth/2-c.clientWidth/2;Wt(c,"left","".concat(r,"px"))}(t):(e=rt(l,t),n=e.width,i=e.time,r=c.clientWidth,c.innerHTML=i,n<=r/2?Wt(c,"left",0):n>o.clientWidth-r/2?Wt(c,"left","".concat(o.clientWidth-r,"px")):Wt(c,"left","".concat(n-r/2,"px")))}),d(o,"mouseout",function(){Wt(c,"display","none")}),d(o,"click",function(t){if(t.target!==s){var e=rt(l,t),n=e.second;u("played",e.percentage),f.seek(n)}}),d(s,"mousedown",function(){r=!0}),d(document,"mousemove",function(t){if(r){var e=rt(l,t),n=e.second,i=e.percentage;s.classList.add("art-show-indicator"),u("played",i),f.seek(n)}}),d(document,"mouseup",function(){r&&(r=!1,s.classList.remove("art-show-indicator"))})}})}}function at(t){return function(m){return X({},t,{mounted:function(f){var h=m.refs.$progress,t=m.events,e=t.proxy,p=t.loadImg,v=!1,y=!1;e(h,"mousemove",function(t){var e,n,i,r,o,a,s,c,u,l,d;v||(v=!0,p(m.option.thumbnails.url).then(function(){y=!0})),y&&(Wt(f,"display","block"),e=rt(m,t).width,n=m.option.thumbnails,i=n.url,r=n.height,o=n.width,a=n.number,s=n.column,c=h.clientWidth/a,u=Math.ceil(e/c),l=Math.ceil(u/s)-1,d=u%s||s-1,Wt(f,"backgroundImage","url(".concat(i,")")),Wt(f,"height","".concat(r,"px")),Wt(f,"width","".concat(o,"px")),Wt(f,"backgroundPosition","-".concat(d*o,"px -").concat(l*r,"px")),e<=o/2?Wt(f,"left",0):e>h.clientWidth-o/2?Wt(f,"left","".concat(h.clientWidth-o,"px")):Wt(f,"left","".concat(e-o/2,"px")))}),e(h,"mouseout",function(){Wt(f,"display","none")})}})}}var st=function(){function n(t){var e=this;zt(this,n),this.id=0,this.art=t,this.art.on("firstCanplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var t,e,n,i,r,a,s,o,c,u,l=this,d=this.art.option;this.add(ot({name:"progress",disable:d.isLive,position:"top",index:10})),this.add(at({name:"thumbnails",disable:!d.thumbnails.url||d.isLive,position:"top",index:20})),this.add((t={name:"playAndPause",disable:!1,position:"left",index:10},function(a){return X({},t,{mounted:function(t){var e=a.events.proxy,n=a.player,i=a.i18n,r=S(t,it.play),o=S(t,it.pause);T(r,i.get("Play")),T(o,i.get("Pause")),Wt(o,"display","none"),e(r,"click",function(){n.play()}),e(o,"click",function(){n.pause()}),a.on("video:playing",function(){Wt(r,"display","none"),Wt(o,"display","flex")}),a.on("video:pause",function(){Wt(r,"display","flex"),Wt(o,"display","none")})}})})),this.add((e={name:"volume",disable:!1,position:"left",index:20},function(d){return X({},e,{mounted:function(t){var e=d.events.proxy,r=d.player,n=d.i18n,i=!1,o=S(t,it.volume),a=S(t,it.volumeClose),s=S(t,'<div class="art-volume-panel"></div>'),c=S(s,'<div class="art-volume-slider-handle"></div>');function u(t){var e=s.getBoundingClientRect(),n=e.left,i=e.width,r=c.getBoundingClientRect().width;return qt(t.x-n-r/2,0,i-r/2)/(i-r)}function l(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:.7;if(r.muted||0===t)Wt(o,"display","none"),Wt(a,"display","flex"),Wt(c,"left","0");else{var e=O(s,"width")||60,n=O(c,"width"),i=n/2+(e-n)*t-n/2;Wt(o,"display","flex"),Wt(a,"display","none"),Wt(c,"left","".concat(i,"px"))}}T(o,n.get("Mute")),Wt(a,"display","none"),l(r.volume),d.on("video:volumechange",function(){l(r.volume)}),e(o,"click",function(){r.muted=!0}),e(a,"click",function(){r.muted=!1}),e(s,"click",function(t){r.muted=!1,r.volume=u(t)}),e(c,"mousedown",function(){i=!0}),e(c,"mousemove",function(t){i&&(r.muted=!1,r.volume=u(t))}),e(document,"mouseup",function(){i&&(i=!1)})}})})),this.add((n={name:"time",disable:d.isLive,position:"left",index:30},function(i){return X({},n,{mounted:function(e){function n(){var t="".concat(Ht(i.player.currentTime)," / ").concat(Ht(i.player.duration));t!==e.innerHTML&&(e.innerHTML=t)}n(),["video:loadedmetadata","video:timeupdate","video:progress"].forEach(function(t){i.on(t,n)})}})})),this.add((i={name:"quality",disable:0===d.quality.length,position:"right",index:10},function(r){return X({},i,{mounted:function(t){var o=r.option,e=r.events.proxy,a=r.player,s=-1,n=o.quality.find(function(t){return t.default})||o.quality[0];s=o.quality.indexOf(n);var c=S(t,'<div class="art-quality-name">'.concat(n.name,"</div>")),i=o.quality.map(function(t,e){return'<div class="art-quality-item" data-index="'.concat(e,'">').concat(t.name,"</div>")}).join("");e(S(t,'<div class="art-qualitys">'.concat(i,"</div>")),"click",function(t){var e=Number(t.target.dataset.index),n=o.quality[e],i=n.url,r=n.name;i&&r&&s!==e&&(a.switchQuality(i,r),c.innerHTML=r,s=e)})}})})),this.add((r={name:"screenshot",disable:!d.screenshot,position:"right",index:20},function(o){return X({},r,{mounted:function(t){var e=o.events.proxy,n=o.i18n,i=o.player,r=S(t,it.screenshot);T(r,n.get("Screenshot")),e(r,"click",function(){i.screenshot()})}})})),this.add((a={name:"subtitle",disable:!d.subtitle.url,position:"right",index:30},function(o){return X({},a,{mounted:function(t){var e=o.events.proxy,n=o.i18n,i=o.subtitle,r=S(t,it.subtitle);T(r,n.get("Hide subtitle")),e(t,"click",function(){i.toggle()}),o.on("subtitle:show",function(){Wt(r,"opacity","1"),T(r,n.get("Hide subtitle"))}),o.on("subtitle:hide",function(){Wt(r,"opacity","0.8"),T(r,n.get("Show subtitle"))})}})})),this.add((s={name:"setting",disable:!d.setting,position:"right",index:40},function(o){return X({},s,{mounted:function(t){var e=o.events.proxy,n=o.i18n,i=o.setting,r=S(t,it.setting);T(r,n.get("Show setting")),e(t,"click",function(){i.toggle()}),o.on("setting:show",function(){Wt(r,"opacity","0.8"),T(r,n.get("Hide setting"))}),o.on("setting:hide",function(){Wt(r,"opacity","1"),T(r,n.get("Show setting"))})}})})),this.add((o={name:"pip",disable:!d.pip,position:"right",index:50},function(r){return X({},o,{mounted:function(t){var e=r.events.proxy,n=r.i18n,i=r.player;T(S(t,it.pip),n.get("Mini player")),e(t,"click",function(){i.pipEnabled()})}})})),this.add((c={name:"fullscreenWeb",disable:!d.fullscreenWeb,position:"right",index:60},function(o){return X({},c,{mounted:function(t){var e=o.events.proxy,n=o.i18n,i=o.player,r=S(t,it.fullscreenWeb);T(r,n.get("Web fullscreen")),e(t,"click",function(){i.fullscreenWebToggle()}),o.on("fullscreenWeb:enabled",function(){Wt(r,"opacity","0.8"),T(r,n.get("Exit web fullscreen"))}),o.on("fullscreenWeb:exit",function(){Wt(r,"opacity","1"),T(r,n.get("Web fullscreen"))})}})})),this.add((u={name:"fullscreen",disable:!d.fullscreen,position:"right",index:70},function(o){return X({},u,{mounted:function(t){var e=o.events.proxy,n=o.i18n,i=o.player,r=S(t,it.fullscreen);T(r,n.get("Fullscreen")),e(t,"click",function(){i.fullscreenToggle()}),o.on("fullscreen:enabled",function(){Wt(r,"opacity","0.8"),T(r,n.get("Exit fullscreen"))}),o.on("fullscreen:exit",function(){Wt(r,"opacity","1"),T(r,n.get("Fullscreen"))})}})})),d.controls.forEach(function(t){l.add(t)})}},{key:"add",value:function(t,e){var n,i="function"==typeof t?t(this.art):t,r=this.art.refs,o=r.$progress,a=r.$controlsLeft,s=r.$controlsRight;switch(i.position){case"top":n=o;break;case"left":n=a;break;case"right":n=s}n&&Y(this.art,this,n,i,e,"control")}},{key:"show",value:function(){this.art.refs.$player.classList.add("artplayer-controls-show")}},{key:"hide",value:function(){this.art.refs.$player.classList.remove("artplayer-controls-show")}}]),n}();var ct=function(){function n(t){var e=this;zt(this,n),this.id=0,this.art=t,this.art.on("firstCanplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var e,r,n,i,o=this,t=this.art,a=t.option,s=t.refs,c=s.$player,u=s.$contextmenu,l=t.events.proxy;this.add((e={disable:!a.playbackRate,name:"playbackRate",index:10},function(n){var t=n.i18n,i=n.player;return X({},e,{html:"\n ".concat(t.get("Play speed"),':\n <span data-rate="0.5">0.5</span>\n <span data-rate="0.75">0.75</span>\n <span data-rate="1.0" class="normal current">').concat(t.get("Normal"),'</span>\n <span data-rate="1.25">1.25</span>\n <span data-rate="1.5">1.5</span>\n <span data-rate="2.0">2.0</span>\n '),click:function(t){var e=t.target.dataset.rate;e&&(i.playbackRate(Number(e)),n.contextmenu.hide())},mounted:function(t){n.on("playbackRateChange",function(e){C(Array.from(t.querySelectorAll("span")).find(function(t){return Number(t.dataset.rate)===e}),"current")})}})})),this.add((r={disable:!a.aspectRatio,name:"aspectRatio",index:20},function(n){var t=n.i18n,i=n.player;return X({},r,{html:"\n ".concat(t.get("Aspect ratio"),':\n <span data-ratio="default" class="default current">').concat(t.get("Default"),'</span>\n <span data-ratio="4:3">4:3</span>\n <span data-ratio="16:9">16:9</span>\n '),click:function(t){var e=t.target.dataset.ratio;e&&(i.aspectRatio(e),n.contextmenu.hide())},mounted:function(t){n.on("aspectRatioChange",function(e){C(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.ratio===e}),"current")})}})})),this.add((n={disable:!1,name:"info",index:30},function(t){return X({},n,{html:t.i18n.get("Video info"),click:function(){t.info.show(),t.contextmenu.hide()}})})),this.add(X({},{disable:!1,name:"version",index:40},{html:'<a href="https://github.com/zhw2590582/artplayer" target="_blank">ArtPlayer 1.0.3</a>'})),this.add((i={disable:!1,name:"close",index:50},function(t){return X({},i,{html:t.i18n.get("Close"),click:function(){t.contextmenu.hide()}})})),a.contextmenu.forEach(function(t){o.add(t)}),l(c,"contextmenu",function(t){t.preventDefault(),o.show(),o.setPos(t)}),l(c,"click",function(t){t.composedPath().includes(u)||o.hide()})}},{key:"add",value:function(t,e){var n=this.art.refs.$contextmenu;Y(this.art,this,n,t,e,"contextmenu")}},{key:"setPos",value:function(t){var e=this.art.refs,n=e.$player,i=e.$contextmenu,r=t.clientX,o=t.clientY,a=n.getBoundingClientRect(),s=a.height,c=a.width,u=a.left,l=a.top,d=i.getBoundingClientRect(),f=d.height,h=d.width,p=r-u,v=o-l;u+c<r+h&&(p=c-h),l+s<o+f&&(v=s-f),Wt(i,"left","".concat(p,"px")),Wt(i,"top","".concat(v,"px"))}},{key:"hide",value:function(){var t=this.art.refs.$contextmenu;Wt(t,"display","none"),this.art.emit("contextmenu:hide",t)}},{key:"show",value:function(){var t=this.art.refs.$contextmenu;Wt(t,"display","block"),this.art.emit("contextmenu:show",t)}}]),n}(),ut=function(){function e(t){zt(this,e),this.art=t,this.init()}return r(e,[{key:"init",value:function(){var t=this,e=this.art,n=e.refs.$infoClose;(0,e.events.proxy)(n,"click",function(){t.hide()})}},{key:"show",value:function(){var t=this.art.refs,e=t.$info,n=t.$infoPanel;Wt(e,"display","block"),n.innerHTML||S(n,this.creatInfo()),clearTimeout(this.timer),this.loop(),this.art.emit("info:show",e)}},{key:"creatInfo",value:function(){var t=[];return t.push('\n <div class="art-info-item ">\n <div class="art-info-title">Player version:</div>\n <div class="art-info-content">1.0.3</div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video url:</div>\n <div class="art-info-content">'.concat(this.art.option.url,"</div>\n </div>\n ")),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video volume:</div>\n <div class="art-info-content" data-video="volume"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video time:</div>\n <div class="art-info-content" data-video="currentTime"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video duration:</div>\n <div class="art-info-content" data-video="duration"></div>\n </div>\n '),t.push('\n <div class="art-info-item">\n <div class="art-info-title">Video resolution:</div>\n <div class="art-info-content">\n <span data-video="videoWidth"></span> x <span data-video="videoHeight"></span>\n </div>\n </div>\n '),t.join("")}},{key:"readInfo",value:function(){var t=this.art.refs,e=t.$infoPanel,n=t.$video;Array.from(e.querySelectorAll("[data-video]")).forEach(function(t){var e=n[t.dataset.video];t.innerHTML=void 0!==e?e:"unknown"})}},{key:"loop",value:function(){var t=this;this.readInfo(),this.timer=setTimeout(function(){t.readInfo(),t.loop()},1e3)}},{key:"hide",value:function(){var t=this.art.refs.$info;Wt(t,"display","none"),clearTimeout(this.timer),this.art.emit("info:hide",t)}}]),e}(),lt=function(){function e(t){zt(this,e),this.art=t,this.state=!0,this.art.option.subtitle.url&&this.init()}return r(e,[{key:"init",value:function(){var i=this,t=this.art,e=t.events.proxy,n=t.option.subtitle,r=t.refs,o=r.$video,a=r.$subtitle;P(a,n.style||{});var s=document.createElement("track");s.default=!0,s.kind="metadata",o.appendChild(s),this.art.refs.$track=s,this.load(n.url).then(function(t){if(s.src=t,i.art.emit("subtitle:load",t),o.textTracks&&o.textTracks[0]){var n=tt(o.textTracks,1)[0];e(n,"cuechange",function(){var t=tt(n.activeCues,1)[0];if(a.innerHTML="",t){var e=document.createElement("div");e.appendChild(t.getCueAsHTML()),a.innerHTML=e.innerHTML.split(/\r?\n/).map(function(t){return"<p>".concat(t,"</p>")}).join("")}i.art.emit("subtitle:update",a)})}})}},{key:"load",value:function(e){var n,i=this.art.notice;return fetch(e).then(function(t){return n=t.headers.get("Content-Type"),t.text()}).then(function(t){return/x-subrip/gi.test(n)?j(_(t)):e}).catch(function(t){throw i.show(t),console.warn(t),t})}},{key:"show",value:function(){var t=this.art,e=t.refs.$subtitle,n=t.i18n,i=t.notice;Wt(e,"display","block"),this.state=!0,i.show(n.get("Show subtitle")),this.art.emit("subtitle:show",e)}},{key:"hide",value:function(){var t=this.art,e=t.refs.$subtitle,n=t.i18n,i=t.notice;Wt(e,"display","none"),this.state=!1,i.show(n.get("Hide subtitle")),this.art.emit("subtitle:hide",e)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}},{key:"switch",value:function(t){var e=this,n=this.art.refs.$track;Bt(n,"You need to initialize the subtitle option first."),this.load(t).then(function(t){n.src=t,e.art.emit("subtitle:switch",t)})}}]),e}();var dt=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});e.ContentRect=function(t){if("getBBox"in t){var e=t.getBBox();return Object.freeze({height:e.height,left:0,top:0,width:e.width})}var n=window.getComputedStyle(t);return Object.freeze({height:parseFloat(n.height||"0"),left:parseFloat(n.paddingLeft||"0"),top:parseFloat(n.paddingTop||"0"),width:parseFloat(n.width||"0")})}});e(dt);dt.ContentRect;var ft=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(){function t(t){this.target=t,this.$$broadcastWidth=this.$$broadcastHeight=0}return Object.defineProperty(t.prototype,"broadcastWidth",{get:function(){return this.$$broadcastWidth},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"broadcastHeight",{get:function(){return this.$$broadcastHeight},enumerable:!0,configurable:!0}),t.prototype.isActive=function(){var t=dt.ContentRect(this.target);return!!t&&(t.width!==this.broadcastWidth||t.height!==this.broadcastHeight)},t}();e.ResizeObservation=n});e(ft);ft.ResizeObservation;var ht=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=function(t){this.target=t,this.contentRect=dt.ContentRect(t)};e.ResizeObserverEntry=n});e(ht);ht.ResizeObserverEntry;var pt=n(function(t,e){Object.defineProperty(e,"__esModule",{value:!0});var n=[],i=function(){function t(t){this.$$observationTargets=[],this.$$activeTargets=[],this.$$skippedTargets=[];var e=function(t){if(void 0===t)return"Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.";if("function"!=typeof t)return"Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function."}(t);if(e)throw TypeError(e);this.$$callback=t,n.push(this)}return t.prototype.observe=function(t){var e=r("observe",t);if(e)throw TypeError(e);0<o(this.$$observationTargets,t)||(this.$$observationTargets.push(new ft.ResizeObservation(t)),d())},t.prototype.unobserve=function(t){var e=r("unobserve",t);if(e)throw TypeError(e);var n=o(this.$$observationTargets,t);n<0||(this.$$observationTargets.splice(n,1),h())},t.prototype.disconnect=function(){this.$$observationTargets=[],this.$$activeTargets=[]},t}();function r(t,e){return void 0===e?"Failed to execute '"+t+"' on 'ResizeObserver': 1 argument required, but only 0 present.":e instanceof window.Element?void 0:"Failed to execute '"+t+"' on 'ResizeObserver': parameter 1 is not of type 'Element'."}function o(t,e){for(var n=0;n<t.length;n+=1)if(t[n].target===e)return n;return-1}e.ResizeObserver=i;var a,s=function(i){n.forEach(function(n){n.$$activeTargets=[],n.$$skippedTargets=[],n.$$observationTargets.forEach(function(t){if(t.isActive()){var e=u(t.target);i<e?n.$$activeTargets.push(t):n.$$skippedTargets.push(t)}})})},c=function(){var r=1/0;return n.forEach(function(t){if(t.$$activeTargets.length){var i=[];t.$$activeTargets.forEach(function(t){var e=new ht.ResizeObserverEntry(t.target);i.push(e),t.$$broadcastWidth=e.contentRect.width,t.$$broadcastHeight=e.contentRect.height;var n=u(t.target);n<r&&(r=n)}),t.$$callback(i,t),t.$$activeTargets=[]}}),r},u=function(t){for(var e=0;t.parentNode;)t=t.parentNode,e+=1;return e},l=function(){var t,e=0;for(s(e);n.some(function(t){return!!t.$$activeTargets.length});)e=c(),s(e);n.some(function(t){return!!t.$$skippedTargets.length})&&(t=new window.ErrorEvent("ResizeLoopError",{message:"ResizeObserver loop completed with undelivered notifications."}),window.dispatchEvent(t))},d=function(){a||f()},f=function(){a=window.requestAnimationFrame(function(){l(),f()})},h=function(){a&&!n.some(function(t){return!!t.$$observationTargets.length})&&(window.cancelAnimationFrame(a),a=void 0)};e.install=function(){return window.ResizeObserver=i}});e(pt);var vt=pt.ResizeObserver;pt.install;var yt=function(){function x(t){var e,n,i,r,o,a,s,c,u,l,d,f,h,p,v,y,m,g,b,w;zt(this,x),this.destroyEvents=[],this.proxy=this.proxy.bind(this),this.hover=this.hover.bind(this),this.loadImg=this.loadImg.bind(this),n=this,i=(e=t).refs.$player,n.proxy(document,["click","contextmenu"],function(t){-1<t.composedPath().indexOf(i)?e.isFocus=!0:(e.isFocus=!1,e.contextmenu.hide())}),o=this,a=(r=t).refs.$player,o.hover(a,function(){a.classList.add("artplayer-hover"),r.emit("hoverenter")},function(){a.classList.remove("artplayer-hover"),r.emit("hoverleave")}),c=this,u=(s=t).refs,l=u.$player,d=u.$video,f=L(function(){l.classList.add("artplayer-hide-cursor"),l.classList.remove("artplayer-hover"),s.controls.hide()},5e3),s.on("hoverleave",function(){s.isPlaying&&f()}),c.proxy(l,"mousemove",function(t){f.clearTimeout(),l.classList.remove("artplayer-hide-cursor"),s.controls.show(),!s.player.pipState&&s.isPlaying&&t.target===d&&f()}),p=this,v=(h=t).option,y=h.refs.$player,(m=new vt(function(){Ft().then(function(){v.autoSize&&(h.player.fullscreenState||h.player.fullscreenWebState||h.player.pipState?h.player.autoSizeRemove():h.player.autoSize()),h.player.aspectRatioReset(),h.emit("resize",y)})})).observe(y),p.destroyEvents.push(function(){m.unobserve(y)}),b=this,w=(g=t).refs.$video,b.proxy(w,"dblclick",function(){g.player.fullscreenToggle(),g.emit("dblclick")})}return r(x,[{key:"proxy",value:function(e,t,n){var i=this,r=3<arguments.length&&void 0!==arguments[3]?arguments[3]:{};Array.isArray(t)?t.forEach(function(t){return i.proxy(e,t,n,r)}):(e.addEventListener(t,n,r),this.destroyEvents.push(function(){e.removeEventListener(t,n,r)}))}},{key:"hover",value:function(t,e,n){this.proxy(t,"mouseenter",e),this.proxy(t,"mouseleave",n)}},{key:"loadImg",value:function(i){var r=this;return new Promise(function(t,e){var n;if(i instanceof HTMLImageElement)n=i;else{if("string"!=typeof i)return e(i);(n=new Image).src=i}return n.complete?t(n):(r.proxy(n,"load",function(){return t(n)}),r.proxy(n,"error",function(){return e(n)}),i)})}},{key:"destroy",value:function(){this.destroyEvents.forEach(function(t){return t()})}}]),x}(),mt=function(){function n(t){var e=this;zt(this,n),this.art=t,this.art.option.hotkey&&this.art.on("firstCanplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var i=this,t=this.art,r=t.player;(0,t.events.proxy)(window,"keydown",function(t){if(i.art.isFocus){var e=document.activeElement.tagName.toUpperCase(),n=document.activeElement.getAttribute("contenteditable");if("INPUT"!==e&&"TEXTAREA"!==e&&""!==n&&"true"!==n)switch(i.art.emit("hotkey",t),t.keyCode){case 39:t.preventDefault(),r.seek(r.currentTime+10);break;case 37:t.preventDefault(),r.seek(r.currentTime-10);break;case 38:t.preventDefault(),r.volume+=.05;break;case 40:t.preventDefault(),r.volume-=.05;break;case 32:t.preventDefault(),r.toggle()}}})}}]),n}(),gt=function(){function n(t){var e=this;zt(this,n),this.id=0,this.art=t,this.add=this.add.bind(this),this.art.option.layers.forEach(function(t){e.add(t)})}return r(n,[{key:"add",value:function(t,e){var n=this.art.refs.$layers;Y(this.art,this,n,t,e,"layer")}},{key:"show",value:function(){var t=this.art.refs.$layers;Wt(t,"display","block"),this.art.emit("layers:show",t)}},{key:"hide",value:function(){var t=this.art.refs.$layers;Wt(t,"display","none"),this.art.emit("layers:hide",t)}}]),n}(),bt=function(){function n(t){zt(this,n);var e=(this.art=t).option;S(t.refs.$loading,e.icons.loading||it.loading)}return r(n,[{key:"hide",value:function(){var t=this.art.refs.$loading;Wt(t,"display","none"),this.art.emit("loading:hide",t)}},{key:"show",value:function(){var t=this.art.refs.$loading;Wt(t,"display","flex"),this.art.emit("loading:show",t)}}]),n}(),wt=function(){function e(t){zt(this,e),this.art=t,this.timer=null}return r(e,[{key:"show",value:function(t){var e=this,n=!(1<arguments.length&&void 0!==arguments[1])||arguments[1],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:1e3,r=this.art.refs,o=r.$notice,a=r.$noticeInner;Wt(o,"display","block"),a.innerHTML=t instanceof Error?t.message.trim():t,n&&(clearTimeout(this.timer),this.timer=setTimeout(function(){e.hide()},i)),this.art.emit("notice:show",o)}},{key:"hide",value:function(){var t=this.art.refs.$notice;Wt(t,"display","none"),this.art.emit("notice:hide",t)}}]),e}(),xt=function(){function n(t){zt(this,n);var e=(this.art=t).option;S(S(t.refs.$mask,'<div class="art-playBig"></div>'),e.icons.playBig||it.playBig)}return r(n,[{key:"show",value:function(){var t=this.art.refs.$mask;Wt(t,"display","flex"),this.art.emit("mask:show",t)}},{key:"hide",value:function(){var t=this.art.refs.$mask;Wt(t,"display","none"),this.art.emit("mask:show",t)}}]),n}();var kt=function(){function n(t){var e=this;zt(this,n),this.id=0,this.art=t,this.state=!1,t.option.setting&&this.art.on("firstCanplay",function(){e.init()})}return r(n,[{key:"init",value:function(){var i,t=this,e=this.art,n=e.refs.$settingClose;(0,e.events.proxy)(n,"click",function(){t.hide()}),this.add((i={disable:!1,name:"flip",index:10},function(e){var t=e.i18n,n=e.player;return X({},i,{html:'\n <div class="art-setting-header">'.concat(t.get("Flip"),'</div>\n <div class="art-setting-body">\n <div class="art-setting-btns">\n <div class="art-setting-btn current">\n <span data-flip="normal">').concat(t.get("Normal"),'</span>\n </div>\n <div class="art-setting-btn">\n <span data-flip="horizontal">').concat(t.get("Horizontal"),'</span>\n </div>\n <div class="art-setting-btn">\n <span data-flip="vertical">').concat(t.get("Vertical"),"</span>\n </div>\n </div>\n </div>\n "),click:function(t){var e=t.target.dataset.flip;e&&n.flip(e)},mounted:function(t){e.on("flipChange",function(e){C(Array.from(t.querySelectorAll("span")).find(function(t){return t.dataset.flip===e}).parentElement,"current")})}})}))}},{key:"add",value:function(t,e){var n=this.art.refs.$settingBody;Y(this.art,this,n,t,e,"setting")}},{key:"show",value:function(){var t=this.art.refs.$setting;Wt(t,"display","flex"),this.state=!0,this.art.emit("setting:show",t)}},{key:"hide",value:function(){var t=this.art.refs.$setting;Wt(t,"display","none"),this.state=!1,this.art.emit("setting:hide",t)}},{key:"toggle",value:function(){this.state?this.hide():this.show()}}]),n}(),Et=function(){function n(t){var e=this;zt(this,n),this.art=t,this.storageName="artplayer_settings",Ft().then(function(){e.init()})}return r(n,[{key:"init",value:function(){var t=this.art.player,e=this.get("volume");e&&(t.volume=e)}},{key:"get",value:function(t){var e=JSON.parse(localStorage.getItem(this.storageName))||{};return t?e[t]:{}}},{key:"set",value:function(t,e){var n=Object.assign({},this.get(),J({},t,e));localStorage.setItem(this.storageName,JSON.stringify(n))}}]),n}(),St=function(){function n(t){var e=this;zt(this,n),this.art=t,this.id=0,t.option.plugins.forEach(function(t){e.add(t)})}return r(n,[{key:"add",value:function(t){this.id+=1;var e=t.call(this,this.art);return this[e&&e.name?e.name:t.name?t.name:"plugin".concat(this.id)]=e,this.art.emit("plugin:add",t),this}}]),n}(),$t=0,Pt=function(t){function n(t){var e;return zt(this,n),(e=c(this,u(n).call(this))).option=w(n.DEFAULTS,t),p(e.option,z),e.init(),e}return d(n,h),r(n,[{key:"init",value:function(){var e=this;this.isFocus=!1,this.isPlaying=!1,this.refs={},this.option.container instanceof Element?this.refs.$container=this.option.container:this.refs.$container=document.querySelector(this.option.container),n.instances.some(function(t){return t.refs.$container===e.refs.$container})&&Bt(!1,"Cannot mount multiple instances on the same dom element"),this.whitelist=new B(this),this.template=new W(this),this.storage=new Et(this),this.i18n=new D(this),this.notice=new wt(this),this.events=new yt(this),this.player=new V(this),this.mse=new Q(this),this.layers=new gt(this),this.controls=new st(this),this.contextmenu=new ct(this),this.subtitle=new lt(this),this.info=new ut(this),this.loading=new bt(this),this.hotkey=new mt(this),this.mask=new xt(this),this.setting=new kt(this),this.plugins=new St(this),$t+=1,this.id=$t,n.instances.push(this)}},{key:"destroy",value:function(){var t=0<arguments.length&&void 0!==arguments[0]&&arguments[0];this.events.destroy(),n.instances.splice(n.instances.indexOf(this),1),t?this.refs.$container.innerHTML="":this.refs.$player.classList.add("artplayer-destroy"),this.emit("destroy")}}],[{key:"version",get:function(){return"1.0.3"}},{key:"env",get:function(){return'"production"'}},{key:"config",get:function(){return It}},{key:"utils",get:function(){return M}},{key:"DEFAULTS",get:function(){return{container:"#artplayer",url:"",poster:"",title:"",type:"",mimeCodec:"",theme:"#f00",volume:.7,isLive:!1,mse:!1,muted:!1,autoplay:!1,autoSize:!1,loop:!1,playbackRate:!1,aspectRatio:!1,screenshot:!1,setting:!1,hotkey:!0,pip:!1,mutex:!0,fullscreen:!1,fullscreenWeb:!1,layers:[],contextmenu:[],quality:[],controls:[],highlight:[],plugins:[],whitelist:[],thumbnails:{url:"",number:60,width:160,height:90,column:10},subtitle:{url:"",style:{}},moreVideoAttr:{controls:!1,preload:"auto"},icons:{loading:"",playBig:""},customType:{},lang:navigator.language.toLowerCase()}}}]),n}();Object.defineProperty(Pt,"instances",{value:[]}),window.Artplayer=Pt,t.default=Pt,Object.defineProperty(t,"__esModule",{value:!0})});