mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 04:31:20 -08:00
update docs
This commit is contained in:
1 parent
d0f6d643a4
commit
93a517eaf8
53 files changed
+444
-245
No files matched your search
@@ -37,7 +37,9 @@ Then you can access the plugin function via `window.artplayerPluginDanmuku`
|
||||
|
||||
### Use the damuku array
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -83,6 +85,7 @@ var art = new Artplayer({
|
||||
useWorker: true, // whether to use web workers
|
||||
synchronousPlayback: false, // Whether to sync to playback speed
|
||||
filter: (danmu) => danmu.text.length < 50, // Barrage filter function
|
||||
// mount: document.querySelector('.your-danmu-input'), // Custom barrage input box position
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -90,7 +93,9 @@ var art = new Artplayer({
|
||||
|
||||
### Use the XML
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -107,7 +112,9 @@ var art = new Artplayer({
|
||||
|
||||
### Use asynchronous calls
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -147,7 +154,9 @@ var art = new Artplayer({
|
||||
|
||||
Hidden or show the danmuku by methods `hide` and `show`
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -183,7 +192,9 @@ var art = new Artplayer({
|
||||
|
||||
By attribute `ishide` judgment the current danmuku is hidden or displayed
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -218,7 +229,9 @@ var art = new Artplayer({
|
||||
|
||||
Send a real-time danmu by method `emit`
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -254,7 +267,9 @@ var art = new Artplayer({
|
||||
|
||||
Changing the danmu configuration in real time through method `config`, support attributes: `speed`, `margin`, `opacity`, `fontSize`, `synchronousPlayback`, `filter`
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
|
||||
@@ -37,7 +37,9 @@ import artplayerPluginDanmuku from 'artplayer-plugin-danmuku';
|
||||
|
||||
### 使用弹幕数组
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -83,6 +85,11 @@ var art = new Artplayer({
|
||||
useWorker: true, // 是否使用 web worker
|
||||
synchronousPlayback: false, // 是否同步到播放速度
|
||||
filter: (danmu) => danmu.text.length < 50, // 弹幕过滤函数
|
||||
|
||||
// mount 选项用于自定义弹幕输入框的挂载位置,默认挂载在播放器控制栏中间
|
||||
// 但在移动端下控制栏宽度不足,所以最好自己决定弹幕输入框放在那里
|
||||
// 移动端弹幕DEMO:http://artplayer.org/danmuku.html
|
||||
// mount: document.querySelector('.your-danmu-input'),
|
||||
}),
|
||||
],
|
||||
});
|
||||
@@ -90,7 +97,9 @@ var art = new Artplayer({
|
||||
|
||||
### 使用弹幕 XML
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -107,7 +116,9 @@ var art = new Artplayer({
|
||||
|
||||
### 使用异步调用
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -147,7 +158,9 @@ var art = new Artplayer({
|
||||
|
||||
通过方法 `hide` 和 `show` 进行隐藏或者显示弹幕
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -183,7 +196,9 @@ var art = new Artplayer({
|
||||
|
||||
通过属性 `isHide` 判断当前弹幕是隐藏或者显示
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -218,7 +233,9 @@ var art = new Artplayer({
|
||||
|
||||
通过方法 `emit` 发送一条实时弹幕
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
@@ -254,7 +271,9 @@ var art = new Artplayer({
|
||||
|
||||
通过方法 `config` 实时改变弹幕配置,支持属性有:`speed`、`margin`、`opacity`、`fontSize`、`synchronousPlayback`、`filter`
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">▶ Run Code</div>
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
|
||||
Reference in new issue
Block a user