From b64fe65164659cb99af5d3b3aa6950c92e0af65e Mon Sep 17 00:00:00 2001 From: Harvey Zack Date: Mon, 6 May 2019 15:48:38 +0800 Subject: [PATCH] build all packages --- dist/artplayer-plugin-danmuku.js | 2 +- dist/artplayer-plugin-gif.js | 2 +- dist/artplayer-react.js | 2 +- dist/artplayer-tool-github.js | 2 +- dist/artplayer-vue.js | 2 +- dist/artplayer.css | 2 +- dist/artplayer.js | 2 +- .../dist/artplayer-plugin-danmuku.js | 2 +- .../dist/artplayer-plugin-gif.js | 2 +- .../artplayer-react/dist/artplayer-react.js | 2 +- .../dist/artplayer-tool-github.js | 2 +- packages/artplayer-vue/dist/artplayer-vue.js | 2 +- packages/artplayer/dist/artplayer.css | 2 +- packages/artplayer/dist/artplayer.js | 2 +- scripts/build.js | 24 +++++++++++-------- 15 files changed, 28 insertions(+), 24 deletions(-) diff --git a/dist/artplayer-plugin-danmuku.js b/dist/artplayer-plugin-danmuku.js index 6c28c3078..97473a211 100644 --- a/dist/artplayer-plugin-danmuku.js +++ b/dist/artplayer-plugin-danmuku.js @@ -5,4 +5,4 @@ * Released under the MIT License. */ -!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var r=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 a=function(e){for(var t=1;t\n '.concat(t.get("Danmu opacity"),': 100%\n \n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=100*Number(t),i.plugins.artplayerPluginDanmuku.config({opacity:Number(t)}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.opacity&&(e.value=t.opacity,n.innerText=100*t.opacity)})})}}}function l(i){var t=i.i18n,r=i.events.proxy;return{name:"danmuku-size",index:50,html:'\n
\n '.concat(t.get("Danmu size"),': 25px\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.artplayerPluginDanmuku.config({fontSize:Number(t)}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.fontSize&&(e.value=t.fontSize,n.innerText=t.fontSize)})})}}}function c(i){var t=i.i18n,r=i.events.proxy;return{name:"danmuku-speed",index:40,html:'\n
\n '.concat(t.get("Danmu speed"),': 5s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.artplayerPluginDanmuku.config({speed:Number(t)}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.speed&&(e.value=t.speed,n.innerText=t.speed)})})}}}function p(t,e,n){return t.filter(function(t){return t.$state===e}).map(n)}function f(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var n=function(t){if(Array.isArray(t))return t};var m=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(i=(o=u.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(r)throw a}}return n};var h=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var $=function(t,e){return n(t)||m(t,e)||h()};function d(t){return fetch(t).then(function(t){return t.text()}).then(function(t){return function(t){if("string"!=typeof t)return[];var e=t.match(/[\S ]*?)<\/d>/gi);return e.length?e.map(function(t){var e=t.match(/(.+)<\/d>/),n=$(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:function(t){switch(t){case 1:case 2:case 3:return"scroll";case 4:case 5:return"static";default:return null}}(Number(a[1])),fontSize:Number(a[2]),color:"#".concat(Number(a[3]).toString(16)),timestamp:Number(a[4]),pool:Number(a[5]),userID:a[6],rowID:Number(a[7])}:null}):[]}(t)})}function y(t,e){var n=$(t.option.margin,2),i=n[0],r=n[1],o=f(t.art.template.$player),a=t.queue.filter(function(t){return t.mode===e.mode&&"emit"===t.$state&&t.$ref&&t.$ref.style.fontSize===e.$ref.style.fontSize}).map(function(t){var e=f(t.$ref),n=e.width,i=e.height,r=e.top-o.top,a=e.left-o.left;return{top:r,left:a,height:i,width:n,right:o.width-a-n,item:t}}).sort(function(t,e){return t.top-e.top});return 0===a.length?i:(a.unshift({top:0,left:0,right:0,height:i,width:o.width}),a.push({top:o.height-r,left:0,right:0,height:r,width:o.width}),function(t){for(var e=0,n={},i=0;i=t.time&&t.time>=e.currentTime-.1&&"wait"===t.$state}).forEach(function(t){t.$ref=function(t){var e=t.find(function(t){return t.$ref&&"wait"===t.$state});if(e){var n=e.$ref;return e.$ref=null,n}var i=document.createElement("div");return i.style.cssText='\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n font-weight: normal;\n line-height: 1.125;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n ',i}(r.queue),r.$danmuku.appendChild(t.$ref),t.$ref.style.opacity=r.option.opacity,t.$ref.style.fontSize="".concat(r.option.fontSize,"px"),t.$ref.innerText=t.text,t.$ref.style.color=t.color,t.$ref.style.border=t.border?"1px solid ".concat(t.color):"none",t.$restTime=r.option.speed,t.$lastStartTime=Date.now();var e=f(t.$ref,"width"),n=y(r,t);switch(t.$state="emit",t.mode){case"scroll":t.$restWidth=i+e+5,t.$ref.style.left="".concat(i,"px"),t.$ref.style.top="".concat(n,"px"),t.$ref.style.transform="translateX(".concat(-t.$restWidth,"px) translateY(0px) translateZ(0px)"),t.$ref.style.transition="transform ".concat(t.$restTime,"s linear 0s");break;case"static":t.$ref.style.top="".concat(n,"px"),t.$ref.style.left="50%",t.$ref.style.marginLeft="-".concat(e/2,"px")}})}r.isStop||r.update()})}},{key:"stop",value:function(){this.isStop=!0,this.suspend(),window.cancelAnimationFrame(this.animationFrameTimer),this.art.emit("artplayerPluginDanmuku:stop")}},{key:"start",value:function(){this.isStop=!1,this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")}},{key:"show",value:function(){this.$danmuku.style="block",this.art.emit("artplayerPluginDanmuku:show")}},{key:"hide",value:function(){this.$danmuku.style="none",this.art.emit("artplayerPluginDanmuku:hide")}},{key:"emit",value:function(t){var e=this.art,n=e.notice,i=e.player,r=e.i18n;t.text.trim()?t.text.length>this.option.maxlength?n.show("".concat(r.get("The length of the danmu does not exceed")," ").concat(this.option.maxlength)):("number"!=typeof t.time&&(t.time=i.currentTime),this.queue.push(a({mode:"scroll"},t,{$state:"wait",$ref:null,$restTime:0,$lastStartTime:0,$restWidth:0}))):n.show(r.get("Danmu text cannot be empty"))}}],[{key:"option",get:function(){return{danmuku:[],speed:5,maxlength:50,margin:[10,100],opacity:1,fontSize:25}}},{key:"scheme",get:function(){return{danmuku:"array|function|string",speed:"number",maxlength:"number",margin:"array",opacity:"number",fontSize:"number"}}}]),r}();return function(n){return function(t){var e=new g(t,n);return{name:"artplayerPluginDanmuku",emit:e.emit.bind(e),config:e.config.bind(e),hide:e.hide.bind(e),show:e.show.bind(e)}}}}); +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).artplayerPluginDanmuku=e()}(this,function(){"use strict";var r=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 a=function(e){for(var t=1;t\n '.concat(t.get("Danmu opacity"),': 100%\n \n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=100*Number(t),i.plugins.artplayerPluginDanmuku.config({opacity:Number(t)})}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.opacity&&(e.value=t.opacity,n.innerText=100*t.opacity)})}}}function l(i){var t=i.i18n,r=i.events.proxy;return{name:"danmuku-size",index:11,html:'\n
\n '.concat(t.get("Danmu size"),': 25px\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.artplayerPluginDanmuku.config({fontSize:Number(t)})}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.fontSize&&(e.value=t.fontSize,n.innerText=t.fontSize)})}}}function c(i){var t=i.i18n,r=i.events.proxy;return{name:"danmuku-speed",index:12,html:'\n
\n '.concat(t.get("Danmu speed"),': 5s\n
\n
\n \n
\n '),mounted:function(t){var e=t.querySelector("input[type=range]"),n=t.querySelector(".art-value");r(e,"change",function(){var t=e.value;n.innerText=t,i.plugins.artplayerPluginDanmuku.config({speed:Number(t)})}),i.on("artplayerPluginDanmuku:config",function(t){e.value!==t.speed&&(e.value=t.speed,n.innerText=t.speed)})}}}function p(n){var t=n.i18n,i=n.events.proxy;return{name:"danmuku-synchronousPlayback",index:13,html:'\n \n "),mounted:function(t){var e=t.querySelector("input[type=checkbox]");i(e,"change",function(){n.plugins.artplayerPluginDanmuku.config({synchronousPlayback:e.checked})}),n.on("artplayerPluginDanmuku:config",function(t){e.checked!==t.synchronousPlayback&&(e.checked=t.synchronousPlayback)})}}}function n(t,e,n){return t.filter(function(t){return t.$state===e}).map(n)}function f(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var h=function(t){if(Array.isArray(t))return t};var m=function(t,e){var n=[],i=!0,r=!1,a=void 0;try{for(var o,u=t[Symbol.iterator]();!(i=(o=u.next()).done)&&(n.push(o.value),!e||n.length!==e);i=!0);}catch(t){r=!0,a=t}finally{try{i||null==u.return||u.return()}finally{if(r)throw a}}return n};var d=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var x=function(t,e){return h(t)||m(t,e)||d()};function y(t){return fetch(t).then(function(t){return t.text()}).then(function(t){return function(t){if("string"!=typeof t)return[];var e=t.match(/[\S ]*?)<\/d>/gi);return e.length?e.map(function(t){var e=t.match(/(.+)<\/d>/),n=x(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:function(t){switch(t){case 1:case 2:case 3:return"scroll";case 4:case 5:return"static";default:return null}}(Number(a[1])),fontSize:Number(a[2]),color:"#".concat(Number(a[3]).toString(16)),timestamp:Number(a[4]),pool:Number(a[5]),userID:a[6],rowID:Number(a[7])}:null}):[]}(t)})}function g(t,e){var n=x(t.option.margin,2),i=n[0],r=n[1],o=f(t.art.template.$player),a=t.queue.filter(function(t){return t.mode===e.mode&&"emit"===t.$state&&t.$ref&&t.$ref.style.fontSize===e.$ref.style.fontSize&&parseFloat(t.$ref.style.top)<=o.height-r}).map(function(t){var e=f(t.$ref),n=e.width,i=e.height,r=e.top-o.top,a=e.left-o.left;return{top:r,left:a,height:i,width:n,right:o.width-a-n}}).sort(function(t,e){return t.top-e.top});return 0===a.length?i:(a.unshift({top:0,left:0,right:0,height:i,width:o.width}),a.push({top:o.height-r,left:0,right:0,height:r,width:o.width}),function(t){for(var e=0,n={},i=0;i=t.time&&t.time>=a.currentTime-.1&&"wait"===t.$state}).forEach(function(t){t.$ref=function(t){var e=t.find(function(t){return t.$ref&&"wait"===t.$state});if(e){var n=e.$ref;return e.$ref=null,n}var i=document.createElement("div");return i.style.cssText='\n user-select: none;\n position: absolute;\n white-space: pre;\n pointer-events: none;\n perspective: 500px;\n display: inline-block;\n will-change: transform;\n font-family: SimHei, "Microsoft JhengHei", Arial, Helvetica, sans-serif;\n font-weight: normal;\n line-height: 1.125;\n text-shadow: rgb(0, 0, 0) 1px 0px 1px, rgb(0, 0, 0) 0px 1px 1px, rgb(0, 0, 0) 0px -1px 1px, rgb(0, 0, 0) -1px 0px 1px;\n ',i}(r.queue),r.$danmuku.appendChild(t.$ref),t.$ref.style.opacity=r.option.opacity,t.$ref.style.fontSize="".concat(r.option.fontSize,"px"),t.$ref.innerText=t.text,t.$ref.style.color=t.color,t.$ref.style.border=t.border?"1px solid ".concat(t.color):"none",t.$restTime=r.option.synchronousPlayback&&a.playbackRateState?r.option.speed/Number(a.playbackRateState):r.option.speed,t.$lastStartTime=Date.now();var e=f(t.$ref,"width"),n=g(r,t);switch(t.$state="emit",t.mode){case"scroll":t.$restWidth=i+e+5,t.$ref.style.left="".concat(i,"px"),t.$ref.style.top="".concat(n,"px"),t.$ref.style.transform="translateX(".concat(-t.$restWidth,"px) translateY(0px) translateZ(0px)"),t.$ref.style.transition="transform ".concat(t.$restTime,"s linear 0s");break;case"static":t.$ref.style.top="".concat(n,"px"),t.$ref.style.left="50%",t.$ref.style.marginLeft="-".concat(e/2,"px")}})}r.isStop||r.update()})}},{key:"stop",value:function(){this.isStop=!0,this.suspend(),window.cancelAnimationFrame(this.animationFrameTimer),this.art.emit("artplayerPluginDanmuku:stop")}},{key:"start",value:function(){this.isStop=!1,this.continue(),this.update(),this.art.emit("artplayerPluginDanmuku:start")}},{key:"show",value:function(){this.$danmuku.style="block",this.art.emit("artplayerPluginDanmuku:show")}},{key:"hide",value:function(){this.$danmuku.style="none",this.art.emit("artplayerPluginDanmuku:hide")}},{key:"emit",value:function(t){var e=this.art,n=e.notice,i=e.player,r=e.i18n;t.text.trim()?t.text.length>this.option.maxlength?n.show("".concat(r.get("The length of the danmu does not exceed")," ").concat(this.option.maxlength)):("number"!=typeof t.time&&(t.time=i.currentTime),this.queue.push(a({mode:"scroll"},t,{$state:"wait",$ref:null,$restTime:0,$lastStartTime:0,$restWidth:0}))):n.show(r.get("Danmu text cannot be empty"))}}],[{key:"option",get:function(){return{danmuku:[],speed:5,maxlength:50,margin:[10,100],opacity:1,fontSize:25,synchronousPlayback:!1}}},{key:"scheme",get:function(){return{danmuku:"array|function|string",speed:"number",maxlength:"number",margin:"array",opacity:"number",fontSize:"number",synchronousPlayback:"boolean"}}}]),r}();return function(n){return function(t){var e=new v(t,n);return{name:"artplayerPluginDanmuku",emit:e.emit.bind(e),config:e.config.bind(e),hide:e.hide.bind(e),show:e.show.bind(e)}}}}); diff --git a/dist/artplayer-plugin-gif.js b/dist/artplayer-plugin-gif.js index 2eb212bd0..012f8e392 100644 --- a/dist/artplayer-plugin-gif.js +++ b/dist/artplayer-plugin-gif.js @@ -5,4 +5,4 @@ * Released under the MIT License. */ -!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).artplayerPluginGif=t()}(this,function(){"use strict";var n=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e};var S=function(t){for(var e=1;e>2,d=(3&o)<<4|(a=e.charCodeAt(r++))>>4,l=(15&a)<<2|(s=e.charCodeAt(r++))>>6,u=63&s,isNaN(a)?l=u=64:isNaN(s)&&(u=64),t=t+n.charAt(c)+n.charAt(d)+n.charAt(l)+n.charAt(u);return t},r?r.bind(e):z.noop),isObject:function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},isEmptyObject:function(e){return z.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&"function"==typeof e},isElement:function(e){return e&&1===e.nodeType},isString:function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},isSupported:{canvas:function(){var e=P.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return e.Worker},blob:function(){return z.Blob},Uint8Array:function(){return e.Uint8Array},Uint32Array:function(){return e.Uint32Array},videoCodecs:function(){var e=P.createElement("video"),t={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{e&&e.canPlayType&&(t.mp4=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),t.h264=""!==(e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),t.ogv=""!==e.canPlayType('video/ogg; codecs="theora"'),t.ogg=""!==e.canPlayType('video/ogg; codecs="theora"'),t.webm=-1!==e.canPlayType('video/webm; codecs="vp8, vorbis"'))}catch(e){}return t}()},noop:function(){},each:function(e,t){var r=void 0,i=void 0;if(z.isArray(e))for(r=-1,i=e.length;++rr&&n<=i;)a.style.fontSize=--i+"px";return P.body.removeChild(a),i+"px"},webWorkerError:!1},n=Object.freeze({default:z}),u={validate:function(i){i=z.isObject(i)?i:{};var n={};return z.each(u.validators,function(e,t){var r=t.errorCode;if(!i[r]&&!t.condition)return!((n=t).error=!0)}),delete n.condition,n},isValid:function(e){var t=!0!==u.validate(e).error;return t},validators:[{condition:z.isFunction(z.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:z.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:z.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:z.isFunction(z.URL),errorCode:"window.URL",errorMsg:"The window.URL API is not supported in your browser"},{condition:z.isSupported.blob(),errorCode:"window.Blob",errorMsg:"The window.Blob File API is not supported in your browser"},{condition:z.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:"The window.Uint8Array function constructor is not supported in your browser"},{condition:z.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:"The window.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},o=Object.freeze({default:u}),a=function(){},c={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:a,completeCallback:a,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},s=Object.freeze({default:c});function d(){return u.isValid()}function h(){var C,S,x,k,F,g=256,O=499,W=491,E=487,A=503,R=3*A,c=g-1,T=4,U=100,m=16,o=1<>p,b=o<>3)*(1<>m-T))>p,w[i]-=s,y[i]+=s<>M)<=1&&(a=0),e=0;e>M)<=1&&(a=0),t=0;t>=T,F[e][1]>>=T,F[e][2]>>=T,F[e][3]=e}(),function(){var e,t,r,i,n,o,a,s;for(e=s=a=0;e>1,t=a+1;t>1,t=a+1;t<256;t++)l[t]=c}(),function(){for(var e=[],t=new Array(g),r=0;r>8&255,v[b++]=255&t,v[b++]=t>>8&255,v[b++]=0|(null!==y?128:0),v[b++]=0,v[b++]=0,null!==i){if(i<0||65535>8&255,v[b++]=0}var w=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===w&&(--b,w=!1),o=o===H?{}:o,e<0||t<0||65535>=1;)++d;c=1<>8&255,v[b++]=g,v[b++]=0),v[b++]=44,v[b++]=255&e,v[b++]=e>>8&255,v[b++]=255&t,v[b++]=t>>8&255,v[b++]=255&r,v[b++]=r>>8&255,v[b++]=255&i,v[b++]=i>>8&255,v[b++]=!0===a?128|d-1:0,!0===a)for(var m=0,h=s.length;m>16&255,v[b++]=p>>8&255,v[b++]=255&p}b=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,l-=8,r===n+256&&(t[n]=255,n=r++)}function g(e){u|=e<>=8,l-=8,r===n+256&&(t[n]=255,n=r++);4096===c?(g(o),c=1+s,d=e+1,h={}):(1<';else if(t instanceof Blob){try{o.src=z.URL.createObjectURL(t)}catch(e){}o.innerHTML=''}}else if(o.mozSrcObject)o.mozSrcObject=r;else if(z.URL)try{o.srcObject=r,o.src=z.URL.createObjectURL(r)}catch(e){o.srcObject=r}o.play(),z.requestTimeout(function e(){e.count=e.count||0,!0===p.loadedData?(p.findVideoSize({videoElement:o,cameraStream:r,completedCallback:i}),p.loadedData=!1):10<(e.count+=1)?p.findVideoSize({videoElement:o,cameraStream:r,completedCallback:i}):e()},0)},startStreaming:function(e){var t=z.isFunction(e.error)?e.error:z.noop,r=z.isFunction(e.streamed)?e.streamed:z.noop,i=z.isFunction(e.completed)?e.completed:z.noop,n=e.crossOrigin,o=e.existingVideo,a=e.lastCameraStream,s=e.options,c=e.webcamVideoElement,d=z.isElement(o)?o:c||P.createElement("video");n&&(d.crossOrigin=s.crossOrigin),d.autoplay=!0,d.loop=!0,d.muted=!0,d.addEventListener("loadeddata",function(e){p.loadedData=!0,s.offset&&(d.currentTime=s.offset)}),o?p.stream({videoElement:d,existingVideo:o,completedCallback:i}):a?p.stream({videoElement:d,cameraStream:a,streamedCallback:r,completedCallback:i}):z.getUserMedia({video:!0},function(e){p.stream({videoElement:d,cameraStream:e,streamedCallback:r,completedCallback:i})},t)},startVideoStreaming:function(o){var e=1>2,d=(3&o)<<4|(a=e.charCodeAt(r++))>>4,l=(15&a)<<2|(s=e.charCodeAt(r++))>>6,u=63&s,isNaN(a)?l=u=64:isNaN(s)&&(u=64),t=t+n.charAt(c)+n.charAt(d)+n.charAt(l)+n.charAt(u);return t},i?i.bind(e):z.noop),isObject:function(e){return e&&"[object Object]"===Object.prototype.toString.call(e)},isEmptyObject:function(e){return z.isObject(e)&&!Object.keys(e).length},isArray:function(e){return e&&Array.isArray(e)},isFunction:function(e){return e&&"function"==typeof e},isElement:function(e){return e&&1===e.nodeType},isString:function(e){return"string"==typeof e||"[object String]"===Object.prototype.toString.call(e)},isSupported:{canvas:function(){var e=P.createElement("canvas");return e&&e.getContext&&e.getContext("2d")},webworkers:function(){return e.Worker},blob:function(){return z.Blob},Uint8Array:function(){return e.Uint8Array},Uint32Array:function(){return e.Uint32Array},videoCodecs:function(){var e=P.createElement("video"),t={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{e&&e.canPlayType&&(t.mp4=""!==e.canPlayType('video/mp4; codecs="mp4v.20.8"'),t.h264=""!==(e.canPlayType('video/mp4; codecs="avc1.42E01E"')||e.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"')),t.ogv=""!==e.canPlayType('video/ogg; codecs="theora"'),t.ogg=""!==e.canPlayType('video/ogg; codecs="theora"'),t.webm=-1!==e.canPlayType('video/webm; codecs="vp8, vorbis"'))}catch(e){}return t}()},noop:function(){},each:function(e,t){var r=void 0,i=void 0;if(z.isArray(e))for(r=-1,i=e.length;++rr&&n<=i;)a.style.fontSize=--i+"px";return P.body.removeChild(a),i+"px"},webWorkerError:!1},o=Object.freeze({default:z}),u={validate:function(i){i=z.isObject(i)?i:{};var n={};return z.each(u.validators,function(e,t){var r=t.errorCode;if(!i[r]&&!t.condition)return!((n=t).error=!0)}),delete n.condition,n},isValid:function(e){var t=!0!==u.validate(e).error;return t},validators:[{condition:z.isFunction(z.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:z.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:z.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:z.isFunction(z.URL),errorCode:"window.URL",errorMsg:"The window.URL API is not supported in your browser"},{condition:z.isSupported.blob(),errorCode:"window.Blob",errorMsg:"The window.Blob File API is not supported in your browser"},{condition:z.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:"The window.Uint8Array function constructor is not supported in your browser"},{condition:z.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:"The window.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},a=Object.freeze({default:u}),c={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:r,completeCallback:r,saveRenderingContexts:!1,savedRenderingContexts:[],crossOrigin:"Anonymous"},s=Object.freeze({default:c});function d(){return u.isValid()}function h(){var C,S,x,k,F,g=256,O=499,W=491,E=487,A=503,R=3*A,c=g-1,T=4,U=100,m=16,o=1<>p,b=o<>3)*(1<>m-T))>p,w[i]-=s,y[i]+=s<>M)<=1&&(a=0),e=0;e>M)<=1&&(a=0),t=0;t>=T,F[e][1]>>=T,F[e][2]>>=T,F[e][3]=e}(),function(){var e,t,r,i,n,o,a,s;for(e=s=a=0;e>1,t=a+1;t>1,t=a+1;t<256;t++)l[t]=c}(),function(){for(var e=[],t=new Array(g),r=0;r>8&255,v[b++]=255&t,v[b++]=t>>8&255,v[b++]=0|(null!==y?128:0),v[b++]=0,v[b++]=0,null!==i){if(i<0||65535>8&255,v[b++]=0}var w=!1;this.addFrame=function(e,t,r,i,n,o){if(!0===w&&(--b,w=!1),o=o===H?{}:o,e<0||t<0||65535>=1;)++d;c=1<>8&255,v[b++]=g,v[b++]=0),v[b++]=44,v[b++]=255&e,v[b++]=e>>8&255,v[b++]=255&t,v[b++]=t>>8&255,v[b++]=255&r,v[b++]=r>>8&255,v[b++]=255&i,v[b++]=i>>8&255,v[b++]=!0===a?128|d-1:0,!0===a)for(var m=0,h=s.length;m>16&255,v[b++]=p>>8&255,v[b++]=255&p}b=function(t,r,e,i){t[r++]=e;var n=r++,o=1<>=8,l-=8,r===n+256&&(t[n]=255,n=r++)}function g(e){u|=e<>=8,l-=8,r===n+256&&(t[n]=255,n=r++);4096===c?(g(o),c=1+s,d=e+1,h={}):(1<';else if(t instanceof Blob){try{o.src=z.URL.createObjectURL(t)}catch(e){}o.innerHTML=''}}else if(o.mozSrcObject)o.mozSrcObject=r;else if(z.URL)try{o.srcObject=r,o.src=z.URL.createObjectURL(r)}catch(e){o.srcObject=r}o.play(),z.requestTimeout(function e(){e.count=e.count||0,!0===p.loadedData?(p.findVideoSize({videoElement:o,cameraStream:r,completedCallback:i}),p.loadedData=!1):10<(e.count+=1)?p.findVideoSize({videoElement:o,cameraStream:r,completedCallback:i}):e()},0)},startStreaming:function(e){var t=z.isFunction(e.error)?e.error:z.noop,r=z.isFunction(e.streamed)?e.streamed:z.noop,i=z.isFunction(e.completed)?e.completed:z.noop,n=e.crossOrigin,o=e.existingVideo,a=e.lastCameraStream,s=e.options,c=e.webcamVideoElement,d=z.isElement(o)?o:c||P.createElement("video");n&&(d.crossOrigin=s.crossOrigin),d.autoplay=!0,d.loop=!0,d.muted=!0,d.addEventListener("loadeddata",function(e){p.loadedData=!0,s.offset&&(d.currentTime=s.offset)}),o?p.stream({videoElement:d,existingVideo:o,completedCallback:i}):a?p.stream({videoElement:d,cameraStream:a,streamedCallback:r,completedCallback:i}):z.getUserMedia({video:!0},function(e){p.stream({videoElement:d,cameraStream:e,streamedCallback:r,completedCallback:i})},t)},startVideoStreaming:function(o){var e=1.")}return e}(e);if(!vt[n]){vt[n]=!0;var r="";t&&t._owner&&t._owner!==M.current&&(r=" It was passed a child from "+z(t._owner.type)+"."),I(t),N(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),I(null)}}}function gt(t,e){if("object"==typeof t)if(Array.isArray(t))for(var n=0;n",i=" Did you accidentally export a JSX literal instead of a component?"):a=typeof t,N(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",a,i)}var s=X.apply(this,arguments);if(null==s)return s;if(r)for(var c=2;c is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Provider},set:function(t){n.Provider=t}},_currentValue:{get:function(){return n._currentValue},set:function(t){n._currentValue=t}},_currentValue2:{get:function(){return n._currentValue2},set:function(t){n._currentValue2=t}},_threadCount:{get:function(){return n._threadCount},set:function(t){n._threadCount=t}},Consumer:{get:function(){return r||N(!(r=!0),"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?"),n.Consumer}}}),n.Consumer=o,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(t){return null!=t&&t.$$typeof===f?k(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof t?k(!1,"forwardRef requires a render function but was given %s.",null===t?"null":typeof t):0!==t.length&&2!==t.length&&k(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===t.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=t&&(null!=t.defaultProps||null!=t.propTypes)&&k(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:c,render:t}},lazy:function(t){var e={$$typeof:p,_ctor:t,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(e,{defaultProps:{configurable:!0,get:function(){return n},set:function(t){N(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=t,Object.defineProperty(e,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(t){N(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=t,Object.defineProperty(e,"propTypes",{enumerable:!0})}}}),e},memo:function(t,e){return pt(t)||k(!1,"memo: The first argument must be a component. Instead received: %s",null===t?"null":typeof t),{$$typeof:f,type:t,compare:void 0===e?null:e}},useCallback:function(t,e){return dt().useCallback(t,e)},useContext:function(t,e){var n=dt();if(void 0!==e&&N(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",e,"number"==typeof e&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==t._context){var r=t._context;r.Consumer===t?N(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===t&&N(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(t,e)},useEffect:function(t,e){return dt().useEffect(t,e)},useImperativeHandle:function(t,e,n){return dt().useImperativeHandle(t,e,n)},useDebugValue:function(t,e){return dt().useDebugValue(t,e)},useLayoutEffect:function(t,e){return dt().useLayoutEffect(t,e)},useMemo:function(t,e){return dt().useMemo(t,e)},useReducer:function(t,e,n){return dt().useReducer(t,e,n)},useRef:function(t){return dt().useRef(t)},useState:function(t){return dt().useState(t)},Fragment:u,StrictMode:n,Suspense:l,createElement:wt,cloneElement:function(t,e,n){for(var r=function(t,e,n){null==t&&w(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",t);var r=void 0,i=h({},t.props),o=t.key,a=t.ref,s=t._self,c=t._source,u=t._owner;if(null!=e){Y(e)&&(a=e.ref,u=M.current),J(e)&&(o=""+e.key);var l=void 0;for(r in t.type&&t.type.defaultProps&&(l=t.type.defaultProps),e)H.call(e,r)&&!B.hasOwnProperty(r)&&(void 0===e[r]&&void 0!==l?i[r]=l[r]:i[r]=e[r])}var f=arguments.length-2;if(1==f)i.children=n;else if(1=Number(n)});return i?i.insertAdjacentElement("beforebegin",e):O(t,e),e}function C(t,e,n){return t.style[e]=n,t}function j(e,n){return Object.keys(n).forEach(function(t){C(e,t,n[t])}),e}function T(t,e){var n=!(2").replace(/\{\\([ibu])1\}/g,"<$1>").replace(/\{([ibu])\}/g,"<$1>").replace(/\{\/([ibu])\}/g,"").replace(/(\d\d:\d\d:\d\d),(\d\d\d)/g,"$1.$2").concat("\r\n\r\n"))}function z(t){return URL.createObjectURL(new Blob([t],{type:"text/vtt"}))}function q(t,e){var n=document.createElement("a");C(n,"display","none"),n.href=t,n.download=e,document.body.appendChild(n),n.click(),document.body.removeChild(n)}var W=Object.freeze({ArtPlayerError:g,errorHandle:b,clamp:w,getExt:x,secondToTime:k,sleep:S,debounce:E,isObject:P,isElement:$,mergeDeep:_,append:O,remove:function(t){return t.parentNode.removeChild(t)},insertByIndex:R,setStyle:C,setStyles:j,getStyle:T,sublings:L,inverseClass:M,tooltip:A,srtToVtt:D,vttToBlob:z,downloadImage:q});function I(t,e,n){if("string"===n){if(""===e.trim())throw new g("".concat(t.join(".")," can not be empty"));return!0}if(e instanceof Element)return!0;throw new g("".concat(t.join(".")," require 'string' or 'Element' type, but got '").concat(n,"'"))}var F={container:{validator:I,required:!0},url:{type:"string|function",required:!0},poster:"string",title:"string",type:{type:"string"},mimeCodec:"string",theme:"string",volume:"number",isLive:"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:I,style:"object",click:"function"}},contextmenu:{type:"array",child:{type:"object|function",disable:"boolean",name:"string",index:"number",html:I,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:I,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"},N={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"]}},H=function t(e){var n=this;a(this,t);var r=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||r.some(function(t){var e=!1;switch(y.kindOf(t)){case"string":e=-1\n \n \n ',this.$player=this.$container.querySelector(".artplayer-video-player"),this.$video=this.$container.querySelector(".artplayer-video")}},{key:"destroy",value:function(t){t?this.$container.innerHTML="":this.$player.classList.add("artplayer-destroy")}}]),n}(),U={"zh-cn":{"About author":"关于作者","Video info":"视频统计信息",Close:"关闭","Video load failed":"视频加载失败",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":"影片載入失敗",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":"迷你播放器"}},V=function(){function e(t){a(this,e),this.art=t,this.init()}return i(e,[{key:"init",value:function(){this.language=U[this.art.option.lang.toLowerCase()]||{}}},{key:"get",value:function(t){return this.language[t]||t}},{key:"update",value:function(t){U=_(U,t),this.init()}}]),e}(),Y=e(function(t){var o,e,i,a,r,n;o="undefined"!=typeof window&&void 0!==window.document?window.document:{},e=t.exports,i="undefined"!=typeof Element&&"ALLOW_KEYBOARD_INPUT"in Element,a=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,r=e.length,i={};n