mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-10 21:06:15 -08:00
- 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.
35 lines
873 B
TypeScript
35 lines
873 B
TypeScript
import type Artplayer from 'artplayer';
|
|
import { Player } from '@glomex/vast-ima-player';
|
|
|
|
export = artplayerPluginVast;
|
|
export as namespace artplayerPluginVast;
|
|
|
|
declare global {
|
|
interface Window {
|
|
artplayerPluginVast?: typeof artplayerPluginVast;
|
|
}
|
|
}
|
|
|
|
type PlayUrlFn = (url: string) => void;
|
|
type PlayResFn = (res: string) => void;
|
|
|
|
interface VastPluginContext {
|
|
art: Artplayer;
|
|
ima: typeof google.ima;
|
|
imaPlayer: Player;
|
|
playUrl: PlayUrlFn;
|
|
playRes: PlayResFn;
|
|
container: HTMLDivElement | null;
|
|
}
|
|
|
|
export type ArtplayerPluginVastOption = (params: VastPluginContext) => void | Promise<void>;
|
|
|
|
export interface ArtplayerPluginVastInstance {
|
|
name: 'artplayerPluginVast';
|
|
destroy?: () => void;
|
|
}
|
|
|
|
declare function artplayerPluginVast(
|
|
option: ArtplayerPluginVastOption,
|
|
): (art: Artplayer) => ArtplayerPluginVastInstance;
|