mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
update
This commit is contained in:
1 parent
5001490210
commit
c4b4d4e7a8
34 files changed
+123
-281
No files matched your search
@@ -1,6 +1,8 @@
|
|||||||
node_modules
|
node_modules
|
||||||
.vscode
|
.vscode
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
.parcel-cache
|
||||||
|
dist
|
||||||
*.log
|
*.log
|
||||||
commit.json
|
commit.json
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
|||||||
+3
-1
@@ -1,6 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "artplayer-packages",
|
"name": "artplayer-packages",
|
||||||
"version": "4.3.0",
|
"version": "4.3.0",
|
||||||
|
"type": "module",
|
||||||
"description": "ArtPlayer.js is a modern and full featured HTML5 video player",
|
"description": "ArtPlayer.js is a modern and full featured HTML5 video player",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"bootstrap": "npx lerna bootstrap",
|
"bootstrap": "npx lerna bootstrap",
|
||||||
@@ -37,6 +38,7 @@
|
|||||||
"lerna": "^4.0.0",
|
"lerna": "^4.0.0",
|
||||||
"mocha": "^9.2.2",
|
"mocha": "^9.2.2",
|
||||||
"mocha-chrome": "^2.2.0",
|
"mocha-chrome": "^2.2.0",
|
||||||
|
"servor": "^4.0.2",
|
||||||
"workbox-build": "^6.5.3"
|
"workbox-build": "^6.5.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,29 +1,42 @@
|
|||||||
{
|
{
|
||||||
"name": "artplayer-document",
|
"name": "artplayer-document",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"dependencies": {
|
"scripts": {
|
||||||
"@docusaurus/core": "2.0.0-beta.15",
|
"docusaurus": "docusaurus",
|
||||||
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
"start": "npx docusaurus start",
|
||||||
"@mdx-js/react": "^1.6.22",
|
"build": "npx docusaurus build && npm run copy",
|
||||||
"@svgr/webpack": "^6.1.0",
|
"copy": "rm -rf ../../docs/document && mv build ../../docs/document",
|
||||||
"clsx": "^1.1.1",
|
"commit": "git add . && git commit -m \"build document\" -n",
|
||||||
"docusaurus-lunr-search": "^2.1.15",
|
"swizzle": "npx docusaurus swizzle",
|
||||||
"file-loader": "^6.2.0",
|
"deploy": "npx docusaurus deploy",
|
||||||
"prism-react-renderer": "^1.2.1",
|
"clear": "npx docusaurus clear",
|
||||||
"react": "^17.0.2",
|
"serve": "npx docusaurus serve",
|
||||||
"react-dom": "^17.0.2",
|
"write-translations": "npx docusaurus write-translations",
|
||||||
"url-loader": "^4.1.1"
|
"write-heading-ids": "npx docusaurus write-heading-ids"
|
||||||
},
|
},
|
||||||
"browserslist": {
|
"dependencies": {
|
||||||
"production": [
|
"@docusaurus/core": "2.0.0-beta.15",
|
||||||
">0.5%",
|
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
||||||
"not dead",
|
"@mdx-js/react": "^1.6.22",
|
||||||
"not op_mini all"
|
"@svgr/webpack": "^6.1.0",
|
||||||
],
|
"clsx": "^1.1.1",
|
||||||
"development": [
|
"docusaurus-lunr-search": "^2.1.15",
|
||||||
"last 1 chrome version",
|
"file-loader": "^6.2.0",
|
||||||
"last 1 firefox version",
|
"prism-react-renderer": "^1.2.1",
|
||||||
"last 1 safari version"
|
"react": "^17.0.2",
|
||||||
]
|
"react-dom": "^17.0.2",
|
||||||
}
|
"url-loader": "^4.1.1"
|
||||||
|
},
|
||||||
|
"browserslist": {
|
||||||
|
"production": [
|
||||||
|
">0.5%",
|
||||||
|
"not dead",
|
||||||
|
"not op_mini all"
|
||||||
|
],
|
||||||
|
"development": [
|
||||||
|
"last 1 chrome version",
|
||||||
|
"last 1 firefox version",
|
||||||
|
"last 1 safari version"
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "artplayer-document",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"scripts": {
|
|
||||||
"docusaurus": "docusaurus",
|
|
||||||
"start": "npx docusaurus start",
|
|
||||||
"build": "npx docusaurus build && npm run copy",
|
|
||||||
"copy": "rm -rf ../../docs/document && mv build ../../docs/document",
|
|
||||||
"commit": "git add . && git commit -m \"build document\" -n",
|
|
||||||
"swizzle": "npx docusaurus swizzle",
|
|
||||||
"deploy": "npx docusaurus deploy",
|
|
||||||
"clear": "npx docusaurus clear",
|
|
||||||
"serve": "npx docusaurus serve",
|
|
||||||
"write-translations": "npx docusaurus write-translations",
|
|
||||||
"write-heading-ids": "npx docusaurus write-heading-ids"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@docusaurus/core": "2.0.0-beta.15",
|
|
||||||
"@docusaurus/preset-classic": "2.0.0-beta.15",
|
|
||||||
"@mdx-js/react": "^1.6.22",
|
|
||||||
"@svgr/webpack": "^6.1.0",
|
|
||||||
"clsx": "^1.1.1",
|
|
||||||
"docusaurus-lunr-search": "^2.1.15",
|
|
||||||
"file-loader": "^6.2.0",
|
|
||||||
"prism-react-renderer": "^1.2.1",
|
|
||||||
"react": "^17.0.2",
|
|
||||||
"react-dom": "^17.0.2",
|
|
||||||
"url-loader": "^4.1.1"
|
|
||||||
},
|
|
||||||
"browserslist": {
|
|
||||||
"production": [
|
|
||||||
">0.5%",
|
|
||||||
"not dead",
|
|
||||||
"not op_mini all"
|
|
||||||
],
|
|
||||||
"development": [
|
|
||||||
"last 1 chrome version",
|
|
||||||
"last 1 firefox version",
|
|
||||||
"last 1 safari version"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import './style/index.scss';
|
import './style/index.less';
|
||||||
import validator from 'option-validator';
|
import validator from 'option-validator';
|
||||||
import Emitter from './utils/emitter';
|
import Emitter from './utils/emitter';
|
||||||
import * as utils from './utils';
|
import * as utils from './utils';
|
||||||
|
|||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,123 +0,0 @@
|
|||||||
// https://github.com/kazzkiq/balloon.css
|
|
||||||
// 1.0.3
|
|
||||||
|
|
||||||
//
|
|
||||||
// Variables
|
|
||||||
// -----------------------------------------
|
|
||||||
|
|
||||||
$balloon-bg: fade-out(#101010, 0.05) !default;
|
|
||||||
$balloon-base-size: 12px !default;
|
|
||||||
$balloon-arrow-size: 5px !default;
|
|
||||||
$balloon-move: 4px !default;
|
|
||||||
|
|
||||||
//
|
|
||||||
// Mixins
|
|
||||||
// -----------------------------------------
|
|
||||||
|
|
||||||
@mixin arrow-down() {
|
|
||||||
width: 0;
|
|
||||||
height: 0;
|
|
||||||
border: $balloon-arrow-size solid transparent;
|
|
||||||
border-top-color: var(--balloon-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin base-effects() {
|
|
||||||
opacity: 0;
|
|
||||||
pointer-events: none;
|
|
||||||
transition: all 0.18s ease-out 0.18s;
|
|
||||||
}
|
|
||||||
|
|
||||||
@mixin normalized-text() {
|
|
||||||
text-indent: 0;
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
||||||
'Helvetica Neue', sans-serif;
|
|
||||||
font-weight: normal;
|
|
||||||
font-style: normal;
|
|
||||||
text-shadow: none;
|
|
||||||
font-size: var(--balloon-font-size);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Styles
|
|
||||||
// -----------------------------------------
|
|
||||||
|
|
||||||
:root {
|
|
||||||
--balloon-color: #{$balloon-bg};
|
|
||||||
--balloon-font-size: #{$balloon-base-size};
|
|
||||||
--balloon-move: #{$balloon-move};
|
|
||||||
}
|
|
||||||
|
|
||||||
// IE 11 button bugfix
|
|
||||||
button[aria-label] {
|
|
||||||
&[data-balloon-pos] {
|
|
||||||
overflow: visible;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
[aria-label] {
|
|
||||||
&[data-balloon-pos] {
|
|
||||||
position: relative; // alt. absolute or fixed
|
|
||||||
|
|
||||||
// Fixing iOS Safari event issue.
|
|
||||||
// More info at: https://goo.gl/w8JF4W
|
|
||||||
cursor: pointer;
|
|
||||||
|
|
||||||
&:after {
|
|
||||||
@include base-effects();
|
|
||||||
@include normalized-text();
|
|
||||||
|
|
||||||
background: var(--balloon-color);
|
|
||||||
border-radius: 2px;
|
|
||||||
color: #fff;
|
|
||||||
content: attr(aria-label);
|
|
||||||
padding: 0.5em 1em;
|
|
||||||
position: absolute;
|
|
||||||
white-space: nowrap;
|
|
||||||
line-height: 1.2;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
@include arrow-down();
|
|
||||||
@include base-effects();
|
|
||||||
|
|
||||||
content: '';
|
|
||||||
position: absolute;
|
|
||||||
z-index: 10;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&:before,
|
|
||||||
&:after {
|
|
||||||
opacity: 1;
|
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&[data-balloon-pos='up'] {
|
|
||||||
&:after {
|
|
||||||
bottom: 100%;
|
|
||||||
left: 50%;
|
|
||||||
margin-bottom: $balloon-arrow-size + 5px;
|
|
||||||
transform: translate(-50%, var(--balloon-move));
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
|
||||||
&:before {
|
|
||||||
bottom: 100%;
|
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, var(--balloon-move));
|
|
||||||
transform-origin: top;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
&:after {
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
&:before {
|
|
||||||
transform: translate(-50%, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,22 @@
|
|||||||
|
@import './artplayer.less';
|
||||||
|
@import './video.less';
|
||||||
|
@import './poster.less';
|
||||||
|
@import './subtitle.less';
|
||||||
|
@import './danmuku.less';
|
||||||
|
@import './layers.less';
|
||||||
|
@import './mask.less';
|
||||||
|
@import './loading.less';
|
||||||
|
@import './bottom.less';
|
||||||
|
@import './notice.less';
|
||||||
|
@import './contextmenu.less';
|
||||||
|
@import './setting.less';
|
||||||
|
@import './info.less';
|
||||||
|
@import './hideCursor.less';
|
||||||
|
@import './aspectRatio.less';
|
||||||
|
@import './fullscreenWeb.less';
|
||||||
|
@import './fullscreenRotate.less';
|
||||||
|
@import './mini.less';
|
||||||
|
@import './autoSize.less';
|
||||||
|
@import './flip.less';
|
||||||
|
@import './plugins.less';
|
||||||
|
@import './selector.less';
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
@import './artplayer.scss';
|
|
||||||
@import './video.scss';
|
|
||||||
@import './poster.scss';
|
|
||||||
@import './subtitle.scss';
|
|
||||||
@import './danmuku.scss';
|
|
||||||
@import './layers.scss';
|
|
||||||
@import './mask.scss';
|
|
||||||
@import './loading.scss';
|
|
||||||
@import './bottom.scss';
|
|
||||||
@import './notice.scss';
|
|
||||||
@import './contextmenu.scss';
|
|
||||||
@import './setting.scss';
|
|
||||||
@import './info.scss';
|
|
||||||
@import './hideCursor.scss';
|
|
||||||
@import './aspectRatio.scss';
|
|
||||||
@import './fullscreenWeb.scss';
|
|
||||||
@import './fullscreenRotate.scss';
|
|
||||||
@import './mini.scss';
|
|
||||||
@import './autoSize.scss';
|
|
||||||
@import './flip.scss';
|
|
||||||
@import './plugins.scss';
|
|
||||||
@import './selector.scss';
|
|
||||||
@import './balloon.scss';
|
|
||||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+37
-39
@@ -1,13 +1,11 @@
|
|||||||
const inquirer = require('inquirer');
|
import inquirer from 'inquirer';
|
||||||
const rollup = require('rollup');
|
import servor from 'servor';
|
||||||
const servor = require('servor');
|
import projects from './projects.js';
|
||||||
const logger = require('./logger');
|
import openBrowser from 'servor/utils/openBrowser.js';
|
||||||
const projects = require('./getProjects')();
|
import { Parcel } from '@parcel/core';
|
||||||
const creatRollupConfig = require('./creatRollupConfig');
|
import { fileURLToPath } from 'url';
|
||||||
const openBrowser = require('servor/utils/openBrowser');
|
|
||||||
|
|
||||||
async function develop(projectPath) {
|
async function develop(name) {
|
||||||
const config = creatRollupConfig(projectPath);
|
|
||||||
const { url } = await servor({
|
const { url } = await servor({
|
||||||
root: 'docs',
|
root: 'docs',
|
||||||
fallback: 'index.html',
|
fallback: 'index.html',
|
||||||
@@ -15,30 +13,35 @@ async function develop(projectPath) {
|
|||||||
port: 8081,
|
port: 8081,
|
||||||
});
|
});
|
||||||
openBrowser(url);
|
openBrowser(url);
|
||||||
const watcher = rollup.watch(config);
|
|
||||||
watcher.on('event', (event) => {
|
const dir = projects[name];
|
||||||
switch (event.code) {
|
const bundler = new Parcel({
|
||||||
case 'START':
|
entries: `${dir}/src/index.js`,
|
||||||
logger.log('checking rollup version...');
|
defaultConfig: '@parcel/config-default',
|
||||||
break;
|
mode: 'development',
|
||||||
case 'BUNDLE_START':
|
defaultTargetOptions: {
|
||||||
logger.log(`bundling ${config.output.file}...`);
|
engines: {
|
||||||
break;
|
browsers: ['last 1 Chrome version'],
|
||||||
case 'BUNDLE_END':
|
},
|
||||||
logger.success(`${config.output.file} bundled in ${event.duration}ms.`);
|
},
|
||||||
logger.success('Watching for changes...');
|
env: {
|
||||||
break;
|
NODE_ENV: 'development',
|
||||||
case 'END':
|
},
|
||||||
logger.success('finished building all bundles');
|
additionalReporters: [
|
||||||
break;
|
{
|
||||||
case 'ERROR':
|
packageName: '@parcel/reporter-cli',
|
||||||
logger.warn(`error: ${event.error}`);
|
resolveFrom: fileURLToPath(import.meta.url),
|
||||||
break;
|
},
|
||||||
case 'FATAL':
|
],
|
||||||
logger.warn(`fatal: ${event.error}`);
|
});
|
||||||
break;
|
|
||||||
default:
|
bundler.watch(async (error, event) => {
|
||||||
logger.warn(`unknown event: ${event.code}`);
|
if (error) throw error;
|
||||||
|
if (event.type === 'buildSuccess') {
|
||||||
|
const bundles = event.bundleGraph.getBundles();
|
||||||
|
console.log(`[${name}]`, `✨ Built ${bundles.length} bundles in ${event.buildTime}ms!`);
|
||||||
|
} else if (event.type === 'buildFailure') {
|
||||||
|
console.log(`[${name}]`, event.diagnostics);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -53,10 +56,5 @@ inquirer
|
|||||||
},
|
},
|
||||||
])
|
])
|
||||||
.then((answers) => {
|
.then((answers) => {
|
||||||
develop(projects[answers.project]);
|
develop(answers.project);
|
||||||
})
|
|
||||||
.catch((err) => {
|
|
||||||
logger.fatal(err);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = develop;
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
const path = require('path');
|
|
||||||
const glob = require('glob');
|
|
||||||
|
|
||||||
module.exports = function getProjects() {
|
|
||||||
return glob
|
|
||||||
.sync(path.join(process.cwd(), 'packages/*'))
|
|
||||||
.filter((item) => {
|
|
||||||
return !item.includes('artplayer-document');
|
|
||||||
})
|
|
||||||
.reduce((result, item) => {
|
|
||||||
const name = item.split(path.sep).pop();
|
|
||||||
result[name] = item;
|
|
||||||
return result;
|
|
||||||
}, {});
|
|
||||||
};
|
|
||||||
+10
-10
@@ -1,27 +1,27 @@
|
|||||||
const chalk = require('chalk');
|
import chalk from 'chalk';
|
||||||
const { format } = require('util');
|
import { format } from 'util';
|
||||||
|
|
||||||
const prefix = 'artplayer-cli';
|
const prefix = 'artplayer-cli';
|
||||||
const sep = chalk.gray('·');
|
const sep = chalk.gray('·');
|
||||||
|
|
||||||
exports.log = function log(...args) {
|
export function log(...args) {
|
||||||
const msg = format.apply(format, args);
|
const msg = format.apply(format, args);
|
||||||
console.log(chalk.white(prefix), sep, msg);
|
console.log(chalk.white(prefix), sep, msg);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.fatal = function fatal(...args) {
|
export function fatal(...args) {
|
||||||
if (args[0] instanceof Error) args[0] = args[0].message.trim();
|
if (args[0] instanceof Error) args[0] = args[0].message.trim();
|
||||||
const msg = format.apply(format, args);
|
const msg = format.apply(format, args);
|
||||||
console.error(chalk.red(prefix), sep, msg);
|
console.error(chalk.red(prefix), sep, msg);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.success = function success(...args) {
|
export function success(...args) {
|
||||||
const msg = format.apply(format, args);
|
const msg = format.apply(format, args);
|
||||||
console.log(chalk.green(prefix), sep, msg);
|
console.log(chalk.green(prefix), sep, msg);
|
||||||
};
|
}
|
||||||
|
|
||||||
exports.warn = function warn(...args) {
|
export function warn(...args) {
|
||||||
const msg = format.apply(format, args);
|
const msg = format.apply(format, args);
|
||||||
console.log(chalk.yellow(prefix), sep, msg);
|
console.log(chalk.yellow(prefix), sep, msg);
|
||||||
};
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import path from 'path';
|
||||||
|
import glob from 'glob';
|
||||||
|
|
||||||
|
export default glob.sync(path.join(process.cwd(), 'packages/*')).reduce((result, item) => {
|
||||||
|
const name = item.split(path.sep).pop();
|
||||||
|
result[name] = item;
|
||||||
|
return result;
|
||||||
|
}, {});
|
||||||
Reference in new issue
Block a user