mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
update docs
This commit is contained in:
1 parent
887792c853
commit
d50e22ea9b
50 files changed
+164
-161
No files matched your search
@@ -58,13 +58,16 @@ The constructor accepts a function as the second parameter, fired when the playe
|
||||
<div className="run-code">▶ Run Code</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
muted: true,
|
||||
}, function() {
|
||||
this.play();
|
||||
});
|
||||
var art = new Artplayer(
|
||||
{
|
||||
container: '.artplayer-app',
|
||||
url: '/assets/sample/video.mp4',
|
||||
muted: true,
|
||||
},
|
||||
function () {
|
||||
this.play();
|
||||
},
|
||||
);
|
||||
```
|
||||
|
||||
:::tip 提示
|
||||
@@ -612,9 +615,9 @@ var art = new Artplayer({
|
||||
html: 'Submenu 02',
|
||||
},
|
||||
],
|
||||
onSelect: function(item) {
|
||||
onSelect: function (item) {
|
||||
console.log(item.html);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
html: 'Custom setting 02',
|
||||
@@ -626,9 +629,9 @@ var art = new Artplayer({
|
||||
html: 'Submenu 02',
|
||||
},
|
||||
],
|
||||
onSelect: function(item) {
|
||||
onSelect: function (item) {
|
||||
console.log(item.html);
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
@@ -966,14 +969,11 @@ var art = new Artplayer({
|
||||
icons: {
|
||||
loading: '<img src="/assets/img/ploading.gif">',
|
||||
state: '<img src="/assets/img/state.png">',
|
||||
loading: '',
|
||||
state: '',
|
||||
play: '',
|
||||
pause: '',
|
||||
check: '',
|
||||
volume: '',
|
||||
volumeClose: '',
|
||||
subtitle: '',
|
||||
screenshot: '',
|
||||
setting: '',
|
||||
pip: '',
|
||||
@@ -983,11 +983,14 @@ var art = new Artplayer({
|
||||
aspectRatio: '',
|
||||
config: '',
|
||||
lock: '',
|
||||
flip: '',
|
||||
unlock: '',
|
||||
fullscreenOff: '',
|
||||
fullscreenOn: '',
|
||||
fullscreenWebOff: '',
|
||||
fullscreenWebOn: '',
|
||||
switchOn: '',
|
||||
switchOff: '',
|
||||
indicator: '',
|
||||
},
|
||||
});
|
||||
@@ -1120,4 +1123,4 @@ var art = new Artplayer({
|
||||
url: '/assets/sample/video.mp4',
|
||||
autoOrientation: true,
|
||||
});
|
||||
```
|
||||
```
|
||||
@@ -967,14 +967,11 @@ var art = new Artplayer({
|
||||
icons: {
|
||||
loading: '<img src="/assets/img/ploading.gif">',
|
||||
state: '<img src="/assets/img/state.png">',
|
||||
loading: '',
|
||||
state: '',
|
||||
play: '',
|
||||
pause: '',
|
||||
check: '',
|
||||
volume: '',
|
||||
volumeClose: '',
|
||||
subtitle: '',
|
||||
screenshot: '',
|
||||
setting: '',
|
||||
pip: '',
|
||||
@@ -984,11 +981,14 @@ var art = new Artplayer({
|
||||
aspectRatio: '',
|
||||
config: '',
|
||||
lock: '',
|
||||
flip: '',
|
||||
unlock: '',
|
||||
fullscreenOff: '',
|
||||
fullscreenOn: '',
|
||||
fullscreenWebOff: '',
|
||||
fullscreenWebOn: '',
|
||||
switchOn: '',
|
||||
switchOff: '',
|
||||
indicator: '',
|
||||
},
|
||||
});
|
||||
|
||||
@@ -73,11 +73,11 @@ var art = new Artplayer({
|
||||
mode: 1,
|
||||
},
|
||||
],
|
||||
speed: 5, // 全局持续时间
|
||||
opacity: 1, // 全局透明度
|
||||
size: 25, // 全局字体大小
|
||||
margin: ['10%', 20], // 距离顶部和距离底部的高度值
|
||||
antiOverlap: true, // 防重叠
|
||||
speed: 5, // 弹幕持续时间,单位秒,范围在[1 ~ 10]
|
||||
opacity: 1, // 弹幕透明度,范围在[0 ~ 1]
|
||||
size: 25, // 字体大小,支持数字和百分比
|
||||
margin: ['10%', 20], // 弹幕上下边距,支持数字和百分比
|
||||
antiOverlap: true, // 是否防重叠
|
||||
useWorker: true, // 是否使用 web worker
|
||||
synchronousPlayback: false, // 是否同步到播放速度
|
||||
filter: (danmu) => danmu.text.length <= 50, // 弹幕过滤函数
|
||||
|
||||
Reference in new issue
Block a user