artplayer@5.0.7

This commit is contained in:
Harvey Zack committed 2023-05-13 22:27:12 +08:00
1 parent e3e42eb399
commit 6ab5aec6d1
123 files changed
+1878 -1767

No files matched your search

@@ -196,12 +196,35 @@ art.on('ready', () => {
});
```
## `switch`
- Type: `Setter`
- Parameter: `String`
设置视频地址,设置时和 `art.url` 类似,但会执行一些优化操作
<div className="run-code">▶ Run Code</div>
```js{9}
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
});
art.on('ready', () => {
art.seek = 10;
setTimeout(() => {
art.switch = '/assets/sample/video.mp4?t=0';
}, 3000);
});
```
## `switchUrl`
- Type: `Function`
- Parameter: `String`
设置视频地址,设置时和 `url` 类似,但会执行一些优化操作
设置视频地址,设置时和 `art.url` 类似,但会执行一些优化操作
<div className="run-code">▶ Run Code</div>
@@ -219,12 +242,18 @@ art.on('ready', () => {
});
```
:::warning 提示
`art.switch` 和 `art.switchUrl` 的功能是一样的,只是 `art.switchUrl` 方法会返回 `Promise`,当 `resolve` 时表示新地址是可以播放,`reject` 时表示新地址加载错误
:::
## `switchQuality`
- Type: `Function`
- Parameter: `String`
设置视频画质地址,和 `switchUrl` 类似,但会带上之前的播放进度
设置视频画质地址,和 `art.switchUrl` 类似,但会带上之前的播放进度
<div className="run-code">▶ Run Code</div>
@@ -925,6 +954,7 @@ art.on('ready', () => {
## `quality`
- Type: `Setter`
- Parameter: `Array`
动态设置画质列表
@@ -196,12 +196,35 @@ art.on('ready', () => {
});
```
## `switch`
- Type: `Setter`
- Parameter: `String`
Setting the video url is similar to that of `art.url`, but some optimization operations will be performed
<div className="run-code">▶ Run Code</div>
```js{9}
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
});
art.on('ready', () => {
art.seek = 10;
setTimeout(() => {
art.switch = '/assets/sample/video.mp4?t=0';
}, 3000);
});
```
## `switchUrl`
- Type: `Function`
- Parameter: `String`
Setting the video url is similar to that of `url`, but some optimization operations will be performed
Setting the video url is similar to that of `art.url`, but some optimization operations will be performed
<div className="run-code">▶ Run Code</div>
@@ -219,12 +242,18 @@ art.on('ready', () => {
});
```
:::warning Tip
The functions of `art.switch` and `art.switchUrl` are the same, except that the `art.switchUrl` method will return `Promise`, when `resolve` means that the new address can be played, and `reject` means that the new address is loaded error
:::
## `switchQuality`
- Type: `Function`
- Parameter: `String`
Set the video quality address, similar to `switchUrl`, but with the previous playback progress
Set the video quality address, similar to `art.switchUrl`, but with the previous playback progress
<div className="run-code">▶ Run Code</div>