Skip to content
On this page

控制器皮肤

演示

👉 查看完整演示

安装

bash
npm install artplayer-plugin-control
bash
yarn add artplayer-plugin-control
bash
pnpm add artplayer-plugin-control
html
<script src="path/to/artplayer-plugin-control.js"></script>

CDN

bash
https://cdn.jsdelivr.net/npm/artplayer-plugin-control/dist/artplayer-plugin-control.js
bash
https://unpkg.com/artplayer-plugin-control/dist/artplayer-plugin-control.js

使用

▶ Run Code
js
var art = new Artplayer({
    container: '.artplayer-app',
    url: '/assets/sample/video.mp4',
    fullscreen: true,
    fullscreenWeb: true,
    plugins: [
        artplayerPluginControl(),
    ],
});

enable

  • Type: Getter/Setter
  • Parameter: Boolean

是否启用新的控制器皮肤

▶ Run Code
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(),
    ],
});