From 17042867fcc581752eb724748428a05d13ec9f28 Mon Sep 17 00:00:00 2001 From: Harvey Zhao Date: Tue, 10 Feb 2026 23:12:03 +0800 Subject: [PATCH] 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. --- docs/assets/js/common.js | 40 +-- docs/assets/ts/artplayer-plugin-ads.d.ts | 4 +- .../assets/ts/artplayer-plugin-ambilight.d.ts | 4 +- docs/assets/ts/artplayer-plugin-asr.d.ts | 4 +- .../ts/artplayer-plugin-audio-track.d.ts | 4 +- .../ts/artplayer-plugin-auto-thumbnail.d.ts | 4 +- docs/assets/ts/artplayer-plugin-chapter.d.ts | 4 +- .../ts/artplayer-plugin-chromecast.d.ts | 4 +- .../ts/artplayer-plugin-danmuku-mask.d.ts | 4 +- docs/assets/ts/artplayer-plugin-danmuku.d.ts | 4 +- .../ts/artplayer-plugin-dash-control.d.ts | 4 +- .../ts/artplayer-plugin-document-pip.d.ts | 4 +- .../ts/artplayer-plugin-hls-control.d.ts | 4 +- docs/assets/ts/artplayer-plugin-iframe.d.ts | 4 +- docs/assets/ts/artplayer-plugin-jassub.d.ts | 4 +- .../artplayer-plugin-multiple-subtitles.d.ts | 4 +- docs/assets/ts/artplayer-plugin-vast.d.ts | 15 +- .../ts/artplayer-plugin-vtt-thumbnail.d.ts | 4 +- .../types => }/artplayer-plugin-websr.d.ts | 4 +- docs/assets/ts/artplayer-proxy-canvas.d.ts | 4 +- .../assets/ts/artplayer-proxy-mediabunny.d.ts | 4 +- docs/assets/ts/artplayer.d.ts | 36 ++- .../types/artplayer-plugin-ads.d.ts | 52 ---- .../types/artplayer-plugin-ambilight.d.ts | 20 -- .../types/artplayer-plugin-asr.d.ts | 26 -- .../types/artplayer-plugin-audio-track.d.ts | 40 --- .../artplayer-plugin-auto-thumbnail.d.ts | 17 -- .../types/artplayer-plugin-chapter.d.ts | 21 -- .../types/artplayer-plugin-chromecast.d.ts | 17 -- .../types/artplayer-plugin-danmuku-mask.d.ts | 25 -- .../types/artplayer-plugin-danmuku.d.ts | 259 ------------------ .../types/artplayer-plugin-dash-control.d.ts | 17 -- .../types/artplayer-plugin-document-pip.d.ts | 22 -- .../types/artplayer-plugin-hls-control.d.ts | 17 -- .../types/artplayer-plugin-iframe.d.ts | 32 --- .../types/artplayer-plugin-jassub.d.ts | 38 --- .../artplayer-plugin-multiple-subtitles.d.ts | 16 -- .../types/artplayer-plugin-vast.d.ts | 36 --- .../types/artplayer-plugin-vtt-thumbnail.d.ts | 10 - .../types/artplayer-proxy-canvas.d.ts | 10 - .../types/artplayer-proxy-mediabunny.d.ts | 79 ------ docs/document/404.html | 2 +- docs/document/advanced/built-in.html | 2 +- docs/document/advanced/class.html | 2 +- docs/document/advanced/event.html | 2 +- docs/document/advanced/global.html | 2 +- docs/document/advanced/plugin.html | 2 +- docs/document/advanced/property.html | 2 +- ...md.BvE8b20f.js => en_index.md.CYpcDsY6.js} | 8 +- ...f.lean.js => en_index.md.CYpcDsY6.lean.js} | 0 ...Rh2JGz.js => en_start_i18n.md.x4tw6CvN.js} | 2 +- ...n.js => en_start_i18n.md.x4tw6CvN.lean.js} | 0 ...ex.md.Cg4MitRm.js => index.md.B8NxRV94.js} | 8 +- ...itRm.lean.js => index.md.B8NxRV94.lean.js} | 0 ...FUpaT.js => plugin_danmuku.md.C7LHV45A.js} | 2 +- ....js => plugin_danmuku.md.C7LHV45A.lean.js} | 0 ....DtnhVL8s.js => start_i18n.md.B0XPxv4h.js} | 2 +- ...lean.js => start_i18n.md.B0XPxv4h.lean.js} | 0 docs/document/component/contextmenu.html | 2 +- docs/document/component/controls.html | 2 +- docs/document/component/layers.html | 2 +- docs/document/component/setting.html | 2 +- docs/document/en/advanced/built-in.html | 2 +- docs/document/en/advanced/class.html | 2 +- docs/document/en/advanced/event.html | 2 +- docs/document/en/advanced/global.html | 2 +- docs/document/en/advanced/plugin.html | 2 +- docs/document/en/advanced/property.html | 2 +- docs/document/en/component/contextmenu.html | 2 +- docs/document/en/component/controls.html | 2 +- docs/document/en/component/layers.html | 2 +- docs/document/en/component/setting.html | 2 +- docs/document/en/index.html | 12 +- docs/document/en/start/i18n.html | 6 +- docs/document/en/start/option.html | 2 +- docs/document/hashmap.json | 2 +- docs/document/index.html | 12 +- docs/document/plugin/danmuku.html | 6 +- docs/document/start/i18n.html | 6 +- docs/document/start/option.html | 2 +- scripts/build-ts.js | 5 +- 81 files changed, 160 insertions(+), 878 deletions(-) rename docs/assets/ts/{packages/artplayer-plugin-websr/types => }/artplayer-plugin-websr.d.ts (93%) delete mode 100644 docs/assets/ts/packages/artplayer-plugin-ads/types/artplayer-plugin-ads.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-ambilight/types/artplayer-plugin-ambilight.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-asr/types/artplayer-plugin-asr.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-audio-track/types/artplayer-plugin-audio-track.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-auto-thumbnail/types/artplayer-plugin-auto-thumbnail.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-chromecast/types/artplayer-plugin-chromecast.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-danmuku-mask/types/artplayer-plugin-danmuku-mask.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-danmuku/types/artplayer-plugin-danmuku.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-document-pip/types/artplayer-plugin-document-pip.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-hls-control/types/artplayer-plugin-hls-control.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-iframe/types/artplayer-plugin-iframe.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-jassub/types/artplayer-plugin-jassub.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-multiple-subtitles/types/artplayer-plugin-multiple-subtitles.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-vast/types/artplayer-plugin-vast.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-plugin-vtt-thumbnail/types/artplayer-plugin-vtt-thumbnail.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-proxy-canvas/types/artplayer-proxy-canvas.d.ts delete mode 100644 docs/assets/ts/packages/artplayer-proxy-mediabunny/types/artplayer-proxy-mediabunny.d.ts rename docs/document/assets/{en_index.md.BvE8b20f.js => en_index.md.CYpcDsY6.js} (98%) rename docs/document/assets/{en_index.md.BvE8b20f.lean.js => en_index.md.CYpcDsY6.lean.js} (100%) rename docs/document/assets/{en_start_i18n.md.DtRh2JGz.js => en_start_i18n.md.x4tw6CvN.js} (98%) rename docs/document/assets/{en_start_i18n.md.DtRh2JGz.lean.js => en_start_i18n.md.x4tw6CvN.lean.js} (100%) rename docs/document/assets/{index.md.Cg4MitRm.js => index.md.B8NxRV94.js} (98%) rename docs/document/assets/{index.md.Cg4MitRm.lean.js => index.md.B8NxRV94.lean.js} (100%) rename docs/document/assets/{plugin_danmuku.md.DUAFUpaT.js => plugin_danmuku.md.C7LHV45A.js} (99%) rename docs/document/assets/{plugin_danmuku.md.DUAFUpaT.lean.js => plugin_danmuku.md.C7LHV45A.lean.js} (100%) rename docs/document/assets/{start_i18n.md.DtnhVL8s.js => start_i18n.md.B0XPxv4h.js} (98%) rename docs/document/assets/{start_i18n.md.DtnhVL8s.lean.js => start_i18n.md.B0XPxv4h.lean.js} (100%) diff --git a/docs/assets/js/common.js b/docs/assets/js/common.js index f0d258a8d..55486716f 100644 --- a/docs/assets/js/common.js +++ b/docs/assets/js/common.js @@ -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', ] diff --git a/docs/assets/ts/artplayer-plugin-ads.d.ts b/docs/assets/ts/artplayer-plugin-ads.d.ts index 618fdd6c1..dd3cde90e 100644 --- a/docs/assets/ts/artplayer-plugin-ads.d.ts +++ b/docs/assets/ts/artplayer-plugin-ads.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-ambilight.d.ts b/docs/assets/ts/artplayer-plugin-ambilight.d.ts index 50abda15a..786b884f4 100644 --- a/docs/assets/ts/artplayer-plugin-ambilight.d.ts +++ b/docs/assets/ts/artplayer-plugin-ambilight.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-asr.d.ts b/docs/assets/ts/artplayer-plugin-asr.d.ts index 769e0b30f..a134e7348 100644 --- a/docs/assets/ts/artplayer-plugin-asr.d.ts +++ b/docs/assets/ts/artplayer-plugin-asr.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-audio-track.d.ts b/docs/assets/ts/artplayer-plugin-audio-track.d.ts index 6d2dd469b..aaddaa9cc 100644 --- a/docs/assets/ts/artplayer-plugin-audio-track.d.ts +++ b/docs/assets/ts/artplayer-plugin-audio-track.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-auto-thumbnail.d.ts b/docs/assets/ts/artplayer-plugin-auto-thumbnail.d.ts index e6f616aa0..dff0302ce 100644 --- a/docs/assets/ts/artplayer-plugin-auto-thumbnail.d.ts +++ b/docs/assets/ts/artplayer-plugin-auto-thumbnail.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-chapter.d.ts b/docs/assets/ts/artplayer-plugin-chapter.d.ts index 5d6f7b378..0c16baa40 100644 --- a/docs/assets/ts/artplayer-plugin-chapter.d.ts +++ b/docs/assets/ts/artplayer-plugin-chapter.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-chromecast.d.ts b/docs/assets/ts/artplayer-plugin-chromecast.d.ts index 5069b042d..4d3aadd12 100644 --- a/docs/assets/ts/artplayer-plugin-chromecast.d.ts +++ b/docs/assets/ts/artplayer-plugin-chromecast.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-danmuku-mask.d.ts b/docs/assets/ts/artplayer-plugin-danmuku-mask.d.ts index 68515f8f8..b2c996b79 100644 --- a/docs/assets/ts/artplayer-plugin-danmuku-mask.d.ts +++ b/docs/assets/ts/artplayer-plugin-danmuku-mask.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-danmuku.d.ts b/docs/assets/ts/artplayer-plugin-danmuku.d.ts index 554ce0fe2..6f6a5ec04 100644 --- a/docs/assets/ts/artplayer-plugin-danmuku.d.ts +++ b/docs/assets/ts/artplayer-plugin-danmuku.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-dash-control.d.ts b/docs/assets/ts/artplayer-plugin-dash-control.d.ts index 39a52d129..35057bb07 100644 --- a/docs/assets/ts/artplayer-plugin-dash-control.d.ts +++ b/docs/assets/ts/artplayer-plugin-dash-control.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-document-pip.d.ts b/docs/assets/ts/artplayer-plugin-document-pip.d.ts index df061d9f4..dee9d2c41 100644 --- a/docs/assets/ts/artplayer-plugin-document-pip.d.ts +++ b/docs/assets/ts/artplayer-plugin-document-pip.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-hls-control.d.ts b/docs/assets/ts/artplayer-plugin-hls-control.d.ts index f047513e8..01c881339 100644 --- a/docs/assets/ts/artplayer-plugin-hls-control.d.ts +++ b/docs/assets/ts/artplayer-plugin-hls-control.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-iframe.d.ts b/docs/assets/ts/artplayer-plugin-iframe.d.ts index 88cfd5bad..f5ebf54f5 100644 --- a/docs/assets/ts/artplayer-plugin-iframe.d.ts +++ b/docs/assets/ts/artplayer-plugin-iframe.d.ts @@ -28,5 +28,5 @@ declare class ArtplayerPluginIframe { export default ArtplayerPluginIframe -export = artplayerPluginIframe -export as namespace artplayerPluginIframe; +export = artplayerPluginIframe; +export as namespace artplayerPluginIframe; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-jassub.d.ts b/docs/assets/ts/artplayer-plugin-jassub.d.ts index 27e10fe86..0239d173d 100644 --- a/docs/assets/ts/artplayer-plugin-jassub.d.ts +++ b/docs/assets/ts/artplayer-plugin-jassub.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-multiple-subtitles.d.ts b/docs/assets/ts/artplayer-plugin-multiple-subtitles.d.ts index a6f710bc1..4d6161dff 100644 --- a/docs/assets/ts/artplayer-plugin-multiple-subtitles.d.ts +++ b/docs/assets/ts/artplayer-plugin-multiple-subtitles.d.ts @@ -12,5 +12,5 @@ declare const artplayerPluginMultipleSubtitles: (option: { export default artplayerPluginMultipleSubtitles -export = artplayerPluginMultipleSubtitles -export as namespace artplayerPluginMultipleSubtitles; +export = artplayerPluginMultipleSubtitles; +export as namespace artplayerPluginMultipleSubtitles; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-vast.d.ts b/docs/assets/ts/artplayer-plugin-vast.d.ts index 41d815667..7d526fd4b 100644 --- a/docs/assets/ts/artplayer-plugin-vast.d.ts +++ b/docs/assets/ts/artplayer-plugin-vast.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-plugin-vtt-thumbnail.d.ts b/docs/assets/ts/artplayer-plugin-vtt-thumbnail.d.ts index 4e8307e77..aaed1e528 100644 --- a/docs/assets/ts/artplayer-plugin-vtt-thumbnail.d.ts +++ b/docs/assets/ts/artplayer-plugin-vtt-thumbnail.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-websr/types/artplayer-plugin-websr.d.ts b/docs/assets/ts/artplayer-plugin-websr.d.ts similarity index 93% rename from docs/assets/ts/packages/artplayer-plugin-websr/types/artplayer-plugin-websr.d.ts rename to docs/assets/ts/artplayer-plugin-websr.d.ts index e18cf0696..a2adaaf32 100644 --- a/docs/assets/ts/packages/artplayer-plugin-websr/types/artplayer-plugin-websr.d.ts +++ b/docs/assets/ts/artplayer-plugin-websr.d.ts @@ -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; \ No newline at end of file +export = artplayerPluginWebsr; +export as namespace artplayerPluginWebsr; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-proxy-canvas.d.ts b/docs/assets/ts/artplayer-proxy-canvas.d.ts index 0db0ddf98..caf16cc42 100644 --- a/docs/assets/ts/artplayer-proxy-canvas.d.ts +++ b/docs/assets/ts/artplayer-proxy-canvas.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer-proxy-mediabunny.d.ts b/docs/assets/ts/artplayer-proxy-mediabunny.d.ts index 823eb12ab..152c886fb 100644 --- a/docs/assets/ts/artplayer-proxy-mediabunny.d.ts +++ b/docs/assets/ts/artplayer-proxy-mediabunny.d.ts @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/artplayer.d.ts b/docs/assets/ts/artplayer.d.ts index 401974c9a..964913abc 100644 --- a/docs/assets/ts/artplayer.d.ts +++ b/docs/assets/ts/artplayer.d.ts @@ -126,6 +126,8 @@ export interface Subtitle { onVttLoad?: (vtt: string) => string } + + export interface SettingOption extends Omit { 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) export type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | (number & Record) export type Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record) @@ -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 } -export = Artplayer -export as namespace Artplayer; +export = Artplayer; +export as namespace Artplayer; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-ads/types/artplayer-plugin-ads.d.ts b/docs/assets/ts/packages/artplayer-plugin-ads/types/artplayer-plugin-ads.d.ts deleted file mode 100644 index ef42e2d59..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-ads/types/artplayer-plugin-ads.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-ambilight/types/artplayer-plugin-ambilight.d.ts b/docs/assets/ts/packages/artplayer-plugin-ambilight/types/artplayer-plugin-ambilight.d.ts deleted file mode 100644 index 5a8e214fd..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-ambilight/types/artplayer-plugin-ambilight.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-asr/types/artplayer-plugin-asr.d.ts b/docs/assets/ts/packages/artplayer-plugin-asr/types/artplayer-plugin-asr.d.ts deleted file mode 100644 index a080639fd..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-asr/types/artplayer-plugin-asr.d.ts +++ /dev/null @@ -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 -} - -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-audio-track/types/artplayer-plugin-audio-track.d.ts b/docs/assets/ts/packages/artplayer-plugin-audio-track/types/artplayer-plugin-audio-track.d.ts deleted file mode 100644 index e7ca50117..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-audio-track/types/artplayer-plugin-audio-track.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-auto-thumbnail/types/artplayer-plugin-auto-thumbnail.d.ts b/docs/assets/ts/packages/artplayer-plugin-auto-thumbnail/types/artplayer-plugin-auto-thumbnail.d.ts deleted file mode 100644 index b52fe3e8e..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-auto-thumbnail/types/artplayer-plugin-auto-thumbnail.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts b/docs/assets/ts/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts deleted file mode 100644 index 40c834635..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-chapter/types/artplayer-plugin-chapter.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-chromecast/types/artplayer-plugin-chromecast.d.ts b/docs/assets/ts/packages/artplayer-plugin-chromecast/types/artplayer-plugin-chromecast.d.ts deleted file mode 100644 index 07b95d502..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-chromecast/types/artplayer-plugin-chromecast.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-danmuku-mask/types/artplayer-plugin-danmuku-mask.d.ts b/docs/assets/ts/packages/artplayer-plugin-danmuku-mask/types/artplayer-plugin-danmuku-mask.d.ts deleted file mode 100644 index f2e367d1c..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-danmuku-mask/types/artplayer-plugin-danmuku-mask.d.ts +++ /dev/null @@ -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 - 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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-danmuku/types/artplayer-plugin-danmuku.d.ts b/docs/assets/ts/packages/artplayer-plugin-danmuku/types/artplayer-plugin-danmuku.d.ts deleted file mode 100644 index d3c62ed2c..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-danmuku/types/artplayer-plugin-danmuku.d.ts +++ /dev/null @@ -1,259 +0,0 @@ -export type Mode = 0 | 1 | 2 -export type Danmuku - = | Danmu[] - | string // URL - | (() => Promise) - | Promise - -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 -} - -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 - - /** - * 弹幕显示前的过滤器,支持返回 Promise - */ - beforeVisible?: (danmu: Danmu) => boolean | Promise - - /** - * 弹幕是否可见 - */ - 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 - - /** - * 实时改变弹幕配置 - */ - 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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts b/docs/assets/ts/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts deleted file mode 100644 index 8f4e1574c..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-dash-control/types/artplayer-plugin-dash-control.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-document-pip/types/artplayer-plugin-document-pip.d.ts b/docs/assets/ts/packages/artplayer-plugin-document-pip/types/artplayer-plugin-document-pip.d.ts deleted file mode 100644 index bcb7fc5b1..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-document-pip/types/artplayer-plugin-document-pip.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-hls-control/types/artplayer-plugin-hls-control.d.ts b/docs/assets/ts/packages/artplayer-plugin-hls-control/types/artplayer-plugin-hls-control.d.ts deleted file mode 100644 index 6d16fe2d3..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-hls-control/types/artplayer-plugin-hls-control.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-iframe/types/artplayer-plugin-iframe.d.ts b/docs/assets/ts/packages/artplayer-plugin-iframe/types/artplayer-plugin-iframe.d.ts deleted file mode 100644 index 78e94018e..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-iframe/types/artplayer-plugin-iframe.d.ts +++ /dev/null @@ -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 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 - commit any>(callback: T): Promise> - message(callback: (...args: any[]) => any): void - destroy(): void -} - -export default ArtplayerPluginIframe - -export = packages\artplayerPluginIframe\types\artplayerPluginIframe; -export as namespace packages\artplayerPluginIframe\types\artplayerPluginIframe; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-jassub/types/artplayer-plugin-jassub.d.ts b/docs/assets/ts/packages/artplayer-plugin-jassub/types/artplayer-plugin-jassub.d.ts deleted file mode 100644 index 63c8f79d8..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-jassub/types/artplayer-plugin-jassub.d.ts +++ /dev/null @@ -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 - 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 - setVideo: (video: HTMLVideoElement) => Promise - destroy: () => Promise - [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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-multiple-subtitles/types/artplayer-plugin-multiple-subtitles.d.ts b/docs/assets/ts/packages/artplayer-plugin-multiple-subtitles/types/artplayer-plugin-multiple-subtitles.d.ts deleted file mode 100644 index c1bd2ac56..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-multiple-subtitles/types/artplayer-plugin-multiple-subtitles.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-vast/types/artplayer-plugin-vast.d.ts b/docs/assets/ts/packages/artplayer-plugin-vast/types/artplayer-plugin-vast.d.ts deleted file mode 100644 index 30eadbe2a..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-vast/types/artplayer-plugin-vast.d.ts +++ /dev/null @@ -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 - -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-plugin-vtt-thumbnail/types/artplayer-plugin-vtt-thumbnail.d.ts b/docs/assets/ts/packages/artplayer-plugin-vtt-thumbnail/types/artplayer-plugin-vtt-thumbnail.d.ts deleted file mode 100644 index ff816fccf..000000000 --- a/docs/assets/ts/packages/artplayer-plugin-vtt-thumbnail/types/artplayer-plugin-vtt-thumbnail.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -declare const artplayerPluginVttThumbnail: (option: { vtt?: string, style?: Partial }) => ( - art: Artplayer, -) => { - name: 'artplayerPluginVttThumbnail' -} - -export default artplayerPluginVttThumbnail - -export = packages\artplayerPluginVttThumbnail\types\artplayerPluginVttThumbnail; -export as namespace packages\artplayerPluginVttThumbnail\types\artplayerPluginVttThumbnail; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-proxy-canvas/types/artplayer-proxy-canvas.d.ts b/docs/assets/ts/packages/artplayer-proxy-canvas/types/artplayer-proxy-canvas.d.ts deleted file mode 100644 index 87b3c9558..000000000 --- a/docs/assets/ts/packages/artplayer-proxy-canvas/types/artplayer-proxy-canvas.d.ts +++ /dev/null @@ -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; \ No newline at end of file diff --git a/docs/assets/ts/packages/artplayer-proxy-mediabunny/types/artplayer-proxy-mediabunny.d.ts b/docs/assets/ts/packages/artplayer-proxy-mediabunny/types/artplayer-proxy-mediabunny.d.ts deleted file mode 100644 index 8d22f0f4c..000000000 --- a/docs/assets/ts/packages/artplayer-proxy-mediabunny/types/artplayer-proxy-mediabunny.d.ts +++ /dev/null @@ -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 - - /** - * 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; \ No newline at end of file diff --git a/docs/document/404.html b/docs/document/404.html index a9d41f1b3..363a1f340 100644 --- a/docs/document/404.html +++ b/docs/document/404.html @@ -21,7 +21,7 @@
- + \ No newline at end of file diff --git a/docs/document/advanced/built-in.html b/docs/document/advanced/built-in.html index 9c84ab646..f2c9f120c 100644 --- a/docs/document/advanced/built-in.html +++ b/docs/document/advanced/built-in.html @@ -217,7 +217,7 @@ art.on('ready', () => { art.plugins.add(myPlugin); }); - + \ No newline at end of file diff --git a/docs/document/advanced/class.html b/docs/document/advanced/class.html index 516a53506..a234111d1 100644 --- a/docs/document/advanced/class.html +++ b/docs/document/advanced/class.html @@ -31,7 +31,7 @@ }); console.info([...Artplayer.instances]);

version ​

返回播放器的版本信息

▶ Run Code
js
console.info(Artplayer.version);

env ​

返回播放器的环境变量

▶ Run Code
js
console.info(Artplayer.env);

build ​

返回播放器的打包时间

▶ Run Code
js
console.info(Artplayer.build);

config ​

返回视频的默认配置

▶ Run Code
js
console.info(Artplayer.config);

utils ​

返回播放器的工具函数集合

▶ Run Code
js
console.info(Artplayer.utils);

全部工具函数请参考以下地址:

artplayer/types/utils.d.ts

scheme ​

返回播放器选项的校验方案

▶ Run Code
js
console.info(Artplayer.scheme);

Emitter ​

返回事件分发器的构造函数

▶ Run Code
js
console.info(Artplayer.Emitter);

validator ​

返回选项的校验函数

▶ Run Code
js
console.info(Artplayer.validator);

kindOf ​

返回类型检测的函数工具

▶ Run Code
js
console.info(Artplayer.kindOf);

html ​

返回播放器所需的 html 字符串

▶ Run Code
js
console.info(Artplayer.html);

option ​

返回播放器的默认选项

▶ Run Code
js
console.info(Artplayer.option);
- + \ No newline at end of file diff --git a/docs/document/advanced/event.html b/docs/document/advanced/event.html index 3091fb6a5..c7cf6f4b6 100644 --- a/docs/document/advanced/event.html +++ b/docs/document/advanced/event.html @@ -385,7 +385,7 @@ art.on('keydown', (event) => { console.log(event.code); });

video:canplay ​

浏览器可以播放媒体文件了,但估计没有足够的数据来支撑播放到结束,不必停下来进一步缓冲内容

video:canplaythrough ​

浏览器估计它可以在不停止内容缓冲的情况下播放媒体直到结束

video:complete ​

OfflineAudioContext 渲染完成

video:durationchange ​

duration 属性的值改变时触发

video:emptied ​

媒体内容变为空;例如,当这个 media 已经加载完成(或者部分加载完成),则发送此事件,并调用 load() 方法重新加载它

video:ended ​

视频停止播放,因为 media 已经到达结束点

video:error ​

获取媒体数据时出错,或者资源类型不是受支持的媒体格式

video:loadeddata ​

media 中的首帧已经完成加载

video:loadedmetadata ​

已加载元数据

video:pause ​

播放已暂停

video:play ​

播放已开始

video:playing ​

由于缺乏数据而暂停或延迟后,播放准备开始

video:progress ​

在浏览器加载资源时周期性触发

video:ratechange ​

播放速率发生变化

video:seeked ​

跳帧(seek)操作完成

video:seeking ​

跳帧(seek)操作开始

video:stalled ​

用户代理(user agent)正在尝试获取媒体数据,但数据意外未出现

video:suspend ​

媒体数据加载已暂停

video:timeupdate ​

currentTime 属性指定的时间发生变化

video:volumechange ​

音量发生变化

video:waiting ​

由于暂时缺少数据,播放已停止

- + \ No newline at end of file diff --git a/docs/document/advanced/global.html b/docs/document/advanced/global.html index d11687349..2f6c08ca5 100644 --- a/docs/document/advanced/global.html +++ b/docs/document/advanced/global.html @@ -248,7 +248,7 @@ // 只销毁界面,不主动清空 src art.destroy(); - + \ No newline at end of file diff --git a/docs/document/advanced/plugin.html b/docs/document/advanced/plugin.html index e67fa370c..a357069ca 100644 --- a/docs/document/advanced/plugin.html +++ b/docs/document/advanced/plugin.html @@ -122,7 +122,7 @@ }) ], }); - + \ No newline at end of file diff --git a/docs/document/advanced/property.html b/docs/document/advanced/property.html index 11ec0fa64..ba48daaae 100644 --- a/docs/document/advanced/property.html +++ b/docs/document/advanced/property.html @@ -457,7 +457,7 @@ art.on('ready', () => { art.subtitleOffset = 1; }); - + \ No newline at end of file diff --git a/docs/document/assets/en_index.md.BvE8b20f.js b/docs/document/assets/en_index.md.CYpcDsY6.js similarity index 98% rename from docs/document/assets/en_index.md.BvE8b20f.js rename to docs/document/assets/en_index.md.CYpcDsY6.js index 459c9e243..af7a1c754 100644 --- a/docs/document/assets/en_index.md.BvE8b20f.js +++ b/docs/document/assets/en_index.md.CYpcDsY6.js @@ -1,4 +1,4 @@ -import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g=JSON.parse('{"title":"Installation & Usage","description":"","frontmatter":{},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md","lastUpdated":1767420511000}'),p={name:"en/index.md"};function t(e,s,h,k,r,E){return a(),n("div",null,s[0]||(s[0]=[l(`

Installation & Usage ​

Installation ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

Usage ​

html
<html>
+import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g=JSON.parse('{"title":"Installation & Usage","description":"","frontmatter":{},"headers":[],"relativePath":"en/index.md","filePath":"en/index.md","lastUpdated":1767420511000}'),p={name:"en/index.md"};function t(e,s,h,k,r,E){return a(),n("div",null,s[0]||(s[0]=[l(`

Installation & Usage ​

Installation ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

Usage ​

html
<html>
     <head>
         <title>ArtPlayer Demo</title>
         <meta charset="UTF-8" />
@@ -19,7 +19,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
           });
         </script>
     </body>
-</html>

Note

The player's dimensions depend on the size of its container container, so your container must have defined dimensions.

See more usage examples at the following link:

/example

Vue.js ​

vue
<template>
+</html>

Note

The player's dimensions depend on the size of its container container, so your container must have defined dimensions.

See more usage examples at the following link:

/example

Vue.js ​

vue
<template>
   <div ref="$container" />
 </template>
 
@@ -71,7 +71,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
 function getInstance(art) {
   console.log(art)
 }
-</script>

Artplayer is not reactive:

Directly modifying option in Vue.js will not update the player.

React.js ​

jsx
import Artplayer from 'artplayer'
+</script>

Artplayer is not reactive:

Directly modifying option in Vue.js will not update the player.

React.js ​

jsx
import Artplayer from 'artplayer'
 import { useEffect, useRef } from 'react'
 
 export default function Player({ option, getInstance, ...rest }) {
@@ -154,7 +154,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
 
 option.volume = 0.5;
 
-const art8 = new Artplayer(option);

Legacy Browsers ​

The production build artplayer.js only supports the latest major version of Chrome: last 1 Chrome version

For legacy browsers, you can use the artplayer.legacy.js file, which supports compatibility down to: IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

If you need to support even older browsers, modify the following configuration and build it yourself:

Build configuration: scripts/build.js

Reference documentation: browserslist

ECMAScript Module ​

Starting from 5.2.6, artplayer and all plugins also provide an ESM version mjs, such as:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
+const art8 = new Artplayer(option);

Legacy Browsers ​

The production build artplayer.js only supports the latest major version of Chrome: last 1 Chrome version

For legacy browsers, you can use the artplayer.legacy.js file, which supports compatibility down to: IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

If you need to support even older browsers, modify the following configuration and build it yourself:

Build configuration: scripts/build.js

Reference documentation: browserslist

ECMAScript Module ​

Starting from 5.2.6, artplayer and all plugins also provide an ESM version mjs, such as:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
 <html lang="en">
 
 <head>
diff --git a/docs/document/assets/en_index.md.BvE8b20f.lean.js b/docs/document/assets/en_index.md.CYpcDsY6.lean.js
similarity index 100%
rename from docs/document/assets/en_index.md.BvE8b20f.lean.js
rename to docs/document/assets/en_index.md.CYpcDsY6.lean.js
diff --git a/docs/document/assets/en_start_i18n.md.DtRh2JGz.js b/docs/document/assets/en_start_i18n.md.x4tw6CvN.js
similarity index 98%
rename from docs/document/assets/en_start_i18n.md.DtRh2JGz.js
rename to docs/document/assets/en_start_i18n.md.x4tw6CvN.js
index 6f0753ce7..2ecead6bd 100644
--- a/docs/document/assets/en_start_i18n.md.DtRh2JGz.js
+++ b/docs/document/assets/en_start_i18n.md.x4tw6CvN.js
@@ -2,7 +2,7 @@ import{_ as a,o as i,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
     container: '.artplayer-app',
     url: '/assets/sample/video.mp4',
     lang: 'zh-cn', // or 'en'
-});

Importing Languages ​

Language files before bundling are located at: artplayer/src/i18n/*.js. Contributions to add your language are welcome.

Language files after bundling are located at: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
+});

Importing Languages ​

Language files before bundling are located at: artplayer/src/i18n/*.js. Contributions to add your language are welcome.

Language files after bundling are located at: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
 import zhTw from 'artplayer/i18n/zh-tw';
 
 var art = new Artplayer({
diff --git a/docs/document/assets/en_start_i18n.md.DtRh2JGz.lean.js b/docs/document/assets/en_start_i18n.md.x4tw6CvN.lean.js
similarity index 100%
rename from docs/document/assets/en_start_i18n.md.DtRh2JGz.lean.js
rename to docs/document/assets/en_start_i18n.md.x4tw6CvN.lean.js
diff --git a/docs/document/assets/index.md.Cg4MitRm.js b/docs/document/assets/index.md.B8NxRV94.js
similarity index 98%
rename from docs/document/assets/index.md.Cg4MitRm.js
rename to docs/document/assets/index.md.B8NxRV94.js
index 9400e70d6..394747784 100644
--- a/docs/document/assets/index.md.Cg4MitRm.js
+++ b/docs/document/assets/index.md.B8NxRV94.js
@@ -1,4 +1,4 @@
-import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g=JSON.parse('{"title":"安装使用","description":"","frontmatter":{},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":1767420511000}'),p={name:"index.md"};function t(e,s,h,k,r,E){return a(),n("div",null,s[0]||(s[0]=[l(`

安装使用 ​

安装 ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

使用 ​

html
<html>
+import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g=JSON.parse('{"title":"安装使用","description":"","frontmatter":{},"headers":[],"relativePath":"index.md","filePath":"index.md","lastUpdated":1767420511000}'),p={name:"index.md"};function t(e,s,h,k,r,E){return a(),n("div",null,s[0]||(s[0]=[l(`

安装使用 ​

安装 ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

使用 ​

html
<html>
     <head>
         <title>ArtPlayer Demo</title>
         <meta charset="UTF-8" />
@@ -19,7 +19,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
           });
         </script>
     </body>
-</html>

提示

播放器的尺寸依赖于容器 container 的尺寸,所以你的容器 container 必须是有尺寸的

以下链接可以看到更多的使用例子

/example

Vue.js ​

vue
<template>
+</html>

提示

播放器的尺寸依赖于容器 container 的尺寸,所以你的容器 container 必须是有尺寸的

以下链接可以看到更多的使用例子

/example

Vue.js ​

vue
<template>
   <div ref="$container" />
 </template>
 
@@ -71,7 +71,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
 function getInstance(art) {
   console.log(art)
 }
-</script>

Artplayer 非响应式:

在 Vue.js 里直接修改 option 是不会改变播放器的

React.js ​

jsx
import Artplayer from 'artplayer'
+</script>

Artplayer 非响应式:

在 Vue.js 里直接修改 option 是不会改变播放器的

React.js ​

jsx
import Artplayer from 'artplayer'
 import { useEffect, useRef } from 'react'
 
 export default function Player({ option, getInstance, ...rest }) {
@@ -154,7 +154,7 @@ import{_ as i,o as a,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const g
 
 option.volume = 0.5;
 
-const art8 = new Artplayer(option);

古老的浏览器 ​

生产构建的 artplayer.js 只兼容最新一个主版本的 Chrome:last 1 Chrome version

对于古老的浏览器,可以使用 artplayer.legacy.js 文件,可以兼容到:IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

假如你要兼容更古老的浏览器时,请修改以下配置然后自行构建:

构建配置:scripts/build.js

参考文档:browserslist

ECMAScript Module ​

从 5.2.6 开始,artplayer 和所有插件还会提供一个 ESM 版本的 mjs,如:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
+const art8 = new Artplayer(option);

古老的浏览器 ​

生产构建的 artplayer.js 只兼容最新一个主版本的 Chrome:last 1 Chrome version

对于古老的浏览器,可以使用 artplayer.legacy.js 文件,可以兼容到:IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

假如你要兼容更古老的浏览器时,请修改以下配置然后自行构建:

构建配置:scripts/build.js

参考文档:browserslist

ECMAScript Module ​

从 5.2.6 开始,artplayer 和所有插件还会提供一个 ESM 版本的 mjs,如:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
 <html lang="en">
 
 <head>
diff --git a/docs/document/assets/index.md.Cg4MitRm.lean.js b/docs/document/assets/index.md.B8NxRV94.lean.js
similarity index 100%
rename from docs/document/assets/index.md.Cg4MitRm.lean.js
rename to docs/document/assets/index.md.B8NxRV94.lean.js
diff --git a/docs/document/assets/plugin_danmuku.md.DUAFUpaT.js b/docs/document/assets/plugin_danmuku.md.C7LHV45A.js
similarity index 99%
rename from docs/document/assets/plugin_danmuku.md.DUAFUpaT.js
rename to docs/document/assets/plugin_danmuku.md.C7LHV45A.js
index aa993cd76..66b06bc40 100644
--- a/docs/document/assets/plugin_danmuku.md.DUAFUpaT.js
+++ b/docs/document/assets/plugin_danmuku.md.C7LHV45A.js
@@ -1,4 +1,4 @@
-import{_ as n,o as l,c as p,ak as s,j as i}from"./chunks/framework.xxfEszSJ.js";const y=JSON.parse('{"title":"弹幕库","description":"","frontmatter":{},"headers":[],"relativePath":"plugin/danmuku.md","filePath":"plugin/danmuku.md","lastUpdated":1734270991000}'),h={name:"plugin/danmuku.md"};function e(k,a,t,r,E,d){return l(),p("div",null,a[0]||(a[0]=[s(`

弹幕库 ​

演示 ​

👉 查看完整演示

安装 ​

bash
npm install artplayer-plugin-danmuku
bash
yarn add artplayer-plugin-danmuku
bash
pnpm add artplayer-plugin-danmuku
html
<script src="path/to/artplayer-plugin-danmuku.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js
bash
https://unpkg.com/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js

弹幕结构 ​

每一个弹幕是一个对象,多个弹幕组成的数组就是弹幕库,通常只需要text就可以发送一个弹幕,其余都是非必要参数

js
{
+import{_ as n,o as l,c as p,ak as s,j as i}from"./chunks/framework.xxfEszSJ.js";const y=JSON.parse('{"title":"弹幕库","description":"","frontmatter":{},"headers":[],"relativePath":"plugin/danmuku.md","filePath":"plugin/danmuku.md","lastUpdated":1734270991000}'),h={name:"plugin/danmuku.md"};function e(k,a,t,r,E,d){return l(),p("div",null,a[0]||(a[0]=[s(`

弹幕库 ​

演示 ​

👉 查看完整演示

安装 ​

bash
npm install artplayer-plugin-danmuku
bash
yarn add artplayer-plugin-danmuku
bash
pnpm add artplayer-plugin-danmuku
html
<script src="path/to/artplayer-plugin-danmuku.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js
bash
https://unpkg.com/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js

弹幕结构 ​

每一个弹幕是一个对象,多个弹幕组成的数组就是弹幕库,通常只需要text就可以发送一个弹幕,其余都是非必要参数

js
{
     text: '', // 弹幕文本
     time: 10, // 弹幕时间, 默认为当前播放器时间
     mode: 0, // 弹幕模式: 0: 滚动(默认),1: 顶部,2: 底部
diff --git a/docs/document/assets/plugin_danmuku.md.DUAFUpaT.lean.js b/docs/document/assets/plugin_danmuku.md.C7LHV45A.lean.js
similarity index 100%
rename from docs/document/assets/plugin_danmuku.md.DUAFUpaT.lean.js
rename to docs/document/assets/plugin_danmuku.md.C7LHV45A.lean.js
diff --git a/docs/document/assets/start_i18n.md.DtnhVL8s.js b/docs/document/assets/start_i18n.md.B0XPxv4h.js
similarity index 98%
rename from docs/document/assets/start_i18n.md.DtnhVL8s.js
rename to docs/document/assets/start_i18n.md.B0XPxv4h.js
index 0e6a6603f..ea7ffed9d 100644
--- a/docs/document/assets/start_i18n.md.DtnhVL8s.js
+++ b/docs/document/assets/start_i18n.md.B0XPxv4h.js
@@ -2,7 +2,7 @@ import{_ as a,o as i,c as n,ak as l}from"./chunks/framework.xxfEszSJ.js";const c
     container: '.artplayer-app',
     url: '/assets/sample/video.mp4',
     lang: 'zh-cn', // or 'en'
-});

导入语言 ​

打包前的语言文件存放于: artplayer/src/i18n/*.js, 欢迎来添加你的语言

打包后的语言文件存放于: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
+});

导入语言 ​

打包前的语言文件存放于: artplayer/src/i18n/*.js, 欢迎来添加你的语言

打包后的语言文件存放于: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
 import zhTw from 'artplayer/i18n/zh-tw';
 
 var art = new Artplayer({
diff --git a/docs/document/assets/start_i18n.md.DtnhVL8s.lean.js b/docs/document/assets/start_i18n.md.B0XPxv4h.lean.js
similarity index 100%
rename from docs/document/assets/start_i18n.md.DtnhVL8s.lean.js
rename to docs/document/assets/start_i18n.md.B0XPxv4h.lean.js
diff --git a/docs/document/component/contextmenu.html b/docs/document/component/contextmenu.html
index a12fee55a..88213cc3b 100644
--- a/docs/document/component/contextmenu.html
+++ b/docs/document/component/contextmenu.html
@@ -106,7 +106,7 @@
         })
     }, 3000);
 });
- + \ No newline at end of file diff --git a/docs/document/component/controls.html b/docs/document/component/controls.html index e8f77f1e1..5c641ace0 100644 --- a/docs/document/component/controls.html +++ b/docs/document/component/controls.html @@ -153,7 +153,7 @@ }); }, 3000); });
- + \ No newline at end of file diff --git a/docs/document/component/layers.html b/docs/document/component/layers.html index 5555b55c0..1240887c1 100644 --- a/docs/document/component/layers.html +++ b/docs/document/component/layers.html @@ -125,7 +125,7 @@ }); }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/component/setting.html b/docs/document/component/setting.html index 49a557369..75147e039 100644 --- a/docs/document/component/setting.html +++ b/docs/document/component/setting.html @@ -245,7 +245,7 @@ }); }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/en/advanced/built-in.html b/docs/document/en/advanced/built-in.html index 8032a787f..ae8539be0 100644 --- a/docs/document/en/advanced/built-in.html +++ b/docs/document/en/advanced/built-in.html @@ -217,7 +217,7 @@ art.on('ready', () => { art.plugins.add(myPlugin); }); - + \ No newline at end of file diff --git a/docs/document/en/advanced/class.html b/docs/document/en/advanced/class.html index 656b35aa6..a56fa3988 100644 --- a/docs/document/en/advanced/class.html +++ b/docs/document/en/advanced/class.html @@ -31,7 +31,7 @@ }); console.info([...Artplayer.instances]);

version ​

Returns the version information of the player.

▶ Run Code
js
console.info(Artplayer.version);

env ​

Returns the environment variables of the player.

▶ Run Code
js
console.info(Artplayer.env);

build ​

Returns the build time of the player.

▶ Run Code
js
console.info(Artplayer.build);

config ​

Returns the default configuration for videos.

▶ Run Code
js
console.info(Artplayer.config);

utils ​

Returns the collection of utility functions for the player.

▶ Run Code
js
console.info(Artplayer.utils);

For all utility functions, please refer to the following address:

artplayer/types/utils.d.ts

scheme ​

Returns the validation schema for player options.

▶ Run Code
js
console.info(Artplayer.scheme);

Emitter ​

Returns the constructor function for the event emitter.

▶ Run Code
js
console.info(Artplayer.Emitter);

validator ​

Returns the validation function for options.

▶ Run Code
js
console.info(Artplayer.validator);

kindOf ​

Returns the utility function for type detection.

▶ Run Code
js
console.info(Artplayer.kindOf);

html ​

Returns the html string required by the player.

▶ Run Code
js
console.info(Artplayer.html);

option ​

Returns the default options for the player.

▶ Run Code
js
console.info(Artplayer.option);
- + \ No newline at end of file diff --git a/docs/document/en/advanced/event.html b/docs/document/en/advanced/event.html index d1ecb1a83..9d9873a02 100644 --- a/docs/document/en/advanced/event.html +++ b/docs/document/en/advanced/event.html @@ -412,7 +412,7 @@ art.on('keydown', (event) => { console.log(event.code); });

video:canplay ​

The browser can start playing the media, but estimates there isn't enough data to play through to the end without having to stop for further buffering

video:canplaythrough ​

The browser estimates it can play the media through to the end without stopping to buffer content

video:complete ​

OfflineAudioContext rendering is complete

video:durationchange ​

Triggered when the value of the duration property changes

video:emptied ​

The media has become empty; for example, this event is sent when the media has already been loaded (or partially loaded), and the load() method is called to reload it

video:ended ​

Playback has stopped because the media has reached its end point

video:error ​

An error occurred while fetching media data, or the resource type is not a supported media format

video:loadeddata ​

The first frame of the media has finished loading

video:loadedmetadata ​

Metadata has been loaded

video:pause ​

Playback has been paused

video:play ​

Playback has begun

video:playing ​

Playback is ready to start after having been paused or delayed due to lack of data

video:progress ​

Periodically triggered while the browser is loading the resource

video:ratechange ​

The playback rate has changed

video:seeked ​

A seek operation has completed

video:seeking ​

A seek operation has begun

video:stalled ​

The user agent is trying to fetch media data, but data is unexpectedly not forthcoming

video:suspend ​

Media data loading has been suspended

video:timeupdate ​

The time indicated by the currentTime attribute has been updated

video:volumechange ​

The volume has changed

video:waiting ​

Playback has stopped due to temporary lack of data

- + \ No newline at end of file diff --git a/docs/document/en/advanced/global.html b/docs/document/en/advanced/global.html index ac0fb841c..7d6f923eb 100644 --- a/docs/document/en/advanced/global.html +++ b/docs/document/en/advanced/global.html @@ -266,7 +266,7 @@ // Only destroys the UI, does not actively clear src art.destroy(); - + \ No newline at end of file diff --git a/docs/document/en/advanced/plugin.html b/docs/document/en/advanced/plugin.html index 51e0078fc..3d5a06308 100644 --- a/docs/document/en/advanced/plugin.html +++ b/docs/document/en/advanced/plugin.html @@ -122,7 +122,7 @@ }) ], }); - + \ No newline at end of file diff --git a/docs/document/en/advanced/property.html b/docs/document/en/advanced/property.html index b11f775e6..f4e74a968 100644 --- a/docs/document/en/advanced/property.html +++ b/docs/document/en/advanced/property.html @@ -487,7 +487,7 @@ art.on('ready', () => { art.subtitleOffset = 1; }); - + \ No newline at end of file diff --git a/docs/document/en/component/contextmenu.html b/docs/document/en/component/contextmenu.html index 28ca6ca21..9a0c9fbc7 100644 --- a/docs/document/en/component/contextmenu.html +++ b/docs/document/en/component/contextmenu.html @@ -106,7 +106,7 @@ }) }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/en/component/controls.html b/docs/document/en/component/controls.html index 17fa6951a..7ffe5c3ba 100644 --- a/docs/document/en/component/controls.html +++ b/docs/document/en/component/controls.html @@ -153,7 +153,7 @@ }); }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/en/component/layers.html b/docs/document/en/component/layers.html index 537dd3906..ee3a6aeef 100644 --- a/docs/document/en/component/layers.html +++ b/docs/document/en/component/layers.html @@ -125,7 +125,7 @@ }); }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/en/component/setting.html b/docs/document/en/component/setting.html index b4fc29fde..64965a78d 100644 --- a/docs/document/en/component/setting.html +++ b/docs/document/en/component/setting.html @@ -260,7 +260,7 @@ }); }, 3000); }); - + \ No newline at end of file diff --git a/docs/document/en/index.html b/docs/document/en/index.html index a5c85a12c..6d390ba9b 100644 --- a/docs/document/en/index.html +++ b/docs/document/en/index.html @@ -13,7 +13,7 @@ - + @@ -23,7 +23,7 @@ -
Skip to content

Installation & Usage ​

Installation ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

Usage ​

html
<html>
+    
Skip to content

Installation & Usage ​

Installation ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

Usage ​

html
<html>
     <head>
         <title>ArtPlayer Demo</title>
         <meta charset="UTF-8" />
@@ -44,7 +44,7 @@
           });
         </script>
     </body>
-</html>

Note

The player's dimensions depend on the size of its container container, so your container must have defined dimensions.

See more usage examples at the following link:

/example

Vue.js ​

vue
<template>
+</html>

Note

The player's dimensions depend on the size of its container container, so your container must have defined dimensions.

See more usage examples at the following link:

/example

Vue.js ​

vue
<template>
   <div ref="$container" />
 </template>
 
@@ -96,7 +96,7 @@
 function getInstance(art) {
   console.log(art)
 }
-</script>

Artplayer is not reactive:

Directly modifying option in Vue.js will not update the player.

React.js ​

jsx
import Artplayer from 'artplayer'
+</script>

Artplayer is not reactive:

Directly modifying option in Vue.js will not update the player.

React.js ​

jsx
import Artplayer from 'artplayer'
 import { useEffect, useRef } from 'react'
 
 export default function Player({ option, getInstance, ...rest }) {
@@ -179,7 +179,7 @@
 
 option.volume = 0.5;
 
-const art8 = new Artplayer(option);

Legacy Browsers ​

The production build artplayer.js only supports the latest major version of Chrome: last 1 Chrome version

For legacy browsers, you can use the artplayer.legacy.js file, which supports compatibility down to: IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

If you need to support even older browsers, modify the following configuration and build it yourself:

Build configuration: scripts/build.js

Reference documentation: browserslist

ECMAScript Module ​

Starting from 5.2.6, artplayer and all plugins also provide an ESM version mjs, such as:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
+const art8 = new Artplayer(option);

Legacy Browsers ​

The production build artplayer.js only supports the latest major version of Chrome: last 1 Chrome version

For legacy browsers, you can use the artplayer.legacy.js file, which supports compatibility down to: IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

If you need to support even older browsers, modify the following configuration and build it yourself:

Build configuration: scripts/build.js

Reference documentation: browserslist

ECMAScript Module ​

Starting from 5.2.6, artplayer and all plugins also provide an ESM version mjs, such as:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
 <html lang="en">
 
 <head>
@@ -237,7 +237,7 @@
         </script>
     </body>
 </html>

Note

You need to modify it before importing the Artplayer dependency for it to take effect.

- + \ No newline at end of file diff --git a/docs/document/en/start/i18n.html b/docs/document/en/start/i18n.html index 639d31128..4f1ce742c 100644 --- a/docs/document/en/start/i18n.html +++ b/docs/document/en/start/i18n.html @@ -13,7 +13,7 @@ - + @@ -27,7 +27,7 @@ container: '.artplayer-app', url: '/assets/sample/video.mp4', lang: 'zh-cn', // or 'en' -});

Importing Languages ​

Language files before bundling are located at: artplayer/src/i18n/*.js. Contributions to add your language are welcome.

Language files after bundling are located at: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
+});

Importing Languages ​

Language files before bundling are located at: artplayer/src/i18n/*.js. Contributions to add your language are welcome.

Language files after bundling are located at: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
 import zhTw from 'artplayer/i18n/zh-tw';
 
 var art = new Artplayer({
@@ -75,7 +75,7 @@
         },
     },
 });
- + \ No newline at end of file diff --git a/docs/document/en/start/option.html b/docs/document/en/start/option.html index fff5630fe..9e03379ed 100644 --- a/docs/document/en/start/option.html +++ b/docs/document/en/start/option.html @@ -475,7 +475,7 @@ url: '/assets/sample/video.mp4', proxy: () => document.createElement('video') }); - + \ No newline at end of file diff --git a/docs/document/hashmap.json b/docs/document/hashmap.json index 881f58bc6..d91c982e9 100644 --- a/docs/document/hashmap.json +++ b/docs/document/hashmap.json @@ -1 +1 @@ -{"advanced_built-in.md":"DbXkhR8l","advanced_class.md":"BE9Wp7q6","advanced_event.md":"DoIgqIU9","advanced_global.md":"Db4VcykV","advanced_plugin.md":"CVp3Oe2x","advanced_property.md":"C_nOKniE","component_contextmenu.md":"lsIURdc3","component_controls.md":"CKAl0l5Z","component_layers.md":"D34Y4OkH","component_setting.md":"BwCpY3NU","en_advanced_built-in.md":"DWw_qKdn","en_advanced_class.md":"bWhe2FDl","en_advanced_event.md":"igITY2FO","en_advanced_global.md":"Bj0Agjzd","en_advanced_plugin.md":"IXiFhAGS","en_advanced_property.md":"DQzShb4B","en_component_contextmenu.md":"3nvb8CSX","en_component_controls.md":"s1SJ4fZd","en_component_layers.md":"wLZPKN9j","en_component_setting.md":"eqeWyMDt","en_index.md":"BvE8b20f","en_start_i18n.md":"DtRh2JGz","en_start_option.md":"CuY4IYWk","index.md":"Cg4MitRm","plugin_danmuku.md":"DUAFUpaT","start_i18n.md":"DtnhVL8s","start_option.md":"DRwrMHeQ"} +{"advanced_built-in.md":"DbXkhR8l","advanced_class.md":"BE9Wp7q6","advanced_event.md":"DoIgqIU9","advanced_global.md":"Db4VcykV","advanced_plugin.md":"CVp3Oe2x","advanced_property.md":"C_nOKniE","component_contextmenu.md":"lsIURdc3","component_controls.md":"CKAl0l5Z","component_layers.md":"D34Y4OkH","component_setting.md":"BwCpY3NU","en_advanced_built-in.md":"DWw_qKdn","en_advanced_class.md":"bWhe2FDl","en_advanced_event.md":"igITY2FO","en_advanced_global.md":"Bj0Agjzd","en_advanced_plugin.md":"IXiFhAGS","en_advanced_property.md":"DQzShb4B","en_component_contextmenu.md":"3nvb8CSX","en_component_controls.md":"s1SJ4fZd","en_component_layers.md":"wLZPKN9j","en_component_setting.md":"eqeWyMDt","en_index.md":"CYpcDsY6","en_start_i18n.md":"x4tw6CvN","en_start_option.md":"CuY4IYWk","index.md":"B8NxRV94","plugin_danmuku.md":"C7LHV45A","start_i18n.md":"B0XPxv4h","start_option.md":"DRwrMHeQ"} diff --git a/docs/document/index.html b/docs/document/index.html index 7936178fd..e9ed9cfa9 100644 --- a/docs/document/index.html +++ b/docs/document/index.html @@ -13,7 +13,7 @@ - + @@ -23,7 +23,7 @@ -
Skip to content

安装使用 ​

安装 ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

使用 ​

html
<html>
+    
Skip to content

安装使用 ​

安装 ​

bash
npm install artplayer
bash
yarn add artplayer
bash
pnpm add artplayer
html
<script src="path/to/artplayer.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.js
bash
https://unpkg.com/artplayer/dist/artplayer.js

使用 ​

html
<html>
     <head>
         <title>ArtPlayer Demo</title>
         <meta charset="UTF-8" />
@@ -44,7 +44,7 @@
           });
         </script>
     </body>
-</html>

提示

播放器的尺寸依赖于容器 container 的尺寸,所以你的容器 container 必须是有尺寸的

以下链接可以看到更多的使用例子

/example

Vue.js ​

vue
<template>
+</html>

提示

播放器的尺寸依赖于容器 container 的尺寸,所以你的容器 container 必须是有尺寸的

以下链接可以看到更多的使用例子

/example

Vue.js ​

vue
<template>
   <div ref="$container" />
 </template>
 
@@ -96,7 +96,7 @@
 function getInstance(art) {
   console.log(art)
 }
-</script>

Artplayer 非响应式:

在 Vue.js 里直接修改 option 是不会改变播放器的

React.js ​

jsx
import Artplayer from 'artplayer'
+</script>

Artplayer 非响应式:

在 Vue.js 里直接修改 option 是不会改变播放器的

React.js ​

jsx
import Artplayer from 'artplayer'
 import { useEffect, useRef } from 'react'
 
 export default function Player({ option, getInstance, ...rest }) {
@@ -179,7 +179,7 @@
 
 option.volume = 0.5;
 
-const art8 = new Artplayer(option);

古老的浏览器 ​

生产构建的 artplayer.js 只兼容最新一个主版本的 Chrome:last 1 Chrome version

对于古老的浏览器,可以使用 artplayer.legacy.js 文件,可以兼容到:IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

假如你要兼容更古老的浏览器时,请修改以下配置然后自行构建:

构建配置:scripts/build.js

参考文档:browserslist

ECMAScript Module ​

从 5.2.6 开始,artplayer 和所有插件还会提供一个 ESM 版本的 mjs,如:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
+const art8 = new Artplayer(option);

古老的浏览器 ​

生产构建的 artplayer.js 只兼容最新一个主版本的 Chrome:last 1 Chrome version

对于古老的浏览器,可以使用 artplayer.legacy.js 文件,可以兼容到:IE 11

js
import Artplayer from 'artplayer/legacy'
bash
https://cdn.jsdelivr.net/npm/artplayer/dist/artplayer.legacy.js
bash
https://unpkg.com/artplayer/dist/artplayer.legacy.js

假如你要兼容更古老的浏览器时,请修改以下配置然后自行构建:

构建配置:scripts/build.js

参考文档:browserslist

ECMAScript Module ​

从 5.2.6 开始,artplayer 和所有插件还会提供一个 ESM 版本的 mjs,如:

  • artplayer/dist/artplayer.mjs
  • artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.mjs
html
<!DOCTYPE html>
 <html lang="en">
 
 <head>
@@ -237,7 +237,7 @@
         </script>
     </body>
 </html>

提示

你需要在引入 Artplayer 依赖前来修改它才会生效

- + \ No newline at end of file diff --git a/docs/document/plugin/danmuku.html b/docs/document/plugin/danmuku.html index e98d552aa..7a0a1d66e 100644 --- a/docs/document/plugin/danmuku.html +++ b/docs/document/plugin/danmuku.html @@ -13,7 +13,7 @@ - + @@ -23,7 +23,7 @@ -
Skip to content

弹幕库 ​

演示 ​

👉 查看完整演示

安装 ​

bash
npm install artplayer-plugin-danmuku
bash
yarn add artplayer-plugin-danmuku
bash
pnpm add artplayer-plugin-danmuku
html
<script src="path/to/artplayer-plugin-danmuku.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js
bash
https://unpkg.com/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js

弹幕结构 ​

每一个弹幕是一个对象,多个弹幕组成的数组就是弹幕库,通常只需要text就可以发送一个弹幕,其余都是非必要参数

js
{
+    
Skip to content

弹幕库 ​

演示 ​

👉 查看完整演示

安装 ​

bash
npm install artplayer-plugin-danmuku
bash
yarn add artplayer-plugin-danmuku
bash
pnpm add artplayer-plugin-danmuku
html
<script src="path/to/artplayer-plugin-danmuku.js"></script>

CDN ​

bash
https://cdn.jsdelivr.net/npm/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js
bash
https://unpkg.com/artplayer-plugin-danmuku/dist/artplayer-plugin-danmuku.js

弹幕结构 ​

每一个弹幕是一个对象,多个弹幕组成的数组就是弹幕库,通常只需要text就可以发送一个弹幕,其余都是非必要参数

js
{
     text: '', // 弹幕文本
     time: 10, // 弹幕时间, 默认为当前播放器时间
     mode: 0, // 弹幕模式: 0: 滚动(默认),1: 顶部,2: 底部
@@ -367,7 +367,7 @@
 art.on('artplayerPluginDanmuku:destroy', () => {
     console.info('弹幕销毁');
 });
- + \ No newline at end of file diff --git a/docs/document/start/i18n.html b/docs/document/start/i18n.html index bd601ec39..eb8908384 100644 --- a/docs/document/start/i18n.html +++ b/docs/document/start/i18n.html @@ -13,7 +13,7 @@ - + @@ -27,7 +27,7 @@ container: '.artplayer-app', url: '/assets/sample/video.mp4', lang: 'zh-cn', // or 'en' -});

导入语言 ​

打包前的语言文件存放于: artplayer/src/i18n/*.js, 欢迎来添加你的语言

打包后的语言文件存放于: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
+});

导入语言 ​

打包前的语言文件存放于: artplayer/src/i18n/*.js, 欢迎来添加你的语言

打包后的语言文件存放于: artplayer/dist/i18n/*.js

js
import id from 'artplayer/i18n/id';
 import zhTw from 'artplayer/i18n/zh-tw';
 
 var art = new Artplayer({
@@ -75,7 +75,7 @@
         },
     },
 });
- + \ No newline at end of file diff --git a/docs/document/start/option.html b/docs/document/start/option.html index ac12e151f..9063a57ea 100644 --- a/docs/document/start/option.html +++ b/docs/document/start/option.html @@ -415,7 +415,7 @@ url: '/assets/sample/video.mp4', proxy: () => document.createElement('video') });
- + \ No newline at end of file diff --git a/scripts/build-ts.js b/scripts/build-ts.js index ad3dc42ad..b34df6830 100644 --- a/scripts/build-ts.js +++ b/scripts/build-ts.js @@ -9,8 +9,9 @@ function ensureDirExists(filePath) { } } -function parsePluginInfo(path) { - const file = path.split('/').pop() || '' +function parsePluginInfo(pluginPath) { + // Use path.basename to handle both Unix and Windows paths correctly + const file = path.basename(pluginPath) const baseName = file.replace('.d.ts', '') const name = baseName