mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-21 12:41: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.
52 lines
829 B
TypeScript
52 lines
829 B
TypeScript
interface Option {
|
|
/**
|
|
* 广告源文本,支持视频链接、图片链接、HTML文本
|
|
*/
|
|
source: string
|
|
|
|
/**
|
|
* 知名广告的类型:'video' | 'image' | 'html'
|
|
*/
|
|
type: 'video' | 'image' | 'html'
|
|
|
|
/**
|
|
* 广告必看的时长,单位为秒
|
|
*/
|
|
playDuration?: number
|
|
|
|
/**
|
|
* 广告总的时长,单位为秒
|
|
*/
|
|
totalDuration?: number
|
|
|
|
/**
|
|
* 视频广告是否默认静音
|
|
*/
|
|
muted?: boolean
|
|
}
|
|
|
|
interface Ads {
|
|
name: 'artplayerPluginAds'
|
|
|
|
/**
|
|
* 跳过广告
|
|
*/
|
|
skip: () => void
|
|
|
|
/**
|
|
* 暂停广告
|
|
*/
|
|
pause: () => void
|
|
|
|
/**
|
|
* 播放广告
|
|
*/
|
|
play: () => void
|
|
}
|
|
|
|
declare const artplayerPluginAds: (option: Option) => (art: Artplayer) => Ads
|
|
|
|
export default artplayerPluginAds
|
|
|
|
export = artplayerPluginAds;
|
|
export as namespace artplayerPluginAds; |