mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01: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.
26 lines
585 B
TypeScript
26 lines
585 B
TypeScript
interface AudioChunk {
|
|
pcm: ArrayBuffer
|
|
wav: ArrayBuffer
|
|
}
|
|
|
|
interface AsrPluginOption {
|
|
length?: number
|
|
interval?: number
|
|
sampleRate?: number
|
|
autoHideTimeout?: number
|
|
onAudioChunk?: (chunk: AudioChunk) => void | Promise<void>
|
|
}
|
|
|
|
interface AsrPluginInstance {
|
|
name: 'artplayerPluginAsr'
|
|
stop: () => void
|
|
hide: () => void
|
|
append: (subtitle: string) => void
|
|
}
|
|
|
|
declare function artplayerPluginAsr(option?: AsrPluginOption): (art: Artplayer) => AsrPluginInstance
|
|
|
|
export default artplayerPluginAsr
|
|
|
|
export = artplayerPluginAsr;
|
|
export as namespace artplayerPluginAsr; |