mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 00:31:20 -08:00
- 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.
79 lines
1.3 KiB
TypeScript
79 lines
1.3 KiB
TypeScript
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 = artplayerProxyMediabunny;
|
|
export as namespace artplayerProxyMediabunny; |