feat: add danmuku plugin documentation and i18n setup guide

- Created a new documentation file for the danmuku plugin, detailing its usage and providing code examples.
- Added a comprehensive guide for language settings (i18n), including instructions for importing languages, setting default languages, and modifying language options.
- Included code snippets for initializing the Artplayer with different languages and examples for adding new languages.
This commit is contained in:
Harvey Zack committed 2025-08-01 09:34:07 +08:00
1 parent c1fe0e2b03
commit 5337f9b075
181 files changed
+1680 -1659

No files matched your search

+25 -11
View File
@@ -1,20 +1,34 @@
import type Artplayer from 'artplayer';
import { Player } from '@glomex/vast-ima-player';
export = artplayerPluginVast;
export as namespace artplayerPluginVast;
type Option = (params: {
declare global {
interface Window {
artplayerPluginVast?: typeof artplayerPluginVast;
}
}
type PlayUrlFn = (url: string) => void;
type PlayResFn = (res: string) => void;
interface VastPluginContext {
art: Artplayer;
id: string;
ima: any;
imaPlayer: any;
$container: HTMLDivElement;
playUrl: (url: string) => void;
playRes: (res: string) => void;
}) => void;
ima: typeof google.ima;
imaPlayer: Player;
playUrl: PlayUrlFn;
playRes: PlayResFn;
container: HTMLDivElement | null;
}
type Result = {
export type ArtplayerPluginVastOption = (params: VastPluginContext) => void | Promise<void>;
export interface ArtplayerPluginVastInstance {
name: 'artplayerPluginVast';
};
destroy?: () => void;
}
declare const artplayerPluginVast: (option: Option) => (art: Artplayer) => Result;
declare function artplayerPluginVast(
option: ArtplayerPluginVastOption,
): (art: Artplayer) => ArtplayerPluginVastInstance;