mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
Update README.md
This commit is contained in:
1 parent
d0939d5b65
commit
150e43d325
1 file changed
+118
-41
+118
-41
@@ -531,6 +531,89 @@ var art = new Artplayer({
|
|||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## subtitleOffset
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
Subtitle time offset plugin
|
||||||
|
|
||||||
|
[Run Code](/)
|
||||||
|
|
||||||
|
```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,
|
||||||
|
subtitleOffset: true,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## miniProgressBar
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
Mini progress bar plugin
|
||||||
|
|
||||||
|
[Run Code](/)
|
||||||
|
|
||||||
|
```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',
|
||||||
|
miniProgressBar: true,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## localPreview
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
Local Preview plugin
|
||||||
|
|
||||||
|
[Run Code](/)
|
||||||
|
|
||||||
|
```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',
|
||||||
|
localPreview: true,
|
||||||
|
controls: [
|
||||||
|
{
|
||||||
|
name: 'preview',
|
||||||
|
position: 'right',
|
||||||
|
html: 'OPEN',
|
||||||
|
mounted: $preview => {
|
||||||
|
art.plugins.localPreview.attach($preview);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
|
## autoPip
|
||||||
|
|
||||||
|
- Type: `Boolean`
|
||||||
|
- Default: `false`
|
||||||
|
|
||||||
|
Auto pip mode plugin, when the video is playing and not triggering in the window view
|
||||||
|
|
||||||
|
[Run Code](/)
|
||||||
|
|
||||||
|
```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',
|
||||||
|
autoPip: true,
|
||||||
|
});
|
||||||
|
```
|
||||||
|
|
||||||
## subtitle
|
## subtitle
|
||||||
|
|
||||||
- Type: `Object`
|
- Type: `Object`
|
||||||
@@ -867,35 +950,35 @@ setTimeout(function() {
|
|||||||
|
|
||||||
Player core function
|
Player core function
|
||||||
|
|
||||||
| propertie | type | Description |
|
| propertie | type | Description |
|
||||||
| ---------------------- | ---------- | ------------------------------------------------------------------------------------------------- |
|
| --------------------- | ---------- | ------------------------------------------------------------------------------------------------- |
|
||||||
| `aspectRatio` | `String` | Set aspect ratio, Currently only accepts three values:`default`, `4:3`, `16:9` and `false` |
|
| `aspectRatio` | `String` | Set aspect ratio, Currently only accepts three values:`default`, `4:3`, `16:9` and `false` |
|
||||||
| `aspectRatioReset` | `Boolean` | Recalculate the aspect ratio |
|
| `aspectRatioReset` | `Boolean` | Recalculate the aspect ratio |
|
||||||
| `attachUrl` | `Function` | Replace play address |
|
| `attachUrl` | `Function` | Replace play address |
|
||||||
| `autoSize` | `Boolean` | Set auto size |
|
| `autoSize` | `Boolean` | Set auto size |
|
||||||
| `currentTime` | `Number` | `Getter` and `Setter` of the current time |
|
| `currentTime` | `Number` | `Getter` and `Setter` of the current time |
|
||||||
| `duration` | `Number` | `Getter` of the duration |
|
| `duration` | `Number` | `Getter` of the duration |
|
||||||
| `flip` | `String` | Set flip, Currently only accepts three values:`normal`, `horizontal`, `vertical` and `false` |
|
| `flip` | `String` | Set flip, Currently only accepts three values:`normal`, `horizontal`, `vertical` and `false` |
|
||||||
| `fullscreen` | `Boolean` | Enable or disable fullscreen |
|
| `fullscreen` | `Boolean` | Enable or disable fullscreen |
|
||||||
| `fullscreenToggle` | `Boolean` | Toggle fullscreen |
|
| `fullscreenToggle` | `Boolean` | Toggle fullscreen |
|
||||||
| `fullscreenWeb` | `Boolean` | Enable or disable web fullscreen |
|
| `fullscreenWeb` | `Boolean` | Enable or disable web fullscreen |
|
||||||
| `fullscreenWebToggle` | `Boolean` | Toggle web fullscreen |
|
| `fullscreenWebToggle` | `Boolean` | Toggle web fullscreen |
|
||||||
| `loaded` | `Number` | Return the proportion of the load |
|
| `loaded` | `Number` | Return the proportion of the load |
|
||||||
| `pause` | `Boolean` | Pause playback |
|
| `pause` | `Boolean` | Pause playback |
|
||||||
| `pip` | `Boolean` | Enable or disable pip |
|
| `pip` | `Boolean` | Enable or disable pip |
|
||||||
| `pipToggle` | `Boolean` | Toggle pip |
|
| `pipToggle` | `Boolean` | Toggle pip |
|
||||||
| `playbackRate` | `String` | Set playbackRate, Currently only accepts three values:`0.5`, `0.75`, `1.0`, `1.25`, `1.5`, `2.0` |
|
| `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 |
|
| `playbackRateReset` | `Boolean` | Recalculate the playback rate |
|
||||||
| `played` | `Number` | Return the proportion of the played |
|
| `played` | `Number` | Return the proportion of the played |
|
||||||
| `playing` | `Boolean` | Return to playing state |
|
| `playing` | `Boolean` | Return to playing state |
|
||||||
| `play` | `Boolean` | Start playback |
|
| `play` | `Boolean` | Start playback |
|
||||||
| `screenshot` | `Function` | Download a screenshot of current time |
|
| `screenshot` | `Function` | Download a screenshot of current time |
|
||||||
| `seek` | `Number` | Set the current time |
|
| `seek` | `Number` | Set the current time |
|
||||||
| `switchQuality` | `Function` | Switch quality |
|
| `switchQuality` | `Function` | Switch quality |
|
||||||
| `switchUrl` | `Function` | Switch video url |
|
| `switchUrl` | `Function` | Switch video url |
|
||||||
| `toggle` | `Boolean` | Toggle play and pause |
|
| `toggle` | `Boolean` | Toggle play and pause |
|
||||||
| `volume` | `Number` | `Getter` and `Setter` of the current volume |
|
| `volume` | `Number` | `Getter` and `Setter` of the current volume |
|
||||||
| `muted` | `Boolean` | `Getter` and `Setter` of the muted |
|
| `muted` | `Boolean` | `Getter` and `Setter` of the muted |
|
||||||
|
|
||||||
[Run Code](/)
|
[Run Code](/)
|
||||||
|
|
||||||
@@ -1066,7 +1149,6 @@ Controls manager, and every control has `show` setter
|
|||||||
| `add` | `Function` | Dynamically add a control |
|
| `add` | `Function` | Dynamically add a control |
|
||||||
| `show` | `setter` | Show or hide |
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
[Run Code](/)
|
[Run Code](/)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -1102,7 +1184,6 @@ Contextmenu manager, and every contextmenu has `show` setter
|
|||||||
| `add` | `Function` | Dynamically add a contextmenu |
|
| `add` | `Function` | Dynamically add a contextmenu |
|
||||||
| `show` | `setter` | Show or hide |
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
[Run Code](/)
|
[Run Code](/)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -1129,7 +1210,6 @@ art.contextmenu.yourContextmenu.show = false;
|
|||||||
| `init` | `Function` | Init subtitle |
|
| `init` | `Function` | Init subtitle |
|
||||||
| `show` | `setter` | Show or hide |
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
[Run Code](/)
|
[Run Code](/)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
@@ -1151,19 +1231,17 @@ art.once('video:canplay', () => {
|
|||||||
|
|
||||||
- Type: `Object`
|
- Type: `Object`
|
||||||
|
|
||||||
| propertie | type | Description |
|
| propertie | type | Description |
|
||||||
| --------- | ---------- | ------------ |
|
| --------- | -------- | ------------ |
|
||||||
| `show` | `setter` | Show or hide |
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
## mask
|
## mask
|
||||||
|
|
||||||
- Type: `Object`
|
- Type: `Object`
|
||||||
|
|
||||||
| propertie | type | Description |
|
| propertie | type | Description |
|
||||||
| --------- | ---------- | ----------- |
|
| --------- | -------- | ------------ |
|
||||||
| `show` | `setter` | Show or hide|
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
## setting
|
## setting
|
||||||
|
|
||||||
@@ -1176,7 +1254,6 @@ Setting manager, and every setting has `show` and `hide` funciton
|
|||||||
| `add` | `Function` | Dynamically add a setting |
|
| `add` | `Function` | Dynamically add a setting |
|
||||||
| `show` | `setter` | Show or hide |
|
| `show` | `setter` | Show or hide |
|
||||||
|
|
||||||
|
|
||||||
[Run Code](/)
|
[Run Code](/)
|
||||||
|
|
||||||
```js
|
```js
|
||||||
|
|||||||
Reference in new issue
Block a user