Files
ArtPlayer/docs/assets/ts/artplayer-plugin-danmuku.d.ts
T
Harvey Zack 699135afcf Danmuku (#759)
* chore: Bump artplayer-plugin-danmuku version to 5.1.0

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Refactor getDanmuTop function to handle additional cases

* chore: Refactor getDanmuTop function to handle additional cases

* chore: Update danmuku plugin with new mount option

* chore: Update danmuku plugin with new mount option

* chore: Refactor danmuku plugin to always create a new Setting instance

* Refactor danmuku plugin to always create a new Setting instance

* Refactor danmuku plugin to always create a new Setting instance

* Update danmuku.js

* Update danmuku.js

* Refactor danmuku plugin to include a new Setting instance

* Refactor danmuku plugin to include a new Setting instance

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* Refactor danmuku plugin styles for better alignment and spacing

* chore: Update package.json files

* Refactor danmuku plugin to remove unnecessary whitespace in the setting template

* chore: Remove ESLint configuration files and update npm dependencies

* chore: Update ESLint configuration to disable console warnings and fix unused variable warnings

* chore: Update ESLint configuration to fix quotes rule

* Update package.json

* Update package.json

* Update setting.js

* chore: Compress CSS code in build script

* chore: Update build script to compress JavaScript code

* chore: Update build script to compress JavaScript code

* chore: Refactor setting.js to improve code organization and remove unused variables

* chore: Add isHover flag to Control component for better control hiding behavior

* chore: Update Control component to use $bottom instead of $controls for better control hiding behavior

* Update package.json

* Update package.json

* Update package.json

* chore: Update lerna.json to use independent versioning and yarn as npm client

* refactor: Update Danmuku class to support configurable modes and visibility

* refactor: Update Danmuku styles for better visibility and configurability

* feat: Update font weight in Danmuku styles for better readability

* refactor: Update Danmuku class to support configurable modes and visibility

* refactor: Add opacity, area, font, and speed sliders to Danmuku settings

* refactor: Initialize sliders for opacity, area, font, and speed in Danmuku settings

* feat: Add slider UI for opacity, area, and speed in Danmuku settings

* feat: Update slider styles in Danmuku settings for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* refactor: Update slider styles in Danmuku settings for better visibility and configurability

* refactor: Update margin slider initialization in Danmuku settings

* refactor: Update slider styles and initialization in Danmuku settings

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku class to support configurable visibility

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Improve Danmuku settings UI for better visibility and configurability

* add lock

* refactor: Add lock and unlock methods to Danmuku settings

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* Update artplayer-plugin-danmuku.d.ts

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings event listeners

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability

* refactor: Update Danmuku settings UI for better visibility and configurability
2024-05-26 14:57:22 +08:00

215 lines
3.8 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type Artplayer from 'artplayer';
export = artplayerPluginDanmuku;
export as namespace artplayerPluginDanmuku;
type Mode = 0 | 1 | 2;
type Danmu = {
/**
* 弹幕文本
*/
text: string;
/**
* 弹幕发送模式: 0: 滚动,1: 顶部,2: 底部
*/
mode?: Mode;
/**
* 弹幕颜色
*/
color?: string;
/**
* 弹幕出现的时间,单位为秒
*/
time?: number;
/**
* 弹幕是否有描边, 默认为 false
*/
border?: boolean;
/**
* 弹幕自定义样式
*/
style?: Partial<CSSStyleDeclaration>;
/**
* 弹幕文本是否转义, 默认为 true
*/
escape?: boolean;
};
type Option = {
/**
* 弹幕数据: 函数,数组,Promise,URL
*/
danmuku: Danmu[] | string | (() => Promise<Danmu[]>) | Promise<Danmu[]>;
/**
* 弹幕持续时间,范围在[1 ~ 10]
*/
speed?: number;
/**
* 弹幕上下边距,支持像素数字和百分比
*/
margin?: [number | `${number}%`, number | `${number}%`];
/**
* 弹幕透明度,范围在[0 ~ 1]
*/
opacity?: number;
/**
* 默认弹幕颜色,可以被单独弹幕项覆盖
*/
color?: string;
/**
* 弹幕模式: 0: 滚动,1: 顶部,2: 底部
*/
mode?: Mode;
/**
* 幕可见的模式
*/
modes?: Mode[];
/**
* 弹幕字体大小,支持像素数字和百分比
*/
fontSize?: number | `${number}%`;
/**
* 弹幕是否防重叠
*/
antiOverlap?: boolean;
/**
* 是否同步播放速度
*/
synchronousPlayback?: boolean;
/**
* 弹幕发射器挂载点, 默认为播放器控制栏中部
*/
mount?: Element;
/**
* 是否开启弹幕热度图
*/
heatmap?:
| boolean
| {
xMin?: number;
xMax?: number;
yMin?: number;
yMax?: number;
scale?: number;
opacity?: number;
minHeight?: number;
sampling?: number;
smoothing?: number;
flattening?: number;
};
/**
* 热力图数据
*/
points?: any[];
/**
* 弹幕载入前的过滤器,只支持返回布尔值
*/
filter?: (danmu: Danmu) => boolean;
/**
* 弹幕发送前的过滤器,支持返回 Promise
*/
beforeEmit?: (danmu: Danmu) => boolean | (() => Promise<boolean>);
/**
* 弹幕显示前的过滤器,支持返回 Promise
*/
beforeVisible?: (danmu: Danmu) => boolean | (() => Promise<boolean>);
/**
* 弹幕是否可见
*/
visible?: boolean;
/**
* 弹幕输入框最大长度, 范围在[1 ~ 1000]
*/
maxLength?: number;
/**
* 输入框锁定时间,范围在[1 ~ 60]
*/
lockTime?: number;
/**
* 弹幕主题,只在自定义挂载时生效
*/
theme?: 'light' | 'dark';
};
type Danmuku = {
name: 'artplayerPluginDanmuku';
/**
* 发送一条实时弹幕
*/
emit: (danmu: Danmu) => Danmuku;
/**
* 重载弹幕源,或者切换新弹幕
*/
load: () => Promise<Danmuku>;
/**
* 实时改变弹幕配置
*/
config: (option: Option) => Danmuku;
/**
* 隐藏弹幕层
*/
hide: () => Danmuku;
/**
* 显示弹幕层
*/
show: () => Danmuku;
/**
* 挂载弹幕输入框
*/
mount: (el?: Element) => void;
/**
* 重置弹幕
*/
reset: () => void;
/**
* 弹幕配置
*/
option: Option;
/**
* 是否隐藏弹幕层
*/
isHide: boolean;
/**
* 是否弹幕层停止状态
*/
isStop: boolean;
};
declare const artplayerPluginDanmuku: (option: Option) => (art: Artplayer) => Danmuku;