mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 21:06:15 -08:00
Delete unnecessary files and update plugin names
This commit is contained in:
1 parent
a2591533f3
commit
2b18452644
15 files changed
+1
-508
No files matched your search
@@ -1,61 +0,0 @@
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
pip: true,
|
||||
screenshot: true,
|
||||
setting: true,
|
||||
loop: true,
|
||||
flip: true,
|
||||
playbackRate: true,
|
||||
aspectRatio: true,
|
||||
fullscreen: true,
|
||||
fullscreenWeb: true,
|
||||
subtitleOffset: true,
|
||||
miniProgressBar: true,
|
||||
airplay: true,
|
||||
theme: '#23ade5',
|
||||
thumbnails: {
|
||||
url: '/assets/sample/thumbnails.png',
|
||||
number: 60,
|
||||
column: 10,
|
||||
},
|
||||
subtitle: {
|
||||
url: '/assets/sample/subtitle.srt',
|
||||
type: 'srt',
|
||||
style: {
|
||||
color: '#fe9200',
|
||||
fontSize: '20px',
|
||||
},
|
||||
encoding: 'utf-8',
|
||||
},
|
||||
highlight: [
|
||||
{
|
||||
time: 15,
|
||||
text: 'One more chance',
|
||||
},
|
||||
{
|
||||
time: 30,
|
||||
text: '谁でもいいはずなのに',
|
||||
},
|
||||
{
|
||||
time: 45,
|
||||
text: '夏の想い出がまわる',
|
||||
},
|
||||
{
|
||||
time: 60,
|
||||
text: 'こんなとこにあるはずもないのに',
|
||||
},
|
||||
{
|
||||
time: 75,
|
||||
text: '终わり',
|
||||
},
|
||||
],
|
||||
icons: {
|
||||
loading: '<img src="/assets/img/ploading.gif">',
|
||||
state: '<img width="150" heigth="150" src="/assets/img/state.svg">',
|
||||
indicator: '<img width="16" heigth="16" src="/assets/img/indicator.svg">',
|
||||
},
|
||||
plugins: [
|
||||
artplayerPluginControl()
|
||||
],
|
||||
});
|
||||
@@ -39,10 +39,6 @@
|
||||
<a
|
||||
href="/?libs=./uncompiled/artplayer-plugin-iframe/index.js&example=iframe">artplayer-plugin-iframe</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="/?libs=./uncompiled/artplayer-plugin-control/index.js&example=control">artplayer-plugin-control</a>
|
||||
</li>
|
||||
<li>
|
||||
<a
|
||||
href="/?libs=https://cdnjs.cloudflare.com/ajax/libs/hls.js/8.0.0-beta.3/hls.min.js%0A./uncompiled/artplayer-plugin-hls-quality/index.js&example=hls.quality">artplayer-plugin-hls-quality</a>
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
node_modules
|
||||
.DS_Store
|
||||
yarn.lock
|
||||
package-lock.json
|
||||
test
|
||||
coverage
|
||||
.nyc_output
|
||||
.parcel-cache
|
||||
.cache
|
||||
docs
|
||||
@@ -1 +0,0 @@
|
||||
package-lock=false
|
||||
@@ -1,15 +0,0 @@
|
||||
# artplayer-plugin-control
|
||||
|
||||
Control plugin for ArtPlayer
|
||||
|
||||
## Demo
|
||||
|
||||
[https://artplayer.org](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-control/index.js&example=control)
|
||||
|
||||
## Usage
|
||||
|
||||
[https://artplayer.org/document/en/Plugins/control](https://artplayer.org/document/en/Plugins/control)
|
||||
|
||||
## License
|
||||
|
||||
MIT © Harvey Zack
|
||||
@@ -1,25 +0,0 @@
|
||||
/*!
|
||||
* artplayer-plugin-control.js v2.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2023 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!// modules are defined as an array
|
||||
// [ module function, map of requires ]
|
||||
//
|
||||
// map of requires is short require name -> numeric require
|
||||
//
|
||||
// anything defined in a previous bundle is accessed via the
|
||||
// orig method which is the require for previous bundles
|
||||
function(e,t,r,o,n){/* eslint-disable no-undef */var l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},a="function"==typeof l[o]&&l[o],i=a.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!i[t]){if(!e[t]){// if we cannot find the module within our internal map or
|
||||
// cache jump to the current global require ie. the last bundle
|
||||
// that was added to the page.
|
||||
var n="function"==typeof l[o]&&l[o];if(!r&&n)return n(t,!0);// If there are other bundles on this page the require from the
|
||||
// previous one is saved to 'previousRequire'. Repeat this as
|
||||
// many times as there are bundles until the module is found or
|
||||
// we exhaust the require chain.
|
||||
if(a)return a(t,!0);// Try the node require function if it exists.
|
||||
if(u&&"string"==typeof t)return u(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var o=e[t][1][r];return null!=o?o:r},s.cache={};var d=i[t]=new p.Module(t);e[t][0].call(d.exports,s,d,d.exports,this)}return i[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.exports={}},p.modules=e,p.cache=i,p.parent=a,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return l[o]}}),l[o]=p;for(var c=0;c<t.length;c++)p(t[c]);if(r){// Expose entry point to Node, AMD or browser globals
|
||||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
||||
var d=p(r);// CommonJS
|
||||
"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):n&&(this[n]=d)}}({"16V0T":[function(e,t,r){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",()=>a);var n=e("bundle-text:./style.less"),l=o.interopDefault(n);function a(){return e=>{!function(e){let{version:t,utils:{errorHandle:r}}=e.constructor,o=t.split(".").map(Number),n=o[0],l=o[1]/100;r(n+l>=5,`Artplayer.js@${t} is not compatible the artplayerPluginControl@${a.version}. Please update it to version Artplayer.js@5.x.x`)}(e);let{template:{$bottom:t,$player:r},constructor:{utils:{append:o,secondToTime:n,addClass:l,removeClass:i,hasClass:u,isMobile:p}}}=e;if(p)return;let c="artplayer-plugin-control";l(r,c);let d=o(t,'<div class="apa-control-current"></div>'),s=o(t,'<div class="apa-control-duration"></div>'),f=["video:loadedmetadata","video:timeupdate","video:progress"];for(let t=0;t<f.length;t++)e.on(f[t],()=>{d.innerText=n(e.currentTime),s.innerText=n(e.duration)});return{name:"artplayerPluginControl",get enable(){return u(r,c)},set enable(state){state?l(r,c):i(r,c)}}}}if(a.env="production",a.version="2.0.0",a.build="2023-11-23 23:22:00","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){let e=document.createElement("style");e.id="artplayer-plugin-control",e.textContent=l.default,document.head.appendChild(e)}"undefined"!=typeof window&&(window.artplayerPluginControl=a)},{"bundle-text:./style.less":"klrMD","@parcel/transformer-js/src/esmodule-helpers.js":"9pCYc"}],klrMD:[function(e,t,r){t.exports=".artplayer-plugin-control{--art-control-height:46px;--art-control-icon-scale:1.1}.artplayer-plugin-control .apa-control-current,.artplayer-plugin-control .apa-control-duration{display:flex}.artplayer-plugin-control .art-control-time,.artplayer-plugin-control .art-controls-center{display:none}.artplayer-plugin-control .art-settings{bottom:85px}.artplayer-plugin-control .art-bottom{backdrop-filter:saturate(180%)blur(20px);background-color:#000000b3;background-image:none;border-radius:10px;align-items:center;width:400px;height:70px;margin-left:-200px;inset:auto auto 10px 50%;overflow:visible;box-shadow:0 10px 15px -3px #0003,0 4px 6px -4px #0003}.artplayer-plugin-control .art-bottom .art-progress{width:70%}.artplayer-plugin-control .art-bottom .art-controls{width:100%}.artplayer-plugin-control .art-bottom .apa-control-current,.artplayer-plugin-control .art-bottom .apa-control-duration{justify-content:center;width:15%;font-size:12px;line-height:1;display:flex;position:absolute;top:10px}.artplayer-plugin-control .art-bottom .apa-control-current{left:0}.artplayer-plugin-control .art-bottom .apa-control-duration{right:0}.apa-control-current,.apa-control-duration{display:none}"},{}],"9pCYc":[function(e,t,r){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||t.hasOwnProperty(r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}]},["16V0T"],"16V0T","parcelRequire4dc0");
|
||||
@@ -1,25 +0,0 @@
|
||||
/*!
|
||||
* artplayer-plugin-control.js v2.0.0
|
||||
* Github: https://github.com/zhw2590582/ArtPlayer
|
||||
* (c) 2017-2023 Harvey Zack
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
!// modules are defined as an array
|
||||
// [ module function, map of requires ]
|
||||
//
|
||||
// map of requires is short require name -> numeric require
|
||||
//
|
||||
// anything defined in a previous bundle is accessed via the
|
||||
// orig method which is the require for previous bundles
|
||||
function(e,t,r,o,n){/* eslint-disable no-undef */var a="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},l="function"==typeof a[o]&&a[o],i=l.cache||{},u="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);function p(t,r){if(!i[t]){if(!e[t]){// if we cannot find the module within our internal map or
|
||||
// cache jump to the current global require ie. the last bundle
|
||||
// that was added to the page.
|
||||
var n="function"==typeof a[o]&&a[o];if(!r&&n)return n(t,!0);// If there are other bundles on this page the require from the
|
||||
// previous one is saved to 'previousRequire'. Repeat this as
|
||||
// many times as there are bundles until the module is found or
|
||||
// we exhaust the require chain.
|
||||
if(l)return l(t,!0);// Try the node require function if it exists.
|
||||
if(u&&"string"==typeof t)return u(t);var c=Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}s.resolve=function(r){var o=e[t][1][r];return null!=o?o:r},s.cache={};var d=i[t]=new p.Module(t);e[t][0].call(d.exports,s,d,d.exports,this)}return i[t].exports;function s(e){var t=s.resolve(e);return!1===t?{}:p(t)}}p.isParcelRequire=!0,p.Module=function(e){this.id=e,this.bundle=p,this.exports={}},p.modules=e,p.cache=i,p.parent=l,p.register=function(t,r){e[t]=[function(e,t){t.exports=r},{}]},Object.defineProperty(p,"root",{get:function(){return a[o]}}),a[o]=p;for(var c=0;c<t.length;c++)p(t[c]);if(r){// Expose entry point to Node, AMD or browser globals
|
||||
// Based on https://github.com/ForbesLindesay/umd/blob/master/template.js
|
||||
var d=p(r);// CommonJS
|
||||
"object"==typeof exports&&"undefined"!=typeof module?module.exports=d:"function"==typeof define&&define.amd?define(function(){return d}):n&&(this[n]=d)}}({eacU2:[function(e,t,r){var o=e("@parcel/transformer-js/src/esmodule-helpers.js");o.defineInteropFlag(r),o.export(r,"default",function(){return l});var n=e("bundle-text:./style.less"),a=o.interopDefault(n);function l(){return function(e){r=(t=e.constructor).version,(0,t.utils.errorHandle)((o=r.split(".").map(Number))[0]+o[1]/100>=5,"Artplayer.js@".concat(r," is not compatible the artplayerPluginControl@").concat(l.version,". Please update it to version Artplayer.js@5.x.x"));var t,r,o,n=e.template,a=n.$bottom,i=n.$player,u=e.constructor.utils,p=u.append,c=u.secondToTime,d=u.addClass,s=u.removeClass,f=u.hasClass;if(!u.isMobile){var y="artplayer-plugin-control";d(i,y);for(var g=p(a,'<div class="apa-control-current"></div>'),m=p(a,'<div class="apa-control-duration"></div>'),b=["video:loadedmetadata","video:timeupdate","video:progress"],x=0;x<b.length;x++)e.on(b[x],function(){g.innerText=c(e.currentTime),m.innerText=c(e.duration)});return{name:"artplayerPluginControl",get enable(){return f(i,y)},set enable(state){state?d(i,y):s(i,y)}}}}}if(l.env="production",l.version="2.0.0",l.build="2023-11-23 23:22:00","undefined"!=typeof document&&!document.getElementById("artplayer-plugin-control")){var i=document.createElement("style");i.id="artplayer-plugin-control",i.textContent=a.default,document.head.appendChild(i)}"undefined"!=typeof window&&(window.artplayerPluginControl=l)},{"bundle-text:./style.less":"kok3H","@parcel/transformer-js/src/esmodule-helpers.js":"iWrD0"}],kok3H:[function(e,t,r){t.exports=".artplayer-plugin-control{--art-control-height:46px;--art-control-icon-scale:1.1}.artplayer-plugin-control .apa-control-current,.artplayer-plugin-control .apa-control-duration{display:flex}.artplayer-plugin-control .art-control-time,.artplayer-plugin-control .art-controls-center{display:none}.artplayer-plugin-control .art-settings{bottom:85px}.artplayer-plugin-control .art-bottom{backdrop-filter:saturate(180%)blur(20px);background-color:rgba(0,0,0,.7);background-image:none;border-radius:10px;align-items:center;width:400px;height:70px;margin-left:-200px;top:auto;bottom:10px;left:50%;right:auto;overflow:visible;box-shadow:0 10px 15px -3px rgba(0,0,0,.2),0 4px 6px -4px rgba(0,0,0,.2)}.artplayer-plugin-control .art-bottom .art-progress{width:70%}.artplayer-plugin-control .art-bottom .art-controls{width:100%}.artplayer-plugin-control .art-bottom .apa-control-current,.artplayer-plugin-control .art-bottom .apa-control-duration{justify-content:center;width:15%;font-size:12px;line-height:1;display:flex;position:absolute;top:10px}.artplayer-plugin-control .art-bottom .apa-control-current{left:0}.artplayer-plugin-control .art-bottom .apa-control-duration{right:0}.apa-control-current,.apa-control-duration{display:none}"},{}],iWrD0:[function(e,t,r){r.interopDefault=function(e){return e&&e.__esModule?e:{default:e}},r.defineInteropFlag=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.exportAll=function(e,t){return Object.keys(e).forEach(function(r){"default"===r||"__esModule"===r||t.hasOwnProperty(r)||Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[r]}})}),t},r.export=function(e,t,r){Object.defineProperty(e,t,{enumerable:!0,get:r})}},{}]},["eacU2"],"eacU2","parcelRequire4dc0");
|
||||
@@ -1,24 +0,0 @@
|
||||
{
|
||||
"license": "MIT",
|
||||
"version": "2.0.0",
|
||||
"name": "artplayer-plugin-control",
|
||||
"types": "types/artplayer-plugin-control.d.ts",
|
||||
"description": "Control plugin for ArtPlayer",
|
||||
"main": "dist/artplayer-plugin-control.js",
|
||||
"legacy": "dist/artplayer-plugin-control.legacy.js",
|
||||
"author": "Harvey Zack <laozhaochaguan@gmail.com>",
|
||||
"browserslist": "last 1 Chrome version",
|
||||
"homepage": "https://artplayer.org",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/zhw2590582/ArtPlayer.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/zhw2590582/ArtPlayer/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"html5",
|
||||
"video",
|
||||
"player"
|
||||
]
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
import style from 'bundle-text:./style.less';
|
||||
|
||||
function checkVersion(art) {
|
||||
const {
|
||||
version,
|
||||
utils: { errorHandle },
|
||||
} = art.constructor;
|
||||
const arr = version.split('.').map(Number);
|
||||
const major = arr[0];
|
||||
const minor = arr[1] / 100;
|
||||
errorHandle(
|
||||
major + minor >= 5,
|
||||
`Artplayer.js@${version} is not compatible the artplayerPluginControl@${artplayerPluginControl.version}. Please update it to version Artplayer.js@5.x.x`,
|
||||
);
|
||||
}
|
||||
|
||||
export default function artplayerPluginControl() {
|
||||
return (art) => {
|
||||
checkVersion(art);
|
||||
|
||||
const {
|
||||
template: { $bottom, $player },
|
||||
constructor: {
|
||||
utils: { append, secondToTime, addClass, removeClass, hasClass, isMobile },
|
||||
},
|
||||
} = art;
|
||||
|
||||
if (isMobile) return;
|
||||
|
||||
const className = 'artplayer-plugin-control';
|
||||
addClass($player, className);
|
||||
|
||||
const $current = append($bottom, `<div class="apa-control-current"></div>`);
|
||||
const $duration = append($bottom, `<div class="apa-control-duration"></div>`);
|
||||
|
||||
const events = ['video:loadedmetadata', 'video:timeupdate', 'video:progress'];
|
||||
|
||||
for (let index = 0; index < events.length; index++) {
|
||||
art.on(events[index], () => {
|
||||
$current.innerText = secondToTime(art.currentTime);
|
||||
$duration.innerText = secondToTime(art.duration);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
name: 'artplayerPluginControl',
|
||||
get enable() {
|
||||
return hasClass($player, className);
|
||||
},
|
||||
set enable(state) {
|
||||
if (state) {
|
||||
addClass($player, className);
|
||||
} else {
|
||||
removeClass($player, className);
|
||||
}
|
||||
},
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
artplayerPluginControl.env = process.env.NODE_ENV;
|
||||
artplayerPluginControl.version = process.env.APP_VER;
|
||||
artplayerPluginControl.build = process.env.BUILD_DATE;
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (!document.getElementById('artplayer-plugin-control')) {
|
||||
const $style = document.createElement('style');
|
||||
$style.id = 'artplayer-plugin-control';
|
||||
$style.textContent = style;
|
||||
document.head.appendChild($style);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window['artplayerPluginControl'] = artplayerPluginControl;
|
||||
}
|
||||
@@ -1,67 +0,0 @@
|
||||
.artplayer-plugin-control {
|
||||
--art-control-height: 46px;
|
||||
--art-control-icon-scale: 1.1;
|
||||
|
||||
.apa-control-current,
|
||||
.apa-control-duration {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.art-control-time,
|
||||
.art-controls-center {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.art-settings {
|
||||
bottom: 85px;
|
||||
}
|
||||
|
||||
.art-bottom {
|
||||
height: 70px;
|
||||
width: 400px;
|
||||
margin-left: -200px;
|
||||
inset: auto;
|
||||
overflow: visible;
|
||||
align-items: center;
|
||||
border-radius: 10px;
|
||||
left: 50%;
|
||||
bottom: 10px;
|
||||
-webkit-backdrop-filter: saturate(180%) blur(20px);
|
||||
backdrop-filter: saturate(180%) blur(20px);
|
||||
background-color: rgba(0, 0, 0, 0.7);
|
||||
box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.2), 0 4px 6px -4px rgb(0 0 0 / 0.2);
|
||||
background-image: none;
|
||||
|
||||
.art-progress {
|
||||
width: 70%;
|
||||
}
|
||||
|
||||
.art-controls {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.apa-control-current,
|
||||
.apa-control-duration {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
line-height: 1;
|
||||
width: 15%;
|
||||
font-size: 12px;
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
}
|
||||
|
||||
.apa-control-current {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
.apa-control-duration {
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.apa-control-current,
|
||||
.apa-control-duration {
|
||||
display: none;
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
|
||||
export = artplayerPluginControl;
|
||||
export as namespace artplayerPluginControl;
|
||||
|
||||
type Option = {};
|
||||
|
||||
type Control = {
|
||||
name: 'artplayerPluginControl';
|
||||
enable: Boolean;
|
||||
};
|
||||
|
||||
declare const artplayerPluginControl: (option?: Option) => (art: Artplayer) => Control;
|
||||
Vendored
+1
-1
@@ -12,5 +12,5 @@ declare const artplayerPluginMultipleSubtitles: (option: {
|
||||
onParser?(...args: object[]): object;
|
||||
}[];
|
||||
}) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginMultipleSubtitles';
|
||||
name: 'multipleSubtitles';
|
||||
};
|
||||
@@ -69,7 +69,6 @@ const config = {
|
||||
{ text: 'Iframe 控制', link: '/plugin/iframe' },
|
||||
{ text: 'Hls 画质', link: '/plugin/hls-quality' },
|
||||
{ text: 'Dash 画质', link: '/plugin/dash-quality' },
|
||||
{ text: '控制器皮肤', link: '/plugin/control-ui' },
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -122,7 +121,6 @@ const config = {
|
||||
{ text: 'Iframe Control', link: '/en/plugin/iframe' },
|
||||
{ text: 'Hls Quality', link: '/en/plugin/hls-quality' },
|
||||
{ text: 'Dash Quality', link: '/en/plugin/dash-quality' },
|
||||
{ text: 'Control UI', link: '/en/plugin/control-ui' },
|
||||
]
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,92 +0,0 @@
|
||||
# 控制器皮肤
|
||||
|
||||
## 演示
|
||||
|
||||
👉 [查看完整演示](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-control/index.js&example=control)
|
||||
|
||||
## 安装
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [npm]
|
||||
npm install artplayer-plugin-control
|
||||
```
|
||||
|
||||
```bash [yarn]
|
||||
yarn add artplayer-plugin-control
|
||||
```
|
||||
|
||||
```bash [pnpm]
|
||||
pnpm add artplayer-plugin-control
|
||||
```
|
||||
|
||||
```html [script]
|
||||
<script src="path/to/artplayer-plugin-control.js"></script>
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## CDN
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [jsdelivr.net]
|
||||
https://cdn.jsdelivr.net/npm/artplayer-plugin-control/dist/artplayer-plugin-control.js
|
||||
```
|
||||
|
||||
```bash [unpkg.com]
|
||||
https://unpkg.com/artplayer-plugin-control/dist/artplayer-plugin-control.js
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## 使用
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-control/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js{7}
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
fullscreen: true,
|
||||
fullscreenWeb: true,
|
||||
plugins: [
|
||||
artplayerPluginControl(),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## `enable`
|
||||
|
||||
- Type: `Getter/Setter`
|
||||
- Parameter: `Boolean`
|
||||
|
||||
是否启用新的控制器皮肤
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-control/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
fullscreen: true,
|
||||
fullscreenWeb: true,
|
||||
controls: [
|
||||
{
|
||||
position: 'right',
|
||||
html: '<button type="button">Switch UI</button>',
|
||||
click: function () {
|
||||
const { enable } = art.plugins.artplayerPluginControl;
|
||||
art.plugins.artplayerPluginControl.enable = !enable;
|
||||
},
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
artplayerPluginControl(),
|
||||
],
|
||||
});
|
||||
```
|
||||
@@ -1,92 +0,0 @@
|
||||
# 控制器皮肤
|
||||
|
||||
## 演示
|
||||
|
||||
👉 [查看完整演示](https://artplayer.org/?libs=./uncompiled/artplayer-plugin-control/index.js&example=control)
|
||||
|
||||
## 安装
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [npm]
|
||||
npm install artplayer-plugin-control
|
||||
```
|
||||
|
||||
```bash [yarn]
|
||||
yarn add artplayer-plugin-control
|
||||
```
|
||||
|
||||
```bash [pnpm]
|
||||
pnpm add artplayer-plugin-control
|
||||
```
|
||||
|
||||
```html [script]
|
||||
<script src="path/to/artplayer-plugin-control.js"></script>
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## CDN
|
||||
|
||||
::: code-group
|
||||
|
||||
```bash [jsdelivr.net]
|
||||
https://cdn.jsdelivr.net/npm/artplayer-plugin-control/dist/artplayer-plugin-control.js
|
||||
```
|
||||
|
||||
```bash [unpkg.com]
|
||||
https://unpkg.com/artplayer-plugin-control/dist/artplayer-plugin-control.js
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
## 使用
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-control/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js{7}
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
fullscreen: true,
|
||||
fullscreenWeb: true,
|
||||
plugins: [
|
||||
artplayerPluginControl(),
|
||||
],
|
||||
});
|
||||
```
|
||||
|
||||
## `enable`
|
||||
|
||||
- Type: `Getter/Setter`
|
||||
- Parameter: `Boolean`
|
||||
|
||||
是否启用新的控制器皮肤
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-control/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
fullscreen: true,
|
||||
fullscreenWeb: true,
|
||||
controls: [
|
||||
{
|
||||
position: 'right',
|
||||
html: '<button type="button">Switch UI</button>',
|
||||
click: function () {
|
||||
const { enable } = art.plugins.artplayerPluginControl;
|
||||
art.plugins.artplayerPluginControl.enable = !enable;
|
||||
},
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
artplayerPluginControl(),
|
||||
],
|
||||
});
|
||||
```
|
||||
Reference in new issue
Block a user