mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
chore: Update package.json to set "private" flag to true
This commit is contained in:
1 parent
c08798fb05
commit
12b1c1d347
84 files changed
+1745
-1728
No files matched your search
@@ -201,12 +201,6 @@ export default class Danmuku {
|
||||
// 弹幕文本为空则直接忽略
|
||||
if (!danmu.text.trim()) return this;
|
||||
|
||||
// 弹幕模式只能是 0, 1, 2
|
||||
if (![0, 1, 2].includes(danmu.mode)) return this;
|
||||
|
||||
// 自定义弹幕过滤函数
|
||||
if (!this.option.filter(danmu)) return this;
|
||||
|
||||
// 设置弹幕时间,如果没有则默认为当前时间加 0.5 秒
|
||||
if (danmu.time) {
|
||||
danmu.time = clamp(danmu.time, 0, Infinity);
|
||||
@@ -234,6 +228,12 @@ export default class Danmuku {
|
||||
danmu.color = this.option.color;
|
||||
}
|
||||
|
||||
// 弹幕模式只能是 0, 1, 2
|
||||
if (![0, 1, 2].includes(danmu.mode)) return this;
|
||||
|
||||
// 自定义弹幕过滤函数
|
||||
if (!this.option.filter(danmu)) return this;
|
||||
|
||||
// 添加到实际弹幕队列
|
||||
this.queue.push({
|
||||
...danmu,
|
||||
|
||||
@@ -164,6 +164,7 @@ var art = new Artplayer({
|
||||
danmuku: [
|
||||
{
|
||||
text: '使用数组',
|
||||
time: 1
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -208,6 +209,7 @@ var art = new Artplayer({
|
||||
return resovle([
|
||||
{
|
||||
text: '使用 Promise 异步返回',
|
||||
time: 1
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -480,6 +482,10 @@ art.on('ready', () => {
|
||||
|
||||
## 事件
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
|
||||
@@ -164,6 +164,7 @@ var art = new Artplayer({
|
||||
danmuku: [
|
||||
{
|
||||
text: '使用数组',
|
||||
time: 1
|
||||
},
|
||||
],
|
||||
}),
|
||||
@@ -208,6 +209,7 @@ var art = new Artplayer({
|
||||
return resovle([
|
||||
{
|
||||
text: '使用 Promise 异步返回',
|
||||
time: 1
|
||||
},
|
||||
]);
|
||||
});
|
||||
@@ -480,6 +482,10 @@ art.on('ready', () => {
|
||||
|
||||
## 事件
|
||||
|
||||
<div className="run-code" data-libs="./uncompiled/artplayer-plugin-danmuku/index.js">
|
||||
▶ Run Code
|
||||
</div>
|
||||
|
||||
```js
|
||||
var art = new Artplayer({
|
||||
container: '.artplayer-app',
|
||||
|
||||
Reference in new issue
Block a user