diff --git a/README.md b/README.md index f15b8860..c6818123 100644 --- a/README.md +++ b/README.md @@ -319,8 +319,6 @@ The player exposes some custom CSS properties, locally scopped under the `.v-vli | `--vlite-controlBarBackground` | `linear-gradient(to top, #000 -50%, transparent)` | Control bar background | | `--vlite-controlsColor` | `#fff\|#000` | Controls color (video\|audio) | | `--vlite-controlsOpacity` | `0.9` | Controls opacity | -| `--vlite-controlsIconWidth` | `28px` | Controls icon width | -| `--vlite-controlsIconHeight` | `28px` | Controls icon height | | `--vlite-progressBarHeight` | `5px` | Progress bar height | | `--vlite-progressBarBackground` | `rgba(0 0 0 / 25%)` | Progress bar background | diff --git a/config/.eslintrc.js b/config/.eslintrc.js index 3a2d09a8..cffab7e9 100644 --- a/config/.eslintrc.js +++ b/config/.eslintrc.js @@ -20,7 +20,7 @@ module.exports = { plugins: ['prettier'], rules: { - indent: ['error', 'tab', { ignoredNodes: ['TemplateLiteral *'] }], + indent: ['error', 'tab', { ignoredNodes: ['TemplateLiteral *'], SwitchCase: 1 }], 'no-tabs': 0, 'space-before-function-paren': [ 'error', @@ -31,6 +31,8 @@ module.exports = { globals: { document: false, navigator: false, - window: false + window: false, + chrome: false, + cast: false } } diff --git a/config/webpack.config.js b/config/webpack.config.js index ea1a780d..700f3aaa 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -46,6 +46,11 @@ const plugins = [ entrykey: 'plugins/pip', library: `${libraryName}Pip`, path: './src/plugins/pip/config' + }, + { + entrykey: 'plugins/cast', + library: `${libraryName}Cast`, + path: './src/plugins/cast/config' } ] @@ -69,7 +74,8 @@ const generator = ({ entry, library = false, isProduction }) => { export: 'default' } } - return { + + const config = { watch: !isProduction, entry, watchOptions: { @@ -136,7 +142,6 @@ const generator = ({ entry, library = false, isProduction }) => { }, context: appDirectory, plugins: [ - new webpack.ProgressPlugin(), new MiniCssExtractPlugin({ filename: '[name].css', chunkFilename: '[name].css' @@ -180,6 +185,12 @@ const generator = ({ entry, library = false, isProduction }) => { splitChunks: false } } + + if (!isProduction) { + config.plugins.push(new webpack.ProgressPlugin()) + } + + return config } module.exports = (env, argv) => { diff --git a/examples/html5/config.js b/examples/html5/config.js index fc08ff5a..1623f84b 100644 --- a/examples/html5/config.js +++ b/examples/html5/config.js @@ -1,11 +1,22 @@ import '../../dist/vlite.css' import '../../dist/plugins/subtitle.css' +import '../../dist/plugins/cast.css' import Vlitejs from '../../dist/vlite.js' import VlitejsSubtitle from '../../dist/plugins/subtitle.js' import VlitejsPip from '../../dist/plugins/pip.js' +import VlitejsCast from '../../dist/plugins/cast.js' Vlitejs.registerPlugin('subtitle', VlitejsSubtitle) Vlitejs.registerPlugin('pip', VlitejsPip) +Vlitejs.registerPlugin('cast', VlitejsCast, { + textTrackStyle: { + backgroundColor: '#21212190' + }, + metadata: { + title: 'The Jungle Book', + subtitle: 'Walt Disney Animation Studios' + } +}) /* eslint-disable no-unused-vars */ const vlite = new Vlitejs('#player', { @@ -24,7 +35,7 @@ const vlite = new Vlitejs('#player', { muted: false, autoHide: true }, - plugins: ['subtitle', 'pip'], + plugins: ['subtitle', 'pip', 'cast'], onReady: function (player) { console.log(player) diff --git a/examples/html5/index.html b/examples/html5/index.html index 41bde5b6..bb0c1867 100644 --- a/examples/html5/index.html +++ b/examples/html5/index.html @@ -8,6 +8,7 @@