mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 13:51:20 -08:00
feat: add danmuku plugin and i18n setup documentation
- Created a new documentation file for the danmuku plugin with code examples. - Added a new documentation file for language settings (i18n) with detailed instructions on language imports, default languages, and how to add or modify languages.
This commit is contained in:
1 parent
7dffd99cfd
commit
17042867fc
81 files changed
+160
-878
No files matched your search
+20
-20
@@ -51,26 +51,26 @@
|
||||
})
|
||||
|
||||
let libUris = [
|
||||
'./assets/ts/packages\artplayer-plugin-ads\types\artplayer-plugin-ads.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-ambilight\types\artplayer-plugin-ambilight.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-asr\types\artplayer-plugin-asr.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-audio-track\types\artplayer-plugin-audio-track.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-auto-thumbnail\types\artplayer-plugin-auto-thumbnail.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-chapter\types\artplayer-plugin-chapter.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-chromecast\types\artplayer-plugin-chromecast.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-danmuku-mask\types\artplayer-plugin-danmuku-mask.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-danmuku\types\artplayer-plugin-danmuku.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-dash-control\types\artplayer-plugin-dash-control.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-document-pip\types\artplayer-plugin-document-pip.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-hls-control\types\artplayer-plugin-hls-control.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-iframe\types\artplayer-plugin-iframe.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-jassub\types\artplayer-plugin-jassub.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-multiple-subtitles\types\artplayer-plugin-multiple-subtitles.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-vast\types\artplayer-plugin-vast.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-vtt-thumbnail\types\artplayer-plugin-vtt-thumbnail.d.ts',
|
||||
'./assets/ts/packages\artplayer-plugin-websr\types\artplayer-plugin-websr.d.ts',
|
||||
'./assets/ts/packages\artplayer-proxy-canvas\types\artplayer-proxy-canvas.d.ts',
|
||||
'./assets/ts/packages\artplayer-proxy-mediabunny\types\artplayer-proxy-mediabunny.d.ts',
|
||||
'./assets/ts/artplayer-plugin-ads.d.ts',
|
||||
'./assets/ts/artplayer-plugin-ambilight.d.ts',
|
||||
'./assets/ts/artplayer-plugin-asr.d.ts',
|
||||
'./assets/ts/artplayer-plugin-audio-track.d.ts',
|
||||
'./assets/ts/artplayer-plugin-auto-thumbnail.d.ts',
|
||||
'./assets/ts/artplayer-plugin-chapter.d.ts',
|
||||
'./assets/ts/artplayer-plugin-chromecast.d.ts',
|
||||
'./assets/ts/artplayer-plugin-danmuku-mask.d.ts',
|
||||
'./assets/ts/artplayer-plugin-danmuku.d.ts',
|
||||
'./assets/ts/artplayer-plugin-dash-control.d.ts',
|
||||
'./assets/ts/artplayer-plugin-document-pip.d.ts',
|
||||
'./assets/ts/artplayer-plugin-hls-control.d.ts',
|
||||
'./assets/ts/artplayer-plugin-iframe.d.ts',
|
||||
'./assets/ts/artplayer-plugin-jassub.d.ts',
|
||||
'./assets/ts/artplayer-plugin-multiple-subtitles.d.ts',
|
||||
'./assets/ts/artplayer-plugin-vast.d.ts',
|
||||
'./assets/ts/artplayer-plugin-vtt-thumbnail.d.ts',
|
||||
'./assets/ts/artplayer-plugin-websr.d.ts',
|
||||
'./assets/ts/artplayer-proxy-canvas.d.ts',
|
||||
'./assets/ts/artplayer-proxy-mediabunny.d.ts',
|
||||
'./assets/ts/artplayer.d.ts',
|
||||
]
|
||||
|
||||
|
||||
+2
-2
@@ -48,5 +48,5 @@ declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads
|
||||
|
||||
export default artplayerPluginAds
|
||||
|
||||
export = artplayerPluginAds
|
||||
export as namespace artplayerPluginAds;
|
||||
export = artplayerPluginAds;
|
||||
export as namespace artplayerPluginAds;
|
||||
+2
-2
@@ -16,5 +16,5 @@ declare const artplayerPluginAmbilight: (option: Option) => (art: Artplayer) =>
|
||||
|
||||
export default artplayerPluginAmbilight
|
||||
|
||||
export = artplayerPluginAmbilight
|
||||
export as namespace artplayerPluginAmbilight;
|
||||
export = artplayerPluginAmbilight;
|
||||
export as namespace artplayerPluginAmbilight;
|
||||
+2
-2
@@ -22,5 +22,5 @@ declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer)
|
||||
|
||||
export default artplayerPluginAsr
|
||||
|
||||
export = artplayerPluginAsr
|
||||
export as namespace artplayerPluginAsr;
|
||||
export = artplayerPluginAsr;
|
||||
export as namespace artplayerPluginAsr;
|
||||
+2
-2
@@ -36,5 +36,5 @@ declare const artplayerPluginAudioTrack: (option: Option) => (art: Artplayer) =>
|
||||
|
||||
export default artplayerPluginAudioTrack
|
||||
|
||||
export = artplayerPluginAudioTrack
|
||||
export as namespace artplayerPluginAudioTrack;
|
||||
export = artplayerPluginAudioTrack;
|
||||
export as namespace artplayerPluginAudioTrack;
|
||||
+2
-2
@@ -13,5 +13,5 @@ declare const artplayerPluginAutoThumbnail: (option: Option) => (art: Artplayer)
|
||||
|
||||
export default artplayerPluginAutoThumbnail
|
||||
|
||||
export = artplayerPluginAutoThumbnail
|
||||
export as namespace artplayerPluginAutoThumbnail;
|
||||
export = artplayerPluginAutoThumbnail;
|
||||
export as namespace artplayerPluginAutoThumbnail;
|
||||
+2
-2
@@ -17,5 +17,5 @@ declare const artplayerPluginChapter: (option: Option) => (art: Artplayer) => Re
|
||||
|
||||
export default artplayerPluginChapter
|
||||
|
||||
export = artplayerPluginChapter
|
||||
export as namespace artplayerPluginChapter;
|
||||
export = artplayerPluginChapter;
|
||||
export as namespace artplayerPluginChapter;
|
||||
+2
-2
@@ -13,5 +13,5 @@ declare const artplayerPluginChromecast: (option: Option) => (art: Artplayer) =>
|
||||
|
||||
export default artplayerPluginChromecast
|
||||
|
||||
export = artplayerPluginChromecast
|
||||
export as namespace artplayerPluginChromecast;
|
||||
export = artplayerPluginChromecast;
|
||||
export as namespace artplayerPluginChromecast;
|
||||
+2
-2
@@ -21,5 +21,5 @@ declare const artplayerPluginDanmukuMask: (option?: Option) => (art: Artplayer)
|
||||
|
||||
export default artplayerPluginDanmukuMask
|
||||
|
||||
export = artplayerPluginDanmukuMask
|
||||
export as namespace artplayerPluginDanmukuMask;
|
||||
export = artplayerPluginDanmukuMask;
|
||||
export as namespace artplayerPluginDanmukuMask;
|
||||
+2
-2
@@ -255,5 +255,5 @@ declare const artplayerPluginDanmuku: (option: Option) => (art: Artplayer) => Re
|
||||
|
||||
export default artplayerPluginDanmuku
|
||||
|
||||
export = artplayerPluginDanmuku
|
||||
export as namespace artplayerPluginDanmuku;
|
||||
export = artplayerPluginDanmuku;
|
||||
export as namespace artplayerPluginDanmuku;
|
||||
+2
-2
@@ -13,5 +13,5 @@ declare const artplayerPluginDashControl: (option: { quality?: Config, audio?: C
|
||||
|
||||
export default artplayerPluginDashControl
|
||||
|
||||
export = artplayerPluginDashControl
|
||||
export as namespace artplayerPluginDashControl;
|
||||
export = artplayerPluginDashControl;
|
||||
export as namespace artplayerPluginDashControl;
|
||||
+2
-2
@@ -18,5 +18,5 @@ declare const artplayerPluginDocumentPip: (option: Option) => (art: Artplayer) =
|
||||
|
||||
export default artplayerPluginDocumentPip
|
||||
|
||||
export = artplayerPluginDocumentPip
|
||||
export as namespace artplayerPluginDocumentPip;
|
||||
export = artplayerPluginDocumentPip;
|
||||
export as namespace artplayerPluginDocumentPip;
|
||||
+2
-2
@@ -13,5 +13,5 @@ declare const artplayerPluginHlsControl: (option: { quality?: Config, audio?: Co
|
||||
|
||||
export default artplayerPluginHlsControl
|
||||
|
||||
export = artplayerPluginHlsControl
|
||||
export as namespace artplayerPluginHlsControl;
|
||||
export = artplayerPluginHlsControl;
|
||||
export as namespace artplayerPluginHlsControl;
|
||||
+2
-2
@@ -28,5 +28,5 @@ declare class ArtplayerPluginIframe {
|
||||
|
||||
export default ArtplayerPluginIframe
|
||||
|
||||
export = artplayerPluginIframe
|
||||
export as namespace artplayerPluginIframe;
|
||||
export = artplayerPluginIframe;
|
||||
export as namespace artplayerPluginIframe;
|
||||
+2
-2
@@ -34,5 +34,5 @@ declare const artplayerPluginJassub: (option: JassubOption) => (art: Artplayer)
|
||||
|
||||
export default artplayerPluginJassub
|
||||
|
||||
export = artplayerPluginJassub
|
||||
export as namespace artplayerPluginJassub;
|
||||
export = artplayerPluginJassub;
|
||||
export as namespace artplayerPluginJassub;
|
||||
+2
-2
@@ -12,5 +12,5 @@ declare const artplayerPluginMultipleSubtitles: (option: {
|
||||
|
||||
export default artplayerPluginMultipleSubtitles
|
||||
|
||||
export = artplayerPluginMultipleSubtitles
|
||||
export as namespace artplayerPluginMultipleSubtitles;
|
||||
export = artplayerPluginMultipleSubtitles;
|
||||
export as namespace artplayerPluginMultipleSubtitles;
|
||||
+9
-6
@@ -4,15 +4,18 @@ declare global {
|
||||
}
|
||||
}
|
||||
|
||||
type PlayUrlFn = (url: string) => void
|
||||
type PlayResFn = (res: string) => void
|
||||
type PlayUrlFn = (url: string, config?: any) => void
|
||||
type PlayResFn = (res: string, config?: any) => void
|
||||
|
||||
interface VastPluginContext {
|
||||
art: Artplayer
|
||||
ima: any // Replace 'any' with a more specific type if available, or declare google.ima type above
|
||||
imaPlayer: Player
|
||||
ima: any
|
||||
imaPlayer: Player | null
|
||||
playUrl: PlayUrlFn
|
||||
playRes: PlayResFn
|
||||
init: () => Player
|
||||
adsRenderingSettings: any
|
||||
playerOptions: PlayerOptions
|
||||
container: HTMLDivElement | null
|
||||
}
|
||||
|
||||
@@ -29,5 +32,5 @@ declare function artplayerPluginVast(
|
||||
|
||||
export default artplayerPluginVast
|
||||
|
||||
export = artplayerPluginVast
|
||||
export as namespace artplayerPluginVast;
|
||||
export = artplayerPluginVast;
|
||||
export as namespace artplayerPluginVast;
|
||||
+2
-2
@@ -6,5 +6,5 @@ declare const artplayerPluginVttThumbnail: (option: { vtt?: string, style?: Part
|
||||
|
||||
export default artplayerPluginVttThumbnail
|
||||
|
||||
export = artplayerPluginVttThumbnail
|
||||
export as namespace artplayerPluginVttThumbnail;
|
||||
export = artplayerPluginVttThumbnail;
|
||||
export as namespace artplayerPluginVttThumbnail;
|
||||
+2
-2
@@ -91,5 +91,5 @@ declare const artplayerPluginWebsr: (option?: Option) => (art: Artplayer) => Res
|
||||
|
||||
export default artplayerPluginWebsr
|
||||
|
||||
export = packages\artplayerPluginWebsr\types\artplayerPluginWebsr;
|
||||
export as namespace packages\artplayerPluginWebsr\types\artplayerPluginWebsr;
|
||||
export = artplayerPluginWebsr;
|
||||
export as namespace artplayerPluginWebsr;
|
||||
+2
-2
@@ -6,5 +6,5 @@ declare const artplayerProxyCanvas: (option?: Option) => (art: Artplayer) => Res
|
||||
|
||||
export default artplayerProxyCanvas
|
||||
|
||||
export = artplayerProxyCanvas
|
||||
export as namespace artplayerProxyCanvas;
|
||||
export = artplayerProxyCanvas;
|
||||
export as namespace artplayerProxyCanvas;
|
||||
+2
-2
@@ -75,5 +75,5 @@ declare const artplayerProxyMediabunny: (option?: Option) => (art: Artplayer) =>
|
||||
|
||||
export default artplayerProxyMediabunny
|
||||
|
||||
export = artplayerProxyMediabunny
|
||||
export as namespace artplayerProxyMediabunny;
|
||||
export = artplayerProxyMediabunny;
|
||||
export as namespace artplayerProxyMediabunny;
|
||||
Vendored
+34
-2
@@ -126,6 +126,8 @@ export interface Subtitle {
|
||||
onVttLoad?: (vtt: string) => string
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface SettingOption extends Omit<Setting, 'html' | 'icon' | 'tooltip'> {
|
||||
html: string
|
||||
icon: string | undefined
|
||||
@@ -237,6 +239,10 @@ export interface Quality {
|
||||
url: string
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type AspectRatio = 'default' | '4:3' | '16:9' | (`${number}:${number}` & Record<never, never>)
|
||||
export type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | (number & Record<never, never>)
|
||||
export type Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record<never, never>)
|
||||
@@ -346,6 +352,15 @@ export declare class Player {
|
||||
reset(): void
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type CustomType
|
||||
= | 'flv'
|
||||
| 'm3u8'
|
||||
@@ -754,6 +769,9 @@ declare module 'artplayer/i18n/*' {
|
||||
export default lang
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export type Bar = 'loaded' | 'played' | 'hover'
|
||||
|
||||
export interface Events {
|
||||
@@ -977,6 +995,8 @@ export interface Config {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
export interface Selector {
|
||||
/**
|
||||
* Whether the default is selected
|
||||
@@ -1108,6 +1128,18 @@ export interface ComponentOption {
|
||||
onSelect?: (this: Artplayer, selector: Selector, element: HTMLElement, event: Event) => void
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
export type {
|
||||
Config,
|
||||
Events,
|
||||
@@ -1297,5 +1329,5 @@ export default class Artplayer extends Player {
|
||||
} & Record<string, unknown>
|
||||
}
|
||||
|
||||
export = Artplayer
|
||||
export as namespace Artplayer;
|
||||
export = Artplayer;
|
||||
export as namespace Artplayer;
|
||||
@@ -1,52 +0,0 @@
|
||||
interface Option {
|
||||
/**
|
||||
* 广告源文本,支持视频链接、图片链接、HTML文本
|
||||
*/
|
||||
source: string
|
||||
|
||||
/**
|
||||
* 知名广告的类型:'video' | 'image' | 'html'
|
||||
*/
|
||||
type: 'video' | 'image' | 'html'
|
||||
|
||||
/**
|
||||
* 广告必看的时长,单位为秒
|
||||
*/
|
||||
playDuration?: number
|
||||
|
||||
/**
|
||||
* 广告总的时长,单位为秒
|
||||
*/
|
||||
totalDuration?: number
|
||||
|
||||
/**
|
||||
* 视频广告是否默认静音
|
||||
*/
|
||||
muted?: boolean
|
||||
}
|
||||
|
||||
interface Ads {
|
||||
name: 'artplayerPluginAds'
|
||||
|
||||
/**
|
||||
* 跳过广告
|
||||
*/
|
||||
skip: () => void
|
||||
|
||||
/**
|
||||
* 暂停广告
|
||||
*/
|
||||
pause: () => void
|
||||
|
||||
/**
|
||||
* 播放广告
|
||||
*/
|
||||
play: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads
|
||||
|
||||
export default artplayerPluginAds
|
||||
|
||||
export = packages\artplayerPluginAds\types\artplayerPluginAds;
|
||||
export as namespace packages\artplayerPluginAds\types\artplayerPluginAds;
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
interface Option {
|
||||
blur?: string
|
||||
opacity?: number
|
||||
frequency?: number
|
||||
zIndex?: number
|
||||
duration?: number
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginAmbilight'
|
||||
start: () => void
|
||||
stop: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginAmbilight: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginAmbilight
|
||||
|
||||
export = packages\artplayerPluginAmbilight\types\artplayerPluginAmbilight;
|
||||
export as namespace packages\artplayerPluginAmbilight\types\artplayerPluginAmbilight;
|
||||
@@ -1,26 +0,0 @@
|
||||
interface AudioChunk {
|
||||
pcm: ArrayBuffer
|
||||
wav: ArrayBuffer
|
||||
}
|
||||
|
||||
interface AsrPluginOption {
|
||||
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
|
||||
}
|
||||
|
||||
declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer) => AsrPluginInstance
|
||||
|
||||
export default artplayerPluginAsr
|
||||
|
||||
export = packages\artplayerPluginAsr\types\artplayerPluginAsr;
|
||||
export as namespace packages\artplayerPluginAsr\types\artplayerPluginAsr;
|
||||
Vendored
-40
@@ -1,40 +0,0 @@
|
||||
interface Option {
|
||||
/**
|
||||
* Audio track URL
|
||||
*/
|
||||
url: string
|
||||
|
||||
/**
|
||||
* Time offset in seconds between video and audio
|
||||
* Positive value means audio plays ahead of video
|
||||
* Negative value means audio plays behind video
|
||||
* @default 0
|
||||
*/
|
||||
offset?: number
|
||||
|
||||
/**
|
||||
* Synchronization threshold in seconds
|
||||
* @default 0.3
|
||||
*/
|
||||
sync?: number
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginAudioTrack'
|
||||
/**
|
||||
* The audio element
|
||||
*/
|
||||
audio: HTMLAudioElement
|
||||
|
||||
/**
|
||||
* Update option
|
||||
*/
|
||||
update: (option: Option) => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginAudioTrack: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginAudioTrack
|
||||
|
||||
export = packages\artplayerPluginAudioTrack\types\artplayerPluginAudioTrack;
|
||||
export as namespace packages\artplayerPluginAudioTrack\types\artplayerPluginAudioTrack;
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
interface Option {
|
||||
url?: string
|
||||
width?: number
|
||||
number?: number
|
||||
scale?: number
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginAutoThumbnail'
|
||||
}
|
||||
|
||||
declare const artplayerPluginAutoThumbnail: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginAutoThumbnail
|
||||
|
||||
export = packages\artplayerPluginAutoThumbnail\types\artplayerPluginAutoThumbnail;
|
||||
export as namespace packages\artplayerPluginAutoThumbnail\types\artplayerPluginAutoThumbnail;
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
type Chapters = {
|
||||
start: number
|
||||
end: number
|
||||
title: string
|
||||
}[]
|
||||
|
||||
interface Option {
|
||||
chapters?: Chapters
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginChapter'
|
||||
update: (option: Option) => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginChapter: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginChapter
|
||||
|
||||
export = packages\artplayerPluginChapter\types\artplayerPluginChapter;
|
||||
export as namespace packages\artplayerPluginChapter\types\artplayerPluginChapter;
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
interface Option {
|
||||
url?: string
|
||||
sdk?: string
|
||||
icon?: string
|
||||
mimeType?: string
|
||||
}
|
||||
|
||||
interface Chromecast {
|
||||
name: 'artplayerPluginChromecast'
|
||||
}
|
||||
|
||||
declare const artplayerPluginChromecast: (option: Option) => (art: Artplayer) => Chromecast
|
||||
|
||||
export default artplayerPluginChromecast
|
||||
|
||||
export = packages\artplayerPluginChromecast\types\artplayerPluginChromecast;
|
||||
export as namespace packages\artplayerPluginChromecast\types\artplayerPluginChromecast;
|
||||
Vendored
-25
@@ -1,25 +0,0 @@
|
||||
interface Option {
|
||||
solutionPath?: string
|
||||
modelSelection?: number
|
||||
smoothSegmentation?: boolean
|
||||
minDetectionConfidence?: number
|
||||
minTrackingConfidence?: number
|
||||
selfieMode?: boolean
|
||||
drawContour?: boolean
|
||||
foregroundThreshold?: number
|
||||
opacity?: number
|
||||
maskBlurAmount?: number
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginDanmukuMask'
|
||||
start: () => Promise<void>
|
||||
stop: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginDanmukuMask: (option?: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginDanmukuMask
|
||||
|
||||
export = packages\artplayerPluginDanmukuMask\types\artplayerPluginDanmukuMask;
|
||||
export as namespace packages\artplayerPluginDanmukuMask\types\artplayerPluginDanmukuMask;
|
||||
-259
@@ -1,259 +0,0 @@
|
||||
export type Mode = 0 | 1 | 2
|
||||
export type Danmuku
|
||||
= | Danmu[]
|
||||
| string // URL
|
||||
| (() => Promise<Danmu[]>)
|
||||
| Promise<Danmu[]>
|
||||
|
||||
export interface Slider {
|
||||
min?: number
|
||||
max?: number
|
||||
steps?: {
|
||||
name?: string
|
||||
value?: number | string
|
||||
show?: boolean
|
||||
}[]
|
||||
}
|
||||
|
||||
export interface Danmu {
|
||||
/**
|
||||
* 弹幕文本
|
||||
*/
|
||||
text: string
|
||||
|
||||
/**
|
||||
* 弹幕发送模式: 0: 滚动,1: 顶部,2: 底部
|
||||
*/
|
||||
mode?: Mode
|
||||
|
||||
/**
|
||||
* 弹幕颜色
|
||||
*/
|
||||
color?: string
|
||||
|
||||
/**
|
||||
* 弹幕出现的时间,单位为秒
|
||||
*/
|
||||
time?: number
|
||||
|
||||
/**
|
||||
* 弹幕是否有描边, 默认为 false
|
||||
*/
|
||||
border?: boolean
|
||||
|
||||
/**
|
||||
* 弹幕自定义样式
|
||||
*/
|
||||
style?: Partial<CSSStyleDeclaration>
|
||||
}
|
||||
|
||||
export interface Option {
|
||||
/**
|
||||
* 弹幕数据: 函数,数组,Promise,URL
|
||||
*/
|
||||
danmuku: Danmuku
|
||||
|
||||
/**
|
||||
* 弹幕持续时间,范围在[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?: HTMLDivElement | string
|
||||
|
||||
/**
|
||||
* 是否开启弹幕热度图
|
||||
*/
|
||||
heatmap?:
|
||||
| boolean
|
||||
| {
|
||||
xMin?: number
|
||||
xMax?: number
|
||||
yMin?: number
|
||||
yMax?: number
|
||||
scale?: number
|
||||
opacity?: number
|
||||
minHeight?: number
|
||||
sampling?: number
|
||||
smoothing?: number
|
||||
flattening?: number
|
||||
}
|
||||
|
||||
/**
|
||||
* 当播放器宽度小于此值时,弹幕发射器置于播放器底部
|
||||
*/
|
||||
width?: number
|
||||
|
||||
/**
|
||||
* 热力图数据
|
||||
*/
|
||||
points?: { time: number, value: number }[]
|
||||
|
||||
/**
|
||||
* 弹幕载入前的过滤器,只支持返回布尔值
|
||||
*/
|
||||
filter?: (danmu: Danmu) => boolean
|
||||
|
||||
/**
|
||||
* 弹幕发送前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeEmit?: (danmu: Danmu) => boolean | Promise<boolean>
|
||||
|
||||
/**
|
||||
* 弹幕显示前的过滤器,支持返回 Promise
|
||||
*/
|
||||
beforeVisible?: (danmu: Danmu) => boolean | Promise<boolean>
|
||||
|
||||
/**
|
||||
* 弹幕是否可见
|
||||
*/
|
||||
visible?: boolean
|
||||
|
||||
/**
|
||||
* 是否开启弹幕发射器
|
||||
*/
|
||||
emitter?: boolean
|
||||
|
||||
/**
|
||||
* 弹幕输入框最大长度, 范围在[1 ~ 1000]
|
||||
*/
|
||||
maxLength?: number
|
||||
|
||||
/**
|
||||
* 输入框锁定时间,范围在[1 ~ 60]
|
||||
*/
|
||||
lockTime?: number
|
||||
|
||||
/**
|
||||
* 弹幕主题,只在自定义挂载时生效
|
||||
*/
|
||||
theme?: 'light' | 'dark'
|
||||
|
||||
/**
|
||||
* 不透明度配置项
|
||||
*/
|
||||
OPACITY?: Slider
|
||||
|
||||
/**
|
||||
* 弹幕速度配置项
|
||||
*/
|
||||
SPEED?: Slider
|
||||
|
||||
/**
|
||||
* 显示区域配置项
|
||||
*/
|
||||
MARGIN?: Slider
|
||||
|
||||
/**
|
||||
* 弹幕字号配置项
|
||||
*/
|
||||
FONT_SIZE?: Slider
|
||||
|
||||
/**
|
||||
* 颜色列表配置项
|
||||
*/
|
||||
COLOR?: string[]
|
||||
}
|
||||
|
||||
export interface Result {
|
||||
name: 'artplayerPluginDanmuku'
|
||||
|
||||
/**
|
||||
* 发送一条实时弹幕
|
||||
*/
|
||||
emit: (danmu: Danmu) => Result
|
||||
|
||||
/**
|
||||
* 重载弹幕源,或者切换新弹幕
|
||||
*/
|
||||
load: (danmuku?: Danmuku) => Promise<Result>
|
||||
|
||||
/**
|
||||
* 实时改变弹幕配置
|
||||
*/
|
||||
config: (option: Option) => Result
|
||||
|
||||
/**
|
||||
* 隐藏弹幕层
|
||||
*/
|
||||
hide: () => Result
|
||||
|
||||
/**
|
||||
* 显示弹幕层
|
||||
*/
|
||||
show: () => Result
|
||||
|
||||
/**
|
||||
* 挂载弹幕输入框
|
||||
*/
|
||||
mount: (el?: HTMLDivElement | string) => void
|
||||
|
||||
/**
|
||||
* 重置弹幕
|
||||
*/
|
||||
reset: () => Result
|
||||
|
||||
/**
|
||||
* 弹幕配置
|
||||
*/
|
||||
option: Option
|
||||
|
||||
/**
|
||||
* 是否隐藏弹幕层
|
||||
*/
|
||||
isHide: boolean
|
||||
|
||||
/**
|
||||
* 是否弹幕层停止状态
|
||||
*/
|
||||
isStop: boolean
|
||||
}
|
||||
|
||||
declare const artplayerPluginDanmuku: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginDanmuku
|
||||
|
||||
export = packages\artplayerPluginDanmuku\types\artplayerPluginDanmuku;
|
||||
export as namespace packages\artplayerPluginDanmuku\types\artplayerPluginDanmuku;
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
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
|
||||
}
|
||||
|
||||
export default artplayerPluginDashControl
|
||||
|
||||
export = packages\artplayerPluginDashControl\types\artplayerPluginDashControl;
|
||||
export as namespace packages\artplayerPluginDashControl\types\artplayerPluginDashControl;
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
interface Option {
|
||||
width?: number
|
||||
height?: number
|
||||
placeholder?: string
|
||||
fallbackToVideoPiP?: boolean
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginDocumentPip'
|
||||
isSupported: boolean
|
||||
isActive: boolean
|
||||
open: () => void
|
||||
close: () => void
|
||||
toggle: () => void
|
||||
}
|
||||
|
||||
declare const artplayerPluginDocumentPip: (option: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginDocumentPip
|
||||
|
||||
export = packages\artplayerPluginDocumentPip\types\artplayerPluginDocumentPip;
|
||||
export as namespace packages\artplayerPluginDocumentPip\types\artplayerPluginDocumentPip;
|
||||
Vendored
-17
@@ -1,17 +0,0 @@
|
||||
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
|
||||
}
|
||||
|
||||
export default artplayerPluginHlsControl
|
||||
|
||||
export = packages\artplayerPluginHlsControl\types\artplayerPluginHlsControl;
|
||||
export as namespace packages\artplayerPluginHlsControl\types\artplayerPluginHlsControl;
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
interface Message {
|
||||
type: string
|
||||
data: any
|
||||
id?: number
|
||||
}
|
||||
|
||||
declare class ArtplayerPluginIframe {
|
||||
constructor(option: { iframe: HTMLIFrameElement, url: string })
|
||||
|
||||
static iframe: boolean
|
||||
static postMessage(message: Message): void
|
||||
static onMessage(event: MessageEvent & { data: Message }): void
|
||||
static inject(): void
|
||||
|
||||
readonly promises: Record<number, { resove: (...args: any[]) => any, reject: (...args: any[]) => any }>
|
||||
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
|
||||
}
|
||||
|
||||
export default ArtplayerPluginIframe
|
||||
|
||||
export = packages\artplayerPluginIframe\types\artplayerPluginIframe;
|
||||
export as namespace packages\artplayerPluginIframe\types\artplayerPluginIframe;
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
export interface JassubOption {
|
||||
workerUrl: string
|
||||
wasmUrl: string
|
||||
modernWasmUrl: string
|
||||
subUrl?: string
|
||||
subContent?: string
|
||||
timeOffset?: number
|
||||
debug?: boolean
|
||||
prescaleFactor?: number
|
||||
prescaleHeightLimit?: number
|
||||
maxRenderHeight?: number
|
||||
fonts?: string[] | Uint8Array[]
|
||||
availableFonts?: Record<string, Uint8Array | string>
|
||||
fallbackFont?: string
|
||||
useLocalFonts?: boolean
|
||||
libassMemoryLimit?: number
|
||||
libassGlyphLimit?: number
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
export interface JassubInstance {
|
||||
resize: (force?: boolean, width?: number, height?: number, top?: number, left?: number) => Promise<void>
|
||||
setVideo: (video: HTMLVideoElement) => Promise<void>
|
||||
destroy: () => Promise<void>
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
interface Result {
|
||||
name: 'artplayerPluginJassub'
|
||||
instance: JassubInstance
|
||||
}
|
||||
|
||||
declare const artplayerPluginJassub: (option: JassubOption) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerPluginJassub
|
||||
|
||||
export = packages\artplayerPluginJassub\types\artplayerPluginJassub;
|
||||
export as namespace packages\artplayerPluginJassub\types\artplayerPluginJassub;
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
declare const artplayerPluginMultipleSubtitles: (option: {
|
||||
subtitles: {
|
||||
url?: string
|
||||
name?: string
|
||||
type?: 'vtt' | 'srt' | 'ass'
|
||||
encoding?: string
|
||||
onParser?: (...args: object[]) => object
|
||||
}[]
|
||||
}) => (art: Artplayer) => {
|
||||
name: 'multipleSubtitles'
|
||||
}
|
||||
|
||||
export default artplayerPluginMultipleSubtitles
|
||||
|
||||
export = packages\artplayerPluginMultipleSubtitles\types\artplayerPluginMultipleSubtitles;
|
||||
export as namespace packages\artplayerPluginMultipleSubtitles\types\artplayerPluginMultipleSubtitles;
|
||||
-36
@@ -1,36 +0,0 @@
|
||||
declare global {
|
||||
interface Window {
|
||||
artplayerPluginVast?: typeof artplayerPluginVast
|
||||
}
|
||||
}
|
||||
|
||||
type PlayUrlFn = (url: string, config?: any) => void
|
||||
type PlayResFn = (res: string, config?: any) => void
|
||||
|
||||
interface VastPluginContext {
|
||||
art: Artplayer
|
||||
ima: any
|
||||
imaPlayer: Player | null
|
||||
playUrl: PlayUrlFn
|
||||
playRes: PlayResFn
|
||||
init: () => Player
|
||||
adsRenderingSettings: any
|
||||
playerOptions: PlayerOptions
|
||||
container: HTMLDivElement | null
|
||||
}
|
||||
|
||||
export type ArtplayerPluginVastOption = (params: VastPluginContext) => void | Promise<void>
|
||||
|
||||
export interface ArtplayerPluginVastInstance {
|
||||
name: 'artplayerPluginVast'
|
||||
destroy?: () => void
|
||||
}
|
||||
|
||||
declare function artplayerPluginVast(
|
||||
option: ArtplayerPluginVastOption,
|
||||
): (art: Artplayer) => ArtplayerPluginVastInstance
|
||||
|
||||
export default artplayerPluginVast
|
||||
|
||||
export = packages\artplayerPluginVast\types\artplayerPluginVast;
|
||||
export as namespace packages\artplayerPluginVast\types\artplayerPluginVast;
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
declare const artplayerPluginVttThumbnail: (option: { vtt?: string, style?: Partial<CSSStyleDeclaration> }) => (
|
||||
art: Artplayer,
|
||||
) => {
|
||||
name: 'artplayerPluginVttThumbnail'
|
||||
}
|
||||
|
||||
export default artplayerPluginVttThumbnail
|
||||
|
||||
export = packages\artplayerPluginVttThumbnail\types\artplayerPluginVttThumbnail;
|
||||
export as namespace packages\artplayerPluginVttThumbnail\types\artplayerPluginVttThumbnail;
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
type Option = (ctx: CanvasRenderingContext2D, video: HTMLVideoElement) => void
|
||||
|
||||
type Result = HTMLCanvasElement
|
||||
|
||||
declare const artplayerProxyCanvas: (option?: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerProxyCanvas
|
||||
|
||||
export = packages\artplayerProxyCanvas\types\artplayerProxyCanvas;
|
||||
export as namespace packages\artplayerProxyCanvas\types\artplayerProxyCanvas;
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
interface Option {
|
||||
/**
|
||||
* Timeout for loading media in milliseconds
|
||||
* @default 0
|
||||
*/
|
||||
loadTimeout?: number
|
||||
|
||||
/**
|
||||
* Interval for timeupdate events in milliseconds
|
||||
* @default 250
|
||||
*/
|
||||
timeupdateInterval?: number
|
||||
|
||||
/**
|
||||
* Audio-video synchronization tolerance in seconds
|
||||
* @default 0.12
|
||||
*/
|
||||
avSyncTolerance?: number
|
||||
|
||||
/**
|
||||
* Whether to drop late video frames
|
||||
* @default false
|
||||
*/
|
||||
dropLateFrames?: boolean
|
||||
|
||||
/**
|
||||
* Poster image URL
|
||||
*/
|
||||
poster?: string
|
||||
|
||||
/**
|
||||
* Media source (URL, Blob, or ReadableStream)
|
||||
*/
|
||||
source?: string | Blob | ReadableStream<Uint8Array>
|
||||
|
||||
/**
|
||||
* Check if server supports range requests before loading
|
||||
* @default false
|
||||
*/
|
||||
preflightRange?: boolean
|
||||
|
||||
/**
|
||||
* Initial volume (0-1)
|
||||
* @default 0.7
|
||||
*/
|
||||
volume?: number
|
||||
|
||||
/**
|
||||
* Initial muted state
|
||||
* @default false
|
||||
*/
|
||||
muted?: boolean
|
||||
|
||||
/**
|
||||
* Autoplay
|
||||
* @default false
|
||||
*/
|
||||
autoplay?: boolean
|
||||
|
||||
/**
|
||||
* Loop playback
|
||||
* @default false
|
||||
*/
|
||||
loop?: boolean
|
||||
|
||||
/**
|
||||
* Cross-origin setting
|
||||
*/
|
||||
crossOrigin?: string
|
||||
}
|
||||
|
||||
type Result = HTMLCanvasElement
|
||||
|
||||
declare const artplayerProxyMediabunny: (option?: Option) => (art: Artplayer) => Result
|
||||
|
||||
export default artplayerProxyMediabunny
|
||||
|
||||
export = packages\artplayerProxyMediabunny\types\artplayerProxyMediabunny;
|
||||
export as namespace packages\artplayerProxyMediabunny\types\artplayerProxyMediabunny;
|
||||
Reference in new issue
Block a user