diff --git a/docs/assets/example/backlight.js b/docs/assets/example/backlight.js
index 06ab52b1b..0583aa641 100644
--- a/docs/assets/example/backlight.js
+++ b/docs/assets/example/backlight.js
@@ -1,7 +1,6 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/your-name.mp4',
+ url: '/assets/sample/video.mp4',
autoSize: true,
light: true,
localVideo: true,
diff --git a/docs/assets/example/blur.js b/docs/assets/example/blur.js
index d205bbb49..ba815af0f 100644
--- a/docs/assets/example/blur.js
+++ b/docs/assets/example/blur.js
@@ -1,7 +1,6 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/your-name.mp4',
+ url: '/assets/sample/video.mp4',
autoSize: true,
moreVideoAttr: {
crossOrigin: 'anonymous',
diff --git a/docs/assets/example/danmuku.js b/docs/assets/example/danmuku.js
index 9bd40c3b5..1882fc70f 100644
--- a/docs/assets/example/danmuku.js
+++ b/docs/assets/example/danmuku.js
@@ -1,14 +1,13 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/your-name.mp4',
+ url: '/assets/sample/video.mp4',
autoSize: true,
setting: true,
playbackRate: true,
fullscreenWeb: true,
plugins: [
artplayerPluginDanmuku({
- danmuku: url + '/danmuku/your-name.xml',
+ danmuku: '/assets/sample/danmuku.xml',
speed: 5,
maxlength: 50,
margin: [10, 100],
diff --git a/docs/assets/example/gif.js b/docs/assets/example/gif.js
index d1338512f..7f25f4c35 100644
--- a/docs/assets/example/gif.js
+++ b/docs/assets/example/gif.js
@@ -1,7 +1,6 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
+ url: '/assets/sample/video.mp4',
title: '【新海诚动画】『秒速5センチメートル』',
autoSize: true,
localVideo: true,
diff --git a/docs/assets/example/github.js b/docs/assets/example/github.js
index d19c5fa12..906262be0 100644
--- a/docs/assets/example/github.js
+++ b/docs/assets/example/github.js
@@ -6,10 +6,9 @@ var danmuku = new ArtplayerToolGithub({
clientSecret: '7bb6fa67ef6e525e5bd5fda46cd3925ecc4a3760',
});
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/your-name.mp4',
+ url: '/assets/sample/video.mp4',
autoSize: true,
controls: [
{
diff --git a/docs/assets/example/index.js b/docs/assets/example/index.js
index 7e5fbfe14..b285d2479 100644
--- a/docs/assets/example/index.js
+++ b/docs/assets/example/index.js
@@ -1,9 +1,8 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
var art = new Artplayer({
container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
+ url: '/assets/sample/video.mp4',
title: 'One More Time One More Chance',
- poster: url + '/image/one-more-time-one-more-chance-poster.jpg',
+ poster: '/assets/sample/poster.jpg',
volume: 0.5,
isLive: false,
muted: false,
@@ -59,22 +58,22 @@ var art = new Artplayer({
{
default: true,
name: 'SD 480P',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
+ url: '/assets/sample/video.mp4',
},
{
name: 'HD 720P',
- url: url + '/video/one-more-time-one-more-chance-720p.mp4',
+ url: '/assets/sample/video.mp4',
},
],
thumbnails: {
- url: url + '/image/one-more-time-one-more-chance-thumbnails.png',
+ url: '/assets/sample/thumbnails.png',
number: 100,
width: 160,
height: 90,
column: 10,
},
subtitle: {
- url: url + '/subtitle/one-more-time-one-more-chance.srt',
+ url: '/assets/sample/subtitle.srt',
style: {
color: '#03A9F4',
},
diff --git a/docs/assets/example/playlist.js b/docs/assets/example/playlist.js
deleted file mode 100644
index 7a50bb5b4..000000000
--- a/docs/assets/example/playlist.js
+++ /dev/null
@@ -1,45 +0,0 @@
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/your-name.mp4',
- poster: url + '/image/one-more-time-one-more-chance-poster.jpg',
- autoSize: true,
- controls: [
- {
- name: 'playlist',
- position: 'right',
- html: 'Playlist',
- click: () => {
- art.plugins.artplayerPluginPlaylist.show();
- },
- },
- {
- name: 'prev',
- position: 'right',
- html: 'Prev',
- click: () => {
- art.plugins.artplayerPluginPlaylist.prev();
- },
- },
- {
- name: 'next',
- position: 'right',
- html: 'Next',
- click: () => {
- art.plugins.artplayerPluginPlaylist.next();
- },
- },
- ],
- plugins: [
- artplayerPluginPlaylist([
- {
- title: 'Your name',
- url: url + '/video/your-name.mp4',
- },
- {
- title: 'One more time one more chance',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- },
- ]),
- ],
-});
diff --git a/docs/assets/sample/danmuku.xml b/docs/assets/sample/danmuku.xml
new file mode 100644
index 000000000..bedb5b671
--- /dev/null
+++ b/docs/assets/sample/danmuku.xml
@@ -0,0 +1 @@
+
`,
- style: {
- position: 'absolute',
- top: '20px',
- right: '20px',
- opacity: '.9',
- },
- },
- ],
-});
-```
-
-## contextmenu
-
-- Type: `Array`
-- Default: `[]`
-
-Custom contextmenu, The type of layer is an object or function
-
-| propertie | type | Description |
-| --------- | ------------------- | --------------------------------------------- |
-| `disable` | `Boolean` | Whether to disable |
-| `name` | `String` | The unique name , used for the class name |
-| `index` | `Number` | The unique index, used for the priority level |
-| `html` | `String`、`Element` | The dom element |
-| `style` | `Object` | The style object |
-| `click` | `Function` | Click event |
-| `mounted` | `Function` | Callback after mounted |
-| `tooltip` | `String` | Tooltip text |
-
-[Run Code](/Configuration.contextmenu)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- contextmenu: [
- {
- html: 'Custom menu',
- click: function (contextmenu) {
- console.info('You clicked on the custom menu');
- contextmenu.show = false;
- },
- },
- ],
-});
-```
-
-## controls
-
-- Type: `Array`
-- Default: `[]`
-
-Custom controls, The type of controls is an object or function
-
-| propertie | type | Description |
-| ---------- | ------------------- | ----------------------------------------------------------------- |
-| `disable` | `Boolean` | Whether to disable |
-| `name` | `String` | The unique name , used for the class name |
-| `index` | `Number` | The unique index, used for the priority level |
-| `html` | `String`、`Element` | The dom element |
-| `style` | `Object` | The style object |
-| `click` | `Function` | Click event |
-| `mounted` | `Function` | Callback after mounted |
-| `position` | `String` | The position where the controller appears: `top`, `left`, `right` |
-| `tooltip` | `String` | Tooltip text |
-
-[Run Code](/Configuration.controls)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- controls: [
- {
- name: 'myController',
- position: 'right',
- index: 10,
- html: 'myController',
- tooltip: 'This is my controller',
- click: function () {
- console.log('myController');
- },
- },
- ],
-});
-```
-
-## plugins
-
-- Type: `Array`
-- Default: `[]`
-
-Custom plugins, The type of plugin is a function
-
-[Run Code](/Configuration.plugins)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- plugins: [
- function myPlugin(art) {
- // Do something you like here.
- // You can also return an object for external calls.
- console.info('myPlugin running...');
- return {
- // This exposes plugin properties or methods for others to use. Like:
- something: 'something',
- doSomething: function () {
- console.info('Do something here...');
- },
- };
- },
- ],
-});
-
-// Call plugin from the outside
-art.plugins.myPlugin.doSomething();
-```
-
-# Instance properties
-
-## Instance
-
-| propertie | type | Description |
-| ----------- | ---------- | ------------------------------------------------ |
-| `isFocus` | `Boolean` | Return the focus state |
-| `userAgent` | `String` | The user agent |
-| `isMobile` | `boolean` | Whether mobile access |
-| `isDestroy` | `Boolean` | Return the destroy state |
-| `option` | `Object` | Return the merge option |
-| `destroy` | `Function` | Destroy instance, will not remove dom by default |
-
-[Run Code](/Properties.instance)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-console.log('isFocus', art.isFocus);
-console.log('isDestroy', art.isDestroy);
-console.log('option', art.option);
-
-setTimeout(function () {
- // remove dom
- art.destroy();
-
- // keep dom
- // art.destroy(false);
-}, 1000);
-```
-
-## player
-
-Player core function.
-
-All player properties and methods can be accessed directly through the instance. For example, the following properties are all equal:
-
-```js
-art.currentTime === art.player.currentTime;
-art.volume === art.player.volume;
-art.seek === art.player.seek;
-```
-
-| propertie | type | Description |
-| ------------------------ | ---------- | ------------------------------------------------------------------------------------------------- |
-| `aspectRatio` | `String` | Set aspect ratio, Currently only accepts three values:`default`, `4:3`, `16:9` and `false` |
-| `aspectRatioReset` | `Boolean` | Recalculate the aspect ratio |
-| `url` | `String` | `Getter` and `Setter` of the video url |
-| `autoSize` | `Boolean` | Set auto size |
-| `currentTime` | `Number` | `Getter` and `Setter` of the current time |
-| `duration` | `Number` | `Getter` of the duration |
-| `flip` | `String` | Set flip, Currently only accepts three values:`normal`, `horizontal`, `vertical` and `false` |
-| `fullscreen` | `Boolean` | Enable or disable fullscreen |
-| `fullscreenToggle` | `Boolean` | Toggle fullscreen |
-| `fullscreenWeb` | `Boolean` | Enable or disable web fullscreen |
-| `fullscreenWebToggle` | `Boolean` | Toggle web fullscreen |
-| `fullscreenRotate` | `Boolean` | Enable or disable web fullscreen on the mobile |
-| `fullscreenRotateToggle` | `Boolean` | Toggle web fullscreen on the mobile |
-| `loaded` | `Number` | Return the proportion of the load |
-| `pause` | `Boolean` | Pause playback |
-| `pip` | `Boolean` | Enable or disable pip |
-| `pipToggle` | `Boolean` | Toggle pip |
-| `min` | `Boolean` | Enable or disable min player |
-| `minToggle` | `Boolean` | Toggle min player |
-| `playbackRate` | `String` | Set playbackRate, Currently only accepts three values:`0.5`, `0.75`, `1.0`, `1.25`, `1.5`, `2.0` |
-| `playbackRateReset` | `Boolean` | Recalculate the playback rate |
-| `played` | `Number` | Return the proportion of the played |
-| `playing` | `Boolean` | Return to playing state |
-| `play` | `Boolean` | Start playback |
-| `screenshot` | `Function` | Download a screenshot of current time |
-| `seek` | `Number` | Set the current time |
-| `forward` | `Number` | Video fast forward |
-| `backward` | `Number` | Video fast backward |
-| `switchQuality` | `Function` | Switch video quality |
-| `switchUrl` | `Function` | Switch video url |
-| `toggle` | `Boolean` | Toggle play and pause |
-| `volume` | `Number` | `Getter` and `Setter` of the current volume |
-| `muted` | `Boolean` | `Getter` and `Setter` of the muted |
-| `light` | `Boolean` | `Getter` and `Setter` of the light mode |
-| `url` | `String` | `Getter` and `Setter` of the video url |
-| `loop` | `Arrary` | `Getter` and `Setter` of the interval loop |
-
-[Run Code](/Properties.player)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.on('ready', () => {
- art.player.seek = 5;
- art.player.screenshot();
-});
-```
-
-## storage
-
-The player will automatically add a `localStorage` object named `artplayer_settings`, Now the player will only set and read the `volume` value.
-
-| propertie | type | Description |
-| --------- | ---------- | ----------------- |
-| `get` | `Function` | Get a storage |
-| `set` | `Function` | Set a storage |
-| `del` | `Function` | Delete a storage |
-| `clean` | `Function` | Clean all storage |
-
-[Run Code](/Properties.storage)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.storage.set('your-key', 'your-value');
-console.log(art.storage.get('your-key'));
-```
-
-## i18n
-
-The current support i18n has: `en`, `zh-cn`, `zh-tw`
-
-| propertie | type | Description |
-| --------- | ---------- | ------------------------------- |
-| `get` | `Function` | Get the a i18n value |
-| `update` | `Function` | Pass in a parameter for merging |
-
-[Run Code](/Properties.i18n)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- lang: 'jp',
-});
-
-console.log(art.i18n.get('Play'));
-art.i18n.update({
- 'zh-cn': {
- Language: '简体',
- },
- 'zh-tw': {
- Language: '繁體',
- },
- jp: {
- Language: '日文',
- },
-});
-console.log(art.i18n.get('Language'));
-```
-
-## hotkey
-
-| propertie | type | Description |
-| --------- | ---------- | ------------ |
-| `add` | `function` | Add a hotkey |
-
-[Run Code](/Properties.hotkey)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-// Add a hotkey
-art.hotkey.add(27, function (event) {
- console.log('You pressed esc button');
-});
-```
-
-## whitelist
-
-| propertie | type | Description |
-| --------- | --------- | ------------------------------------- |
-| `state` | `Boolean` | Whether to enable the UI on the phone |
-
-## notice
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | -------- | -------------- |
-| `show` | `setter` | Show a message |
-
-[Run Code](/Properties.notice)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-// auto hide
-art.notice.show = 'some message';
-```
-
-## events
-
-Agent for managing native events
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ------------------------------------------------------------------------------------ |
-| `proxy` | `Function` | A proxy for `addEventListener` and `removeEventListener` to manage event destruction |
-| `hover` | `Function` | Hover simplified proxy |
-| `loadImg` | `Function` | Determine whether to finish the picture |
-| `destroy` | `Function` | Destroy all events |
-
-[Run Code](/Properties.events)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-var target = document.querySelector('body');
-art.events.proxy(target, 'click', function (e) {
- console.log('body click');
-});
-```
-
-## layers
-
-Layer manager, and every layer has `show` and `hide` funciton
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ----------------------- |
-| `add` | `Function` | Dynamically add a layer |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.layers)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.layers.add({
- html: `
`,
- style: {
- position: 'absolute',
- top: '20px',
- right: '20px',
- opacity: '.9',
- },
-});
-```
-
-## controls
-
-Controls manager, and every control has `show` setter
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ------------------------- |
-| `add` | `Function` | Dynamically add a control |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.controls)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.controls.add({
- name: 'myController',
- position: 'right',
- index: 10,
- html: 'myController',
- tooltip: 'This is my controller',
- click: function () {
- console.log('myController');
- },
-});
-```
-
-## contextmenu
-
-Contextmenu manager, and every contextmenu has `show` setter
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ----------------------------- |
-| `add` | `Function` | Dynamically add a contextmenu |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.contextmenu)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.contextmenu.add({
- html: 'Custom menu',
- click: function (contextmenu) {
- console.info('You clicked on the custom menu');
- contextmenu.show = false;
- },
-});
-```
-
-## subtitle
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ---------------- |
-| `init` | `Function` | Init subtitle |
-| `show` | `setter` | Show or hide |
-| `switch` | `Function` | Switch subtitle |
-| `url` | `getter` | get subtitle url |
-
-[Run Code](/Properties.subtitle)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- subtitle: {
- url: url + '/subtitle/one-more-time-one-more-chance.srt',
- },
- controls: [
- {
- position: 'right',
- index: 10,
- html: 'subtitle 01',
- click: function () {
- art.subtitle.switch(url + '/subtitle/one-more-time-one-more-chance.srt', 'srt subtitle name');
- },
- },
- {
- position: 'right',
- index: 20,
- html: 'subtitle 02',
- click: function () {
- art.subtitle.switch(url + '/subtitle/one-more-time-one-more-chance.vtt', 'vtt subtitle name');
- },
- },
- ],
-});
-```
-
-## loading
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | -------- | ------------ |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.loading)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.on('ready', function () {
- // Show the loading
- art.loading.show = true;
- setTimeout(function () {
- // Hide the loading
- art.loading.show = false;
- }, 5000);
-});
-```
-
-## mask
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | -------- | ------------ |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.mask)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.on('ready', function () {
- // Show the mask
- art.mask.show = true;
- setTimeout(function () {
- // Hide the mask
- art.mask.show = false;
- }, 5000);
-});
-```
-
-## setting
-
-Setting manager, and every setting has `show` and `hide` funciton
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ------------------------- |
-| `add` | `Function` | Dynamically add a setting |
-| `show` | `setter` | Show or hide |
-
-[Run Code](/Properties.setting)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
- setting: true,
-});
-
-art.on('ready', function () {
- // Add a setting
- art.setting.add({
- html: 'Your Setting',
- name: 'yourSetting',
- });
-
- // Show the setting
- art.setting.show = true;
- setTimeout(function () {
- // Hide the setting
- art.setting.show = false;
- }, 5000);
-});
-```
-
-## plugins
-
-Plugins manager
-
-- Type: `Object`
-
-| propertie | type | Description |
-| --------- | ---------- | ------------------------ |
-| `add` | `Function` | Dynamically add a plugin |
-
-[Run Code](/Properties.plugins)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- url: url + '/video/one-more-time-one-more-chance-480p.mp4',
-});
-
-art.plugins.add(function myPlugin(art) {
- // Do something you like here.
- // You can also return an object for external calls.
- console.info('myPlugin running...');
- return {
- // This exposes plugin properties or methods for others to use. Like:
- something: 'something',
- doSomething: function () {
- console.info('Do something here...');
- },
- };
-});
-
-// Call plugin from the outside
-art.plugins.myPlugin.something === 'something';
-art.plugins.myPlugin.doSomething();
-```
-
-# Class static properties
-
-All properties are read only
-
-| propertie | type | Description |
-| --------------------- | -------- | ------------------------- |
-| `Artplayer.version` | `String` | Version Information |
-| `Artplayer.env` | `String` | Environmental variable |
-| `Artplayer.config` | `Object` | Configuration information |
-| `Artplayer.utils` | `Object` | Utils function |
-| `Artplayer.option` | `Object` | Default option |
-| `Artplayer.instances` | `Array` | Instance collection |
-| `Artplayer.scheme` | `Array` | Option scheme |
-| `Artplayer.Emitter` | `Array` | Emitter constructor |
-| `Artplayer.validator` | `Array` | Option validator |
-| `Artplayer.kindOf` | `Array` | Data type detection tool |
-
-# Event
-
-```js
-art.on('ready', function (args) {
- console.log('The player can play');
-});
-```
-
-## Instance
-
-| Event | Description | Parameter |
-| --------------------- | --------------------------------------- | ----------------------- |
-| `ready` | When the video can be played | `undefined` |
-| `play` | When the video play | `undefined` |
-| `pause` | When the video pause | `undefined` |
-| `seek` | When the video seek | Video current time |
-| `volume` | When the video volume change | Video volume value |
-| `destroy` | When the instance is destroyed | `undefined` |
-| `focus` | When the player gets focus | `undefined` |
-| `blur` | When the player loses focus | `undefined` |
-| `hoverenter` | When the mouse is moved into the player | `undefined` |
-| `hoverleave` | When the mouse is moved out the player | `undefined` |
-| `resize` | When the player resize | Player size |
-| `mousemove` | When the mouse moves over the player | `undefined` |
-| `aspectRatioChange` | When aspect ratio change | Aspect ratio |
-| `aspectRatioRemove` | When aspect ratio remove | `undefined` |
-| `aspectRatioReset` | When aspect ratio reset | `undefined` |
-| `customType` | After triggering CustomType | Type name |
-| `urlChange` | After the video url change | Video url |
-| `autoSizeChange` | When the player auto size change | Player size |
-| `autoSizeRemove` | When the player auto size remove | `undefined` |
-| `flipChange` | When the player flip change | Flip name |
-| `flipRemove` | When the player flip remove | `undefined` |
-| `fullscreenChange` | When the full screen status change | Whether full screen |
-| `fullscreenWebChange` | When entering web full screen | Whether web full screen |
-| `pipChange` | When entering picture in picture | Whether in pip |
-| `minChange` | When entering min player | Whether in min player |
-| `playbackRateChange` | When playback rate change | Playback rate |
-| `playbackRateRemove` | When playback rate remove | `undefined` |
-| `playbackRateReset` | When playback rate reset | `undefined` |
-| `screenshot` | When a screenshot occurs | Image data uri |
-| `switch` | When switching video url | Video url |
-| `loopAdd` | When an interval loop is added | Interval arrary |
-| `loopRemove` | When the interval loop is deleted | `undefined` |
-| `loopStart` | When entering the interval cycle | Interval arrary |
-
-## Video (Native event)
-
-You can use all the native events of video directly: [MDN web docs - Media events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events).
-
-But be careful to add the `video` prefix in front of the event:
-
-```js
-art.on('video:canplay', function (event) {
- console.log(event);
-});
-```
-
-## Subtitle
-
-| Event | Description | Parameter |
-| ----------------- | ----------------------------- | --------------------- |
-| `subtitle:update` | When the subtitles change | Current subtitle text |
-| `subtitle:switch` | When switching subtitles | Current subtitle url |
-| `subtitle:load` | When the subtitles loaded | Current subtitle url |
-| `subtitle:err` | When the subtitles load error | Error object |
-| `subtitle:toggle` | When displaying subtitles | Whether to show |
-
-## Notice
-
-| Event | Description | Parameter |
-| --------------- | ---------------------- | --------------- |
-| `notice:toggle` | When displaying notice | Whether to show |
-
-## Mask
-
-| Event | Description | Parameter |
-| ------------- | -------------------- | --------------- |
-| `mask:toggle` | When displaying mask | Whether to show |
-
-## Loading
-
-| Event | Description | Parameter |
-| ---------------- | ----------------------- | --------------- |
-| `loading:toggle` | When displaying loading | Whether to show |
-
-## Layer
-
-| Event | Description | Parameter |
-| -------------- | ----------------------- | ------------------- |
-| `layer:add` | When adding a new layer | Layer configuration |
-| `layer:toggle` | When displaying layer | Whether to show |
-
-## Info
-
-| Event | Description | Parameter |
-| ------------- | -------------------- | --------------- |
-| `info:toggle` | When displaying info | Whether to show |
-
-## Hotkey
-
-| Event | Description | Parameter |
-| -------- | ---------------------------- | ------------------- |
-| `hotkey` | When the hotkey is triggered | Hotkey event object |
-
-## Setting
-
-| Event | Description | Parameter |
-| ---------------- | ------------------------- | --------------------- |
-| `setting:add` | When adding a new setting | Setting configuration |
-| `setting:toggle` | When displaying setting | Whether to show |
-
-## Contextmenu
-
-| Event | Description | Parameter |
-| -------------------- | ----------------------------- | ------------------------- |
-| `contextmenu:add` | When adding a new contextmenu | Contextmenu configuration |
-| `contextmenu:toggle` | When displaying contextmenu | Whether to show |
-
-## Control
-
-| Event | Description | Parameter |
-| ---------------- | ------------------------- | --------------------- |
-| `control:add` | When adding a new control | Control configuration |
-| `control:toggle` | When displaying control | Whether to show |
-
-## Plugins
-
-| Event | Description | Parameter |
-| ------------ | ------------------------ | -------------------- |
-| `plugin:add` | When adding a new plugin | Plugin configuration |
-
-# Third-party libraries
-
-## flv.js
-
-- HomePage: [https://github.com/Bilibili/flv.js](https://github.com/Bilibili/flv.js)
-
-[Run Code](/lib=https://cdn.bootcss.com/flv.js/1.4.2/flv.js)
-
-```js
-var url = 'https://zhw2590582.github.io/assets-cdn';
-var art = new Artplayer({
- container: '.artplayer-app',
- autoplay: true,
- url: url + '/video/one-more-time-one-more-chance-480p.flv',
- customType: {
- flv: function (video, url) {
- const flvPlayer = flvjs.createPlayer({
- type: 'flv',
- url: url,
- });
- flvPlayer.attachMediaElement(video);
- flvPlayer.load();
- },
- },
-});
-```
-
-## hls.js
-
-- HomePage: [https://github.com/video-dev/hls.js](https://github.com/video-dev/hls.js)
-
-[Run Code](/lib=https://cdn.bootcss.com/hls.js/0.10.1/hls.js)
-
-```js
-var art = new Artplayer({
- container: '.artplayer-app',
- autoplay: true,
- url: 'https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8',
- customType: {
- m3u8: function (video, url) {
- var hls = new Hls();
- hls.loadSource(url);
- hls.attachMedia(video);
- },
- },
-});
-```
-
-## dash.js
-
-- HomePage: [https://github.com/Dash-Industry-Forum/dash.js](https://github.com/Dash-Industry-Forum/dash.js)
-
-[Run Code](/lib=https://cdn.bootcss.com/dashjs/2.9.2/dash.all.min.js)
-
-```js
-var art = new Artplayer({
- container: '.artplayer-app',
- autoplay: true,
- url: 'https://dash.akamaized.net/envivio/EnvivioDash3/manifest.mpd',
- customType: {
- mpd: function (video, url) {
- var player = dashjs.MediaPlayer().create();
- player.initialize(video, url, true);
- },
- },
-});
-```
-
-## shaka-player
-
-- HomePage: [https://github.com/google/shaka-player](https://github.com/google/shaka-player)
-
-[Run Code](/lib=https://cdn.bootcss.com/shaka-player/2.5.0-beta/shaka-player.compiled.js)
-
-```js
-var art = new Artplayer({
- container: '.artplayer-app',
- autoplay: true,
- url: '//storage.googleapis.com/shaka-demo-assets/angel-one/dash.mpd',
- customType: {
- mpd: function (video, url) {
- shaka.polyfill.installAll();
- var player = new shaka.Player(video);
- player.load(url);
- },
- },
-});
-```
-
-## webtorrent
-
-- HomePage: [https://github.com/webtorrent/webtorrent](https://github.com/webtorrent/webtorrent)
-
-[Run Code](/lib=https://cdn.bootcss.com/webtorrent/0.102.4/webtorrent.min.js)
-
-```js
-var art = new Artplayer({
- container: '.artplayer-app',
- autoplay: true,
- url:
- 'magnet:?xt=urn:btih:6a9759bffd5c0af65319979fb7832189f4f3c35d&dn=sintel.mp4&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&tr=wss%3A%2F%2Ftracker.webtorrent.io&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fsintel-1024-surround.mp4',
- type: 'torrent',
- customType: {
- torrent: function (video, url, art) {
- var client = new WebTorrent();
- art.loading.show = true;
- client.add(url, function (torrent) {
- var file = torrent.files[0];
- file.renderTo(video, {
- autoplay: true,
- });
- });
- },
- },
+ url: '/assets/sample/video.mp4',
});
```
diff --git a/docs/document/_sidebar.md b/docs/document/_sidebar.md
new file mode 100644
index 000000000..1f5b848d1
--- /dev/null
+++ b/docs/document/_sidebar.md
@@ -0,0 +1,6 @@
+- [Getting started](/)
+- [Options](/options)
+- [Properties](/properties)
+- [Events](/events)
+- [Class](/class)
+- [Libraries](/libraries)
diff --git a/docs/document/class.md b/docs/document/class.md
new file mode 100644
index 000000000..9e07360a0
--- /dev/null
+++ b/docs/document/class.md
@@ -0,0 +1,99 @@
+## version
+
+- Type: `String`
+
+[Run Code](/Class.version)
+
+```js
+console.log(Artplayer.version);
+```
+
+## env
+
+- Type: `String`
+
+[Run Code](/Class.env)
+
+```js
+console.log(Artplayer.env);
+```
+
+## config
+
+- Type: `Object`
+
+[Run Code](/Class.config)
+
+```js
+console.log(Artplayer.config);
+```
+
+## utils
+
+- Type: `Object`
+
+[Run Code](/Class.utils)
+
+```js
+console.log(Artplayer.utils);
+```
+
+## option
+
+- Type: `Object`
+
+[Run Code](/Class.option)
+
+```js
+console.log(Artplayer.option);
+```
+
+## instances
+
+- Type: `Array`
+
+[Run Code](/Class.instances)
+
+```js
+console.log(Artplayer.instances.length);
+```
+
+## scheme
+
+- Type: `Object`
+
+[Run Code](/Class.scheme)
+
+```js
+console.log(Artplayer.scheme);
+```
+
+## Emitter
+
+- Type: `Function`
+
+[Run Code](/Class.Emitter)
+
+```js
+console.log(Artplayer.Emitter);
+```
+
+## validator
+
+- Type: `Function`
+
+[Run Code](/Class.validator)
+
+```js
+console.log(Artplayer.validator);
+```
+
+## kindOf
+
+- Type: `Function`
+
+[Run Code](/Class.kindOf)
+
+```js
+console.log(Artplayer.kindOf);
+```
diff --git a/docs/document/common.js b/docs/document/common.js
deleted file mode 100644
index 2357469a5..000000000
--- a/docs/document/common.js
+++ /dev/null
@@ -1,25 +0,0 @@
-(function () {
- window.runCode = function(hook) {
- hook.ready(function() {
- Array.from(document.querySelectorAll('.markdown-section a'))
- .filter(function(item) {
- return item.innerHTML === 'Run Code';
- })
- .forEach(function(item) {
- item.addEventListener('click', function(event) {
- event.preventDefault();
- var codeElement = item.parentElement.nextElementSibling;
- if (
- codeElement.tagName === 'PRE' &&
- codeElement.dataset.lang === 'js'
- ) {
- var libs = item.href.split('/lib=')[1] || '';
- var code = encodeURIComponent(codeElement.innerText);
- var url = 'https://artplayer.org/?libs=' + libs + '&code=' + code;
- window.open(url);
- }
- });
- });
- });
- };
-})();
diff --git a/docs/document/events.md b/docs/document/events.md
new file mode 100644
index 000000000..1357898be
--- /dev/null
+++ b/docs/document/events.md
@@ -0,0 +1,129 @@
+```js
+art.on('ready', function (args) {
+ console.log('The player can play');
+});
+```
+
+## Instance
+
+| Event | Description | Parameter |
+| --------------------- | --------------------------------------- | ----------------------- |
+| `ready` | When the video can be played | `undefined` |
+| `play` | When the video play | `undefined` |
+| `pause` | When the video pause | `undefined` |
+| `seek` | When the video seek | Video current time |
+| `volume` | When the video volume change | Video volume value |
+| `destroy` | When the instance is destroyed | `undefined` |
+| `focus` | When the player gets focus | `undefined` |
+| `blur` | When the player loses focus | `undefined` |
+| `hoverenter` | When the mouse is moved into the player | `undefined` |
+| `hoverleave` | When the mouse is moved out the player | `undefined` |
+| `resize` | When the player resize | Player size |
+| `mousemove` | When the mouse moves over the player | `undefined` |
+| `aspectRatioChange` | When aspect ratio change | Aspect ratio |
+| `aspectRatioRemove` | When aspect ratio remove | `undefined` |
+| `aspectRatioReset` | When aspect ratio reset | `undefined` |
+| `customType` | After triggering CustomType | Type name |
+| `urlChange` | After the video url change | Video url |
+| `autoSizeChange` | When the player auto size change | Player size |
+| `autoSizeRemove` | When the player auto size remove | `undefined` |
+| `flipChange` | When the player flip change | Flip name |
+| `flipRemove` | When the player flip remove | `undefined` |
+| `fullscreenChange` | When the full screen status change | Whether full screen |
+| `fullscreenWebChange` | When entering web full screen | Whether web full screen |
+| `pipChange` | When entering picture in picture | Whether in pip |
+| `minChange` | When entering min player | Whether in min player |
+| `playbackRateChange` | When playback rate change | Playback rate |
+| `playbackRateRemove` | When playback rate remove | `undefined` |
+| `playbackRateReset` | When playback rate reset | `undefined` |
+| `screenshot` | When a screenshot occurs | Image data uri |
+| `switch` | When switching video url | Video url |
+| `loopAdd` | When an interval loop is added | Interval arrary |
+| `loopRemove` | When the interval loop is deleted | `undefined` |
+| `loopStart` | When entering the interval cycle | Interval arrary |
+
+## Video (Native event)
+
+You can use all the native events of video directly: [MDN web docs - Media events](https://developer.mozilla.org/en-US/docs/Web/Guide/Events/Media_events).
+
+But be careful to add the `video` prefix in front of the event:
+
+```js
+art.on('video:canplay', function (event) {
+ console.log(event);
+});
+```
+
+## Subtitle
+
+| Event | Description | Parameter |
+| ----------------- | ----------------------------- | --------------------- |
+| `subtitle:update` | When the subtitles change | Current subtitle text |
+| `subtitle:switch` | When switching subtitles | Current subtitle url |
+| `subtitle:load` | When the subtitles loaded | Current subtitle url |
+| `subtitle:err` | When the subtitles load error | Error object |
+| `subtitle:toggle` | When displaying subtitles | Whether to show |
+
+## Notice
+
+| Event | Description | Parameter |
+| --------------- | ---------------------- | --------------- |
+| `notice:toggle` | When displaying notice | Whether to show |
+
+## Mask
+
+| Event | Description | Parameter |
+| ------------- | -------------------- | --------------- |
+| `mask:toggle` | When displaying mask | Whether to show |
+
+## Loading
+
+| Event | Description | Parameter |
+| ---------------- | ----------------------- | --------------- |
+| `loading:toggle` | When displaying loading | Whether to show |
+
+## Layer
+
+| Event | Description | Parameter |
+| -------------- | ----------------------- | ------------------- |
+| `layer:add` | When adding a new layer | Layer configuration |
+| `layer:toggle` | When displaying layer | Whether to show |
+
+## Info
+
+| Event | Description | Parameter |
+| ------------- | -------------------- | --------------- |
+| `info:toggle` | When displaying info | Whether to show |
+
+## Hotkey
+
+| Event | Description | Parameter |
+| -------- | ---------------------------- | ------------------- |
+| `hotkey` | When the hotkey is triggered | Hotkey event object |
+
+## Setting
+
+| Event | Description | Parameter |
+| ---------------- | ------------------------- | --------------------- |
+| `setting:add` | When adding a new setting | Setting configuration |
+| `setting:toggle` | When displaying setting | Whether to show |
+
+## Contextmenu
+
+| Event | Description | Parameter |
+| -------------------- | ----------------------------- | ------------------------- |
+| `contextmenu:add` | When adding a new contextmenu | Contextmenu configuration |
+| `contextmenu:toggle` | When displaying contextmenu | Whether to show |
+
+## Control
+
+| Event | Description | Parameter |
+| ---------------- | ------------------------- | --------------------- |
+| `control:add` | When adding a new control | Control configuration |
+| `control:toggle` | When displaying control | Whether to show |
+
+## Plugins
+
+| Event | Description | Parameter |
+| ------------ | ------------------------ | -------------------- |
+| `plugin:add` | When adding a new plugin | Plugin configuration |
diff --git a/docs/document/index.html b/docs/document/index.html
index c89fb6413..f6ab9f940 100644
--- a/docs/document/index.html
+++ b/docs/document/index.html
@@ -1,36 +1,69 @@
+