Files
ArtPlayer/docs/assets/ts/artplayer-plugin-vast.d.ts
T
Harvey Zhao a8d36a38ad feat: add artplayer-plugin-audio-track for audio synchronization with video
- Implemented the audio track plugin for ArtPlayer, allowing audio to be synchronized with video playback.
- Added main functionality in `src/index.js` to handle audio playback, synchronization, and event listeners for play, pause, seek, and volume changes.
- Created TypeScript definitions for the plugin in `types/artplayer-plugin-audio-track.d.ts`.
- Included necessary build files in `dist/` for various module formats (CommonJS, ES Module, and legacy).
- Updated package metadata in `package.json` and added a README for documentation.
- Added `.npmignore` to exclude unnecessary files from the package.
2026-01-03 13:42:11 +08:00

33 lines
854 B
TypeScript

declare global {
interface Window {
artplayerPluginVast?: typeof artplayerPluginVast
}
}
type PlayUrlFn = (url: string) => void
type PlayResFn = (res: string) => void
interface VastPluginContext {
art: Artplayer
ima: any // Replace 'any' with a more specific type if available, or declare google.ima type above
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
export default artplayerPluginVast
export = artplayerPluginVast;
export as namespace artplayerPluginVast;