mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 11:56:15 -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.
14 lines
388 B
JavaScript
14 lines
388 B
JavaScript
// npm i artplayer-plugin-audio-track
|
|
// import artplayerPluginAudioTrack from 'artplayer-plugin-audio-track';
|
|
|
|
var art = new Artplayer({
|
|
container: '.artplayer-app',
|
|
url: '/assets/sample/sprite-fight.mp4',
|
|
plugins: [
|
|
artplayerPluginAudioTrack({
|
|
url: '/assets/sample/sprite-fight.aac',
|
|
offset: 0,
|
|
sync: 0.3,
|
|
}),
|
|
],
|
|
}); |