This commit is contained in:
Harvey committed 2022-02-14 09:49:49 +08:00
1 parent 222f786b88
commit ce677ef602
62 files changed
+245 -224

No files matched your search

@@ -5,15 +5,15 @@ sidebar_position: 6
Settings panels are similar to a collection of list selections, and support multi-layer nested
| Property | Type | Description |
| ------------- | ------------------- | ------------------------ |
| `html` | `String`、`Element` | DOM elements of selector |
| `icon` | `String`、`Element` | Icon of selector |
| `selector` | `Array` | Selector List |
| `onSelect` | `Function` | Selector Click event |
| `width` | `Number` | Panel width |
| `default` | `Boolean` | Default selected |
| `description` | `String` | Description Text |
| Property | Type | Description |
| ---------- | ------------------- | ------------------------ |
| `html` | `String`、`Element` | DOM elements of selector |
| `icon` | `String`、`Element` | Icon of selector |
| `selector` | `Array` | Selector List |
| `onSelect` | `Function` | Selector Click event |
| `width` | `Number` | Panel width |
| `default` | `Boolean` | Default selected |
| `tooltip` | `String` | Tooltip Text |
<div className="run-code">▶ Run Code</div>
@@ -5,15 +5,15 @@ sidebar_position: 6
设置面板类似于列表选择的集合,而且支持多层嵌套
| 属性 | 类型 | 描述 |
| ------------- | ------------------- | --------------- |
| `html` | `String`、`Element` | 元素的 DOM 元素 |
| `icon` | `String`、`Element` | 元素的图标 |
| `selector` | `Array` | 元素列表 |
| `onSelect` | `Function` | 元素点击事件 |
| `width` | `Number` | 列表宽度 |
| `default` | `Boolean` | 是否默认选中 |
| `description` | `String` | 描述文案 |
| 属性 | 类型 | 描述 |
| ---------- | ------------------- | --------------- |
| `html` | `String`、`Element` | 元素的 DOM 元素 |
| `icon` | `String`、`Element` | 元素的图标 |
| `selector` | `Array` | 元素列表 |
| `onSelect` | `Function` | 元素点击事件 |
| `width` | `Number` | 列表宽度 |
| `default` | `Boolean` | 是否默认选中 |
| `tooltip` | `String` | 描述文案 |
<div className="run-code">▶ Run Code</div>
@@ -5,4 +5,4 @@
* Released under the MIT License.
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,(function(){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}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={"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 r(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function i(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function o(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,a=[],o=!0,s=!1;try{for(n=n.call(t);!(o=(r=n.next()).done)&&(a.push(r.value),!e||a.length!==e);o=!0);}catch(t){s=!0,i=t}finally{try{o||null==n.return||n.return()}finally{if(s)throw i}}return a}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:case 5:return 1}}function u(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&&e.length?e.map((function(t){var e=o(t.match(/<d p="(.+)">(.+)<\/d>/),3),n=e[1],r=e[2],i=n.split(",");return 8===i.length&&r.trim()?{text:r,time:Number(i[0]),mode:s(Number(i[1])),fontSize:Number(i[2]),color:"#".concat(Number(i[3]).toString(16)),timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}:null})):[]}(t)}))}function l(t,e){var n=o(t.option.margin,2),r=n[0],a=n[1],s=i(t.art.template.$player),u=t.queue.filter((function(t){return t.mode===e.mode&&"emit"===t.$state&&t.$ref&&t.$ref.style.fontSize===e.$ref.style.fontSize&&parseFloat(t.$ref.style.top)<=s.height-a})).map((function(t){var e=i(t.$ref),n=e.width,r=e.height,a=e.top-s.top,o=e.left-s.left;return{top:a,left:o,height:r,width:n,right:s.width-o-n}})).sort((function(t,e){return t.top-e.top}));return 0===u.length?r:(u.unshift({top:0,left:0,right:0,height:r,width:s.width}),u.push({top:s.height-a,left:0,right:0,height:a,width:s.width}),function(t){for(var e=0,n={},r=0;r<t.length;r+=1){var i=t[r];n[i.top]?n[i.top].push(i):n[i.top]=[i]}for(var a=Object.keys(n),s=0,u=1;u<t.length;u+=1){var l=t[u],f=t[u-1],c=f.top+f.height,h=l.top-c;h>s&&(e=c,s=h)}if(0===e)for(var p=0,m=0;m<a.length;m+=1){for(var d=t[0].width,y=a[m],g=n[y],b=0;b<g.length;b+=1){var $=g[b];$.right<d&&(d=$.right)}d>p&&(p=d,e=o(g,1)[0].top)}if(0===e){var v=a.filter((function(t,e){return 0!==e&&e!==a.length-1})).sort((function(t,e){return n[t].length-n[e].length}));e=o(v,1)[0]}return e}(u))}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?f(Object(r),!0).forEach((function(n){t(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var h=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e.i18n.update(n),this.art=e,this.queue=[],this.option={},this.config(r),this.isStop=!1,this.isHide=!1,this.animationFrameTimer=null,this.$danmuku=e.template.$danmuku,e.on("video:play",this.start.bind(this)),e.on("video:playing",this.start.bind(this)),e.on("video:pause",this.stop.bind(this)),e.on("video:waiting",Line truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).artplayerPluginDanmuku=e()}(this,(function(){"use strict";function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}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={"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 r(t,e,n){return t.filter((function(t){return t.$state===e})).map(n)}function i(t,e){var n=t.getBoundingClientRect();return e?n[e]:n}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}}(t,e)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(t){switch(t){case 1:case 2:case 3:default:return 0;case 4:case 5:return 1}}function u(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&&e.length?e.map((function(t){var e=a(t.match(/<d p="(.+)">(.+)<\/d>/),3),n=e[1],r=e[2],i=n.split(",");return 8===i.length&&r.trim()?{text:r,time:Number(i[0]),mode:s(Number(i[1])),fontSize:Number(i[2]),color:"#".concat(Number(i[3]).toString(16)),timestamp:Number(i[4]),pool:Number(i[5]),userID:i[6],rowID:Number(i[7])}:null})):[]}(t)}))}function l(t,e){var n=a(t.option.margin,2),r=n[0],o=n[1],s=i(t.art.template.$player),u=t.queue.filter((function(t){return t.mode===e.mode&&"emit"===t.$state&&t.$ref&&t.$ref.style.fontSize===e.$ref.style.fontSize&&parseFloat(t.$ref.style.top)<=s.height-o})).map((function(t){var e=i(t.$ref),n=e.width,r=e.height,o=e.top-s.top,a=e.left-s.left;return{top:o,left:a,height:r,width:n,right:s.width-a-n}})).sort((function(t,e){return t.top-e.top}));return 0===u.length?r:(u.unshift({top:0,left:0,right:0,height:r,width:s.width}),u.push({top:s.height-o,left:0,right:0,height:o,width:s.width}),function(t){for(var e=0,n={},r=0;r<t.length;r+=1){var i=t[r];n[i.top]?n[i.top].push(i):n[i.top]=[i]}for(var o=Object.keys(n),s=0,u=1;u<t.length;u+=1){var l=t[u],f=t[u-1],c=f.top+f.height,p=l.top-c;p>s&&(e=c,s=p)}if(0===e)for(var h=0,m=0;m<o.length;m+=1){for(var d=t[0].width,y=o[m],g=n[y],b=0;b<g.length;b+=1){var $=g[b];$.right<d&&(d=$.right)}d>h&&(h=d,e=a(g,1)[0].top)}if(0===e){var v=o.filter((function(t,e){return 0!==e&&e!==o.length-1})).sort((function(t,e){return n[t].length-n[e].length}));e=a(v,1)[0]}return e}(u))}function f(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?f(Object(r),!0).forEach((function(n){t(e,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):f(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var p=function(){function t(e,r){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),e.i18n.update(n),this.art=e,this.queue=[],this.option={},this.config(r),this.isStop=!1,this.isHide=!1,this.animationFrameTimer=null,this.$danmuku=e.template.$danmuku,e.on("video:play",this.start.bind(this)),e.on("video:playing",this.start.bind(this)),e.on("video:pause",this.stop.bind(this)),e.on("video:waiting",Line truncated
+2 -2
View File
@@ -1,8 +1,8 @@
/*!
* artplayer.js v4.3.0
* artplayer.js v4.3.1
* Github: https://github.com/zhw2590582/ArtPlayer#readme
* (c) 2017-2022 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="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(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&&o(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},s(t)}!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}('.art-video-player{zoom:1;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-high-contrast-adjust:none;background-color:#000;color:#eee;direction:ltr;display:flex;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:14px;height:100%;line-height:1.3;margin:0 auto;outline:0;position:relative;text-align:left;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:20}.art-video-player *{box-sizing:border-box;margin:0;padding:0}.art-video-player ::-webkit-scrollbar{height:5px;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{align-items:center;display:inline-flex;justify-content:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}@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}}.art-video-player .art-video{background-color:#000;cursor:pointer;z-index:10}.art-video-player .art-poster,.art-video-player .art-video{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.art-video-player .art-poster{background-position:50%;background-repeat:no-repeat;background-size:cover;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:11}.art-video-player .art-subtitle{bottom:10px;color:#fff;display:none;font-size:20px;padding:0 20px;pointer-events:none;position:absolute;text-align:center;text-shadow:.5px .5px .5px rgba(0,0,0,.5);width:100%;z-index:20}.art-video-player .art-subtitle p{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;line-height:1.2;margin:5px 0 0;word-break:break-all}.art-video-player .art-bilingual p:nth-child(n+2){transform:scale(.6);transform-origin:center top}.art-video-player.art-subtitle-show .art-subtitle{display:block}.art-video-player.art-control-show .art-subtitle{bottom:50px}.art-video-player .art-danmuku{z-index:30}.art-video-player .art-danmuku,.art-video-player .art-layers{bottom:0;height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%}.art-video-player .art-layers{display:none;z-index:40}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}.art-video-player .art-mask{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:50}.art-video-player .art-mask .art-state{align-items:center;bottom:65px;display:flex;height:60px;justify-content:center;opacity:.6;position:absolute;right:30px;width:60px}.art-video-player.art-mask-show .art-mask{display:flex}.art-video-player .art-loading{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;pointer-events:nonLine truncated
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Artplayer=e()}(this,(function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function r(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function o(t,e){return o=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},o(t,e)}function i(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}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o(t,e)}function a(t){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(t)}function c(t,e){if(e&&("object"===a(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return n(t)}function l(t){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},l(t)}!function(t,e){void 0===e&&(e={});var r=e.insertAt;if(t&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=t:o.appendChild(document.createTextNode(t))}}('.art-video-player{zoom:1;-webkit-tap-highlight-color:rgba(0,0,0,0);-ms-high-contrast-adjust:none;background-color:#000;color:#eee;direction:ltr;display:flex;font-family:Roboto,Arial,Helvetica,sans-serif;font-size:14px;height:100%;line-height:1.3;margin:0 auto;outline:0;position:relative;text-align:left;touch-action:manipulation;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;width:100%;z-index:20}.art-video-player *{box-sizing:border-box;margin:0;padding:0}.art-video-player ::-webkit-scrollbar{height:5px;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{align-items:center;display:inline-flex;justify-content:center;line-height:1.5}.art-video-player .art-icon svg{fill:#fff}.art-video-player img{max-width:100%;vertical-align:top}@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}}.art-video-player .art-video{background-color:#000;cursor:pointer;z-index:10}.art-video-player .art-poster,.art-video-player .art-video{bottom:0;height:100%;left:0;position:absolute;right:0;top:0;width:100%}.art-video-player .art-poster{background-position:50%;background-repeat:no-repeat;background-size:cover;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:11}.art-video-player .art-subtitle{bottom:10px;color:#fff;display:none;font-size:20px;padding:0 20px;pointer-events:none;position:absolute;text-align:center;text-shadow:.5px .5px .5px rgba(0,0,0,.5);width:100%;z-index:20}.art-video-player .art-subtitle p{height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;line-height:1.2;margin:5px 0 0;word-break:break-all}.art-video-player .art-bilingual p:nth-child(n+2){transform:scale(.6);transform-origin:center top}.art-video-player.art-subtitle-show .art-subtitle{display:block}.art-video-player.art-control-show .art-subtitle{bottom:50px}.art-video-player .art-danmuku{z-index:30}.art-video-player .art-danmuku,.art-video-player .art-layers{bottom:0;height:100%;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%}.art-video-player .art-layers{display:none;z-index:40}.art-video-player .art-layers .art-layer{pointer-events:auto}.art-video-player.art-layer-show .art-layers{display:block}.art-video-player .art-mask{align-items:center;bottom:0;display:none;height:100%;justify-content:center;left:0;overflow:hidden;pointer-events:none;position:absolute;right:0;top:0;width:100%;z-index:50}.art-video-player .art-mask .art-state{align-items:center;bottom:65px;display:flex;height:60px;justify-content:center;opacity:.6;position:absolute;right:30px;width:60px}.art-video-player.art-mask-show .art-mask{display:flex}.art-video-player .art-loadingLine truncated
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "artplayer",
"version": "4.3.0",
"version": "4.3.1",
"expose": "Artplayer",
"description": "ArtPlayer.js is a modern and full featured HTML5 video player",
"main": "dist/artplayer.js",
+1
View File
@@ -21,6 +21,7 @@ export const ComponentOption = {
click: `?${f}`,
mounted: `?${f}`,
tooltip: `?${s}`,
width: `?${n}`,
selector: `?${a}`,
onSelect: `?${f}`,
};
@@ -7,8 +7,8 @@ export default function aspectRatio(art) {
return value === 'default' ? i18n.get('Default') : value;
}
function update($panel, $description, value) {
if ($description) $description.innerText = getI18n(value);
function update($panel, $tooltip, value) {
if ($tooltip) $tooltip.innerText = getI18n(value);
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
if ($current) inverseClass($current, 'art-current');
}
@@ -17,7 +17,7 @@ export default function aspectRatio(art) {
width: 200,
html: i18n.get('Aspect Ratio'),
icon: icons.aspectRatio,
description: getI18n(art.aspectRatio),
tooltip: getI18n(art.aspectRatio),
selector: ['default', '4:3', '16:9'].map((item) => {
return {
value: item,
@@ -29,9 +29,9 @@ export default function aspectRatio(art) {
art.aspectRatio = item.value;
},
mounted: ($panel, item) => {
update($panel, item._$description, art.aspectRatio);
update($panel, item._$tooltip, art.aspectRatio);
art.on('aspectRatio', () => {
update($panel, item._$description, art.aspectRatio);
update($panel, item._$tooltip, art.aspectRatio);
});
},
};
+5 -5
View File
@@ -9,8 +9,8 @@ export default function flip(art) {
vertical: 'Vertical',
};
function update($panel, $description, value) {
if ($description) $description.innerText = i18n.get(keys[value]);
function update($panel, $tooltip, value) {
if ($tooltip) $tooltip.innerText = i18n.get(keys[value]);
const $current = queryAll('.art-setting-item', $panel).find((item) => item.dataset.value === value);
if ($current) inverseClass($current, 'art-current');
}
@@ -18,7 +18,7 @@ export default function flip(art) {
return {
width: 200,
html: i18n.get('Video Flip'),
description: i18n.get(keys[art.flip]),
tooltip: i18n.get(keys[art.flip]),
icon: icons.config,
selector: Object.keys(keys).map((item) => {
return {
@@ -31,9 +31,9 @@ export default function flip(art) {
art.flip = item.value;
},
mounted: ($panel, item) => {
update($panel, item._$description, art.flip);
update($panel, item._$tooltip, art.flip);
art.on('flip', () => {
update($panel, item._$description, art.flip);
update($panel, item._$tooltip, art.flip);
});
},
};
+13 -9
View File
@@ -133,13 +133,13 @@ export default class Setting extends Component {
append($left, item.html);
if (hasChildren) {
const $description = document.createElement('div');
addClass($description, 'art-setting-item-right-description');
append($right, $description);
item._$description = $description;
const $tooltip = document.createElement('div');
addClass($tooltip, 'art-setting-item-right-tooltip');
append($right, $tooltip);
item._$tooltip = $tooltip;
if (item.description) {
$description.innerHTML = item.description;
if (item.tooltip) {
$tooltip.innerHTML = item.tooltip;
}
const $iconRight = document.createElement('div');
@@ -160,9 +160,9 @@ export default class Setting extends Component {
if (item._parentItem && item._parentItem.onSelect) {
const result = item._parentItem.onSelect.call(this.art, item, $item, event);
if (item._parentItem._$description) {
if (item._parentItem._$tooltip) {
if (typeof result === 'string' || typeof result === 'number') {
item._parentItem._$description.innerHTML = result;
item._parentItem._$tooltip.innerHTML = result;
}
}
}
@@ -173,7 +173,11 @@ export default class Setting extends Component {
}
add(callback) {
this.option.push(callback(this.art));
if (typeof callback === 'function') {
this.option.push(callback(this.art));
} else {
this.option.push(callback);
}
this.option = makeRecursion(this.option);
this.init(this.option);
}
@@ -7,8 +7,8 @@ export default function playbackRate(art) {
return value === 1.0 ? i18n.get('Normal') : value;
}
function update($panel, $description, value) {
if ($description) $description.innerText = getI18n(value);
function update($panel, $tooltip, value) {
if ($tooltip) $tooltip.innerText = getI18n(value);
const $current = queryAll('.art-setting-item', $panel).find((item) => Number(item.dataset.value) === value);
if ($current) inverseClass($current, 'art-current');
}
@@ -16,7 +16,7 @@ export default function playbackRate(art) {
return {
width: 200,
html: i18n.get('Play Speed'),
description: getI18n(art.playbackRate),
tooltip: getI18n(art.playbackRate),
icon: icons.playbackRate,
selector: [0.5, 0.75, 1.0, 1.25, 1.5, 2.0].map((item) => {
return {
@@ -29,9 +29,9 @@ export default function playbackRate(art) {
art.playbackRate = item.value;
},
mounted: ($panel, item) => {
update($panel, item._$description, art.playbackRate);
update($panel, item._$tooltip, art.playbackRate);
art.on('playbackRate', () => {
update($panel, item._$description, art.playbackRate);
update($panel, item._$tooltip, art.playbackRate);
});
},
};
@@ -7,8 +7,8 @@ export default function subtitleOffset(art) {
return value === 0 ? i18n.get('Normal') : value;
}
function update($panel, $description, value) {
if ($description) $description.innerText = getI18n(value);
function update($panel, $tooltip, value) {
if ($tooltip) $tooltip.innerText = getI18n(value);
const $current = queryAll('.art-setting-item', $panel).find((item) => Number(item.dataset.value) === value);
if ($current) inverseClass($current, 'art-current');
}
@@ -16,7 +16,7 @@ export default function subtitleOffset(art) {
return {
width: 200,
html: i18n.get('Subtitle Offset'),
description: getI18n(art.subtitleOffset),
tooltip: getI18n(art.subtitleOffset),
icon: icons.subtitle,
selector: [-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5].map((item) => {
return {
@@ -29,9 +29,9 @@ export default function subtitleOffset(art) {
art.subtitleOffset = item.value;
},
mounted: ($panel, item) => {
update($panel, item._$description, art.subtitleOffset);
update($panel, item._$tooltip, art.subtitleOffset);
art.on('subtitleOffset', () => {
update($panel, item._$description, art.subtitleOffset);
update($panel, item._$tooltip, art.subtitleOffset);
});
},
};
+1 -1
View File
@@ -72,7 +72,7 @@
display: flex;
align-items: center;
.art-setting-item-right-description {
.art-setting-item-right-tooltip {
font-size: 12px;
white-space: nowrap;
color: rgba(255, 255, 255, 0.5);
+6 -1
View File
@@ -86,6 +86,11 @@ type SettingOption = {
*/
width?: number;
/**
* The tooltip of setting
*/
tooltip?: string;
/**
* Whether the default is selected
*/
@@ -701,5 +706,5 @@ declare class Artplayer extends Player {
readonly contextmenu: Record<string, HTMLElement> & Component;
readonly setting: Component;
readonly setting: Record<string, HTMLElement> & Component;
}