Compare commits

...
50 Commits
Author SHA1 Message Date
Harvey 778816e3f3 v3.5.3 2020-04-27 11:42:54 +08:00
Harvey 113ccc5415 添加弹幕验证 2020-04-26 10:07:09 +08:00
Harvey ae7d87e08b 添加弹幕验证 2020-04-26 09:36:12 +08:00
Harvey 7f3b116851 Update danmuku.js 2020-04-26 08:59:30 +08:00
Harvey b5d5487dcf 弹幕隐藏时不运算动画 2020-04-26 08:43:09 +08:00
Harvey cef14a1523 Update package.json 2020-04-24 08:44:00 +08:00
zhw2590582 43215d6950 Update package.json 2020-04-19 09:28:16 +08:00
zhw2590582 334f2e0674 Update package.json 2020-04-18 19:05:44 +08:00
Harvey f56054a9b4 Update package.json 2020-04-16 16:39:40 +08:00
Harvey ac4e5a9c94 Revert "优化focus事件"
This reverts commit df424ec3ac.
2020-04-16 14:57:33 +08:00
Harvey df424ec3ac 优化focus事件 2020-04-16 12:18:26 +08:00
Harvey 51bde726ae 优化blur事件 2020-04-16 11:38:19 +08:00
Harvey 4285201fa9 字幕添加word-break: break-all 2020-04-14 13:06:17 +08:00
Harvey 687df9fd5e build all packages 2020-04-14 12:59:38 +08:00
Harvey bc30f87f54 v3.5.2 2020-04-14 12:59:07 +08:00
Harvey be060e48c4 add isSafari util 2020-04-10 18:31:27 +08:00
Harvey 5f5461eeb4 build 2020-04-10 18:16:53 +08:00
Harvey b322b804fe preload => auto 2020-04-10 18:16:22 +08:00
Harvey Zack 8a812afb3b Merge pull request #63 from zhw2590582/dependabot/npm_and_yarn/chalk-4.0.0
Bump chalk from 3.0.0 to 4.0.0
2020-04-03 08:16:52 +08:00
dependabot-preview[bot] e8beff8f97 Bump chalk from 3.0.0 to 4.0.0
Bumps [chalk](https://github.com/chalk/chalk) from 3.0.0 to 4.0.0.
- [Release notes](https://github.com/chalk/chalk/releases)
- [Commits](https://github.com/chalk/chalk/compare/v3.0.0...v4.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-04-02 19:18:31 +00:00
Harvey c6c8b8e22f Update mobile.js 2020-03-31 08:24:24 +08:00
Harvey de8cbdd375 remove bilibiliDanmuParseFromAv 2020-03-30 11:11:26 +08:00
Harvey Zack b512ce1b23 Merge pull request #61 from Hitsuki9/master
pauseMix 函数名拼写错误
2020-03-30 11:05:26 +08:00
Hitsuki9 eaa1e4d599 Update pauseMix.js 2020-03-30 10:47:48 +08:00
zhw2590582 12f90007b3 Update index.html 2020-03-30 10:27:46 +08:00
zhw2590582 92a38d6146 修复弹幕隐藏失败的bug 2020-03-30 10:27:46 +08:00
zhw2590582 986bde33c7 Update index.html 2020-03-29 11:07:12 +08:00
zhw2590582 850b133af0 修复弹幕隐藏失败的bug 2020-03-28 19:53:13 +08:00
zhw2590582 70002b7fb5 build all packages 2020-03-22 07:37:10 +08:00
zhw2590582 88979de569 v3.5.1 2020-03-22 07:36:45 +08:00
zhw2590582 2eb6616bdd Update lerna.json 2020-03-22 07:34:33 +08:00
zhw2590582 43f68a3b68 add escape 2020-03-22 07:28:36 +08:00
zhw2590582 e2193c7aa9 Update package.json 2020-03-20 20:55:01 +08:00
zhw2590582 8fe0630ab3 add close back 2020-03-19 22:22:50 +08:00
zhw2590582 03e3fa496f Update package.json 2020-03-16 20:14:35 +08:00
zhw2590582 6a9863ad99 压缩 2020-03-15 08:32:31 +08:00
zhw2590582 bb92f3dc3d Update currentTimeMix.js 2020-03-15 07:43:15 +08:00
zhw2590582 3b0f500438 Update index.js 2020-03-14 22:20:23 +08:00
zhw2590582 08509c8123 remove autoPip 2020-03-14 22:18:09 +08:00
Harvey f07207e78a add Patreon 2020-03-11 17:50:46 +08:00
Harvey 9f01b17137 添加cdn例子 2020-03-10 09:22:28 +08:00
zhw2590582 30e5a776e6 Update index.html 2020-03-09 20:18:04 +08:00
Harvey d212bf90ef Update package.json 2020-03-09 16:11:43 +08:00
Harvey Zack 563a874c96 Update README.md 2020-03-07 18:08:19 +08:00
Harvey c441001e14 Update package.json 2020-03-04 12:29:23 +08:00
zhw2590582 2d4da12180 优化背光刷新频率 2020-02-29 23:03:44 +08:00
zhw2590582 c7a351bc55 fix event.composedPath 2020-02-29 22:18:11 +08:00
zhw2590582 25b041ad8c Update README.md 2020-02-29 09:50:25 +08:00
zhw2590582 3379e6091c 添加灯光模式 2020-02-29 09:37:06 +08:00
Harvey 4867d8e25a Update README.md 2020-02-28 10:04:04 +08:00
70 changed files with 504 additions and 227 deletions

No files matched your search

+15 -15
View File
@@ -1,13 +1,13 @@
{
"packages/artplayer/dist/artplayer.js": {
"bundled": 177549,
"minified": 103704,
"gzipped": 24566
"bundled": 180210,
"minified": 105304,
"gzipped": 24933
},
"packages/artplayer-plugin-backlight/dist/artplayer-plugin-backlight.js": {
"bundled": 4642,
"minified": 1999,
"gzipped": 961
"bundled": 4629,
"minified": 1985,
"gzipped": 955
},
"packages/artplayer-tool-github/dist/artplayer-tool-github.js": {
"bundled": 12660,
@@ -25,18 +25,18 @@
"gzipped": 2786
},
"packages/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js": {
"bundled": 23511,
"minified": 12515,
"gzipped": 4067
"bundled": 24092,
"minified": 12783,
"gzipped": 4151
},
"packages/artplayer-vue/dist/artplayer-vue.js": {
"bundled": 179108,
"minified": 104630,
"gzipped": 24709
"bundled": 181769,
"minified": 106232,
"gzipped": 25078
},
"packages/artplayer-react/dist/artplayer-react.js": {
"bundled": 261037,
"minified": 133184,
"gzipped": 33776
"bundled": 263704,
"minified": 134791,
"gzipped": 34145
}
}
+7
View File
@@ -69,6 +69,12 @@ import Artplayer from 'artplayer';
<script src="path/to/artplayer.js"></script>
```
或者从 jsDelivr CDN 引入:
```html
<script src="https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js"></script>
```
将会导出全局变量到`window.Artplayer`.
## 使用
@@ -109,6 +115,7 @@ $ npm start
我们通过这些渠道接受捐赠:
- [Patreon](https://www.patreon.com/artplayer)
- [Paypal](https://www.paypal.me/harveyzack)
- [微信支付](./images/wechatpay.jpg)
- [支付宝](./images/alipay.jpg)
+7
View File
@@ -71,6 +71,12 @@ Or umd builds are also available:
<script src="path/to/artplayer.js"></script>
```
Or from jsDelivr CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js"></script>
```
Will expose the global variable to `window.Artplayer`.
## Usage
@@ -111,6 +117,7 @@ $ npm start
We accept donations through these channels:
- [Patreon](https://www.patreon.com/artplayer)
- [Paypal](https://www.paypal.me/harveyzack)
- [WeChat Pay](./images/wechatpay.jpg)
- [Alipay](./images/alipay.jpg)
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-plugin-backlight.js v3.4.2
* artplayer-plugin-backlight.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).artplayerPluginBacklight=e()}(this,(function(){"use strict";function t(t){for(var e=[],o=0;o<10;o+=1)for(var n=0;n<5;n+=1)0!==o&&9!==o&&0!==n&&4!==n||e.push(t(o,n,10,5));return e}return function(e){var o=e.constructor.utils.setStyles,n=e.template,a=n.$player,r=n.$video,i=e.player,c=document.createElement("div");c.classList.add("artplayer-backlight"),o(c,{position:"absolute",zIndex:9,left:0,top:0,right:0,bottom:0,width:"100%",height:"100%"});var l,s=(l=c,t((function(t,e,o,n){var a=document.createElement("div");return a.style.position="absolute",a.style.left="".concat(100*t/o,"%"),a.style.top="".concat(100*e/n,"%"),a.style.width="".concat(100/o,"%"),a.style.height="".concat(100/n,"%"),a.style.webkitBorderRadius="50%",a.style.borderRadius="50%",a.style.webkitTransition="all .2s ease",a.style.transition="all .2s ease",l.appendChild(a),{$box:a,left:0===t,right:t===o-1,top:0===e,bottom:e===n-1}}))),u=document.createElement("canvas");return a.insertBefore(c,r),function o(){window.requestAnimationFrame((function(){if(i.playing){var n=r.clientWidth,a=r.clientHeight;(function(e,o,n,a){var r=e.getContext("2d");return e.width=n,e.height=a,r.drawImage(o,0,0),t((function(t,e,o,i){for(var c=n/o,l=a/i,s=t*c,u=e*l,d=r.getImageData(s,u,c,l).data,f=0,h=0,p=0,g=0,y=d.length;g<y;g+=4)f+=d[g],h+=d[g+1],p+=d[g+2];return{r:f=Math.floor(f/(d.length/4)),g:h=Math.floor(h/(d.length/4)),b:p=Math.floor(p/(d.length/4))}}))})(u,r,n,a).forEach((function(t,e){var o=t.r,n=t.g,a=t.b,r=s[e],i=r.$box,c=r.left,l=r.right,u=r.top,d=r.bottom,f=c?"-64px":l?"64px":"0",h=u?"-64px":d?"64px":"0";i.style.webkitBoxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px"),i.style.boxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px")}))}e.isDestroy||o()}))}(),{name:"artplayerPluginBacklight"}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).artplayerPluginBacklight=e()}(this,(function(){"use strict";function t(t){for(var e=[],o=0;o<10;o+=1)for(var n=0;n<5;n+=1)0!==o&&9!==o&&0!==n&&4!==n||e.push(t(o,n,10,5));return e}return function(e){var o=e.constructor.utils.setStyles,n=e.template,a=n.$player,r=n.$video,i=e.player,c=document.createElement("div");c.classList.add("artplayer-backlight"),o(c,{position:"absolute",zIndex:9,left:0,top:0,right:0,bottom:0,width:"100%",height:"100%"});var l,s=(l=c,t((function(t,e,o,n){var a=document.createElement("div");return a.style.position="absolute",a.style.left="".concat(100*t/o,"%"),a.style.top="".concat(100*e/n,"%"),a.style.width="".concat(100/o,"%"),a.style.height="".concat(100/n,"%"),a.style.webkitBorderRadius="50%",a.style.borderRadius="50%",a.style.webkitTransition="all .2s ease",a.style.transition="all .2s ease",l.appendChild(a),{$box:a,left:0===t,right:t===o-1,top:0===e,bottom:e===n-1}}))),u=document.createElement("canvas");return a.insertBefore(c,r),function o(){setTimeout((function(){if(i.playing){var n=r.clientWidth,a=r.clientHeight;(function(e,o,n,a){var r=e.getContext("2d");return e.width=n,e.height=a,r.drawImage(o,0,0),t((function(t,e,o,i){for(var c=n/o,l=a/i,s=t*c,u=e*l,d=r.getImageData(s,u,c,l).data,f=0,h=0,p=0,g=0,y=d.length;g<y;g+=4)f+=d[g],h+=d[g+1],p+=d[g+2];return{r:f=Math.floor(f/(d.length/4)),g:h=Math.floor(h/(d.length/4)),b:p=Math.floor(p/(d.length/4))}}))})(u,r,n,a).forEach((function(t,e){var o=t.r,n=t.g,a=t.b,r=s[e],i=r.$box,c=r.left,l=r.right,u=r.top,d=r.bottom,f=c?"-64px":l?"64px":"0",h=u?"-64px":d?"64px":"0";i.style.webkitBoxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px"),i.style.boxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px")}))}e.isDestroy||o()}),200)}(),{name:"artplayerPluginBacklight"}}}));
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-plugin-danmuku.js v3.4.2
* artplayer-plugin-danmuku.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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 t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(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 i=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t},r={"zh-cn":{"Danmu opacity":"弹幕透明度","Danmu speed":"弹幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"弹幕文本不能为空","The length of the danmu does not exceed":"弹幕文本字数不能超过","Danmu speed synchronous playback multiple":"弹幕速度同步播放倍数"},"zh-tw":{"Danmu opacity":"彈幕透明度","Danmu speed":"彈幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"彈幕文本不能為空","The length of the danmu does not exceed":"彈幕文本字數不能超過","Danmu speed synchronous playback multiple":"彈幕速度同步播放倍數"}};function a(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-opacity",index:10,html:'<div class="art-setting-header">'.concat(e.get("Danmu opacity"),': <span class="art-value">100</span>%</div><div class="art-setting-range"><input type="range" value="1" min="0.1" max="1" step="0.1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=100*Number(e),t.plugins.artplayerPluginDanmuku.config({opacity:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.opacity&&(i.value=t.opacity,r.innerText=100*t.opacity)}))}}}function o(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-size",index:11,html:'<div class="art-setting-header">'.concat(e.get("Danmu size"),': <span class="art-value">25</span>px</div><div class="art-setting-range"><input type="range" value="25" min="14" max="30" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({fontSize:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.fontSize&&(i.value=t.fontSize,r.innerText=t.fontSize)}))}}}function u(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-speed",index:12,html:'<div class="art-setting-header">'.concat(e.get("Danmu speed"),': <span class="art-value">5</span>s</div><div class="art-setting-range"><input type="range" value="5" min="1" max="10" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({speed:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.speed&&(i.value=t.speed,r.innerText=t.speed)}))}}}function s(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-synchronousPlayback",index:13,html:'<label class="art-setting-checkbox"><input type="checkbox"/>'.concat(e.get("Danmu speed synchronous playback multiple"),"</label>"),mounted:function(e){var i=e.querySelector("input[type=checkbox]");n(i,"change",(function(){t.plugins.artplayerPluginDanmuku.config({synchronousPlayback:i.checked})})),t.on("artplayerPluginDanmuku:config",(function(t){i.checked!==t.synchronousPlayback&&(i.checked=t.synchronousPlayback)}))}}}function l(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function c(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var p=function(t){if(Array.isArray(t))return t};var f=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){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 m=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var h=function(t,e){return p(t)||f(t,e)||m()};function d(t){switch(t){case 1:case 2:case 3:return 0;case 4:case 5:return 1;default:return 0}}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(/<d([\S ]*?>[\S ]*?)<\/d>/gi);return e.length?e.map((function(t){var e=t.match(/<d p="(.+)">(.+)<\/d>/),n=h(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:d(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=h(t.option.margiLine truncated
!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 t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(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 i=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t},r={"zh-cn":{"Danmu opacity":"弹幕透明度","Danmu speed":"弹幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"弹幕文本不能为空","The length of the danmu does not exceed":"弹幕文本字数不能超过","Danmu speed synchronous playback multiple":"弹幕速度同步播放倍数"},"zh-tw":{"Danmu opacity":"彈幕透明度","Danmu speed":"彈幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"彈幕文本不能為空","The length of the danmu does not exceed":"彈幕文本字數不能超過","Danmu speed synchronous playback multiple":"彈幕速度同步播放倍數"}};function a(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-opacity",index:10,html:'<div class="art-setting-header">'.concat(e.get("Danmu opacity"),': <span class="art-value">100</span>%</div><div class="art-setting-range"><input type="range" value="1" min="0.1" max="1" step="0.1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=100*Number(e),t.plugins.artplayerPluginDanmuku.config({opacity:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.opacity&&(i.value=t.opacity,r.innerText=100*t.opacity)}))}}}function o(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-size",index:11,html:'<div class="art-setting-header">'.concat(e.get("Danmu size"),': <span class="art-value">25</span>px</div><div class="art-setting-range"><input type="range" value="25" min="14" max="30" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({fontSize:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.fontSize&&(i.value=t.fontSize,r.innerText=t.fontSize)}))}}}function u(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-speed",index:12,html:'<div class="art-setting-header">'.concat(e.get("Danmu speed"),': <span class="art-value">5</span>s</div><div class="art-setting-range"><input type="range" value="5" min="1" max="10" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({speed:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.speed&&(i.value=t.speed,r.innerText=t.speed)}))}}}function s(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-synchronousPlayback",index:13,html:'<label class="art-setting-checkbox"><input type="checkbox"/>'.concat(e.get("Danmu speed synchronous playback multiple"),"</label>"),mounted:function(e){var i=e.querySelector("input[type=checkbox]");n(i,"change",(function(){t.plugins.artplayerPluginDanmuku.config({synchronousPlayback:i.checked})})),t.on("artplayerPluginDanmuku:config",(function(t){i.checked!==t.synchronousPlayback&&(i.checked=t.synchronousPlayback)}))}}}function l(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function c(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var p=function(t){if(Array.isArray(t))return t};var f=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){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 m=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var h=function(t,e){return p(t)||f(t,e)||m()};function d(t){switch(t){case 1:case 2:case 3:return 0;case 4:case 5:return 1;default:return 0}}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(/<d([\S ]*?>[\S ]*?)<\/d>/gi);return e.length?e.map((function(t){var e=t.match(/<d p="(.+)">(.+)<\/d>/),n=h(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:d(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=h(t.option.margiLine truncated
+1 -1
View File
@@ -1,5 +1,5 @@
/*!
* artplayer-plugin-gif.js v3.4.2
* artplayer-plugin-gif.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-react.js v3.4.2
* artplayer-react.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o};var e=function(e,n){if(null==e)return{};var r,o,i=t(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i};var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t};var s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var l=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?s(t):e},u=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),p=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var f=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&&p(t,e)},d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function b(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var v=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,o=b(t),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))h.call(n,a)&&(o[a]=n[a]);if(d){r=d(n);for(var c=0;c<r.length;c++)y.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},m="function"==typeof Symbol&&Symbol.for,g=m?Symbol.for("react.element"):60103,w=m?Symbol.for("react.portal"):60106,x=m?Symbol.for("react.fragment"):60107,O=m?Symbol.for("react.strict_mode"):60108,k=m?Symbol.for("react.profiler"):60114,j=m?Symbol.for("react.provider"):60109,P=m?Symbol.for("react.context"):60110,S=m?Symbol.for("react.forward_ref"):60112,E=m?Symbol.for("react.suspense"):60113,C=m?Symbol.for("react.memo"):60115,R=m?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};function _(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}function z(){}function L(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}_.prototype.isReactComponent={},_.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(D(85));this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},z.prototype=_.prototype;var q=L.prototype=new z;q.constructor=L,v(q,_.prototype),q.isPureReactComponent=!0;var M={current:null},F={current:null},I=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function V(t,e,n){var r,o={},i=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(i=""+e.key),e)I.call(e,r)&&!N.hasOwnProperty(r)&&(o[r]=e[r]);var c=arguments.length-2;if(1===c)oLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o};var e=function(e,n){if(null==e)return{};var r,o,i=t(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i};var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t};var s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var l=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?s(t):e},u=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),p=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var f=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&&p(t,e)},d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function b(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var v=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,o=b(t),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))h.call(n,a)&&(o[a]=n[a]);if(d){r=d(n);for(var c=0;c<r.length;c++)y.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},m="function"==typeof Symbol&&Symbol.for,g=m?Symbol.for("react.element"):60103,w=m?Symbol.for("react.portal"):60106,x=m?Symbol.for("react.fragment"):60107,O=m?Symbol.for("react.strict_mode"):60108,k=m?Symbol.for("react.profiler"):60114,j=m?Symbol.for("react.provider"):60109,P=m?Symbol.for("react.context"):60110,S=m?Symbol.for("react.forward_ref"):60112,E=m?Symbol.for("react.suspense"):60113,C=m?Symbol.for("react.memo"):60115,R=m?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};function _(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}function z(){}function L(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}_.prototype.isReactComponent={},_.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(D(85));this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},z.prototype=_.prototype;var q=L.prototype=new z;q.constructor=L,v(q,_.prototype),q.isPureReactComponent=!0;var M={current:null},F={current:null},I=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function V(t,e,n){var r,o={},i=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(i=""+e.key),e)I.call(e,r)&&!N.hasOwnProperty(r)&&(o[r]=e[r]);var c=arguments.length-2;if(1===c)oLine truncated
+1 -1
View File
@@ -1,5 +1,5 @@
/*!
* artplayer-tool-github.js v3.4.2
* artplayer-tool-github.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
+1 -1
View File
@@ -1,5 +1,5 @@
/*!
* artplayer-tool-thumbnail.js v3.4.2
* artplayer-tool-thumbnail.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-vue.js v3.4.2
* artplayer-vue.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).ArtplayerVue=e()}(this,(function(){"use strict";var t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var s=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?a(t):e},c=o((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),l=o((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var u=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 p(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}p(".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");p(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");p(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");p(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");p(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");p(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justifLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ArtplayerVue=e()}(this,(function(){"use strict";var t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var a=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"!==i(e)&&"function"!=typeof e?a(t):e},s=o((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),l=o((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var u=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 p(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}p(".art-undercover{background:#000;position:fixed;top:0;left:0;display:none;height:100%;width:100%;opacity:.9;z-index:10}.art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:20;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");p(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");p(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");p(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");p(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");p(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-stateLine truncated
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer.js v3.4.2
* artplayer.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var a=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?i(t):e},s=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),c=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var l=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&&c(t,e)};function u(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}u(".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");u(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");u(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");u(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");u(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");u(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.art-video-player .art-mask .art-state{right:30px;bottom:55px;width:60px;height:60px;opacity:Line truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var a=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?i(t):e},s=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),c=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var l=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&&c(t,e)};function u(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}u(".art-undercover{background:#000;position:fixed;top:0;left:0;display:none;height:100%;width:100%;opacity:.9;z-index:10}.art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:20;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");u(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");u(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");u(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");u(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");u(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:Line truncated
+1
View File
@@ -181,6 +181,7 @@ img {
.part-right .console {
position: relative;
z-index: 8;
height: 30%;
}
+1
View File
@@ -3,6 +3,7 @@ var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/your-name.mp4',
autoSize: true,
light: true,
localVideo: true,
moreVideoAttr: {
crossOrigin: 'anonymous',
+42 -10
View File
@@ -6,13 +6,45 @@ var art = new Artplayer({
setting: true,
playbackRate: true,
fullscreenWeb: true,
plugins: [artplayerPluginDanmuku({
danmuku: url + '/danmuku/your-name.xml',
speed: 5,
maxlength: 50,
margin: [10, 100],
opacity: 1,
fontSize: 25,
synchronousPlayback: false,
})],
});
plugins: [
artplayerPluginDanmuku({
danmuku: url + '/danmuku/your-name.xml',
speed: 5,
maxlength: 50,
margin: [10, 100],
opacity: 1,
fontSize: 25,
synchronousPlayback: false,
}),
],
controls: [
{
position: 'right',
html: 'Hide',
click: function () {
art.plugins.artplayerPluginDanmuku.hide();
},
},
{
position: 'right',
html: 'Show',
click: function () {
art.plugins.artplayerPluginDanmuku.show();
},
},
{
position: 'right',
html: 'Send',
click: function () {
var text = prompt('Please enter', 'Danmu text');
if (!text || !text.trim()) return;
var color = '#' + Math.floor(Math.random() * 0xffffff).toString(16);
art.plugins.artplayerPluginDanmuku.emit({
text: text,
color: color,
border: true,
});
},
},
],
});
+1 -1
View File
@@ -45,7 +45,7 @@ var art = new Artplayer({
...data,
mode: 0,
time: art.player.currentTime + 0.2,
border: data.color,
border: true,
});
})
.catch(() => {
+1 -1
View File
@@ -23,8 +23,8 @@ var art = new Artplayer({
localVideo: true,
localSubtitle: true,
networkMonitor: false,
autoPip: true,
mutex: true,
light: true,
backdrop: true,
theme: '#ffad00',
lang: navigator.language.toLowerCase(),
+2 -2
View File
@@ -3,12 +3,12 @@ var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
// whitelist: ['iPhone OS 11'],
// whitelist: ['iPhone'],
// whitelist: [(ua)=>{ return /iPhone OS 11/gi.test(ua); }],
// whitelist: [/iPhone OS 11/gi]
});
Artplayer.config.video.events.forEach(function(item) {
Artplayer.config.events.forEach(function(item) {
art && art.on('video:' + item, function(event) {
console.log('video: ' + event.type);
});
+44 -7
View File
@@ -436,6 +436,42 @@ var art = new Artplayer({
});
```
## light
- Type: `Boolean`
- Default: `false`
Whether to display the light mode in the context menu
[Run Code](/Configuration.light)
```js
var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
light: true,
});
```
## backdrop
- Type: `Boolean`
- Default: `true`
Whether to use blurred background in the context menu and settings panel
[Run Code](/Configuration.backdrop)
```js
var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
backdrop: true,
});
```
## hotkey
- Type: `Boolean`
@@ -693,13 +729,13 @@ var art = new Artplayer({
Custom thumbnails in the progress bar with lazy load
| propertie | type | Description |
| --------- | -------- | -------------------- |
| `url` | `String` | Thumbnails image url |
| `number` | `Number` | Thumbnails number |
| `width` | `Number` | Thumbnails width |
| `height` | `Number` | Thumbnails height |
| `column` | `Number` | Thumbnails column |
| propertie | type | Description |
| --------- | -------- | -------------------------------------- |
| `url` | `String` | Thumbnails image url |
| `number` | `Number` | Total number of thumbnails |
| `width` | `Number` | The width of each thumbnail |
| `height` | `Number` | The height of each thumbnail |
| `column` | `Number` | Total number of columns for thumbnails |
[Run Code](/Configuration.thumbnails)
@@ -1042,6 +1078,7 @@ art.seek === art.player.seek;
| `toggle` | `Boolean` | Toggle play and pause |
| `volume` | `Number` | `Getter` and `Setter` of the current volume |
| `muted` | `Boolean` | `Getter` and `Setter` of the muted |
| `light` | `Boolean` | `Getter` and `Setter` of the light mode |
| `url` | `String` | `Getter` of the video url |
[Run Code](/Properties.player)
+1 -1
View File
@@ -22,7 +22,7 @@
plugins: [window.runCode]
}
</script>
<script src="//unpkg.com/docsify/lib/docsify.min.js"></script>
<script src="https://unpkg.com/docsify@4.10.2/lib/docsify.min.js"></script>
<script>
var _hmt = _hmt || [];
(function() {
+2 -2
View File
@@ -28,13 +28,13 @@
<ul>
<li class="title">Plugins</li>
<li>
<a href="./?libs=.%2Funcompiled%2Fartplayer-plugin-gif.js&example=gif">artplayer-plugin-gif</a>
<a href="./?libs=.%2Funcompiled%2Fartplayer-plugin-danmuku.js&example=danmuku">artplayer-plugin-danmuku</a>
</li>
<li>
<a href="./?libs=.%2Funcompiled%2Fartplayer-plugin-backlight.js&example=backlight">artplayer-plugin-backlight</a>
</li>
<li>
<a href="./?libs=.%2Funcompiled%2Fartplayer-plugin-danmuku.js&example=danmuku">artplayer-plugin-danmuku</a>
<a href="./?libs=.%2Funcompiled%2Fartplayer-plugin-gif.js&example=gif">artplayer-plugin-gif</a>
</li>
</ul>
<ul>
@@ -101,7 +101,7 @@
$player.insertBefore($backlight, $video);
(function loop() {
window.requestAnimationFrame(function () {
setTimeout(function () {
if (player.playing) {
var clientWidth = $video.clientWidth,
clientHeight = $video.clientHeight;
@@ -128,7 +128,7 @@
if (!art.isDestroy) {
loop();
}
});
}, 200);
})();
return {
@@ -1 +1 @@
{"version":3,"file":"artplayer-plugin-backlight.js","sources":["../../packages/artplayer-plugin-backlight/src/index.js"],"sourcesContent":["function matrixCallback(callback) {\n const result = [];\n const x = 10;\n const y = 5;\n for (let xIndex = 0; xIndex < x; xIndex += 1) {\n for (let yIndex = 0; yIndex < y; yIndex += 1) {\n if (xIndex === 0 || xIndex === x - 1 || yIndex === 0 || yIndex === y - 1) {\n result.push(callback(xIndex, yIndex, x, y));\n }\n }\n }\n return result;\n}\n\nfunction getColors($canvas, $video, width, height) {\n const ctx = $canvas.getContext('2d');\n $canvas.width = width;\n $canvas.height = height;\n ctx.drawImage($video, 0, 0);\n return matrixCallback((xIndex, yIndex, x, y) => {\n const itemW = width / x;\n const itemH = height / y;\n const itemX = xIndex * itemW;\n const itemY = yIndex * itemH;\n const { data } = ctx.getImageData(itemX, itemY, itemW, itemH);\n let r = 0;\n let g = 0;\n let b = 0;\n for (let i = 0, l = data.length; i < l; i += 4) {\n r += data[i];\n g += data[i + 1];\n b += data[i + 2];\n }\n r = Math.floor(r / (data.length / 4));\n g = Math.floor(g / (data.length / 4));\n b = Math.floor(b / (data.length / 4));\n return { r, g, b };\n });\n}\n\nfunction creatMatrix(parent) {\n return matrixCallback((xIndex, yIndex, x, y) => {\n const $box = document.createElement('div');\n $box.style.position = 'absolute';\n $box.style.left = `${xIndex * 100 / x}%`;\n $box.style.top = `${yIndex * 100 / y}%`;\n $box.style.width = `${100 / x}%`;\n $box.style.height = `${100 / y}%`;\n $box.style.webkitBorderRadius = '50%';\n $box.style.borderRadius = '50%';\n $box.style.webkitTransition = 'all .2s ease';\n $box.style.transition = 'all .2s ease';\n parent.appendChild($box);\n return {\n $box,\n left: xIndex === 0,\n right: xIndex === x - 1,\n top: yIndex === 0,\n bottom: yIndex === y - 1,\n };\n });\n}\n\nfunction artplayerPluginBacklight(art) {\n const { setStyles } = art.constructor.utils;\n const {\n template: { $player, $video },\n player,\n } = art;\n\n const $backlight = document.createElement('div');\n $backlight.classList.add('artplayer-backlight');\n setStyles($backlight, {\n position: 'absolute',\n zIndex: 9,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: '100%',\n height: '100%',\n });\n\n const matrix = creatMatrix($backlight);\n const $canvas = document.createElement('canvas');\n $player.insertBefore($backlight, $video);\n\n (function loop() {\n window.requestAnimationFrame(() => {\n if (player.playing) {\n const { clientWidth, clientHeight } = $video;\n const colors = getColors($canvas, $video, clientWidth, clientHeight);\n colors.forEach(({ r, g, b }, index) => {\n const { $box, left, right, top, bottom } = matrix[index];\n // eslint-disable-next-line no-nested-ternary\n const x = left ? '-64px' : right ? '64px' : '0';\n // eslint-disable-next-line no-nested-ternary\n const y = top ? '-64px' : bottom ? '64px' : '0';\n $box.style.webkitBoxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;\n $box.style.boxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;\n }); \n };\n\n if (!art.isDestroy) {\n loop();\n }\n });\n })();\n\n return {\n name: 'artplayerPluginBacklight',\n };\n}\n\nexport default artplayerPluginBacklight;"],"names":["matrixCallback","callback","result","x","y","xIndex","yIndex","push","getColors","$canvas","$video","width","height","ctx","getContext","drawImage","itemW","itemH","itemX","itemY","getImageData","data","r","g","b","i","l","length","Math","floor","creatMatrix","parent","$box","document","createElement","style","position","left","top","webkitBorderRadius","borderRadius","webkitTransition","transition","appendChild","right","bottom","artplayerPluginBacklight","art","setStyles","constructor","utils","template","$player","player","$backlight","classList","add","zIndex","matrix","insertBefore","loop","window","requestAnimationFrame","playing","clientWidth","clientHeight","colors","forEach","index","webkitBoxShadow","boxShadow","isDestroy","name"],"mappings":";;;;;;IAAA,SAASA,cAAT,CAAwBC,QAAxB,EAAkC;IAC9B,MAAMC,MAAM,GAAG,EAAf;IACA,MAAMC,CAAC,GAAG,EAAV;IACA,MAAMC,CAAC,GAAG,CAAV;;IACA,OAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,CAA9B,EAAiCE,MAAM,IAAI,CAA3C,EAA8C;IAC1C,SAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,Line truncated
{"version":3,"file":"artplayer-plugin-backlight.js","sources":["../../packages/artplayer-plugin-backlight/src/index.js"],"sourcesContent":["function matrixCallback(callback) {\n const result = [];\n const x = 10;\n const y = 5;\n for (let xIndex = 0; xIndex < x; xIndex += 1) {\n for (let yIndex = 0; yIndex < y; yIndex += 1) {\n if (xIndex === 0 || xIndex === x - 1 || yIndex === 0 || yIndex === y - 1) {\n result.push(callback(xIndex, yIndex, x, y));\n }\n }\n }\n return result;\n}\n\nfunction getColors($canvas, $video, width, height) {\n const ctx = $canvas.getContext('2d');\n $canvas.width = width;\n $canvas.height = height;\n ctx.drawImage($video, 0, 0);\n return matrixCallback((xIndex, yIndex, x, y) => {\n const itemW = width / x;\n const itemH = height / y;\n const itemX = xIndex * itemW;\n const itemY = yIndex * itemH;\n const { data } = ctx.getImageData(itemX, itemY, itemW, itemH);\n let r = 0;\n let g = 0;\n let b = 0;\n for (let i = 0, l = data.length; i < l; i += 4) {\n r += data[i];\n g += data[i + 1];\n b += data[i + 2];\n }\n r = Math.floor(r / (data.length / 4));\n g = Math.floor(g / (data.length / 4));\n b = Math.floor(b / (data.length / 4));\n return { r, g, b };\n });\n}\n\nfunction creatMatrix(parent) {\n return matrixCallback((xIndex, yIndex, x, y) => {\n const $box = document.createElement('div');\n $box.style.position = 'absolute';\n $box.style.left = `${(xIndex * 100) / x}%`;\n $box.style.top = `${(yIndex * 100) / y}%`;\n $box.style.width = `${100 / x}%`;\n $box.style.height = `${100 / y}%`;\n $box.style.webkitBorderRadius = '50%';\n $box.style.borderRadius = '50%';\n $box.style.webkitTransition = 'all .2s ease';\n $box.style.transition = 'all .2s ease';\n parent.appendChild($box);\n return {\n $box,\n left: xIndex === 0,\n right: xIndex === x - 1,\n top: yIndex === 0,\n bottom: yIndex === y - 1,\n };\n });\n}\n\nfunction artplayerPluginBacklight(art) {\n const { setStyles } = art.constructor.utils;\n const {\n template: { $player, $video },\n player,\n } = art;\n\n const $backlight = document.createElement('div');\n $backlight.classList.add('artplayer-backlight');\n setStyles($backlight, {\n position: 'absolute',\n zIndex: 9,\n left: 0,\n top: 0,\n right: 0,\n bottom: 0,\n width: '100%',\n height: '100%',\n });\n\n const matrix = creatMatrix($backlight);\n const $canvas = document.createElement('canvas');\n $player.insertBefore($backlight, $video);\n\n (function loop() {\n setTimeout(() => {\n if (player.playing) {\n const { clientWidth, clientHeight } = $video;\n const colors = getColors($canvas, $video, clientWidth, clientHeight);\n colors.forEach(({ r, g, b }, index) => {\n const { $box, left, right, top, bottom } = matrix[index];\n // eslint-disable-next-line no-nested-ternary\n const x = left ? '-64px' : right ? '64px' : '0';\n // eslint-disable-next-line no-nested-ternary\n const y = top ? '-64px' : bottom ? '64px' : '0';\n $box.style.webkitBoxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;\n $box.style.boxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;\n });\n }\n\n if (!art.isDestroy) {\n loop();\n }\n }, 200);\n })();\n\n return {\n name: 'artplayerPluginBacklight',\n };\n}\n\nexport default artplayerPluginBacklight;\n"],"names":["matrixCallback","callback","result","x","y","xIndex","yIndex","push","getColors","$canvas","$video","width","height","ctx","getContext","drawImage","itemW","itemH","itemX","itemY","getImageData","data","r","g","b","i","l","length","Math","floor","creatMatrix","parent","$box","document","createElement","style","position","left","top","webkitBorderRadius","borderRadius","webkitTransition","transition","appendChild","right","bottom","artplayerPluginBacklight","art","setStyles","constructor","utils","template","$player","player","$backlight","classList","add","zIndex","matrix","insertBefore","loop","setTimeout","playing","clientWidth","clientHeight","colors","forEach","index","webkitBoxShadow","boxShadow","isDestroy","name"],"mappings":";;;;;;IAAA,SAASA,cAAT,CAAwBC,QAAxB,EAAkC;IAC9B,MAAMC,MAAM,GAAG,EAAf;IACA,MAAMC,CAAC,GAAG,EAAV;IACA,MAAMC,CAAC,GAAG,CAAV;;IACA,OAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,CAA9B,EAAiCE,MAAM,IAAI,CAA3C,EAA8C;IAC1C,SAAK,IAAIC,MAAM,GAAG,CAAlB,EAAqBA,MAAM,GAAGF,CAA9B,EAAiCE,MAAM,IAALine truncated
+22 -7
View File
@@ -427,6 +427,7 @@
this.option = {};
this.config(option);
this.isStop = false;
this.isHide = false;
this.animationFrameTimer = null;
this.$danmuku = art.template.$danmuku;
art.on('video:play', this.start.bind(this));
@@ -532,7 +533,7 @@
player = _this$art.player,
$player = _this$art.template.$player;
this.animationFrameTimer = window.requestAnimationFrame(function () {
if (player.playing) {
if (player.playing && !_this2.isHide) {
var danmuLeft = getRect($player, 'width');
filter(_this2.queue, 'emit', function (danmu) {
danmu.$restTime -= (Date.now() - danmu.$lastStartTime) / 1000;
@@ -558,8 +559,8 @@
danmu.$ref.style.opacity = _this2.option.opacity;
danmu.$ref.style.fontSize = "".concat(_this2.option.fontSize, "px");
danmu.$ref.innerText = danmu.text;
danmu.$ref.style.color = danmu.color;
danmu.$ref.style.border = danmu.border ? "1px solid ".concat(danmu.color) : 'none';
danmu.$ref.style.color = danmu.color || '#fff';
danmu.$ref.style.border = danmu.border ? "1px solid ".concat(danmu.color || '#fff') : 'none';
danmu.$restTime = _this2.option.synchronousPlayback && player.playbackRate ? _this2.option.speed / Number(player.playbackRate) : _this2.option.speed;
danmu.$lastStartTime = Date.now();
var danmuWidth = getRect(danmu.$ref, 'width');
@@ -610,13 +611,15 @@
}, {
key: "show",
value: function show() {
this.$danmuku.style = 'block';
this.isHide = false;
this.$danmuku.style.display = 'block';
this.art.emit('artplayerPluginDanmuku:show');
}
}, {
key: "hide",
value: function hide() {
this.$danmuku.style = 'none';
this.isHide = true;
this.$danmuku.style.display = 'none';
this.art.emit('artplayerPluginDanmuku:hide');
}
}, {
@@ -626,6 +629,16 @@
notice = _this$art2.notice,
player = _this$art2.player,
i18n = _this$art2.i18n;
var _this$art$constructor2 = this.art.constructor,
clamp = _this$art$constructor2.utils.clamp,
validator = _this$art$constructor2.validator;
validator(danmu, {
text: 'string',
mode: 'number|undefined',
color: 'string|undefined',
time: 'number|undefined',
border: 'boolean|undefined'
});
if (!danmu.text.trim()) {
notice.show = i18n.get('Danmu text cannot be empty');
@@ -637,8 +650,10 @@
return;
}
if (typeof danmu.time !== 'number') {
danmu.time = player.currentTime;
if (danmu.time) {
danmu.time = clamp(danmu.time, 0, Infinity);
} else {
danmu.time = player.currentTime + 0.5;
}
this.queue.push(_objectSpread({
@@ -1 +1 @@
{"version":3,"file":"artplayer-plugin-danmuku.js","sources":["../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../packages/artplayer-plugin-danmuku/src/i18n.js","../../packages/artplayer-plugin-danmuku/src/setting.js","../../packages/artplayer-plugin-danmuku/src/utils.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../packages/artplayer-plugin-danmuku/src/bilibili.js","../../packages/artplayer-plugin-danmuku/src/getDanmuTop.js","../../packages/artplayer-plugin-danmuku/src/danmuku.js","../../packages/artplayer-plugin-danmuku/src/index.js"],"sourcesContent":["function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","export default {\n 'zh-cn': {\n 'Danmu opacity': '弹幕透明度',\n 'Danmu speed': '弹幕速度',\n 'Danmu size': '弹幕大小',\n 'Danmu text cannot be empty': '弹幕文本不能为空',\n 'The length of the danmu does not exceed': '弹幕文本字数不能超过',\n 'Danmu speed synchronous playback multiple': '弹幕速度同步播放倍数',\n },\n 'zh-tw': {\n 'Danmu opacity': '彈幕透明度',\n 'Danmu speed': '彈幕速度',\n 'Danmu size': '弹幕大小',\n 'Danmu text cannot be empty': '彈幕文本不能為空',\n 'The length of the danmu does not exceed': '彈幕文本字數不能超過',\n 'Danmu speed synchronous playback multiple': '彈幕速度同步播放倍數',\n },\n};","export function opacity(art) {\n const {\n i18n,\n events: { proxy },\n } = art;\n\n return {\n name: 'danmuku-opacity',\n index: 10,\n html: `\n <div class=\"art-setting-header\">\n ${i18n.get('Danmu opacity')}: <span class=\"art-value\">100</span>%\n </div>\n <div class=\"art-setting-range\">\n <input type=\"range\" value=\"1\" min=\"0.1\" max=\"1\" step=\"0.1\">\n </div>\n `,\n mounted: $setting => {\n const $range = $setting.querySelector('input[type=range]');\n const $value = $setting.querySelector('.art-value');\n proxy($range, 'change', () => {\n const { value } = $range;\n $value.innerText = Number(value) * 100;\n\n art.plugins.artplayerPluginDanmuku.config({\n opacity: Number(value),\n });\n });\n\n art.on('artplayerPluginDanmuku:config', config => {\n if ($range.value !== config.opacity) {\n $range.value = config.opacity;\n $value.innerText = config.opacity * 100;\n }\n });\n },\n };\n}\n\nexport function size(art) {\n const {\n i18n,\n events: { proxy },\n } = art;\n\n return {\n name: 'danmuku-size',\n index: 11,\n html: `\n <div class=\"art-setting-header\">\n ${i18n.get('Danmu size')}: <span class=\"art-value\">25</span>px\n </div>\n <div class=\"art-setting-range\">\n <input type=\"range\" value=\"25\" min=\"14\" max=\"30\" step=\"1\">\n </div>\n `,\n mounted: $setting => {\n const $range = $setting.querySelector('input[type=range]');\n const $value = $setting.querySelector('.art-value');\n proxy($range, 'change', () => {\n const { value } = $range;\n $value.innerText = value;\n\n art.plugins.artplayerPluginDanmuku.config({\n fLine truncated
{"version":3,"file":"artplayer-plugin-danmuku.js","sources":["../../node_modules/@babel/runtime/helpers/defineProperty.js","../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../packages/artplayer-plugin-danmuku/src/i18n.js","../../packages/artplayer-plugin-danmuku/src/setting.js","../../packages/artplayer-plugin-danmuku/src/utils.js","../../node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/slicedToArray.js","../../packages/artplayer-plugin-danmuku/src/bilibili.js","../../packages/artplayer-plugin-danmuku/src/getDanmuTop.js","../../packages/artplayer-plugin-danmuku/src/danmuku.js","../../packages/artplayer-plugin-danmuku/src/index.js"],"sourcesContent":["function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;","export default {\n 'zh-cn': {\n 'Danmu opacity': '弹幕透明度',\n 'Danmu speed': '弹幕速度',\n 'Danmu size': '弹幕大小',\n 'Danmu text cannot be empty': '弹幕文本不能为空',\n 'The length of the danmu does not exceed': '弹幕文本字数不能超过',\n 'Danmu speed synchronous playback multiple': '弹幕速度同步播放倍数',\n },\n 'zh-tw': {\n 'Danmu opacity': '彈幕透明度',\n 'Danmu speed': '彈幕速度',\n 'Danmu size': '弹幕大小',\n 'Danmu text cannot be empty': '彈幕文本不能為空',\n 'The length of the danmu does not exceed': '彈幕文本字數不能超過',\n 'Danmu speed synchronous playback multiple': '彈幕速度同步播放倍數',\n },\n};","export function opacity(art) {\n const {\n i18n,\n events: { proxy },\n } = art;\n\n return {\n name: 'danmuku-opacity',\n index: 10,\n html: `\n <div class=\"art-setting-header\">\n ${i18n.get('Danmu opacity')}: <span class=\"art-value\">100</span>%\n </div>\n <div class=\"art-setting-range\">\n <input type=\"range\" value=\"1\" min=\"0.1\" max=\"1\" step=\"0.1\">\n </div>\n `,\n mounted: $setting => {\n const $range = $setting.querySelector('input[type=range]');\n const $value = $setting.querySelector('.art-value');\n proxy($range, 'change', () => {\n const { value } = $range;\n $value.innerText = Number(value) * 100;\n\n art.plugins.artplayerPluginDanmuku.config({\n opacity: Number(value),\n });\n });\n\n art.on('artplayerPluginDanmuku:config', config => {\n if ($range.value !== config.opacity) {\n $range.value = config.opacity;\n $value.innerText = config.opacity * 100;\n }\n });\n },\n };\n}\n\nexport function size(art) {\n const {\n i18n,\n events: { proxy },\n } = art;\n\n return {\n name: 'danmuku-size',\n index: 11,\n html: `\n <div class=\"art-setting-header\">\n ${i18n.get('Danmu size')}: <span class=\"art-value\">25</span>px\n </div>\n <div class=\"art-setting-range\">\n <input type=\"range\" value=\"25\" min=\"14\" max=\"30\" step=\"1\">\n </div>\n `,\n mounted: $setting => {\n const $range = $setting.querySelector('input[type=range]');\n const $value = $setting.querySelector('.art-value');\n proxy($range, 'change', () => {\n const { value } = $range;\n $value.innerText = value;\n\n art.plugins.artplayerPluginDanmuku.config({\n fLine truncated
+110 -45
View File
@@ -144,13 +144,13 @@
}
}
var css = ".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFydHBsYXllci5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGtCQUNFLG1CQUFhLENBQWIsbUJBQWEsQ0FBYixZQUFhLENBQ2IsaUJBQWtCLENBQ2xCLGFBQWMsQ0FDZCxVQUFXLENBQ1gsVUFBVyxDQUNYLFdBQVksQ0FDWixTQUFVLENBQ1YsTUFBTyxDQUNQLDZDQUFpRCxDQUNqRCxVQUFXLENBQ1gsZUFBZ0IsQ0FDaEIsYUFBYyxDQUNkLGNBQWUsQ0FDZixlQUFnQixDQUNoQix3QkFBaUIsQ0FBakIscUJBQWlCLENBQWpCLG9CQUFpQixDQUFqQixnQkFBaUIsQ0FDakIseUNBQTZDLENBQzdDLDZCQUEwQixDQUExQix5QkFBMEIsQ0FDMUIsNkJBQWdDLENBQ2hDLG9CQUNFLFFBQVMsQ0FDVCxTQUFVLENBQ1YsNkJBQXNCLENBQXRCLHFCQUF3QixDQUMxQixzQ0FDRSxTQUFZLENBQ2QsNENBQ0UscUJBQXdCLENBQzFCLGtEQUNFLHFCQUF3QixDQUMxQiw0QkFDRSwwQkFBb0IsQ0FBcEIsMEJBQW9CLENBQXBCLG1CQUFvQixDQUNwQix1QkFBdUIsQ0FBdkIsb0JBQXVCLENBQXZCLHNCQUF1QixDQUN2Qix3QkFBbUIsQ0FBbkIscUJBQW1CLENBQW5CLGtCQUFtQixDQUNuQixlQUFrQixDQUNsQixnQ0FDRSxTQUFZLENBQ2hCLHNCQUNFLGNBQWUsQ0FDZixrQkFBcUIsQ0FDdkIseUJBQ0UsYUFBYyxDQUNkLGlCQUFrQixDQUNsQixLQUFNLENBQ04sTUFBTyxDQUNQLFdBQVksQ0FDWixVQUFXLENBQ1gsZUFBZ0IsQ0FDaEIsbUJBQW9CLENBQ3BCLFVBQWEsQ0FDZiwyRUFDRSx1Q0FDRSxpREFBa0QsQ0FDbEQseUNBQTBDLENBQzFDLHlDQUFpRCxDQUFFIiwiZmlsZSI6ImFydHBsYXllci5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIge1xuICBkaXNwbGF5OiBmbGV4O1xuICBwb3NpdGlvbjogcmVsYXRpdmU7XG4gIG1hcmdpbjogMCBhdXRvO1xuICB6LWluZGV4OiAxMDtcbiAgd2lkdGg6IDEwMCU7XG4gIGhlaWdodDogMTAwJTtcbiAgb3V0bGluZTogMDtcbiAgem9vbTogMTtcbiAgZm9udC1mYW1pbHk6IFJvYm90bywgQXJpYWwsIEhlbHZldGljYSwgc2Fucy1zZXJpZjtcbiAgY29sb3I6ICNlZWU7XG4gIHRleHQtYWxpZ246IGxlZnQ7XG4gIGRpcmVjdGlvbjogbHRyO1xuICBmb250LXNpemU6IDE0cHg7XG4gIGxpbmUtaGVpZ2h0OiAxLjM7XG4gIHVzZXItc2VsZWN0OiBub25lO1xuICAtd2Via2l0LXRhcC1oaWdobGlnaHQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMCk7XG4gIHRvdWNoLWFjdGlvbjogbWFuaXB1bGF0aW9uO1xuICAtbXMtaGlnaC1jb250cmFzdC1hZGp1c3Q6IG5vbmU7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgKiB7XG4gICAgbWFyZ2luOiAwO1xuICAgIHBhZGRpbmc6IDA7XG4gICAgYm94LXNpemluZzogYm9yZGVyLWJveDsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciA6Oi13ZWJraXQtc2Nyb2xsYmFyIHtcbiAgICB3aWR0aDogNXB4OyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIDo6LXdlYmtpdC1zY3JvbGxiYXItdGh1bWIge1xuICAgIGJhY2tncm91bmQtY29sb3I6ICM2NjY7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgOjotd2Via2l0LXNjcm9sbGJhci10aHVtYjpob3ZlciB7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogI2NjYzsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWljb24ge1xuICAgIGRpc3BsYXk6IGlubGluZS1mbGV4O1xuICAgIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICAgIGFsaWduLWl0ZW1zOiBjZW50ZXI7XG4gICAgbGluZS1oZWlnaHQ6IDEuNTsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtaWNvbiBzdmcge1xuICAgICAgZmlsbDogI2ZmZjsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciBpbWcge1xuICAgIG1heC13aWR0aDogMTAwJTtcbiAgICB2ZXJ0aWNhbC1hbGlnbjogdG9wOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyID4gPiA+IG9iamVjdCB7XG4gICAgZGlzcGxheTogYmxvY2s7XG4gICAgcG9zaXRpb246IGFic29sdXRlO1xuICAgIHRvcDogMDtcbiAgICBsZWZ0OiAwO1xuICAgIGhlaWdodDogMTAwJTtcbiAgICB3aWR0aDogMTAwJTtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICAgIHotaW5kZXg6IC0xOyB9XG4gIEBzdXBwb3J0cyAoLXdlYmtpdC1iYWNrZHJvcC1maWx0ZXI6IGluaXRpYWwpIG9yIChiYWNrZHJvcC1maWx0ZXI6IGluaXRpYWwpIHtcbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWJhY2tkcm9wLWZpbHRlciB7XG4gICAgICAtd2Via2l0LWJhY2tkcm9wLWZpbHRlcjogc2F0dXJhdGUoMTgwJSkgYmx1cigyMHB4KTtcbiAgICAgIGJhY2tkcm9wLWZpbHRlcjogc2F0dXJhdGUoMTgwJSkgYmx1cigyMHB4KTtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMCwgMCwgMCwgMC43KSAhaW1wb3J0YW50OyB9IH1cbiJdfQ== */";
var css = ".art-undercover{background:#000;position:fixed;top:0;left:0;display:none;height:100%;width:100%;opacity:.9;z-index:10}.art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:20;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFydHBsYXllci5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGdCQUNFLGVBQWdCLENBQ2hCLGNBQWUsQ0FDZixLQUFNLENBQ04sTUFBTyxDQUNQLFlBQWEsQ0FDYixXQUFZLENBQ1osVUFBVyxDQUNYLFVBQVksQ0FDWixVQUFhLENBRWYsa0JBQ0UsbUJBQWEsQ0FBYixtQkFBYSxDQUFiLFlBQWEsQ0FDYixpQkFBa0IsQ0FDbEIsYUFBYyxDQUNkLFVBQVcsQ0FDWCxVQUFXLENBQ1gsV0FBWSxDQUNaLFNBQVUsQ0FDVixNQUFPLENBQ1AsNkNBQWlELENBQ2pELFVBQVcsQ0FDWCxlQUFnQixDQUNoQixhQUFjLENBQ2QsY0FBZSxDQUNmLGVBQWdCLENBQ2hCLHdCQUFpQixDQUFqQixxQkFBaUIsQ0FBakIsb0JBQWlCLENBQWpCLGdCQUFpQixDQUNqQix5Q0FBNkMsQ0FDN0MsNkJBQTBCLENBQTFCLHlCQUEwQixDQUMxQiw2QkFBZ0MsQ0FDaEMsb0JBQ0UsUUFBUyxDQUNULFNBQVUsQ0FDViw2QkFBc0IsQ0FBdEIscUJBQXdCLENBQzFCLHNDQUNFLFNBQVksQ0FDZCw0Q0FDRSxxQkFBd0IsQ0FDMUIsa0RBQ0UscUJBQXdCLENBQzFCLDRCQUNFLDBCQUFvQixDQUFwQiwwQkFBb0IsQ0FBcEIsbUJBQW9CLENBQ3BCLHVCQUF1QixDQUF2QixvQkFBdUIsQ0FBdkIsc0JBQXVCLENBQ3ZCLHdCQUFtQixDQUFuQixxQkFBbUIsQ0FBbkIsa0JBQW1CLENBQ25CLGVBQWtCLENBQ2xCLGdDQUNFLFNBQVksQ0FDaEIsc0JBQ0UsY0FBZSxDQUNmLGtCQUFxQixDQUN2Qix5QkFDRSxhQUFjLENBQ2QsaUJBQWtCLENBQ2xCLEtBQU0sQ0FDTixNQUFPLENBQ1AsV0FBWSxDQUNaLFVBQVcsQ0FDWCxlQUFnQixDQUNoQixtQkFBb0IsQ0FDcEIsVUFBYSxDQUNmLDJFQUNFLHVDQUNFLGlEQUFrRCxDQUNsRCx5Q0FBMEMsQ0FDMUMseUNBQWlELENBQUUiLCJmaWxlIjoiYXJ0cGxheWVyLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXVuZGVyY292ZXIge1xuICBiYWNrZ3JvdW5kOiAjMDAwO1xuICBwb3NpdGlvbjogZml4ZWQ7XG4gIHRvcDogMDtcbiAgbGVmdDogMDtcbiAgZGlzcGxheTogbm9uZTtcbiAgaGVpZ2h0OiAxMDAlO1xuICB3aWR0aDogMTAwJTtcbiAgb3BhY2l0eTogMC45O1xuICB6LWluZGV4OiAxMDsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllciB7XG4gIGRpc3BsYXk6IGZsZXg7XG4gIHBvc2l0aW9uOiByZWxhdGl2ZTtcbiAgbWFyZ2luOiAwIGF1dG87XG4gIHotaW5kZXg6IDIwO1xuICB3aWR0aDogMTAwJTtcbiAgaGVpZ2h0OiAxMDAlO1xuICBvdXRsaW5lOiAwO1xuICB6b29tOiAxO1xuICBmb250LWZhbWlseTogUm9ib3RvLCBBcmlhbCwgSGVsdmV0aWNhLCBzYW5zLXNlcmlmO1xuICBjb2xvcjogI2VlZTtcbiAgdGV4dC1hbGlnbjogbGVmdDtcbiAgZGlyZWN0aW9uOiBsdHI7XG4gIGZvbnQtc2l6ZTogMTRweDtcbiAgbGluZS1oZWlnaHQ6IDEuMztcbiAgdXNlci1zZWxlY3Q6IG5vbmU7XG4gIC13ZWJraXQtdGFwLWhpZ2hsaWdodC1jb2xvcjogcmdiYSgwLCAwLCAwLCAwKTtcbiAgdG91Y2gtYWN0aW9uOiBtYW5pcHVsYXRpb247XG4gIC1tcy1oaWdoLWNvbnRyYXN0LWFkanVzdDogbm9uZTsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciAqIHtcbiAgICBtYXJnaW46IDA7XG4gICAgcGFkZGluZzogMDtcbiAgICBib3gtc2l6aW5nOiBib3JkZXItYm94OyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIDo6LXdlYmtpdC1zY3JvbGxiYXIge1xuICAgIHdpZHRoOiA1cHg7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgOjotd2Via2l0LXNjcm9sbGJhci10aHVtYiB7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogIzY2NjsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciA6Oi13ZWJraXQtc2Nyb2xsYmFyLXRodW1iOmhvdmVyIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAjY2NjOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtaWNvbiB7XG4gICAgZGlzcGxheTogaW5saW5lLWZsZXg7XG4gICAganVzdGlmeS1jb250ZW50OiBjZW50ZXI7XG4gICAgYWxpZ24taXRlbXM6IGNlbnRlcjtcbiAgICBsaW5lLWhlaWdodDogMS41OyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1pY29uIHN2ZyB7XG4gICAgICBmaWxsOiAjZmZmOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIGltZyB7XG4gICAgbWF4LXdpZHRoOiAxMDAlO1xuICAgIHZlcnRpY2FsLWFsaWduOiB0b3A7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgPiA+ID4gb2JqZWN0IHtcbiAgICBkaXNwbGF5OiBibG9jaztcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgdG9wOiAwO1xuICAgIGxlZnQ6IDA7XG4gICAgaGVpZ2h0OiAxMDAlO1xuICAgIHdpZHRoOiAxMDAlO1xuICAgIG92ZXJmbG93OiBoaWRkZW47XG4gICAgcG9pbnRlci1ldmVudHM6IG5vbmU7XG4gICAgei1pbmRleDogLTE7IH1cbiAgQHN1cHBvcnRzICgtd2Via2l0LWJhY2tkcm9wLWZpbHRlcjogaW5pdGlhbCkgb3IgKGJhY2tkcm9wLWZpbHRlcjogaW5pdGlhbCkge1xuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtYmFja2Ryb3AtZmlsdGVLine truncated
styleInject(css);
var css$1 = ".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInZpZGVvLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNkJBQ0UsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxNQUFPLENBQ1AsS0FBTSxDQUNOLE9BQVEsQ0FDUixRQUFTLENBQ1QsVUFBVyxDQUNYLFdBQVksQ0FDWixxQkFBc0IsQ0FDdEIsY0FBaUIiLCJmaWxlIjoidmlkZW8uc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW8tcGxheWVyIC5hcnQtdmlkZW8ge1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDEwO1xuICBsZWZ0OiAwO1xuICB0b3A6IDA7XG4gIHJpZ2h0OiAwO1xuICBib3R0b206IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIGJhY2tncm91bmQtY29sb3I6ICMwMDA7XG4gIGN1cnNvcjogcG9pbnRlcjsgfVxuIl19 */";
styleInject(css$1);
var css$2 = ".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN1YnRpdGxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0NBQ0UsWUFBYSxDQUNiLGlCQUFrQixDQUNsQixVQUFXLENBQ1gsV0FBWSxDQUNaLFVBQVcsQ0FDWCxjQUFlLENBQ2YsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxjQUFlLENBQ2YsbUJBQW9CLENBQ3BCLHlDQUFtRCxDQUNuRCxrQ0FDRSxZQUFlLENBRW5CLGtEQUNFLGFBQWdCIiwiZmlsZSI6InN1YnRpdGxlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LXN1YnRpdGxlIHtcbiAgZGlzcGxheTogbm9uZTtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiAyMDtcbiAgYm90dG9tOiA0MHB4O1xuICB3aWR0aDogMTAwJTtcbiAgcGFkZGluZzogMCAyMHB4O1xuICB0ZXh0LWFsaWduOiBjZW50ZXI7XG4gIGNvbG9yOiAjZmZmO1xuICBmb250LXNpemU6IDIwcHg7XG4gIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICB0ZXh0LXNoYWRvdzogMC41cHggMC41cHggMC41cHggcmdiYSgwLCAwLCAwLCAwLjUpOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtc3VidGl0bGUgcCB7XG4gICAgbWFyZ2luOiA1cHggMDsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtc3VidGl0bGUtc2hvdyAuYXJ0LXN1YnRpdGxlIHtcbiAgZGlzcGxheTogYmxvY2s7IH1cbiJdfQ== */";
var css$2 = ".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{word-break:break-all;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInN1YnRpdGxlLnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsZ0NBQ0UsWUFBYSxDQUNiLGlCQUFrQixDQUNsQixVQUFXLENBQ1gsV0FBWSxDQUNaLFVBQVcsQ0FDWCxjQUFlLENBQ2YsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxjQUFlLENBQ2YsbUJBQW9CLENBQ3BCLHlDQUFtRCxDQUNuRCxrQ0FDRSxvQkFBcUIsQ0FDckIsMEJBQW1CLENBQW5CLHVCQUFtQixDQUFuQixrQkFBbUIsQ0FDbkIsWUFBZSxDQUVuQixrREFDRSxhQUFnQiIsImZpbGUiOiJzdWJ0aXRsZS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIgLmFydC1zdWJ0aXRsZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIHBvc2l0aW9uOiBhYnNvbHV0ZTtcbiAgei1pbmRleDogMjA7XG4gIGJvdHRvbTogNDBweDtcbiAgd2lkdGg6IDEwMCU7XG4gIHBhZGRpbmc6IDAgMjBweDtcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xuICBjb2xvcjogI2ZmZjtcbiAgZm9udC1zaXplOiAyMHB4O1xuICBwb2ludGVyLWV2ZW50czogbm9uZTtcbiAgdGV4dC1zaGFkb3c6IDAuNXB4IDAuNXB4IDAuNXB4IHJnYmEoMCwgMCwgMCwgMC41KTsgfVxuICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LXN1YnRpdGxlIHAge1xuICAgIHdvcmQtYnJlYWs6IGJyZWFrLWFsbDtcbiAgICBoZWlnaHQ6IGZpdC1jb250ZW50O1xuICAgIG1hcmdpbjogNXB4IDA7IH1cblxuLmFydC12aWRlby1wbGF5ZXIuYXJ0LXN1YnRpdGxlLXNob3cgLmFydC1zdWJ0aXRsZSB7XG4gIGRpc3BsYXk6IGJsb2NrOyB9XG4iXX0= */";
styleInject(css$2);
var css$3 = ".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImRhbm11a3Uuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSwrQkFDRSxpQkFBa0IsQ0FDbEIsVUFBVyxDQUNYLE1BQU8sQ0FDUCxLQUFNLENBQ04sT0FBUSxDQUNSLFFBQVMsQ0FDVCxVQUFXLENBQ1gsV0FBWSxDQUNaLGVBQWdCLENBQ2hCLG1CQUFzQiIsImZpbGUiOiJkYW5tdWt1LnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWRhbm11a3Uge1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDMwO1xuICBsZWZ0OiAwO1xuICB0b3A6IDA7XG4gIHJpZ2h0OiAwO1xuICBib3R0b206IDA7XG4gIHdpZHRoOiAxMDAlO1xuICBoZWlnaHQ6IDEwMCU7XG4gIG92ZXJmbG93OiBoaWRkZW47XG4gIHBvaW50ZXItZXZlbnRzOiBub25lOyB9XG4iXX0= */";
@@ -171,7 +171,7 @@
var css$8 = ".art-video-player .art-notice{display:none;font-size:14px;position:absolute;z-index:80;left:0;top:0;padding:10px;width:100%;pointer-events:none}.art-video-player .art-notice .art-notice-inner{display:inline-block;padding:5px 10px;color:#fff;background:rgba(0,0,0,.6);border-radius:3px}.art-video-player.art-notice-show .art-notice{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm5vdGljZS5zY3NzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLDhCQUNFLFlBQWEsQ0FDYixjQUFlLENBQ2YsaUJBQWtCLENBQ2xCLFVBQVcsQ0FDWCxNQUFPLENBQ1AsS0FBTSxDQUNOLFlBQWEsQ0FDYixVQUFXLENBQ1gsbUJBQXNCLENBQ3RCLGdEQUNFLG9CQUFxQixDQUNyQixnQkFBaUIsQ0FDakIsVUFBVyxDQUNYLHlCQUE4QixDQUM5QixpQkFBb0IsQ0FFeEIsOENBQ0UsbUJBQWEsQ0FBYixtQkFBYSxDQUFiLFlBQWUiLCJmaWxlIjoibm90aWNlLnNjc3MiLCJzb3VyY2VzQ29udGVudCI6WyIuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LW5vdGljZSB7XG4gIGRpc3BsYXk6IG5vbmU7XG4gIGZvbnQtc2l6ZTogMTRweDtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiA4MDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICBwYWRkaW5nOiAxMHB4O1xuICB3aWR0aDogMTAwJTtcbiAgcG9pbnRlci1ldmVudHM6IG5vbmU7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1ub3RpY2UgLmFydC1ub3RpY2UtaW5uZXIge1xuICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICBwYWRkaW5nOiA1cHggMTBweDtcbiAgICBjb2xvcjogI2ZmZjtcbiAgICBiYWNrZ3JvdW5kOiByZ2JhKDAsIDAsIDAsIDAuNik7XG4gICAgYm9yZGVyLXJhZGl1czogM3B4OyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1ub3RpY2Utc2hvdyAuYXJ0LW5vdGljZSB7XG4gIGRpc3BsYXk6IGZsZXg7IH1cbiJdfQ== */";
styleInject(css$8);
var css$9 = ".art-video-player .art-contextmenus{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:120;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.9);border-radius:3px}.art-video-player .art-contextmenus .art-contextmenu{cursor:pointer;font-size:13px;display:block;color:#fff;padding:7px 10px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu a{color:#fff;text-decoration:none}.art-video-player .art-contextmenus .art-contextmenu span{display:inline-block;padding:0 7px}.art-video-player .art-contextmenus .art-contextmenu span.art-current,.art-video-player .art-contextmenus .art-contextmenu span:hover{color:#00c9ff}.art-video-player .art-contextmenus .art-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu:last-child{border-bottom:none}.art-video-player.art-contextmenu-show .art-contextmenus{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRleHRtZW51LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0NBQ0UsWUFBYSxDQUNiLDJCQUFzQixDQUF0Qiw0QkFBc0IsQ0FBdEIseUJBQXNCLENBQXRCLHFCQUFzQixDQUN0QixpQkFBa0IsQ0FDbEIsV0FBWSxDQUNaLE1BQU8sQ0FDUCxLQUFNLENBQ04sZUFBZ0IsQ0FDaEIsYUFBYyxDQUNkLHlCQUE4QixDQUM5QixpQkFBb0IsQ0FDcEIscURBQ0UsY0FBZSxDQUNmLGNBQWUsQ0FDZixhQUFjLENBQ2QsVUFBVyxDQUNYLGdCQUFpQixDQUNqQixlQUFnQixDQUNoQixzQkFBdUIsQ0FDdkIsa0JBQW1CLENBQ25CLGtDQUF1QyxDQUN2QywwQ0FBbUQsQ0FDbkQsdURBQ0UsVUFBVyxDQUNYLG9CQUF1QixDQUN6QiwwREFDRSxvQkFBcUIsQ0FDckIsYUFBZ0IsQ0FDaEIsc0lBQ0UsYUFBZ0IsQ0FDcEIsMkRBQ0UsbUNBQTRDLENBQzlDLGdFQUNFLGtCQUFxQixDQUUzQix5REFDRSxtQkFBYSxDQUFiLG1CQUFhLENBQWIsWUFBZSIsImZpbGUiOiJjb250ZXh0bWVudS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMge1xuICBkaXNwbGF5OiBub25lO1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDEyMDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICBtaW4td2lkdGg6IDIwMHB4O1xuICBwYWRkaW5nOiA1cHggMDtcbiAgYmFja2dyb3VuZDogcmdiYSgwLCAwLCAwLCAwLjkpO1xuICBib3JkZXItcmFkaXVzOiAzcHg7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSB7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIGZvbnQtc2l6ZTogMTNweDtcbiAgICBkaXNwbGF5OiBibG9jaztcbiAgICBjb2xvcjogI2ZmZjtcbiAgICBwYWRkaW5nOiA3cHggMTBweDtcbiAgICBvdmVyZmxvdzogaGlkZGVuO1xuICAgIHRleHQtb3ZlcmZsb3c6IGVsbGlwc2lzO1xuICAgIHdoaXRlLXNwYWNlOiBub3dyYXA7XG4gICAgdGV4dC1zaGFkb3c6IDAgMCAycHggcmdiYSgwLCAwLCAwLCAwLjUpO1xuICAgIGJvcmRlci1ib3R0b206IDFweCBzb2xpZCByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMSk7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51IGEge1xuICAgICAgY29sb3I6ICNmZmY7XG4gICAgICB0ZXh0LWRlY29yYXRpb246IG5vbmU7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51IHNwYW4ge1xuICAgICAgZGlzcGxheTogaW5saW5lLWJsb2NrO1xuICAgICAgcGFkZGluZzogMCA3cHg7IH1cbiAgICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtY29udGV4dG1lbnVzIC5hcnQtY29udGV4dG1lbnUgc3Bhbjpob3ZlciwgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSBzcGFuLmFydC1jdXJyZW50IHtcbiAgICAgICAgY29sb3I6ICMwMGM5ZmY7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51OmhvdmVyIHtcbiAgICAgIGJhY2tncm91bmQtY29sb3I6IHJnYmEoMjU1LCAyNTUsIDI1NSwgMC4xKTsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtY29udGV4dG1lbnVzIC5hcnQtY29udGV4dG1lbnU6bGFzdC1jaGlsZCB7XG4gICAgICBib3JkZXItYm90dG9tOiBub25lOyB9XG5cbi5hcnQtdmlkZW8tcGxheWVyLmFydC1jb250ZXh0bWVudS1zaG93IC5hcnQtY29udGV4dG1lbnVzIHtcbiAgZGlzcGxheTogZmxleDsgfVxuIl19 */";
var css$9 = ".art-video-player .art-contextmenus{display:none;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;position:absolute;z-index:120;left:0;top:0;min-width:200px;padding:5px 0;background:rgba(0,0,0,.9);border-radius:3px}.art-video-player .art-contextmenus .art-contextmenu{cursor:pointer;font-size:12px;display:block;color:#fff;padding:10px 15px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-shadow:0 0 2px rgba(0,0,0,.5);border-bottom:1px solid hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu a{color:#fff;text-decoration:none}.art-video-player .art-contextmenus .art-contextmenu span{display:inline-block;padding:0 7px}.art-video-player .art-contextmenus .art-contextmenu span.art-current,.art-video-player .art-contextmenus .art-contextmenu span:hover{color:#00c9ff}.art-video-player .art-contextmenus .art-contextmenu:hover{background-color:hsla(0,0%,100%,.1)}.art-video-player .art-contextmenus .art-contextmenu:last-child{border-bottom:none}.art-video-player.art-contextmenu-show .art-contextmenus{display:-webkit-box;display:-ms-flexbox;display:flex}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImNvbnRleHRtZW51LnNjc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0NBQ0UsWUFBYSxDQUNiLDJCQUFzQixDQUF0Qiw0QkFBc0IsQ0FBdEIseUJBQXNCLENBQXRCLHFCQUFzQixDQUN0QixpQkFBa0IsQ0FDbEIsV0FBWSxDQUNaLE1BQU8sQ0FDUCxLQUFNLENBQ04sZUFBZ0IsQ0FDaEIsYUFBYyxDQUNkLHlCQUE4QixDQUM5QixpQkFBb0IsQ0FDcEIscURBQ0UsY0FBZSxDQUNmLGNBQWUsQ0FDZixhQUFjLENBQ2QsVUFBVyxDQUNYLGlCQUFrQixDQUNsQixlQUFnQixDQUNoQixzQkFBdUIsQ0FDdkIsa0JBQW1CLENBQ25CLGtDQUF1QyxDQUN2QywwQ0FBbUQsQ0FDbkQsdURBQ0UsVUFBVyxDQUNYLG9CQUF1QixDQUN6QiwwREFDRSxvQkFBcUIsQ0FDckIsYUFBZ0IsQ0FDaEIsc0lBQ0UsYUFBZ0IsQ0FDcEIsMkRBQ0UsbUNBQTRDLENBQzlDLGdFQUNFLGtCQUFxQixDQUUzQix5REFDRSxtQkFBYSxDQUFiLG1CQUFhLENBQWIsWUFBZSIsImZpbGUiOiJjb250ZXh0bWVudS5zY3NzIiwic291cmNlc0NvbnRlbnQiOlsiLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMge1xuICBkaXNwbGF5OiBub25lO1xuICBmbGV4LWRpcmVjdGlvbjogY29sdW1uO1xuICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gIHotaW5kZXg6IDEyMDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICBtaW4td2lkdGg6IDIwMHB4O1xuICBwYWRkaW5nOiA1cHggMDtcbiAgYmFja2dyb3VuZDogcmdiYSgwLCAwLCAwLCAwLjkpO1xuICBib3JkZXItcmFkaXVzOiAzcHg7IH1cbiAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSB7XG4gICAgY3Vyc29yOiBwb2ludGVyO1xuICAgIGZvbnQtc2l6ZTogMTJweDtcbiAgICBkaXNwbGF5OiBibG9jaztcbiAgICBjb2xvcjogI2ZmZjtcbiAgICBwYWRkaW5nOiAxMHB4IDE1cHg7XG4gICAgb3ZlcmZsb3c6IGhpZGRlbjtcbiAgICB0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcbiAgICB3aGl0ZS1zcGFjZTogbm93cmFwO1xuICAgIHRleHQtc2hhZG93OiAwIDAgMnB4IHJnYmEoMCwgMCwgMCwgMC41KTtcbiAgICBib3JkZXItYm90dG9tOiAxcHggc29saWQgcmdiYSgyNTUsIDI1NSwgMjU1LCAwLjEpOyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSBhIHtcbiAgICAgIGNvbG9yOiAjZmZmO1xuICAgICAgdGV4dC1kZWNvcmF0aW9uOiBub25lOyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudSBzcGFuIHtcbiAgICAgIGRpc3BsYXk6IGlubGluZS1ibG9jaztcbiAgICAgIHBhZGRpbmc6IDAgN3B4OyB9XG4gICAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51IHNwYW46aG92ZXIsIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtY29udGV4dG1lbnVzIC5hcnQtY29udGV4dG1lbnUgc3Bhbi5hcnQtY3VycmVudCB7XG4gICAgICAgIGNvbG9yOiAjMDBjOWZmOyB9XG4gICAgLmFydC12aWRlby1wbGF5ZXIgLmFydC1jb250ZXh0bWVudXMgLmFydC1jb250ZXh0bWVudTpob3ZlciB7XG4gICAgICBiYWNrZ3JvdW5kLWNvbG9yOiByZ2JhKDI1NSwgMjU1LCAyNTUsIDAuMSk7IH1cbiAgICAuYXJ0LXZpZGVvLXBsYXllciAuYXJ0LWNvbnRleHRtZW51cyAuYXJ0LWNvbnRleHRtZW51Omxhc3QtY2hpbGQge1xuICAgICAgYm9yZGVyLWJvdHRvbTogbm9uZTsgfVxuXG4uYXJ0LXZpZGVvLXBsYXllci5hcnQtY29udGV4dG1lbnUtc2hvdyAuYXJ0LWNvbnRleHRtZW51cyB7XG4gIGRpc3BsYXk6IGZsZXg7IH1cbiJdfQ== */";
styleInject(css$9);
var css$a = ".art-video-player .art-settings{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute;z-index:90;left:0;top:0;height:100%;width:100%;opacity:0;visibility:hidden;pointer-events:none;overflow:hidden}.art-video-player .art-settings .art-setting-inner{position:absolute;top:0;right:-300px;bottom:0;width:300px;height:100%;font-size:12px;background:rgba(0,0,0,.9);-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;overflow:auto}.art-video-player .art-settings .art-setting-inner .art-setting-body{overflow-y:auto;width:100%;height:100%}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting{border-bottom:1px solid hsla(0,0%,100%,.1);padding:10px 15px}.art-video-player .art-settings .art-setting-inner .art-setting-body .art-setting .art-setting-header{margin-bottom:5px}.art-video-player .art-settings .art-setting-radio{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-radio .art-radio-item{-webkit-box-flex:1;-ms-flex:1;flex:1;padding:0 2px}.art-video-player .art-settings .art-setting-radio .art-radio-item button{height:22px;width:100%;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px}.art-video-player .art-settings .art-setting-radio .art-radio-item.current button{background-color:#00a1d6}.art-video-player .art-settings .art-setting-range input{width:100%;height:3px;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:hsla(0,0%,100%,.5)}.art-video-player .art-settings .art-setting-checkbox input{height:14px;width:14px;margin-right:5px}.art-video-player .art-settings .art-setting-upload{display:-webkit-box;display:-ms-flexbox;display:flex}.art-video-player .art-settings .art-setting-upload .art-upload-btn{width:80px;height:22px;line-height:22px;border:none;outline:none;color:#fff;background:hsla(0,0%,100%,.2);border-radius:2px;text-align:center}.art-video-player .art-settings .art-setting-upload .art-upload-value{-webkit-box-flex:1;-ms-flex:1;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;height:22px;line-height:22px;padding-left:10px}.art-video-player.art-setting-show .art-settings{opacity:1;visibility:visible;pointer-events:auto}.art-video-player.art-setting-show .art-settings .art-setting-inner{right:0}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNldHRpbmcuc2NzcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxnQ0FDRSxtQkFBYSxDQUFiLG1CQUFhLENBQWIsWUFBYSxDQUNiLHdCQUFtQixDQUFuQixxQkFBbUIsQ0FBbkIsa0JBQW1CLENBQ25CLHVCQUF1QixDQUF2QixvQkFBdUIsQ0FBdkIsc0JBQXVCLENBQ3ZCLGlCQUFrQixDQUNsQixVQUFXLENBQ1gsTUFBTyxDQUNQLEtBQU0sQ0FDTixXQUFZLENBQ1osVUFBVyxDQUNYLFNBQVUsQ0FDVixpQkFBa0IsQ0FDbEIsbUJBQW9CLENBQ3BCLGVBQWtCLENBQ2xCLG1EQUNFLGlCQUFrQixDQUNsQixLQUFNLENBQ04sWUFBYSxDQUNiLFFBQVMsQ0FDVCxXQUFZLENBQ1osV0FBWSxDQUNaLGNBQWUsQ0FDZix5QkFBOEIsQ0FDOUIsc0NBQWdDLENBQWhDLDhCQUFnQyxDQUNoQyxhQUFnQixDQUNoQixxRUFDRSxlQUFnQixDQUNoQixVQUFXLENBQ1gsV0FBYyxDQUNkLGtGQUNFLDBDQUFpRCxDQUNqRCxpQkFBb0IsQ0FDcEIsc0dBQ0UsaUJBQW9CLENBQzVCLG1EQUNFLG1CQUFhLENBQWIsbUJBQWEsQ0FBYixZQUFlLENBQ2YsbUVBQ0Usa0JBQU8sQ0FBUCxVQUFPLENBQVAsTUFBTyxDQUNQLGFBQWdCLENBQ2hCLDBFQUNFLFdBQVksQ0FDWixVQUFXLENBQ1gsV0FBWSxDQUNaLFlBQWEsQ0FDYixVQUFXLENBQ1gsNkJBQW9DLENBQ3BDLGlCQUFvQixDQUN0QixrRkFDRSx3QkFBMkIsQ0FDakMseURBQ0UsVUFBVyxDQUNYLFVBQVcsQ0FDWCxZQUFhLENBQ2IsdUJBQWdCLENBQWhCLG9CQUFnQixDQUFoQixlQUFnQixDQUNoQixtQ0FBNEMsQ0FDOUMsNERBQ0UsV0FBWSxDQUNaLFVBQVcsQ0FDWCxnQkFBbUIsQ0FDckIsb0RBQ0UsbUJBQWEsQ0FBYixtQkFBYSxDQUFiLFlBQWUsQ0FDZixvRUFDRSxVQUFXLENBQ1gsV0FBWSxDQUNaLGdCQUFpQixDQUNqQixXQUFZLENBQ1osWUFBYSxDQUNiLFVBQVcsQ0FDWCw2QkFBb0MsQ0FDcEMsaUJBQWtCLENBQ2xCLGlCQUFvQixDQUN0QixzRUFDRSxrQkFBTyxDQUFQLFVBQU8sQ0FBUCxNQUFPLENBQ1AsZUFBZ0IsQ0FDaEIsc0JBQXVCLENBQ3ZCLGtCQUFtQixDQUNuQixXQUFZLENBQ1osZ0JBQWlCLENBQ2pCLGlCQUFvQixDQUUxQixpREFDRSxTQUFVLENBQ1Ysa0JBQW1CLENBQ25CLG1CQUFzQixDQUN0QixvRUFDRSxPQUFVIiwiZmlsZSI6InNldHRpbmcuc2NzcyIsInNvdXJjZXNDb250ZW50IjpbIi5hcnQtdmlkZW8tcGxheWVyIC5hcnQtc2V0dGluZ3Mge1xuICBkaXNwbGF5OiBmbGV4O1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuICBqdXN0aWZ5LWNvbnRlbnQ6IGNlbnRlcjtcbiAgcG9zaXRpb246IGFic29sdXRlO1xuICB6LWluZGV4OiA5MDtcbiAgbGVmdDogMDtcbiAgdG9wOiAwO1xuICBoZWlnaHQ6IDEwMCU7XG4gIHdpZHRoOiAxMDAlO1xuICBvcGFjaXR5OiAwO1xuICB2aXNpYmlsaXR5OiBoaWRkZW47XG4gIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICBvdmVyZmxvdzogaGlkZGVuOyB9XG4gIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtc2V0dGluZ3MgLmFydC1zZXR0aW5nLWlubmVyIHtcbiAgICBwb3NpdGlvbjogYWJzb2x1dGU7XG4gICAgdG9wOiAwO1xuICAgIHJpZ2h0OiAtMzAwcHg7XG4gICAgYm90dG9tOiAwO1xuICAgIHdpZHRoOiAzMDBweDtcbiAgICBoZWlnaHQ6IDEwMCU7XG4gICAgZm9udC1zaXplOiAxMnB4O1xuICAgIGJhY2tncm91bmQ6IHJnYmEoMCwgMCwgMCwgMC45KTtcbiAgICB0cmFuc2l0aW9uOiBhbGwgMC4ycyBlYXNlLWluLW91dDtcbiAgICBvdmVyZmxvdzogYXV0bzsgfVxuICAgIC5hcnQtdmlkZW8tcGxheWVyIC5hcnQtc2V0dGluZ3MgLmFydC1zZXR0aW5nLWlubmVyIC5hcnQtc2V0dGluZy1ib2R5IHtcbiAgICAgIG92ZXJmbG93LXk6IGFLine truncated
@@ -673,6 +673,25 @@
var sec = Math.floor(second - hour * 3600 - min * 60);
return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');
}
function escape(str) {
return str.replace(/[&<>'"]/g, function (tag) {
return {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;'
}[tag] || tag;
});
}
var userAgent = window.navigator.userAgent;
function isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
}
function isSafari() {
return /^((?!chrome|android).)*safari/i.test(userAgent);
}
@@ -706,7 +725,11 @@
debounce: debounce,
throttle: throttle,
clamp: clamp,
secondToTime: secondToTime
secondToTime: secondToTime,
escape: escape,
userAgent: userAgent,
isMobile: isMobile,
isSafari: isSafari
});
function validElement(value, type, paths) {
@@ -734,6 +757,7 @@
hotkey: 'boolean',
pip: 'boolean',
mutex: 'boolean',
light: 'boolean',
backdrop: 'boolean',
fullscreen: 'boolean',
fullscreenWeb: 'boolean',
@@ -816,8 +840,8 @@
var kindOf = art.constructor.kindOf,
whitelist = art.option.whitelist;
this.ua = navigator.userAgent;
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua);
this.ua = userAgent;
this.isMobile = isMobile();
this.state = !this.isMobile || whitelist.some(function (item) {
switch (kindOf(item)) {
case 'string':
@@ -875,7 +899,8 @@
var _this$art$option = this.art.option,
theme = _this$art$option.theme,
backdrop = _this$art$option.backdrop;
this.$container.innerHTML = "\n <div class=\"art-video-player art-subtitle-show art-layer-show\" style=\"--theme: ".concat(theme, "\">\n <video class=\"art-video\">\n <track default kind=\"metadata\"></track>\n </video>\n <div class=\"art-subtitle\"></div>\n <div class=\"art-danmuku\"></div>\n <div class=\"art-layers\"></div>\n <div class=\"art-mask\">\n <div class=\"art-state\"></div>\n </div>\n <div class=\"art-bottom\">\n <div class=\"art-progress\"></div>\n <div class=\"art-controls\">\n <div class=\"art-controls-left\"></div>\n <div class=\"art-controls-right\"></div>\n </div>\n </div>\n <div class=\"art-loading\"></div>\n <div class=\"art-notice\">\n <div class=\"art-notice-inner\"></div>\n </div>\n <div class=\"art-settings\">\n <div class=\"art-setting-inner\">\n <div class=\"art-setting-body\"></div>\n </div>\n </div>\n <div class=\"art-info\">\n <div class=\"art-info-panel\">\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Player version:</div>\n <div class=\"art-info-content\">3.4.1</div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video url:</div>\n <div class=\"art-info-content\" data-video=\"src\"></div>\n </div>\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 <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 <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 <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 </div>\n <div class=\"art-info-close\">[x]</div>\n </div>\n <div class=\"art-pip-header\">\n <div class=\"art-pip-title\"></div>\n <div class=\"art-pip-close\">\xD7</div>\n </div>\n <div class=\"art-contextmenus\"></div>\n </div>\n ");
this.$container.innerHTML = "\n <div class=\"art-undercover\"></div>\n <div class=\"art-video-player art-subtitle-show art-layer-show\" style=\"--theme: ".concat(theme, "\">\n <video class=\"art-video\">\n <track default kind=\"metadata\"></track>\n </video>\n <div class=\"art-subtitle\"></div>\n <div class=\"art-danmuku\"></div>\n <div class=\"art-layers\"></div>\n <div class=\"art-mask\">\n <div class=\"art-state\"></div>\n </div>\n <div class=\"art-bottom\">\n <div class=\"art-progress\"></div>\n <div class=\"art-controls\">\n <div class=\"art-controls-left\"></div>\n <div class=\"art-controls-right\"></div>\n </div>\n </div>\n <div class=\"art-loading\"></div>\n <div class=\"art-notice\">\n <div class=\"art-notice-inner\"></div>\n </div>\n <div class=\"art-settings\">\n <div class=\"art-setting-inner\">\n <div class=\"art-setting-body\"></div>\n </div>\n </div>\n <div class=\"art-info\">\n <div class=\"art-info-panel\">\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Player version:</div>\n <div class=\"art-info-content\">3.5.2</div>\n </div>\n <div class=\"art-info-item\">\n <div class=\"art-info-title\">Video url:</div>\n <div class=\"art-info-content\" data-video=\"src\"></div>\n </div>\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 <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 <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 <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 </div>\n <div class=\"art-info-close\">[x]</div>\n </div>\n <div class=\"art-pip-header\">\n <div class=\"art-pip-title\"></div>\n <div class=\"art-pip-close\">\xD7</div>\n </div>\n <div class=\"art-contextmenus\"></div>\n </div>\n ");
this.$undercover = this.query('.art-undercover');
this.$player = this.query('.art-video-player');
this.$video = this.query('.art-video');
this.$track = this.query('.art-video track');
@@ -948,6 +973,8 @@
var zhCn = {
"Video info": "视频统计信息",
Close: Close,
"Light Off": "关灯",
"Light On": "开灯",
"Video load failed": "视频加载失败",
Volume: Volume,
Play: Play,
@@ -1002,6 +1029,8 @@
var zhTw = {
"Video info": "影片統計訊息",
Close: Close$1,
"Light Off": "關燈",
"Light On": "開燈",
"Video load failed": "影片載入失敗",
Volume: Volume$1,
Play: Play$1,
@@ -1278,7 +1307,7 @@
});
}
function pauseMin(art, player) {
function pauseMix(art, player) {
var $video = art.template.$video,
i18n = art.i18n,
notice = art.notice;
@@ -1355,12 +1384,13 @@
}
function currentTimeMix(art, player) {
var $video = art.template.$video;
def(player, 'currentTime', {
get: function get() {
return art.template.$video.currentTime || 0;
return $video.currentTime || 0;
},
set: function set(currentTime) {
art.template.$video.currentTime = clamp(currentTime, 0, player.duration);
set: function set(time) {
$video.currentTime = clamp(time, 0, player.duration || Infinity);
}
});
}
@@ -2072,6 +2102,19 @@
});
}
function lightMix(art, player) {
var $undercover = art.template.$undercover;
def(player, 'light', {
get: function get() {
return getStyle($undercover, 'display', false) !== 'none';
},
set: function set(value) {
setStyle($undercover, 'display', value ? 'block' : 'none');
art.emit('light', value);
}
});
}
var Player = function Player(art) {
classCallCheck(this, Player);
@@ -2079,7 +2122,7 @@
eventInit(art, this);
attrInit(art, this);
playMix(art, this);
pauseMin(art, this);
pauseMix(art, this);
toggleMix(art, this);
seekMix(art, this);
volumeMix(art, this);
@@ -2098,6 +2141,7 @@
resizeMix(art, this);
rectMix(art, this);
flipMix(art, this);
lightMix(art, this);
proxyPropertys(art, this);
};
@@ -3025,7 +3069,7 @@
function version(option) {
return _objectSpread$f({}, option, {
html: '<a href="https://artplayer.org" target="_blank">ArtPlayer 3.4.1</a>'
html: '<a href="https://artplayer.org" target="_blank">ArtPlayer 3.5.2</a>'
});
}
@@ -3033,9 +3077,32 @@
function _objectSpread$g(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$g(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$g(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function light(option) {
return function (art) {
var i18n = art.i18n,
player = art.player;
return _objectSpread$g({}, option, {
html: i18n.get('Light Off'),
click: function click(contextmenu) {
player.light = !player.light;
contextmenu.show = false;
},
mounted: function mounted($menu) {
art.on('light', function (value) {
$menu.innerText = i18n.get(value ? 'Light On' : 'Light Off');
});
}
});
};
}
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function close(option) {
return function (art) {
return _objectSpread$g({}, option, {
return _objectSpread$h({}, option, {
html: art.i18n.get('Close'),
click: function click(contextmenu) {
contextmenu.show = false;
@@ -3087,10 +3154,16 @@
index: 40
}));
_this.add(light({
disable: !option.light,
name: 'light',
index: 50
}));
_this.add(close({
disable: false,
name: 'close',
index: 50
index: 60
}));
option.contextmenu.forEach(function (item) {
@@ -3225,7 +3298,7 @@
if (this.activeCue) {
$subtitle.innerHTML = this.activeCue.text.split(/\r?\n/).map(function (item) {
return "<p>".concat(item, "</p>");
return "<p>".concat(escape(item), "</p>");
}).join('');
this.art.emit('subtitle:update', this.activeCue.text);
}
@@ -3313,7 +3386,7 @@
function clickInit(art, events) {
var $player = art.template.$player;
events.proxy(document, ['click', 'contextmenu'], function (event) {
if (event.composedPath().indexOf($player) > -1) {
if (event.composedPath && event.composedPath().indexOf($player) > -1) {
art.isFocus = true;
art.emit('focus');
} else {
@@ -3693,16 +3766,16 @@
var pip$1 = "<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>";
function ownKeys$h(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$h(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$h(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$h(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$i(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var Icons = function Icons(art) {
var _this = this;
classCallCheck(this, Icons);
var icons = _objectSpread$h({
var icons = _objectSpread$i({
loading: loading,
state: state,
play: play,
@@ -3726,14 +3799,14 @@
});
};
function ownKeys$i(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$i(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$j(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function flip(option) {
return function (art) {
var i18n = art.i18n,
player = art.player;
return _objectSpread$i({}, option, {
return _objectSpread$j({}, option, {
html: "\n <div class=\"art-setting-header\">".concat(i18n.get('Flip'), "</div>\n <div class=\"art-setting-radio\">\n <div class=\"art-radio-item current\">\n <button type=\"button\" data-value=\"normal\">").concat(i18n.get('Normal'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"horizontal\">").concat(i18n.get('Horizontal'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"vertical\">").concat(i18n.get('Vertical'), "</button>\n </div>\n </div>\n "),
click: function click(setting, event) {
var value = event.target.dataset.value;
@@ -3757,14 +3830,14 @@
};
}
function ownKeys$j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$j(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$k(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function aspectRatio$1(option) {
return function (art) {
var i18n = art.i18n,
player = art.player;
return _objectSpread$j({}, option, {
return _objectSpread$k({}, option, {
html: "\n <div class=\"art-setting-header\">".concat(i18n.get('Aspect ratio'), "</div>\n <div class=\"art-setting-radio\">\n <div class=\"art-radio-item current\">\n <button type=\"button\" data-value=\"default\">").concat(i18n.get('Default'), "</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"4:3\">4:3</button>\n </div>\n <div class=\"art-radio-item\">\n <button type=\"button\" data-value=\"16:9\">16:9</button>\n </div>\n </div>\n "),
click: function click(setting, event) {
var value = event.target.dataset.value;
@@ -3788,15 +3861,15 @@
};
}
function ownKeys$k(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function ownKeys$l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
function _objectSpread$k(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$k(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$k(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function _objectSpread$l(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$l(Object(source), true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$l(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
function playbackRate$1(option) {
return function (art) {
var i18n = art.i18n,
player = art.player,
proxy = art.events.proxy;
return _objectSpread$k({}, option, {
return _objectSpread$l({}, option, {
html: "\n <div class=\"art-setting-header\">\n ".concat(i18n.get('Play speed'), ": <span class=\"art-subtitle-value\">1.0</span>x\n </div>\n <div class=\"art-setting-range\">\n <input class=\"art-subtitle-range\" value=\"1\" type=\"range\" min=\"0.5\" max=\"2\" step=\"0.25\">\n </div>\n "),
mounted: function mounted($setting) {
var $range = query('.art-setting-range input', $setting);
@@ -4243,18 +4316,9 @@
value: function add(plugin) {
this.id += 1;
var result = plugin.call(this, this.art);
var pluginName = '';
if (result && result.name) {
pluginName = result.name;
} else if (plugin.name) {
pluginName = plugin.name;
} else {
pluginName = "plugin".concat(this.id);
}
var pluginName = result && result.name || plugin.name || "plugin".concat(this.id);
errorHandle(!has(this, pluginName), "Cannot add a plugin that already has the same name: ".concat(pluginName));
Object.defineProperty(this, pluginName, {
def(this, pluginName, {
value: result
});
this.art.emit('plugin:add', plugin);
@@ -4368,7 +4432,7 @@
}], [{
key: "version",
get: function get() {
return '3.4.1';
return '3.5.2';
}
}, {
key: "env",
@@ -4428,6 +4492,7 @@
hotkey: true,
pip: false,
mutex: true,
light: false,
backdrop: true,
fullscreen: false,
fullscreenWeb: false,
@@ -4435,7 +4500,6 @@
miniProgressBar: false,
localVideo: false,
localSubtitle: false,
autoPip: false,
networkMonitor: false,
layers: [],
contextmenu: [],
@@ -4457,7 +4521,7 @@
},
moreVideoAttr: {
controls: false,
preload: 'metadata'
preload: isSafari() ? 'auto' : 'metadata'
},
icons: {},
customType: {},
@@ -4469,11 +4533,12 @@
return Artplayer;
}(Emitter);
Object.defineProperty(Artplayer, 'instances', {
def(Artplayer, 'instances', {
value: []
}); // eslint-disable-next-line no-console
console.log('%c ArtPlayer %c 3.4.1 %c https://artplayer.org', 'color: #fff; background: #5f5f5f', 'color: #fff; background: #4bc729', '');
console.log('%c ArtPlayer %c 3.5.2 %c https://artplayer.org', 'color: #fff; background: #5f5f5f', 'color: #fff; background: #4bc729', '');
window.Artplayer = Artplayer;
return Artplayer;
+1 -1
View File
@@ -1 +1 @@
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/style-inject/dist/style-inject.es.js","../../packages/artplayer/node_modules/option-validator/dist/option-validator.js","../../packages/artplayer/src/utils/emitter.js","../../packages/artplayer/src/utils/dom.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../packages/artplayer/src/utils/error.js","../../packages/artplayer/src/utils/subtitle.js","../../packages/artplayer/src/utils/file.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../packages/artplayer/src/utils/property.js","../../packages/artplayer/src/utils/time.js","../../packages/artplayer/src/utils/format.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/src/whitelist.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n/index.js","../../packages/artplayer/src/player/urlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMix.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/playingMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/rectMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/index.js","../../node_modules/@babel/runtime/helpers/superPropBase.js","../../node_modules/@babel/runtime/helpers/get.js","../../packages/artplayer/src/utils/component.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../packages/artplayer/src/control/fullscreen.js","../../packages/artplayer/src/control/fullscreenWeb.js","../../packages/artplayer/src/control/pip.js","../../packages/artplayer/src/control/playAndPause.js","../../packages/artplayer/src/control/progress.js","../../packages/artplayer/src/control/subtitle.js","../../packages/artplayer/src/control/time.js","../../packages/artplayer/src/control/volume.js","../../packages/artplayer/src/control/setting.js","../../packages/artplayer/src/control/thumbnails.js","../../packages/artplayer/src/control/screenshot.js","../../packages/artplayer/src/control/quality.js","../../packages/artplayer/src/control/index.js","../../packages/artplayer/src/contextmenu/playbackRate.js","../../packages/artplayer/src/contextmenu/aspectRatio.js","../../packages/artplayer/src/contextmenu/info.js","../../packages/artplayer/src/contextmenu/version.js","../../packages/artplayer/src/contextmenu/close.js","../../packages/artplayer/src/contextmenu/index.js","../../packages/artplayer/src/info.js","../../packages/artplayer/src/subtitle.js","../../packages/artplayer/src/events/clickInit.js","../../packages/artplayer/src/events/hoverInit.js","../../packages/artplayer/src/events/mousemoveInit.js","../../packages/artplayer/src/events/resizeInit.js","../../packages/artplayer/src/events/index.js","../../packages/artplayer/src/hotkey.js","../../packages/artplayer/src/layer.js","../../packages/artplayer/src/loading.js","../../packages/artplayer/src/notice.js","../../packages/artplayer/src/mask.js","../../packages/artplayer/src/icons/index.js","../../packages/artplayer/src/setting/flip.js","../../packages/artplayer/src/setting/aspectRatio.js","../../packages/artplayer/src/setting/playbackRate.js","../../pacLine truncated
{"version":3,"file":"artplayer.js","sources":["../../node_modules/@babel/runtime/helpers/classCallCheck.js","../../node_modules/@babel/runtime/helpers/createClass.js","../../node_modules/@babel/runtime/helpers/typeof.js","../../node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/inherits.js","../../node_modules/style-inject/dist/style-inject.es.js","../../packages/artplayer/node_modules/option-validator/dist/option-validator.js","../../packages/artplayer/src/utils/emitter.js","../../packages/artplayer/src/utils/dom.js","../../node_modules/@babel/runtime/helpers/isNativeFunction.js","../../node_modules/@babel/runtime/helpers/construct.js","../../node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../packages/artplayer/src/utils/error.js","../../packages/artplayer/src/utils/subtitle.js","../../packages/artplayer/src/utils/file.js","../../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/iterableToArray.js","../../node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/toConsumableArray.js","../../packages/artplayer/src/utils/property.js","../../packages/artplayer/src/utils/time.js","../../packages/artplayer/src/utils/format.js","../../packages/artplayer/src/utils/compatibility.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/src/whitelist.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n/index.js","../../packages/artplayer/src/player/urlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMix.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/playingMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/rectMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/lightMix.js","../../packages/artplayer/src/player/index.js","../../node_modules/@babel/runtime/helpers/superPropBase.js","../../node_modules/@babel/runtime/helpers/get.js","../../packages/artplayer/src/utils/component.js","../../node_modules/@babel/runtime/helpers/defineProperty.js","../../packages/artplayer/src/control/fullscreen.js","../../packages/artplayer/src/control/fullscreenWeb.js","../../packages/artplayer/src/control/pip.js","../../packages/artplayer/src/control/playAndPause.js","../../packages/artplayer/src/control/progress.js","../../packages/artplayer/src/control/subtitle.js","../../packages/artplayer/src/control/time.js","../../packages/artplayer/src/control/volume.js","../../packages/artplayer/src/control/setting.js","../../packages/artplayer/src/control/thumbnails.js","../../packages/artplayer/src/control/screenshot.js","../../packages/artplayer/src/control/quality.js","../../packages/artplayer/src/control/index.js","../../packages/artplayer/src/contextmenu/playbackRate.js","../../packages/artplayer/src/contextmenu/aspectRatio.js","../../packages/artplayer/src/contextmenu/info.js","../../packages/artplayer/src/contextmenu/version.js","../../packages/artplayer/src/contextmenu/light.js","../../packages/artplayer/src/contextmenu/close.js","../../packages/artplayer/src/contextmenu/index.js","../../packages/artplayer/src/info.js","../../packages/artplayer/src/subtitle.js","../../packages/artplayer/src/events/clickInit.js","../../packages/artplayer/src/events/hoverInit.js","../../packages/artplayer/src/events/mousemoveInit.js","../../packages/artplayer/src/events/resizeInit.js","../../packages/artplayer/src/events/index.js","../../packages/artplayer/src/hotkey.js","../../packages/artplayer/src/layer.js","../../packages/artplayer/src/loading.js","../../packages/artplayer/src/notice.js","../../packages/artplayer/src/mask.js","../../packages/artplayer/src/icons/index.js","../../pacLine truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"lerna": "3.4.3",
"version": "3.4.2",
"version": "3.5.3",
"packages": [
"packages/*"
],
+18 -18
View File
@@ -31,41 +31,41 @@
},
"homepage": "https://github.com/zhw2590582/ArtPlayer",
"dependencies": {
"@babel/core": "^7.8.4",
"@babel/core": "^7.9.0",
"@babel/plugin-external-helpers": "^7.8.3",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.4",
"@babel/runtime": "^7.8.4",
"autoprefixer": "^9.7.4",
"@babel/plugin-transform-runtime": "^7.9.0",
"@babel/preset-env": "^7.9.5",
"@babel/runtime": "^7.9.2",
"autoprefixer": "^9.7.6",
"babel-eslint": "^10.1.0",
"browser-env": "^3.3.0",
"chai": "^4.2.0",
"chalk": "^3.0.0",
"cpy": "^8.0.1",
"cross-env": "^7.0.0",
"chalk": "^4.0.0",
"cpy": "^8.1.0",
"cross-env": "^7.0.2",
"cssnano": "^4.1.10",
"del": "^5.1.0",
"eslint": "^6.8.0",
"eslint-config-airbnb-base": "^14.0.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-import": "^2.20.1",
"eslint-config-airbnb-base": "^14.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.20.2",
"glob": "^7.1.6",
"inquirer": "^7.0.4",
"inquirer": "^7.1.0",
"lerna": "^3.20.2",
"mocha": "^7.1.0",
"mocha": "^7.1.1",
"mocha-chrome": "^2.2.0",
"node-sass": "^4.13.1",
"rollup": "^1.31.1",
"rollup-plugin-babel": "^4.3.3",
"node-sass": "^4.14.0",
"rollup": "^2.7.2",
"rollup-plugin-babel": "^4.4.0",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-eslint": "^7.0.0",
"rollup-plugin-json": "^4.0.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^2.1.1",
"rollup-plugin-postcss": "^3.1.0",
"rollup-plugin-replace": "^2.2.0",
"rollup-plugin-size-snapshot": "^0.11.0",
"rollup-plugin-svgo": "^1.1.0",
"rollup-plugin-terser": "^5.2.0",
"rollup-plugin-terser": "^5.3.0",
"servor": "^3.2.0",
"travis-size-report": "^1.1.0"
}
@@ -1,8 +1,8 @@
/*!
* artplayer-plugin-backlight.js v3.4.2
* artplayer-plugin-backlight.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).artplayerPluginBacklight=e()}(this,(function(){"use strict";function t(t){for(var e=[],o=0;o<10;o+=1)for(var n=0;n<5;n+=1)0!==o&&9!==o&&0!==n&&4!==n||e.push(t(o,n,10,5));return e}return function(e){var o=e.constructor.utils.setStyles,n=e.template,a=n.$player,r=n.$video,i=e.player,c=document.createElement("div");c.classList.add("artplayer-backlight"),o(c,{position:"absolute",zIndex:9,left:0,top:0,right:0,bottom:0,width:"100%",height:"100%"});var l,s=(l=c,t((function(t,e,o,n){var a=document.createElement("div");return a.style.position="absolute",a.style.left="".concat(100*t/o,"%"),a.style.top="".concat(100*e/n,"%"),a.style.width="".concat(100/o,"%"),a.style.height="".concat(100/n,"%"),a.style.webkitBorderRadius="50%",a.style.borderRadius="50%",a.style.webkitTransition="all .2s ease",a.style.transition="all .2s ease",l.appendChild(a),{$box:a,left:0===t,right:t===o-1,top:0===e,bottom:e===n-1}}))),u=document.createElement("canvas");return a.insertBefore(c,r),function o(){window.requestAnimationFrame((function(){if(i.playing){var n=r.clientWidth,a=r.clientHeight;(function(e,o,n,a){var r=e.getContext("2d");return e.width=n,e.height=a,r.drawImage(o,0,0),t((function(t,e,o,i){for(var c=n/o,l=a/i,s=t*c,u=e*l,d=r.getImageData(s,u,c,l).data,f=0,h=0,p=0,g=0,y=d.length;g<y;g+=4)f+=d[g],h+=d[g+1],p+=d[g+2];return{r:f=Math.floor(f/(d.length/4)),g:h=Math.floor(h/(d.length/4)),b:p=Math.floor(p/(d.length/4))}}))})(u,r,n,a).forEach((function(t,e){var o=t.r,n=t.g,a=t.b,r=s[e],i=r.$box,c=r.left,l=r.right,u=r.top,d=r.bottom,f=c?"-64px":l?"64px":"0",h=u?"-64px":d?"64px":"0";i.style.webkitBoxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px"),i.style.boxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px")}))}e.isDestroy||o()}))}(),{name:"artplayerPluginBacklight"}}}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).artplayerPluginBacklight=e()}(this,(function(){"use strict";function t(t){for(var e=[],o=0;o<10;o+=1)for(var n=0;n<5;n+=1)0!==o&&9!==o&&0!==n&&4!==n||e.push(t(o,n,10,5));return e}return function(e){var o=e.constructor.utils.setStyles,n=e.template,a=n.$player,r=n.$video,i=e.player,c=document.createElement("div");c.classList.add("artplayer-backlight"),o(c,{position:"absolute",zIndex:9,left:0,top:0,right:0,bottom:0,width:"100%",height:"100%"});var l,s=(l=c,t((function(t,e,o,n){var a=document.createElement("div");return a.style.position="absolute",a.style.left="".concat(100*t/o,"%"),a.style.top="".concat(100*e/n,"%"),a.style.width="".concat(100/o,"%"),a.style.height="".concat(100/n,"%"),a.style.webkitBorderRadius="50%",a.style.borderRadius="50%",a.style.webkitTransition="all .2s ease",a.style.transition="all .2s ease",l.appendChild(a),{$box:a,left:0===t,right:t===o-1,top:0===e,bottom:e===n-1}}))),u=document.createElement("canvas");return a.insertBefore(c,r),function o(){setTimeout((function(){if(i.playing){var n=r.clientWidth,a=r.clientHeight;(function(e,o,n,a){var r=e.getContext("2d");return e.width=n,e.height=a,r.drawImage(o,0,0),t((function(t,e,o,i){for(var c=n/o,l=a/i,s=t*c,u=e*l,d=r.getImageData(s,u,c,l).data,f=0,h=0,p=0,g=0,y=d.length;g<y;g+=4)f+=d[g],h+=d[g+1],p+=d[g+2];return{r:f=Math.floor(f/(d.length/4)),g:h=Math.floor(h/(d.length/4)),b:p=Math.floor(p/(d.length/4))}}))})(u,r,n,a).forEach((function(t,e){var o=t.r,n=t.g,a=t.b,r=s[e],i=r.$box,c=r.left,l=r.right,u=r.top,d=r.bottom,f=c?"-64px":l?"64px":"0",h=u?"-64px":d?"64px":"0";i.style.webkitBoxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px"),i.style.boxShadow="rgb(".concat(o,", ").concat(n,", ").concat(a,") ").concat(f," ").concat(h," 128px")}))}e.isDestroy||o()}),200)}(),{name:"artplayerPluginBacklight"}}}));
@@ -1,6 +1,6 @@
{
"name": "artplayer-plugin-backlight",
"version": "3.4.2",
"version": "3.5.3",
"expose": "artplayerPluginBacklight",
"description": "Backlight plugin for ArtPlayer",
"main": "dist/artplayer-plugin-backlight.js",
@@ -42,8 +42,8 @@ function creatMatrix(parent) {
return matrixCallback((xIndex, yIndex, x, y) => {
const $box = document.createElement('div');
$box.style.position = 'absolute';
$box.style.left = `${xIndex * 100 / x}%`;
$box.style.top = `${yIndex * 100 / y}%`;
$box.style.left = `${(xIndex * 100) / x}%`;
$box.style.top = `${(yIndex * 100) / y}%`;
$box.style.width = `${100 / x}%`;
$box.style.height = `${100 / y}%`;
$box.style.webkitBorderRadius = '50%';
@@ -86,7 +86,7 @@ function artplayerPluginBacklight(art) {
$player.insertBefore($backlight, $video);
(function loop() {
window.requestAnimationFrame(() => {
setTimeout(() => {
if (player.playing) {
const { clientWidth, clientHeight } = $video;
const colors = getColors($canvas, $video, clientWidth, clientHeight);
@@ -98,13 +98,13 @@ function artplayerPluginBacklight(art) {
const y = top ? '-64px' : bottom ? '64px' : '0';
$box.style.webkitBoxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;
$box.style.boxShadow = `rgb(${r}, ${g}, ${b}) ${x} ${y} 128px`;
});
};
});
}
if (!art.isDestroy) {
loop();
}
});
}, 200);
})();
return {
@@ -112,4 +112,4 @@ function artplayerPluginBacklight(art) {
};
}
export default artplayerPluginBacklight;
export default artplayerPluginBacklight;
@@ -1,8 +1,8 @@
/*!
* artplayer-plugin-danmuku.js v3.4.2
* artplayer-plugin-danmuku.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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 t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(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 i=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t},r={"zh-cn":{"Danmu opacity":"弹幕透明度","Danmu speed":"弹幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"弹幕文本不能为空","The length of the danmu does not exceed":"弹幕文本字数不能超过","Danmu speed synchronous playback multiple":"弹幕速度同步播放倍数"},"zh-tw":{"Danmu opacity":"彈幕透明度","Danmu speed":"彈幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"彈幕文本不能為空","The length of the danmu does not exceed":"彈幕文本字數不能超過","Danmu speed synchronous playback multiple":"彈幕速度同步播放倍數"}};function a(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-opacity",index:10,html:'<div class="art-setting-header">'.concat(e.get("Danmu opacity"),': <span class="art-value">100</span>%</div><div class="art-setting-range"><input type="range" value="1" min="0.1" max="1" step="0.1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=100*Number(e),t.plugins.artplayerPluginDanmuku.config({opacity:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.opacity&&(i.value=t.opacity,r.innerText=100*t.opacity)}))}}}function o(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-size",index:11,html:'<div class="art-setting-header">'.concat(e.get("Danmu size"),': <span class="art-value">25</span>px</div><div class="art-setting-range"><input type="range" value="25" min="14" max="30" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({fontSize:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.fontSize&&(i.value=t.fontSize,r.innerText=t.fontSize)}))}}}function u(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-speed",index:12,html:'<div class="art-setting-header">'.concat(e.get("Danmu speed"),': <span class="art-value">5</span>s</div><div class="art-setting-range"><input type="range" value="5" min="1" max="10" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({speed:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.speed&&(i.value=t.speed,r.innerText=t.speed)}))}}}function s(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-synchronousPlayback",index:13,html:'<label class="art-setting-checkbox"><input type="checkbox"/>'.concat(e.get("Danmu speed synchronous playback multiple"),"</label>"),mounted:function(e){var i=e.querySelector("input[type=checkbox]");n(i,"change",(function(){t.plugins.artplayerPluginDanmuku.config({synchronousPlayback:i.checked})})),t.on("artplayerPluginDanmuku:config",(function(t){i.checked!==t.synchronousPlayback&&(i.checked=t.synchronousPlayback)}))}}}function l(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function c(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var p=function(t){if(Array.isArray(t))return t};var f=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){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 m=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var h=function(t,e){return p(t)||f(t,e)||m()};function d(t){switch(t){case 1:case 2:case 3:return 0;case 4:case 5:return 1;default:return 0}}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(/<d([\S ]*?>[\S ]*?)<\/d>/gi);return e.length?e.map((function(t){var e=t.match(/<d p="(.+)">(.+)<\/d>/),n=h(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:d(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=h(t.option.margiLine truncated
!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 t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(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 i=function(t,e,i){return e&&n(t.prototype,e),i&&n(t,i),t},r={"zh-cn":{"Danmu opacity":"弹幕透明度","Danmu speed":"弹幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"弹幕文本不能为空","The length of the danmu does not exceed":"弹幕文本字数不能超过","Danmu speed synchronous playback multiple":"弹幕速度同步播放倍数"},"zh-tw":{"Danmu opacity":"彈幕透明度","Danmu speed":"彈幕速度","Danmu size":"弹幕大小","Danmu text cannot be empty":"彈幕文本不能為空","The length of the danmu does not exceed":"彈幕文本字數不能超過","Danmu speed synchronous playback multiple":"彈幕速度同步播放倍數"}};function a(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-opacity",index:10,html:'<div class="art-setting-header">'.concat(e.get("Danmu opacity"),': <span class="art-value">100</span>%</div><div class="art-setting-range"><input type="range" value="1" min="0.1" max="1" step="0.1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=100*Number(e),t.plugins.artplayerPluginDanmuku.config({opacity:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.opacity&&(i.value=t.opacity,r.innerText=100*t.opacity)}))}}}function o(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-size",index:11,html:'<div class="art-setting-header">'.concat(e.get("Danmu size"),': <span class="art-value">25</span>px</div><div class="art-setting-range"><input type="range" value="25" min="14" max="30" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({fontSize:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.fontSize&&(i.value=t.fontSize,r.innerText=t.fontSize)}))}}}function u(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-speed",index:12,html:'<div class="art-setting-header">'.concat(e.get("Danmu speed"),': <span class="art-value">5</span>s</div><div class="art-setting-range"><input type="range" value="5" min="1" max="10" step="1"></div>'),mounted:function(e){var i=e.querySelector("input[type=range]"),r=e.querySelector(".art-value");n(i,"change",(function(){var e=i.value;r.innerText=e,t.plugins.artplayerPluginDanmuku.config({speed:Number(e)})})),t.on("artplayerPluginDanmuku:config",(function(t){i.value!==t.speed&&(i.value=t.speed,r.innerText=t.speed)}))}}}function s(t){var e=t.i18n,n=t.events.proxy;return{name:"danmuku-synchronousPlayback",index:13,html:'<label class="art-setting-checkbox"><input type="checkbox"/>'.concat(e.get("Danmu speed synchronous playback multiple"),"</label>"),mounted:function(e){var i=e.querySelector("input[type=checkbox]");n(i,"change",(function(){t.plugins.artplayerPluginDanmuku.config({synchronousPlayback:i.checked})})),t.on("artplayerPluginDanmuku:config",(function(t){i.checked!==t.synchronousPlayback&&(i.checked=t.synchronousPlayback)}))}}}function l(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function c(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}var p=function(t){if(Array.isArray(t))return t};var f=function(t,e){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t)){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 m=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")};var h=function(t,e){return p(t)||f(t,e)||m()};function d(t){switch(t){case 1:case 2:case 3:return 0;case 4:case 5:return 1;default:return 0}}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(/<d([\S ]*?>[\S ]*?)<\/d>/gi);return e.length?e.map((function(t){var e=t.match(/<d p="(.+)">(.+)<\/d>/),n=h(e,3),i=n[1],r=n[2],a=i.split(",");return 8===a.length&&r.trim()?{text:r,time:Number(a[0]),mode:d(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=h(t.option.margiLine truncated
@@ -1,6 +1,6 @@
{
"name": "artplayer-plugin-danmuku",
"version": "3.4.2",
"version": "3.5.3",
"expose": "artplayerPluginDanmuku",
"description": "Danmuku plugin for ArtPlayer",
"main": "dist/artplayer-plugin-danmuku.js",
@@ -39,21 +39,5 @@ export function bilibiliDanmuParseFromXml(xmlString) {
export function bilibiliDanmuParseFromUrl(url) {
return fetch(url)
.then(res => res.text())
.then(xmlString => {
return bilibiliDanmuParseFromXml(xmlString);
});
}
export function bilibiliDanmuParseFromAv(av) {
const corsUrl = 'https://cors-anywhere.herokuapp.com/';
return fetch(`${corsUrl}https://api.bilibili.com/x/web-interface/view?aid=${av}`)
.then(res => res.json())
.then(res => {
if (res.code === 0 && res.data && res.data.cid) {
return bilibiliDanmuParseFromUrl(
`${corsUrl}https://api.bilibili.com/x/v1/dm/list.so?oid=${res.data.cid}`,
);
}
throw new Error(`Unable to get data: ${JSON.stringify(res)}`);
});
.then(xmlString => bilibiliDanmuParseFromXml(xmlString));
}
@@ -16,6 +16,7 @@ export default class Danmuku {
this.option = {};
this.config(option);
this.isStop = false;
this.isHide = false;
this.animationFrameTimer = null;
this.$danmuku = art.template.$danmuku;
art.on('video:play', this.start.bind(this));
@@ -25,12 +26,12 @@ export default class Danmuku {
art.on('resize', this.resize.bind(this));
art.on('destroy', this.stop.bind(this));
if (typeof this.option.danmuku === 'function') {
this.option.danmuku().then(danmus => {
this.option.danmuku().then((danmus) => {
danmus.forEach(this.emit.bind(this));
art.emit('artplayerPluginDanmuku:loaded');
});
} else if (typeof this.option.danmuku === 'string') {
bilibiliDanmuParseFromUrl(this.option.danmuku).then(danmus => {
bilibiliDanmuParseFromUrl(this.option.danmuku).then((danmus) => {
danmus.forEach(this.emit.bind(this));
art.emit('artplayerPluginDanmuku:loaded');
});
@@ -81,7 +82,7 @@ export default class Danmuku {
}
continue() {
filter(this.queue, 'stop', danmu => {
filter(this.queue, 'stop', (danmu) => {
danmu.$state = 'emit';
danmu.$lastStartTime = Date.now();
switch (danmu.mode) {
@@ -97,7 +98,7 @@ export default class Danmuku {
suspend() {
const { $player } = this.art.template;
filter(this.queue, 'emit', danmu => {
filter(this.queue, 'emit', (danmu) => {
danmu.$state = 'stop';
switch (danmu.mode) {
case 0: {
@@ -117,7 +118,7 @@ export default class Danmuku {
resize() {
const { $player } = this.art.template;
const danmuLeft = getRect($player, 'width');
filter(this.queue, 'wait', danmu => {
filter(this.queue, 'wait', (danmu) => {
if (danmu.$ref) {
danmu.$ref.style.border = 'none';
danmu.$ref.style.left = `${danmuLeft}px`;
@@ -134,10 +135,10 @@ export default class Danmuku {
template: { $player },
} = this.art;
this.animationFrameTimer = window.requestAnimationFrame(() => {
if (player.playing) {
if (player.playing && !this.isHide) {
const danmuLeft = getRect($player, 'width');
filter(this.queue, 'emit', danmu => {
filter(this.queue, 'emit', (danmu) => {
danmu.$restTime -= (Date.now() - danmu.$lastStartTime) / 1000;
danmu.$lastStartTime = Date.now();
if (danmu.$restTime <= 0) {
@@ -152,19 +153,19 @@ export default class Danmuku {
this.queue
.filter(
danmu =>
(danmu) =>
player.currentTime + 0.1 >= danmu.time &&
danmu.time >= player.currentTime - 0.1 &&
danmu.$state === 'wait',
)
.forEach(danmu => {
.forEach((danmu) => {
danmu.$ref = getDanmuRef(this.queue);
this.$danmuku.appendChild(danmu.$ref);
danmu.$ref.style.opacity = this.option.opacity;
danmu.$ref.style.fontSize = `${this.option.fontSize}px`;
danmu.$ref.innerText = danmu.text;
danmu.$ref.style.color = danmu.color;
danmu.$ref.style.border = danmu.border ? `1px solid ${danmu.color}` : 'none';
danmu.$ref.style.color = danmu.color || '#fff';
danmu.$ref.style.border = danmu.border ? `1px solid ${danmu.color || '#fff'}` : 'none';
danmu.$restTime =
this.option.synchronousPlayback && player.playbackRate
? this.option.speed / Number(player.playbackRate)
@@ -214,17 +215,32 @@ export default class Danmuku {
}
show() {
this.$danmuku.style = 'block';
this.isHide = false;
this.$danmuku.style.display = 'block';
this.art.emit('artplayerPluginDanmuku:show');
}
hide() {
this.$danmuku.style = 'none';
this.isHide = true;
this.$danmuku.style.display = 'none';
this.art.emit('artplayerPluginDanmuku:hide');
}
emit(danmu) {
const { notice, player, i18n } = this.art;
const {
utils: { clamp },
validator,
} = this.art.constructor;
validator(danmu, {
text: 'string',
mode: 'number|undefined',
color: 'string|undefined',
time: 'number|undefined',
border: 'boolean|undefined',
});
if (!danmu.text.trim()) {
notice.show = i18n.get('Danmu text cannot be empty');
return;
@@ -235,8 +251,10 @@ export default class Danmuku {
return;
}
if (typeof danmu.time !== 'number') {
danmu.time = player.currentTime;
if (danmu.time) {
danmu.time = clamp(danmu.time, 0, Infinity);
} else {
danmu.time = player.currentTime + 0.5;
}
this.queue.push({
+1 -1
View File
@@ -1,5 +1,5 @@
/*!
* artplayer-plugin-gif.js v3.4.2
* artplayer-plugin-gif.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer-plugin-gif",
"version": "3.4.2",
"version": "3.5.3",
"expose": "artplayerPluginGif",
"description": "Gif plugin for ArtPlayer",
"main": "dist/artplayer-plugin-gif.js",
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-react.js v3.4.2
* artplayer-react.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o};var e=function(e,n){if(null==e)return{};var r,o,i=t(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i};var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t};var s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var l=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?s(t):e},u=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),p=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var f=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&&p(t,e)},d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function b(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var v=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,o=b(t),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))h.call(n,a)&&(o[a]=n[a]);if(d){r=d(n);for(var c=0;c<r.length;c++)y.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},m="function"==typeof Symbol&&Symbol.for,g=m?Symbol.for("react.element"):60103,w=m?Symbol.for("react.portal"):60106,x=m?Symbol.for("react.fragment"):60107,O=m?Symbol.for("react.strict_mode"):60108,k=m?Symbol.for("react.profiler"):60114,j=m?Symbol.for("react.provider"):60109,P=m?Symbol.for("react.context"):60110,S=m?Symbol.for("react.forward_ref"):60112,E=m?Symbol.for("react.suspense"):60113,C=m?Symbol.for("react.memo"):60115,R=m?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};function _(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}function z(){}function L(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}_.prototype.isReactComponent={},_.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(D(85));this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},z.prototype=_.prototype;var q=L.prototype=new z;q.constructor=L,v(q,_.prototype),q.isPureReactComponent=!0;var M={current:null},F={current:null},I=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function V(t,e,n){var r,o={},i=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(i=""+e.key),e)I.call(e,r)&&!N.hasOwnProperty(r)&&(o[r]=e[r]);var c=arguments.length-2;if(1===c)oLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ArtplayerReact=e()}(this,(function(){"use strict";var t=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o};var e=function(e,n){if(null==e)return{};var r,o,i=t(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o<a.length;o++)r=a[o],n.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i};var n=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(t,e,n){return e&&a(t.prototype,e),n&&a(t,n),t};var s=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var l=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?s(t):e},u=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),p=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var f=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&&p(t,e)},d=Object.getOwnPropertySymbols,h=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;function b(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var v=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},n=0;n<10;n++)e["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(t){r[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var n,r,o=b(t),i=1;i<arguments.length;i++){for(var a in n=Object(arguments[i]))h.call(n,a)&&(o[a]=n[a]);if(d){r=d(n);for(var c=0;c<r.length;c++)y.call(n,r[c])&&(o[r[c]]=n[r[c]])}}return o},m="function"==typeof Symbol&&Symbol.for,g=m?Symbol.for("react.element"):60103,w=m?Symbol.for("react.portal"):60106,x=m?Symbol.for("react.fragment"):60107,O=m?Symbol.for("react.strict_mode"):60108,k=m?Symbol.for("react.profiler"):60114,j=m?Symbol.for("react.provider"):60109,P=m?Symbol.for("react.context"):60110,S=m?Symbol.for("react.forward_ref"):60112,E=m?Symbol.for("react.suspense"):60113,C=m?Symbol.for("react.memo"):60115,R=m?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator;function D(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n<arguments.length;n++)e+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A={};function _(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}function z(){}function L(t,e,n){this.props=t,this.context=e,this.refs=A,this.updater=n||T}_.prototype.isReactComponent={},_.prototype.setState=function(t,e){if("object"!=typeof t&&"function"!=typeof t&&null!=t)throw Error(D(85));this.updater.enqueueSetState(this,t,e,"setState")},_.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")},z.prototype=_.prototype;var q=L.prototype=new z;q.constructor=L,v(q,_.prototype),q.isPureReactComponent=!0;var M={current:null},F={current:null},I=Object.prototype.hasOwnProperty,N={key:!0,ref:!0,__self:!0,__source:!0};function V(t,e,n){var r,o={},i=null,a=null;if(null!=e)for(r in void 0!==e.ref&&(a=e.ref),void 0!==e.key&&(i=""+e.key),e)I.call(e,r)&&!N.hasOwnProperty(r)&&(o[r]=e[r]);var c=arguments.length-2;if(1===c)oLine truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer-react",
"version": "3.4.2",
"version": "3.5.3",
"expose": "ArtplayerReact",
"description": "React Component for Artplayer",
"main": "dist/artplayer-react.js",
+1 -1
View File
@@ -4,7 +4,7 @@ Danmu plugin for ArtPlayer
## Demo
[Checkout the demo](https://artplayer.org/?libs=./uncompiled/artplayer-tool-github.js%0A./uncompiled/artplayer-plugin-danmu.js&example=github) from Github Pages
[Checkout the demo](https://artplayer.org/?libs=./uncompiled/artplayer-tool-github.js%0A./uncompiled/artplayer-plugin-danmuku.js&example=github) from Github Pages
## Install
@@ -1,5 +1,5 @@
/*!
* artplayer-tool-github.js v3.4.2
* artplayer-tool-github.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer-tool-github",
"version": "3.4.2",
"version": "3.5.3",
"expose": "ArtplayerToolGithub",
"description": "Github tool for ArtPlayer",
"main": "dist/artplayer-tool-github.js",
@@ -1,5 +1,5 @@
/*!
* artplayer-tool-thumbnail.js v3.4.2
* artplayer-tool-thumbnail.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* Released under the MIT License.
@@ -1,6 +1,6 @@
{
"name": "artplayer-tool-thumbnail",
"version": "3.4.2",
"version": "3.5.3",
"expose": "ArtplayerToolThumbnail",
"description": "thumbnail tool for ArtPlayer",
"main": "dist/artplayer-tool-thumbnail.js",
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer-vue.js v3.4.2
* artplayer-vue.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).ArtplayerVue=e()}(this,(function(){"use strict";var t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var a=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var s=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?a(t):e},c=o((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),l=o((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var u=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 p(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}p(".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");p(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");p(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");p(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");p(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");p(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justifLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).ArtplayerVue=e()}(this,(function(){"use strict";var t=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 e=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function n(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var r=function(t,e,r){return e&&n(t.prototype,e),r&&n(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function o(t,e){return t(e={exports:{}},e.exports),e.exports}var i=o((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var a=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"!==i(e)&&"function"!=typeof e?a(t):e},s=o((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),l=o((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var u=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 p(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}p(".art-undercover{background:#000;position:fixed;top:0;left:0;display:none;height:100%;width:100%;opacity:.9;z-index:10}.art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:20;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");p(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");p(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");p(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");p(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");p(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-stateLine truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer-vue",
"version": "3.4.2",
"version": "3.5.3",
"expose": "ArtplayerVue",
"description": "Vue Component for Artplayer",
"main": "dist/artplayer-vue.js",
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer.js v3.4.2
* artplayer.js v3.5.2
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2020 Harvey Zack
* 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).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var a=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?i(t):e},s=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),c=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var l=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&&c(t,e)};function u(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}u(".art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:10;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");u(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");u(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");u(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");u(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");u(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:absolute}.art-video-player .art-mask .art-state{right:30px;bottom:55px;width:60px;height:60px;opacity:Line truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t=t||self).Artplayer=e()}(this,(function(){"use strict";var t=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")};function e(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var n=function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function r(t,e){return t(e={exports:{}},e.exports),e.exports}var o=r((function(t){function e(n){return"function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?t.exports=e=function(t){return typeof t}:t.exports=e=function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(n)}t.exports=e}));var i=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t};var a=function(t,e){return!e||"object"!==o(e)&&"function"!=typeof e?i(t):e},s=r((function(t){function e(n){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(n)}t.exports=e})),c=r((function(t){function e(n,r){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(n,r)}t.exports=e}));var l=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&&c(t,e)};function u(t,e){void 0===e&&(e={});var n=e.insertAt;if(t&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}u(".art-undercover{background:#000;position:fixed;top:0;left:0;display:none;height:100%;width:100%;opacity:.9;z-index:10}.art-video-player{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative;margin:0 auto;z-index:20;width:100%;height:100%;outline:0;zoom:1;font-family:Roboto,Arial,Helvetica,sans-serif;color:#eee;text-align:left;direction:ltr;font-size:14px;line-height:1.3;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-touch-action:manipulation;touch-action:manipulation;-ms-high-contrast-adjust:none}.art-video-player *{margin:0;padding:0;-webkit-box-sizing:border-box;box-sizing:border-box}.art-video-player ::-webkit-scrollbar{width:5px}.art-video-player ::-webkit-scrollbar-thumb{background-color:#666}.art-video-player ::-webkit-scrollbar-thumb:hover{background-color:#ccc}.art-video-player .art-icon{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}.art-video-player>object{display:block;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}@supports ((-webkit-backdrop-filter:initial) or (backdrop-filter:initial)){.art-video-player .art-backdrop-filter{-webkit-backdrop-filter:saturate(180%) blur(20px);backdrop-filter:saturate(180%) blur(20px);background-color:rgba(0,0,0,.7)!important}}");u(".art-video-player .art-video{position:absolute;z-index:10;left:0;top:0;right:0;bottom:0;width:100%;height:100%;background-color:#000;cursor:pointer}");u(".art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:40px;width:100%;padding:0 20px;text-align:center;color:#fff;font-size:20px;pointer-events:none;text-shadow:.5px .5px .5px rgba(0,0,0,.5)}.art-video-player .art-subtitle p{margin:5px 0}.art-video-player.art-subtitle-show .art-subtitle{display:block}");u(".art-video-player .art-danmuku{position:absolute;z-index:30;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}");u(".art-video-player .art-layers{display:none;position:absolute;z-index:40;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}");u(".art-video-player .art-mask{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.art-video-player .art-mask,.art-video-player .art-mask .art-state{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:Line truncated
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer",
"version": "3.4.2",
"version": "3.5.3",
"expose": "Artplayer",
"description": "ArtPlayer.js is a modern and full featured HTML5 video player",
"main": "dist/artplayer.js",
@@ -24,7 +24,7 @@
"homepage": "https://github.com/zhw2590582/ArtPlayer#readme",
"dependencies": {
"option-validator": "^2.0.5",
"screenfull": "^5.0.0"
"screenfull": "^5.0.2"
},
"gitHead": "0a3a20568e37f99972eefb01d4b1dcf4036a46db"
}
+10 -1
View File
@@ -4,6 +4,7 @@ import playbackRate from './playbackRate';
import aspectRatio from './aspectRatio';
import info from './info';
import version from './version';
import light from './light';
import close from './close';
export default class Contextmenu extends Component {
@@ -53,11 +54,19 @@ export default class Contextmenu extends Component {
}),
);
this.add(
light({
disable: !option.light,
name: 'light',
index: 50,
}),
);
this.add(
close({
disable: false,
name: 'close',
index: 50,
index: 60,
}),
);
@@ -0,0 +1,18 @@
export default function light(option) {
return art => {
const { i18n, player } = art;
return {
...option,
html: i18n.get('Light Off'),
click: contextmenu => {
player.light = !player.light;
contextmenu.show = false;
},
mounted: $menu => {
art.on('light', value => {
$menu.innerText = i18n.get(value ? 'Light On' : 'Light Off');
});
},
};
};
}
+3 -3
View File
@@ -1,10 +1,10 @@
export default function clickInit(art, events) {
const { $player } = art.template;
events.proxy(document, ['click', 'contextmenu'], event => {
if (event.composedPath().indexOf($player) > -1) {
events.proxy(document, ['click', 'contextmenu'], (event) => {
if (event.composedPath && event.composedPath().indexOf($player) > -1) {
art.isFocus = true;
art.emit('focus');
} else {
} else if (art.isFocus) {
art.isFocus = false;
art.emit('blur');
}
+2
View File
@@ -1,6 +1,8 @@
{
"Video info": "视频统计信息",
"Close": "关闭",
"Light Off": "关灯",
"Light On": "开灯",
"Video load failed": "视频加载失败",
"Volume": "音量",
"Play": "播放",
+2
View File
@@ -1,6 +1,8 @@
{
"Video info": "影片統計訊息",
"Close": "關閉",
"Light Off": "關燈",
"Light On": "開燈",
"Video load failed": "影片載入失敗",
"Volume": "音量",
"Play": "播放",
+9 -7
View File
@@ -25,6 +25,7 @@ import Plugins from './plugins';
import Mobile from './mobile';
let id = 0;
const instances = [];
class Artplayer extends Emitter {
constructor(option) {
super();
@@ -56,7 +57,11 @@ class Artplayer extends Emitter {
id += 1;
this.id = id;
Artplayer.instances.push(this);
instances.push(this);
}
static get instances() {
return instances;
}
static get version() {
@@ -112,6 +117,7 @@ class Artplayer extends Emitter {
hotkey: true,
pip: false,
mutex: true,
light: false,
backdrop: true,
fullscreen: false,
fullscreenWeb: false,
@@ -119,7 +125,6 @@ class Artplayer extends Emitter {
miniProgressBar: false,
localVideo: false,
localSubtitle: false,
autoPip: false,
networkMonitor: false,
layers: [],
contextmenu: [],
@@ -141,7 +146,7 @@ class Artplayer extends Emitter {
},
moreVideoAttr: {
controls: false,
preload: 'metadata',
preload: utils.isSafari() ? 'auto' : 'metadata',
},
icons: {},
customType: {},
@@ -158,10 +163,6 @@ class Artplayer extends Emitter {
}
}
Object.defineProperty(Artplayer, 'instances', {
value: [],
});
// eslint-disable-next-line no-console
console.log(
'%c ArtPlayer %c __VERSION__ %c https://artplayer.org',
@@ -170,4 +171,5 @@ console.log(
'',
);
window.Artplayer = Artplayer;
export default Artplayer;
@@ -1,10 +1,12 @@
import { clamp, def } from '../utils';
export default function currentTimeMix(art, player) {
const { $video } = art.template;
def(player, 'currentTime', {
get: () => art.template.$video.currentTime || 0,
set: currentTime => {
art.template.$video.currentTime = clamp(currentTime, 0, player.duration);
get: () => $video.currentTime || 0,
set: time => {
$video.currentTime = clamp(time, 0, player.duration || Infinity);
},
});
}
+2
View File
@@ -21,6 +21,7 @@ import playingMix from './playingMix';
import autoSizeMix from './autoSizeMix';
import rectMix from './rectMix';
import flipMix from './flipMix';
import lightMix from './lightMix';
import { proxyPropertys } from '../utils';
export default class Player {
@@ -48,6 +49,7 @@ export default class Player {
autoSizeMix(art, this);
rectMix(art, this);
flipMix(art, this);
lightMix(art, this);
proxyPropertys(art, this);
}
}
+15
View File
@@ -0,0 +1,15 @@
import { def, getStyle, setStyle } from '../utils';
export default function lightMix(art, player) {
const { $undercover } = art.template;
def(player, 'light', {
get() {
return getStyle($undercover, 'display', false) !== 'none';
},
set(value) {
setStyle($undercover, 'display', value ? 'block' : 'none');
art.emit('light', value);
},
});
}
+1 -1
View File
@@ -1,6 +1,6 @@
import { def } from '../utils';
export default function pauseMin(art, player) {
export default function pauseMix(art, player) {
const {
template: { $video },
i18n,
+4 -14
View File
@@ -1,4 +1,4 @@
import { errorHandle, has } from '../utils';
import { errorHandle, has, def } from '../utils';
import subtitleOffset from './subtitleOffset';
import localVideo from './localVideo';
import localSubtitle from './localSubtitle';
@@ -40,19 +40,9 @@ export default class Plugins {
add(plugin) {
this.id += 1;
const result = plugin.call(this, this.art);
let pluginName = '';
if (result && result.name) {
pluginName = result.name;
} else if (plugin.name) {
pluginName = plugin.name;
} else {
pluginName = `plugin${this.id}`;
}
errorHandle(
!has(this, pluginName),
`Cannot add a plugin that already has the same name: ${pluginName}`,
);
Object.defineProperty(this, pluginName, {
const pluginName = (result && result.name) || plugin.name || `plugin${this.id}`;
errorHandle(!has(this, pluginName), `Cannot add a plugin that already has the same name: ${pluginName}`);
def(this, pluginName, {
value: result,
});
this.art.emit('plugin:add', plugin);
+1
View File
@@ -28,6 +28,7 @@ export default {
hotkey: 'boolean',
pip: 'boolean',
mutex: 'boolean',
light: 'boolean',
backdrop: 'boolean',
fullscreen: 'boolean',
fullscreenWeb: 'boolean',
+13 -1
View File
@@ -1,8 +1,20 @@
.art-undercover {
background: #000;
position: fixed;
top: 0;
left: 0;
display: none;
height: 100%;
width: 100%;
opacity: 0.9;
z-index: 10;
}
.art-video-player {
display: flex;
position: relative;
margin: 0 auto;
z-index: 10;
z-index: 20;
width: 100%;
height: 100%;
outline: 0;
@@ -13,10 +13,10 @@
.art-contextmenu {
cursor: pointer;
font-size: 13px;
font-size: 12px;
display: block;
color: #fff;
padding: 7px 10px;
padding: 10px 15px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
@@ -13,6 +13,8 @@
text-shadow: 0.5px 0.5px 0.5px rgba(0, 0, 0, 0.5);
p {
word-break: break-all;
height: fit-content;
margin: 5px 0;
}
}
+2 -2
View File
@@ -1,4 +1,4 @@
import { setStyles, srtToVtt, vttToBlob, getExt, assToVtt } from './utils';
import { setStyles, srtToVtt, vttToBlob, getExt, assToVtt, escape } from './utils';
import Component from './utils/component';
export default class Subtitle extends Component {
@@ -39,7 +39,7 @@ export default class Subtitle extends Component {
if (this.activeCue) {
$subtitle.innerHTML = this.activeCue.text
.split(/\r?\n/)
.map(item => `<p>${item}</p>`)
.map(item => `<p>${escape(item)}</p>`)
.join('');
this.art.emit('subtitle:update', this.activeCue.text);
}
+3
View File
@@ -35,6 +35,7 @@ export default class Template {
desktop() {
const { theme, backdrop } = this.art.option;
this.$container.innerHTML = `
<div class="art-undercover"></div>
<div class="art-video-player art-subtitle-show art-layer-show" style="--theme: ${theme}">
<video class="art-video">
<track default kind="metadata"></track>
@@ -99,6 +100,8 @@ export default class Template {
<div class="art-contextmenus"></div>
</div>
`;
this.$undercover = this.query('.art-undercover');
this.$player = this.query('.art-video-player');
this.$video = this.query('.art-video');
this.$track = this.query('.art-video track');
@@ -0,0 +1,9 @@
export const userAgent = window.navigator.userAgent;
export function isMobile() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
}
export function isSafari() {
return /^((?!chrome|android).)*safari/i.test(userAgent);
}
+14
View File
@@ -9,3 +9,17 @@ export function secondToTime(second) {
const sec = Math.floor(second - hour * 3600 - min * 60);
return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':');
}
export function escape(str) {
return str.replace(
/[&<>'"]/g,
tag =>
({
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
"'": '&#39;',
'"': '&quot;',
}[tag] || tag),
);
}
+1
View File
@@ -5,3 +5,4 @@ export * from './file';
export * from './property';
export * from './time';
export * from './format';
export * from './compatibility';
+5 -3
View File
@@ -1,14 +1,16 @@
import { isMobile, userAgent } from './utils/compatibility';
export default class Whitelist {
constructor(art) {
const {
constructor: { kindOf },
option: { whitelist },
} = art;
this.ua = navigator.userAgent;
this.isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(this.ua);
this.ua = userAgent;
this.isMobile = isMobile();
this.state =
!this.isMobile ||
whitelist.some(item => {
whitelist.some((item) => {
switch (kindOf(item)) {
case 'string':
return this.ua.indexOf(item) > -1;
+24
View File
@@ -251,6 +251,30 @@ var art = new Artplayer({
});
it(`Configuration.light`, function() {
var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
light: true,
});
});
it(`Configuration.backdrop`, function() {
var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
url: url + '/video/one-more-time-one-more-chance-480p.mp4',
backdrop: true,
});
});
it(`Configuration.hotkey`, function() {
var url = 'https://zhw2590582.github.io/assets-cdn';