mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-25 08:01:20 -08:00
优化icon
This commit is contained in:
1 parent
3861770105
commit
3a545ae5e6
7 files changed
+159
-139
No files matched your search
Vendored
+1
-1
@@ -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).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 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)}}var r=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t};var n=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return 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(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e}));var a=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&&i(t,e)},c=o((function(t){function e(r){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(r)}t.exports=e}));var l=function(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?n(t):e},s=o((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e}));!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-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;background-color:#000;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}}.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}.art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:10px;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 0;line-height:1}.art-video-player .art-bilingual p:nth-child(2){font-size:.6em}.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{position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.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{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hiddLine 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";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 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)}}var r=function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t};var n=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return 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(r,n){return t.exports=e=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},e(r,n)}t.exports=e}));var a=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&&i(t,e)},c=o((function(t){function e(r){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(r)}t.exports=e}));var l=function(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?n(t):e},s=o((function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},e(r)}t.exports=e}));!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-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;background-color:#000;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}}.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}.art-video-player .art-subtitle{display:none;position:absolute;z-index:20;bottom:10px;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 0;line-height:1}.art-video-player .art-bilingual p:nth-child(2){font-size:.6em}.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{position:absolute;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hidden;pointer-events:none}.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{display:none;z-index:50;left:0;top:0;right:0;bottom:0;width:100%;height:100%;overflow:hiddLine truncated
|
||||
@@ -1,4 +1,4 @@
|
||||
import { append } from '../utils';
|
||||
import { append, def, addClass } from '../utils';
|
||||
import loading from './loading.svg';
|
||||
import state from './state.svg';
|
||||
import play from './play.svg';
|
||||
@@ -30,12 +30,16 @@ export default class Icons {
|
||||
...art.option.icons,
|
||||
};
|
||||
|
||||
Object.keys(icons).forEach(key => {
|
||||
const icon = document.createElement('i');
|
||||
icon.classList.add('art-icon');
|
||||
icon.classList.add(`art-icon-${key}`);
|
||||
append(icon, icons[key]);
|
||||
this[key] = icon;
|
||||
Object.keys(icons).forEach((key) => {
|
||||
def(this, key, {
|
||||
get: () => {
|
||||
const icon = document.createElement('i');
|
||||
addClass(icon, 'art-icon');
|
||||
addClass(icon, `art-icon-${key}`);
|
||||
append(icon, icons[key]);
|
||||
return icon;
|
||||
},
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,59 +1,64 @@
|
||||
import { errorHandle } from '../utils';
|
||||
|
||||
const b = 'boolean';
|
||||
const s = 'string';
|
||||
const n = 'number';
|
||||
const o = 'object';
|
||||
const a = 'array';
|
||||
const f = 'function';
|
||||
const r = 'regexp';
|
||||
|
||||
function validElement(value, type, paths) {
|
||||
return errorHandle(
|
||||
type === 'string' || value instanceof Element,
|
||||
`${paths.join('.')} require 'string' or 'Element' type`,
|
||||
);
|
||||
return errorHandle(type === s || value instanceof Element, `${paths.join('.')} require s or 'Element' type`);
|
||||
}
|
||||
|
||||
const component = {
|
||||
html: validElement,
|
||||
disable: '?boolean',
|
||||
name: '?string',
|
||||
index: '?number',
|
||||
style: '?object',
|
||||
click: '?function',
|
||||
mounted: '?function',
|
||||
tooltip: '?string',
|
||||
selector: '?array',
|
||||
onSelect: '?function',
|
||||
disable: `?${b}`,
|
||||
name: `?${s}`,
|
||||
index: `?${n}`,
|
||||
style: `?${o}`,
|
||||
click: `?${f}`,
|
||||
mounted: `?${f}`,
|
||||
tooltip: `?${s}`,
|
||||
selector: `?${a}`,
|
||||
onSelect: `?${f}`,
|
||||
};
|
||||
|
||||
export default {
|
||||
container: validElement,
|
||||
url: 'string',
|
||||
poster: 'string',
|
||||
title: 'string',
|
||||
theme: 'string',
|
||||
lang: 'string',
|
||||
volume: 'number',
|
||||
isLive: 'boolean',
|
||||
muted: 'boolean',
|
||||
autoplay: 'boolean',
|
||||
autoSize: 'boolean',
|
||||
autoMini: 'boolean',
|
||||
loop: 'boolean',
|
||||
flip: 'boolean',
|
||||
rotate: 'boolean',
|
||||
playbackRate: 'boolean',
|
||||
aspectRatio: 'boolean',
|
||||
screenshot: 'boolean',
|
||||
setting: 'boolean',
|
||||
hotkey: 'boolean',
|
||||
pip: 'boolean',
|
||||
mutex: 'boolean',
|
||||
light: 'boolean',
|
||||
backdrop: 'boolean',
|
||||
fullscreen: 'boolean',
|
||||
fullscreenWeb: 'boolean',
|
||||
subtitleOffset: 'boolean',
|
||||
miniProgressBar: 'boolean',
|
||||
localVideo: 'boolean',
|
||||
localSubtitle: 'boolean',
|
||||
networkMonitor: 'boolean',
|
||||
plugins: ['function'],
|
||||
whitelist: ['string|function|regexp'],
|
||||
url: s,
|
||||
poster: s,
|
||||
title: s,
|
||||
theme: s,
|
||||
lang: s,
|
||||
volume: n,
|
||||
isLive: b,
|
||||
muted: b,
|
||||
autoplay: b,
|
||||
autoSize: b,
|
||||
autoMini: b,
|
||||
loop: b,
|
||||
flip: b,
|
||||
rotate: b,
|
||||
playbackRate: b,
|
||||
aspectRatio: b,
|
||||
screenshot: b,
|
||||
setting: b,
|
||||
hotkey: b,
|
||||
pip: b,
|
||||
mutex: b,
|
||||
light: b,
|
||||
backdrop: b,
|
||||
fullscreen: b,
|
||||
fullscreenWeb: b,
|
||||
subtitleOffset: b,
|
||||
miniProgressBar: b,
|
||||
localVideo: b,
|
||||
localSubtitle: b,
|
||||
networkMonitor: b,
|
||||
plugins: [f],
|
||||
whitelist: [`${s}|${f}|${r}`],
|
||||
layers: [component],
|
||||
contextmenu: [component],
|
||||
controls: [
|
||||
@@ -70,31 +75,31 @@ export default {
|
||||
],
|
||||
quality: [
|
||||
{
|
||||
default: '?boolean',
|
||||
name: 'string',
|
||||
url: 'string',
|
||||
default: `?${b}`,
|
||||
name: s,
|
||||
url: s,
|
||||
},
|
||||
],
|
||||
highlight: [
|
||||
{
|
||||
time: 'number',
|
||||
text: 'string',
|
||||
time: n,
|
||||
text: s,
|
||||
},
|
||||
],
|
||||
thumbnails: {
|
||||
url: 'string',
|
||||
number: 'number',
|
||||
width: 'number',
|
||||
height: 'number',
|
||||
column: 'number',
|
||||
url: s,
|
||||
number: n,
|
||||
width: n,
|
||||
height: n,
|
||||
column: n,
|
||||
},
|
||||
subtitle: {
|
||||
url: 'string',
|
||||
style: 'object',
|
||||
encoding: 'string',
|
||||
bilingual: 'boolean',
|
||||
url: s,
|
||||
style: o,
|
||||
encoding: s,
|
||||
bilingual: b,
|
||||
},
|
||||
moreVideoAttr: 'object',
|
||||
icons: 'object',
|
||||
customType: 'object',
|
||||
moreVideoAttr: o,
|
||||
icons: o,
|
||||
customType: o,
|
||||
};
|
||||
Reference in new issue
Block a user