mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 21:01:20 -08:00
build all
Refactor utility functions for improved readability and consistency - Updated compatibility.js to use consistent line endings and formatting. - Refactored component.js for better readability and structure, including consistent use of arrow functions and binding. - Simplified dom.js functions with consistent formatting and improved readability. - Enhanced emitter.js with consistent formatting and arrow function usage. - Streamlined error.js for improved readability and consistency. - Refactored file.js to use consistent formatting and improved readability. - Improved format.js functions for better readability and consistency. - Updated index.js to maintain consistent export formatting. - Refactored property.js for improved readability and consistency. - Enhanced subtitle.js with consistent formatting and improved readability. - Refactored time.js for better readability and consistent formatting. fix: update lint script to target only source files for consistency Revert "fix: restore export statements for various plugins and update type definitions for better clarity" This reverts commit b5e969d81ec765cd8a34b06e6ef4f232ef25087f. fix: restore export statements for various plugins and update type definitions for better clarity Refactor type definitions to use interfaces instead of type aliases for better extensibility and clarity across i18n, icons, option, player, quality, setting, subtitle, template, and utils modules.
This commit is contained in:
1 parent
532dd67cfd
commit
35ad9883af
447 files changed
+18248
-17946
No files matched your search
+40
-40
@@ -1,52 +1,52 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginAds;
|
||||
export = artplayerPluginAds
|
||||
export as namespace artplayerPluginAds;
|
||||
|
||||
type Option = {
|
||||
/**
|
||||
* 广告源文本,支持视频链接、图片链接、HTML文本
|
||||
*/
|
||||
source: string;
|
||||
interface Option {
|
||||
/**
|
||||
* 广告源文本,支持视频链接、图片链接、HTML文本
|
||||
*/
|
||||
source: string
|
||||
|
||||
/**
|
||||
* 知名广告的类型:'video' | 'image' | 'html'
|
||||
*/
|
||||
type: 'video' | 'image' | 'html';
|
||||
/**
|
||||
* 知名广告的类型:'video' | 'image' | 'html'
|
||||
*/
|
||||
type: 'video' | 'image' | 'html'
|
||||
|
||||
/**
|
||||
* 广告必看的时长,单位为秒
|
||||
*/
|
||||
playDuration?: number;
|
||||
/**
|
||||
* 广告必看的时长,单位为秒
|
||||
*/
|
||||
playDuration?: number
|
||||
|
||||
/**
|
||||
* 广告总的时长,单位为秒
|
||||
*/
|
||||
totalDuration?: number;
|
||||
/**
|
||||
* 广告总的时长,单位为秒
|
||||
*/
|
||||
totalDuration?: number
|
||||
|
||||
/**
|
||||
* 视频广告是否默认静音
|
||||
*/
|
||||
muted?: boolean;
|
||||
};
|
||||
/**
|
||||
* 视频广告是否默认静音
|
||||
*/
|
||||
muted?: boolean
|
||||
}
|
||||
|
||||
type Ads = {
|
||||
name: 'artplayerPluginAds';
|
||||
interface Ads {
|
||||
name: 'artplayerPluginAds'
|
||||
|
||||
/**
|
||||
* 跳过广告
|
||||
*/
|
||||
skip: () => void;
|
||||
/**
|
||||
* 跳过广告
|
||||
*/
|
||||
skip: () => void
|
||||
|
||||
/**
|
||||
* 暂停广告
|
||||
*/
|
||||
pause: () => void;
|
||||
/**
|
||||
* 暂停广告
|
||||
*/
|
||||
pause: () => void
|
||||
|
||||
/**
|
||||
* 播放广告
|
||||
*/
|
||||
play: () => void;
|
||||
};
|
||||
/**
|
||||
* 播放广告
|
||||
*/
|
||||
play: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads;
|
||||
declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads
|
||||
+15
-15
@@ -1,20 +1,20 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginAmbilight;
|
||||
export = artplayerPluginAmbilight
|
||||
export as namespace artplayerPluginAmbilight;
|
||||
|
||||
type Option = {
|
||||
blur?: string;
|
||||
opacity?: number;
|
||||
frequency?: number;
|
||||
zIndex?: number;
|
||||
duration?: number;
|
||||
};
|
||||
interface Option {
|
||||
blur?: string
|
||||
opacity?: number
|
||||
frequency?: number
|
||||
zIndex?: number
|
||||
duration?: number
|
||||
}
|
||||
|
||||
type Result = {
|
||||
name: 'artplayerPluginAmbilight';
|
||||
start: () => void;
|
||||
stop: () => void;
|
||||
};
|
||||
interface Result {
|
||||
name: 'artplayerPluginAmbilight'
|
||||
start: () => void
|
||||
stop: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginAmbilight: (option: Option) => (art: Artplayer) => Result;
|
||||
declare const artplayerPluginAmbilight: (option: Option) => (art: Artplayer) => Result
|
||||
+14
-14
@@ -1,26 +1,26 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginAsr;
|
||||
export = artplayerPluginAsr
|
||||
export as namespace artplayerPluginAsr;
|
||||
|
||||
interface AudioChunk {
|
||||
pcm: ArrayBuffer;
|
||||
wav: ArrayBuffer;
|
||||
pcm: ArrayBuffer
|
||||
wav: ArrayBuffer
|
||||
}
|
||||
|
||||
interface AsrPluginOption {
|
||||
length?: number;
|
||||
interval?: number;
|
||||
sampleRate?: number;
|
||||
autoHideTimeout?: number;
|
||||
onAudioChunk?: (chunk: AudioChunk) => void | Promise<void>;
|
||||
length?: number
|
||||
interval?: number
|
||||
sampleRate?: number
|
||||
autoHideTimeout?: number
|
||||
onAudioChunk?: (chunk: AudioChunk) => void | Promise<void>
|
||||
}
|
||||
|
||||
interface AsrPluginInstance {
|
||||
name: 'artplayerPluginAsr';
|
||||
stop: () => void;
|
||||
hide: () => void;
|
||||
append: (subtitle: string) => void;
|
||||
name: 'artplayerPluginAsr'
|
||||
stop: () => void
|
||||
hide: () => void
|
||||
append: (subtitle: string) => void
|
||||
}
|
||||
|
||||
declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer) => AsrPluginInstance;
|
||||
declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer) => AsrPluginInstance
|
||||
+12
-12
@@ -1,17 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginAutoThumbnail;
|
||||
export = artplayerPluginAutoThumbnail
|
||||
export as namespace artplayerPluginAutoThumbnail;
|
||||
|
||||
type Option = {
|
||||
url?: string;
|
||||
width?: number;
|
||||
number?: number;
|
||||
scale?: number;
|
||||
};
|
||||
interface Option {
|
||||
url?: string
|
||||
width?: number
|
||||
number?: number
|
||||
scale?: number
|
||||
}
|
||||
|
||||
type Result = {
|
||||
name: 'artplayerPluginAutoThumbnail';
|
||||
};
|
||||
interface Result {
|
||||
name: 'artplayerPluginAutoThumbnail'
|
||||
}
|
||||
|
||||
declare const artplayerPluginAutoThumbnail: (option: Option) => (art: Artplayer) => Result;
|
||||
declare const artplayerPluginAutoThumbnail: (option: Option) => (art: Artplayer) => Result
|
||||
+14
-14
@@ -1,21 +1,21 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginChapter;
|
||||
export = artplayerPluginChapter
|
||||
export as namespace artplayerPluginChapter;
|
||||
|
||||
type Chapters = {
|
||||
start: number;
|
||||
end: number;
|
||||
title: string;
|
||||
}[];
|
||||
start: number
|
||||
end: number
|
||||
title: string
|
||||
}[]
|
||||
|
||||
type Option = {
|
||||
chapters?: Chapters;
|
||||
};
|
||||
interface Option {
|
||||
chapters?: Chapters
|
||||
}
|
||||
|
||||
type Result = {
|
||||
name: 'artplayerPluginChapter';
|
||||
update: (option: Option) => void;
|
||||
};
|
||||
interface Result {
|
||||
name: 'artplayerPluginChapter'
|
||||
update: (option: Option) => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginChapter: (option: Option) => (art: Artplayer) => Result;
|
||||
declare const artplayerPluginChapter: (option: Option) => (art: Artplayer) => Result
|
||||
+12
-12
@@ -1,17 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginChromecast;
|
||||
export = artplayerPluginChromecast
|
||||
export as namespace artplayerPluginChromecast;
|
||||
|
||||
type Option = {
|
||||
url?: string;
|
||||
sdk?: string;
|
||||
icon?: string;
|
||||
mimeType?: string;
|
||||
};
|
||||
interface Option {
|
||||
url?: string
|
||||
sdk?: string
|
||||
icon?: string
|
||||
mimeType?: string
|
||||
}
|
||||
|
||||
type Chromecast = {
|
||||
name: 'artplayerPluginChromecast';
|
||||
};
|
||||
interface Chromecast {
|
||||
name: 'artplayerPluginChromecast'
|
||||
}
|
||||
|
||||
declare const artplayerPluginChromecast: (option: Option) => (art: Artplayer) => Chromecast;
|
||||
declare const artplayerPluginChromecast: (option: Option) => (art: Artplayer) => Chromecast
|
||||
+20
-20
@@ -1,25 +1,25 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginDanmukuMask;
|
||||
export = artplayerPluginDanmukuMask
|
||||
export as namespace artplayerPluginDanmukuMask;
|
||||
|
||||
type Option = {
|
||||
solutionPath?: string;
|
||||
modelSelection?: number;
|
||||
smoothSegmentation?: boolean;
|
||||
minDetectionConfidence?: number;
|
||||
minTrackingConfidence?: number;
|
||||
selfieMode?: boolean;
|
||||
drawContour?: boolean;
|
||||
foregroundThreshold?: number;
|
||||
opacity?: number;
|
||||
maskBlurAmount?: number;
|
||||
};
|
||||
interface Option {
|
||||
solutionPath?: string
|
||||
modelSelection?: number
|
||||
smoothSegmentation?: boolean
|
||||
minDetectionConfidence?: number
|
||||
minTrackingConfidence?: number
|
||||
selfieMode?: boolean
|
||||
drawContour?: boolean
|
||||
foregroundThreshold?: number
|
||||
opacity?: number
|
||||
maskBlurAmount?: number
|
||||
}
|
||||
|
||||
type Result = {
|
||||
name: 'artplayerPluginDanmukuMask';
|
||||
start: () => Promise<void>;
|
||||
stop: () => void;
|
||||
};
|
||||
interface Result {
|
||||
name: 'artplayerPluginDanmukuMask'
|
||||
start: () => Promise<void>
|
||||
stop: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginDanmukuMask: (option?: Option) => (art: Artplayer) => Result;
|
||||
declare const artplayerPluginDanmukuMask: (option?: Option) => (art: Artplayer) => Result
|
||||
+206
-206
@@ -1,255 +1,255 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginDanmuku;
|
||||
export = artplayerPluginDanmuku
|
||||
export as namespace artplayerPluginDanmuku;
|
||||
|
||||
type Mode = 0 | 1 | 2;
|
||||
type Danmuku = Danmu[] | string | (() => Promise<Danmu[]>) | Promise<Danmu[]>;
|
||||
type Mode = 0 | 1 | 2
|
||||
type Danmuku = Danmu[] | string | (() => Promise<Danmu[]>) | Promise<Danmu[]>
|
||||
|
||||
type Slider = {
|
||||
min?: number;
|
||||
max?: number;
|
||||
steps?: {
|
||||
name?: string;
|
||||
value?: any;
|
||||
show?: boolean;
|
||||
}[];
|
||||
};
|
||||
interface Slider {
|
||||
min?: number
|
||||
max?: number
|
||||
steps?: {
|
||||
name?: string
|
||||
value?: any
|
||||
show?: boolean
|
||||
}[]
|
||||
}
|
||||
|
||||
type Danmu = {
|
||||
/**
|
||||
* 弹幕文本
|
||||
*/
|
||||
text: string;
|
||||
interface Danmu {
|
||||
/**
|
||||
* 弹幕文本
|
||||
*/
|
||||
text: string
|
||||
|
||||
/**
|
||||
* 弹幕发送模式: 0: 滚动,1: 顶部,2: 底部
|
||||
*/
|
||||
mode?: Mode;
|
||||
/**
|
||||
* 弹幕发送模式: 0: 滚动,1: 顶部,2: 底部
|
||||
*/
|
||||
mode?: Mode
|
||||
|
||||
/**
|
||||
* 弹幕颜色
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* 弹幕颜色
|
||||
*/
|
||||
color?: string
|
||||
|
||||
/**
|
||||
* 弹幕出现的时间,单位为秒
|
||||
*/
|
||||
time?: number;
|
||||
/**
|
||||
* 弹幕出现的时间,单位为秒
|
||||
*/
|
||||
time?: number
|
||||
|
||||
/**
|
||||
* 弹幕是否有描边, 默认为 false
|
||||
*/
|
||||
border?: boolean;
|
||||
/**
|
||||
* 弹幕是否有描边, 默认为 false
|
||||
*/
|
||||
border?: boolean
|
||||
|
||||
/**
|
||||
* 弹幕自定义样式
|
||||
*/
|
||||
style?: Partial<CSSStyleDeclaration>;
|
||||
};
|
||||
/**
|
||||
* 弹幕自定义样式
|
||||
*/
|
||||
style?: Partial<CSSStyleDeclaration>
|
||||
}
|
||||
|
||||
type Option = {
|
||||
/**
|
||||
* 弹幕数据: 函数,数组,Promise,URL
|
||||
*/
|
||||
danmuku: Danmuku;
|
||||
interface Option {
|
||||
/**
|
||||
* 弹幕数据: 函数,数组,Promise,URL
|
||||
*/
|
||||
danmuku: Danmuku
|
||||
|
||||
/**
|
||||
* 弹幕持续时间,范围在[1 ~ 10]
|
||||
*/
|
||||
speed?: number;
|
||||
/**
|
||||
* 弹幕持续时间,范围在[1 ~ 10]
|
||||
*/
|
||||
speed?: number
|
||||
|
||||
/**
|
||||
* 弹幕上下边距,支持像素数字和百分比
|
||||
*/
|
||||
margin?: [number | `${number}%`, number | `${number}%`];
|
||||
/**
|
||||
* 弹幕上下边距,支持像素数字和百分比
|
||||
*/
|
||||
margin?: [number | `${number}%`, number | `${number}%`]
|
||||
|
||||
/**
|
||||
* 弹幕透明度,范围在[0 ~ 1]
|
||||
*/
|
||||
opacity?: number;
|
||||
/**
|
||||
* 弹幕透明度,范围在[0 ~ 1]
|
||||
*/
|
||||
opacity?: number
|
||||
|
||||
/**
|
||||
* 默认弹幕颜色,可以被单独弹幕项覆盖
|
||||
*/
|
||||
color?: string;
|
||||
/**
|
||||
* 默认弹幕颜色,可以被单独弹幕项覆盖
|
||||
*/
|
||||
color?: string
|
||||
|
||||
/**
|
||||
* 弹幕模式: 0: 滚动,1: 顶部,2: 底部
|
||||
*/
|
||||
mode?: Mode;
|
||||
/**
|
||||
* 弹幕模式: 0: 滚动,1: 顶部,2: 底部
|
||||
*/
|
||||
mode?: Mode
|
||||
|
||||
/**
|
||||
* 弹幕可见的模式
|
||||
*/
|
||||
modes?: Mode[];
|
||||
/**
|
||||
* 弹幕可见的模式
|
||||
*/
|
||||
modes?: Mode[]
|
||||
|
||||
/**
|
||||
* 弹幕字体大小,支持像素数字和百分比
|
||||
*/
|
||||
fontSize?: number | `${number}%`;
|
||||
/**
|
||||
* 弹幕字体大小,支持像素数字和百分比
|
||||
*/
|
||||
fontSize?: number | `${number}%`
|
||||
|
||||
/**
|
||||
* 弹幕是否防重叠
|
||||
*/
|
||||
antiOverlap?: boolean;
|
||||
/**
|
||||
* 弹幕是否防重叠
|
||||
*/
|
||||
antiOverlap?: boolean
|
||||
|
||||
/**
|
||||
* 是否同步播放速度
|
||||
*/
|
||||
synchronousPlayback?: boolean;
|
||||
/**
|
||||
* 是否同步播放速度
|
||||
*/
|
||||
synchronousPlayback?: boolean
|
||||
|
||||
/**
|
||||
* 弹幕发射器挂载点, 默认为播放器控制栏中部
|
||||
*/
|
||||
mount?: HTMLDivElement | string;
|
||||
/**
|
||||
* 弹幕发射器挂载点, 默认为播放器控制栏中部
|
||||
*/
|
||||
mount?: HTMLDivElement | string
|
||||
|
||||
/**
|
||||
* 是否开启弹幕热度图
|
||||
*/
|
||||
heatmap?:
|
||||
| boolean
|
||||
| {
|
||||
xMin?: number;
|
||||
xMax?: number;
|
||||
yMin?: number;
|
||||
yMax?: number;
|
||||
scale?: number;
|
||||
opacity?: number;
|
||||
minHeight?: number;
|
||||
sampling?: number;
|
||||
smoothing?: number;
|
||||
flattening?: number;
|
||||
};
|
||||
/**
|
||||
* 是否开启弹幕热度图
|
||||
*/
|
||||
heatmap?:
|
||||
| boolean
|
||||
| {
|
||||
xMin?: number
|
||||
xMax?: number
|
||||
yMin?: number
|
||||
yMax?: number
|
||||
scale?: number
|
||||
opacity?: number
|
||||
minHeight?: number
|
||||
sampling?: number
|
||||
smoothing?: number
|
||||
flattening?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 当播放器宽度小于此值时,弹幕发射器置于播放器底部
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* 当播放器宽度小于此值时,弹幕发射器置于播放器底部
|
||||
*/
|
||||
width?: number
|
||||
|
||||
/**
|
||||
* 热力图数据
|
||||
*/
|
||||
points?: any[];
|
||||
/**
|
||||
* 热力图数据
|
||||
*/
|
||||
points?: any[]
|
||||
|
||||
/**
|
||||
* 弹幕载入前的过滤器,只支持返回布尔值
|
||||
*/
|
||||
filter?: (danmu: Danmu) => boolean;
|
||||
/**
|
||||
* 弹幕载入前的过滤器,只支持返回布尔值
|
||||
*/
|
||||
filter?: (danmu: Danmu) => boolean
|
||||
|
||||
/**
|
||||
* 弹幕发送前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeEmit?: (danmu: Danmu) => boolean | Promise<boolean>;
|
||||
/**
|
||||
* 弹幕发送前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeEmit?: (danmu: Danmu) => boolean | Promise<boolean>
|
||||
|
||||
/**
|
||||
* 弹幕显示前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeVisible?: (danmu: Danmu) => boolean | Promise<boolean>;
|
||||
/**
|
||||
* 弹幕显示前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeVisible?: (danmu: Danmu) => boolean | Promise<boolean>
|
||||
|
||||
/**
|
||||
* 弹幕是否可见
|
||||
*/
|
||||
visible?: boolean;
|
||||
/**
|
||||
* 弹幕是否可见
|
||||
*/
|
||||
visible?: boolean
|
||||
|
||||
/**
|
||||
* 是否开启弹幕发射器
|
||||
*/
|
||||
emitter?: boolean;
|
||||
/**
|
||||
* 是否开启弹幕发射器
|
||||
*/
|
||||
emitter?: boolean
|
||||
|
||||
/**
|
||||
* 弹幕输入框最大长度, 范围在[1 ~ 1000]
|
||||
*/
|
||||
maxLength?: number;
|
||||
/**
|
||||
* 弹幕输入框最大长度, 范围在[1 ~ 1000]
|
||||
*/
|
||||
maxLength?: number
|
||||
|
||||
/**
|
||||
* 输入框锁定时间,范围在[1 ~ 60]
|
||||
*/
|
||||
lockTime?: number;
|
||||
/**
|
||||
* 输入框锁定时间,范围在[1 ~ 60]
|
||||
*/
|
||||
lockTime?: number
|
||||
|
||||
/**
|
||||
* 弹幕主题,只在自定义挂载时生效
|
||||
*/
|
||||
theme?: 'light' | 'dark';
|
||||
/**
|
||||
* 弹幕主题,只在自定义挂载时生效
|
||||
*/
|
||||
theme?: 'light' | 'dark'
|
||||
|
||||
/**
|
||||
* 不透明度配置项
|
||||
*/
|
||||
OPACITY?: Slider;
|
||||
/**
|
||||
* 不透明度配置项
|
||||
*/
|
||||
OPACITY?: Slider
|
||||
|
||||
/**
|
||||
* 弹幕速度配置项
|
||||
*/
|
||||
SPEED?: Slider;
|
||||
/**
|
||||
* 弹幕速度配置项
|
||||
*/
|
||||
SPEED?: Slider
|
||||
|
||||
/**
|
||||
* 显示区域配置项
|
||||
*/
|
||||
MARGIN?: Slider;
|
||||
/**
|
||||
* 显示区域配置项
|
||||
*/
|
||||
MARGIN?: Slider
|
||||
|
||||
/**
|
||||
* 弹幕字号配置项
|
||||
*/
|
||||
FONT_SIZE?: Slider;
|
||||
/**
|
||||
* 弹幕字号配置项
|
||||
*/
|
||||
FONT_SIZE?: Slider
|
||||
|
||||
/**
|
||||
* 颜色列表配置项
|
||||
*/
|
||||
COLOR?: string[];
|
||||
};
|
||||
/**
|
||||
* 颜色列表配置项
|
||||
*/
|
||||
COLOR?: string[]
|
||||
}
|
||||
|
||||
type Result = {
|
||||
name: 'artplayerPluginDanmuku';
|
||||
interface Result {
|
||||
name: 'artplayerPluginDanmuku'
|
||||
|
||||
/**
|
||||
* 发送一条实时弹幕
|
||||
*/
|
||||
emit: (danmu: Danmu) => Result;
|
||||
/**
|
||||
* 发送一条实时弹幕
|
||||
*/
|
||||
emit: (danmu: Danmu) => Result
|
||||
|
||||
/**
|
||||
* 重载弹幕源,或者切换新弹幕
|
||||
*/
|
||||
load: (danmuku?: Danmuku) => Promise<Result>;
|
||||
/**
|
||||
* 重载弹幕源,或者切换新弹幕
|
||||
*/
|
||||
load: (danmuku?: Danmuku) => Promise<Result>
|
||||
|
||||
/**
|
||||
* 实时改变弹幕配置
|
||||
*/
|
||||
config: (option: Option) => Result;
|
||||
/**
|
||||
* 实时改变弹幕配置
|
||||
*/
|
||||
config: (option: Option) => Result
|
||||
|
||||
/**
|
||||
* 隐藏弹幕层
|
||||
*/
|
||||
hide: () => Result;
|
||||
/**
|
||||
* 隐藏弹幕层
|
||||
*/
|
||||
hide: () => Result
|
||||
|
||||
/**
|
||||
* 显示弹幕层
|
||||
*/
|
||||
show: () => Result;
|
||||
/**
|
||||
* 显示弹幕层
|
||||
*/
|
||||
show: () => Result
|
||||
|
||||
/**
|
||||
* 挂载弹幕输入框
|
||||
*/
|
||||
mount: (el?: HTMLDivElement | string) => void;
|
||||
/**
|
||||
* 挂载弹幕输入框
|
||||
*/
|
||||
mount: (el?: HTMLDivElement | string) => void
|
||||
|
||||
/**
|
||||
* 重置弹幕
|
||||
*/
|
||||
reset: () => Result;
|
||||
/**
|
||||
* 重置弹幕
|
||||
*/
|
||||
reset: () => Result
|
||||
|
||||
/**
|
||||
* 弹幕配置
|
||||
*/
|
||||
option: Option;
|
||||
/**
|
||||
* 弹幕配置
|
||||
*/
|
||||
option: Option
|
||||
|
||||
/**
|
||||
* 是否隐藏弹幕层
|
||||
*/
|
||||
isHide: boolean;
|
||||
/**
|
||||
* 是否隐藏弹幕层
|
||||
*/
|
||||
isHide: boolean
|
||||
|
||||
/**
|
||||
* 是否弹幕层停止状态
|
||||
*/
|
||||
isStop: boolean;
|
||||
};
|
||||
/**
|
||||
* 是否弹幕层停止状态
|
||||
*/
|
||||
isStop: boolean
|
||||
}
|
||||
|
||||
declare const artplayerPluginDanmuku: (option: Option) => (art: Artplayer) => Result;
|
||||
declare const artplayerPluginDanmuku: (option: Option) => (art: Artplayer) => Result
|
||||
+13
-13
@@ -1,17 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginDashControl;
|
||||
export = artplayerPluginDashControl
|
||||
export as namespace artplayerPluginDashControl;
|
||||
|
||||
type Config = {
|
||||
control?: boolean;
|
||||
setting?: boolean;
|
||||
title?: string;
|
||||
auto?: string;
|
||||
getName?(level: object): String;
|
||||
};
|
||||
interface Config {
|
||||
control?: boolean
|
||||
setting?: boolean
|
||||
title?: string
|
||||
auto?: string
|
||||
getName?: (level: object) => string
|
||||
}
|
||||
|
||||
declare const artplayerPluginDashControl: (option: { quality?: Config; audio?: Config }) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginDashControl';
|
||||
update: () => void;
|
||||
};
|
||||
declare const artplayerPluginDashControl: (option: { quality?: Config, audio?: Config }) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginDashControl'
|
||||
update: () => void
|
||||
}
|
||||
+13
-13
@@ -1,17 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginHlsControl;
|
||||
export = artplayerPluginHlsControl
|
||||
export as namespace artplayerPluginHlsControl;
|
||||
|
||||
type Config = {
|
||||
control?: boolean;
|
||||
setting?: boolean;
|
||||
title?: string;
|
||||
auto?: string;
|
||||
getName?(level: object): String;
|
||||
};
|
||||
interface Config {
|
||||
control?: boolean
|
||||
setting?: boolean
|
||||
title?: string
|
||||
auto?: string
|
||||
getName?: (level: object) => string
|
||||
}
|
||||
|
||||
declare const artplayerPluginHlsControl: (option: { quality?: Config; audio?: Config }) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginHlsControl';
|
||||
update: () => void;
|
||||
};
|
||||
declare const artplayerPluginHlsControl: (option: { quality?: Config, audio?: Config }) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginHlsControl'
|
||||
update: () => void
|
||||
}
|
||||
+22
-22
@@ -1,30 +1,30 @@
|
||||
export = ArtplayerPluginIframe;
|
||||
export = ArtplayerPluginIframe
|
||||
export as namespace ArtplayerPluginIframe;
|
||||
|
||||
type Message = {
|
||||
type: string;
|
||||
data: any;
|
||||
id?: number;
|
||||
};
|
||||
interface Message {
|
||||
type: string
|
||||
data: any
|
||||
id?: number
|
||||
}
|
||||
|
||||
declare class ArtplayerPluginIframe {
|
||||
constructor(option: { iframe: HTMLIFrameElement; url: string });
|
||||
constructor(option: { iframe: HTMLIFrameElement, url: string })
|
||||
|
||||
static iframe: boolean;
|
||||
static postMessage(message: Message): void;
|
||||
static onMessage(event: MessageEvent & { data: Message }): void;
|
||||
static inject(): void;
|
||||
static iframe: boolean
|
||||
static postMessage(message: Message): void
|
||||
static onMessage(event: MessageEvent & { data: Message }): void
|
||||
static inject(): void
|
||||
|
||||
readonly promises: Record<number, { resove: Function; reject: Function }>;
|
||||
readonly injected: boolean;
|
||||
readonly destroyed: boolean;
|
||||
readonly $iframe: HTMLIFrameElement;
|
||||
readonly url: string;
|
||||
readonly messageCallback: (...args: any[]) => any;
|
||||
readonly promises: Record<number, { resove: Function, reject: Function }>
|
||||
readonly injected: boolean
|
||||
readonly destroyed: boolean
|
||||
readonly $iframe: HTMLIFrameElement
|
||||
readonly url: string
|
||||
readonly messageCallback: (...args: any[]) => any
|
||||
|
||||
onMessage(event: MessageEvent & { data: Message }): void;
|
||||
postMessage(message: Message): Promise<any>;
|
||||
commit<T extends (...args: any[]) => any>(callback: T): Promise<ReturnType<T>>;
|
||||
message(callback: (...args: any[]) => any): void;
|
||||
destroy(): void;
|
||||
onMessage(event: MessageEvent & { data: Message }): void
|
||||
postMessage(message: Message): Promise<any>
|
||||
commit<T extends (...args: any[]) => any>(callback: T): Promise<ReturnType<T>>
|
||||
message(callback: (...args: any[]) => any): void
|
||||
destroy(): void
|
||||
}
|
||||
+13
-13
@@ -1,17 +1,17 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type SubtitlesOctopus from '@hrgui/libass-wasm-ts';
|
||||
import { type Options } from 'libass-wasm';
|
||||
import type SubtitlesOctopus from '@hrgui/libass-wasm-ts'
|
||||
import type Artplayer from 'artplayer'
|
||||
import type { Options } from 'libass-wasm'
|
||||
|
||||
export = artplayerPluginAss;
|
||||
export = artplayerPluginAss
|
||||
export as namespace artplayerPluginAss;
|
||||
|
||||
declare const artplayerPluginAss: (options: Options) => (art: Artplayer) => {
|
||||
name: 'artplayerPluginLibass';
|
||||
libass: SubtitlesOctopus;
|
||||
visible: boolean;
|
||||
init: () => void;
|
||||
switch: (url: string) => void;
|
||||
show: () => void;
|
||||
hide: () => void;
|
||||
destroy: () => void;
|
||||
};
|
||||
name: 'artplayerPluginLibass'
|
||||
libass: SubtitlesOctopus
|
||||
visible: boolean
|
||||
init: () => void
|
||||
switch: (url: string) => void
|
||||
show: () => void
|
||||
hide: () => void
|
||||
destroy: () => void
|
||||
}
|
||||
+11
-11
@@ -1,16 +1,16 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginMultipleSubtitles;
|
||||
export = artplayerPluginMultipleSubtitles
|
||||
export as namespace artplayerPluginMultipleSubtitles;
|
||||
|
||||
declare const artplayerPluginMultipleSubtitles: (option: {
|
||||
subtitles: {
|
||||
url?: string;
|
||||
name?: string;
|
||||
type?: 'vtt' | 'srt' | 'ass';
|
||||
encoding?: string;
|
||||
onParser?(...args: object[]): object;
|
||||
}[];
|
||||
subtitles: {
|
||||
url?: string
|
||||
name?: string
|
||||
type?: 'vtt' | 'srt' | 'ass'
|
||||
encoding?: string
|
||||
onParser?: (...args: object[]) => object
|
||||
}[]
|
||||
}) => (art: Artplayer) => {
|
||||
name: 'multipleSubtitles';
|
||||
};
|
||||
name: 'multipleSubtitles'
|
||||
}
|
||||
+19
-19
@@ -1,34 +1,34 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import { Player } from '@glomex/vast-ima-player';
|
||||
import type { Player } from '@glomex/vast-ima-player'
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginVast;
|
||||
export = artplayerPluginVast
|
||||
export as namespace artplayerPluginVast;
|
||||
|
||||
declare global {
|
||||
interface Window {
|
||||
artplayerPluginVast?: typeof artplayerPluginVast;
|
||||
}
|
||||
interface Window {
|
||||
artplayerPluginVast?: typeof artplayerPluginVast
|
||||
}
|
||||
}
|
||||
|
||||
type PlayUrlFn = (url: string) => void;
|
||||
type PlayResFn = (res: string) => void;
|
||||
type PlayUrlFn = (url: string) => void
|
||||
type PlayResFn = (res: string) => void
|
||||
|
||||
interface VastPluginContext {
|
||||
art: Artplayer;
|
||||
ima: typeof google.ima;
|
||||
imaPlayer: Player;
|
||||
playUrl: PlayUrlFn;
|
||||
playRes: PlayResFn;
|
||||
container: HTMLDivElement | null;
|
||||
art: Artplayer
|
||||
ima: typeof google.ima
|
||||
imaPlayer: Player
|
||||
playUrl: PlayUrlFn
|
||||
playRes: PlayResFn
|
||||
container: HTMLDivElement | null
|
||||
}
|
||||
|
||||
export type ArtplayerPluginVastOption = (params: VastPluginContext) => void | Promise<void>;
|
||||
export type ArtplayerPluginVastOption = (params: VastPluginContext) => void | Promise<void>
|
||||
|
||||
export interface ArtplayerPluginVastInstance {
|
||||
name: 'artplayerPluginVast';
|
||||
destroy?: () => void;
|
||||
name: 'artplayerPluginVast'
|
||||
destroy?: () => void
|
||||
}
|
||||
|
||||
declare function artplayerPluginVast(
|
||||
option: ArtplayerPluginVastOption,
|
||||
): (art: Artplayer) => ArtplayerPluginVastInstance;
|
||||
option: ArtplayerPluginVastOption,
|
||||
): (art: Artplayer) => ArtplayerPluginVastInstance
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import type Artplayer from 'artplayer';
|
||||
import type Artplayer from 'artplayer'
|
||||
|
||||
export = artplayerPluginVttThumbnail;
|
||||
export = artplayerPluginVttThumbnail
|
||||
export as namespace artplayerPluginVttThumbnail;
|
||||
|
||||
declare const artplayerPluginVttThumbnail: (option: { vtt?: string; style?: Partial<CSSStyleDeclaration> }) => (
|
||||
art: Artplayer,
|
||||
declare const artplayerPluginVttThumbnail: (option: { vtt?: string, style?: Partial<CSSStyleDeclaration> }) => (
|
||||
art: Artplayer,
|
||||
) => {
|
||||
name: 'artplayerPluginVttThumbnail';
|
||||
};
|
||||
name: 'artplayerPluginVttThumbnail'
|
||||
}
|
||||
Vendored
+1142
-1142
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user