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.
This commit is contained in:
Harvey Zhao committed 2026-01-03 13:42:11 +08:00
1 parent ae03670f9a
commit a8d36a38ad
85 files changed
+702 -124

No files matched your search

+34 -24
View File
@@ -126,6 +126,8 @@ export interface Subtitle {
onVttLoad?: (vtt: string) => string
}
export interface SettingOption extends Omit<Setting, 'html' | 'icon' | 'tooltip'> {
html: string
icon: string | undefined
@@ -237,6 +239,10 @@ export interface Quality {
url: string
}
export type AspectRatio = 'default' | '4:3' | '16:9' | (`${number}:${number}` & Record<never, never>)
export type PlaybackRate = 0.5 | 0.75 | 1.0 | 1.25 | 1.5 | 1.75 | 2.0 | (number & Record<never, never>)
export type Flip = 'normal' | 'horizontal' | 'vertical' | (string & Record<never, never>)
@@ -346,6 +352,15 @@ export declare class Player {
reset(): void
}
export type CustomType
= | 'flv'
| 'm3u8'
@@ -754,6 +769,9 @@ declare module 'artplayer/i18n/*' {
export default lang
}
export type Bar = 'loaded' | 'played' | 'hover'
export interface Events {
@@ -853,28 +871,15 @@ export interface CssVar {
'--art-theme': string
'--art-font-color': string
'--art-background-color': string
'--art-font-size-sm': string
'--art-text-shadow-color': string
'--art-transition-duration': string
'--art-ease-standard': string
'--art-padding': string
'--art-border-radius': string
'--art-mobile-padding': string
'--art-mobile-radius': string
'--art-radius-sm': string
'--art-space-xxs': string
'--art-space-xs': string
'--art-surface-hover-color': string
'--art-surface-border-color': string
'--art-surface-muted-color': string
'--art-surface-range-color': string
'--art-progress-height': string
'--art-progress-color': string
'--art-progress-top-gap': string
'--art-hover-color': string
'--art-loaded-color': string
'--art-tip-padding': string
'--art-tip-offset': string
'--art-state-size': string
'--art-state-opacity': number
'--art-bottom-height': string
@@ -886,7 +891,6 @@ export interface CssVar {
'--art-control-opacity': number
'--art-control-icon-size': string
'--art-control-icon-scale': number
'--art-touch-hit-size': string
'--art-volume-height': string
'--art-volume-handle-size': string
'--art-lock-size': string
@@ -897,7 +901,6 @@ export interface CssVar {
'--art-settings-max-height': string
'--art-selector-max-height': string
'--art-contextmenus-min-width': string
'--art-contextmenu-padding-x': string
'--art-subtitle-font-size': string
'--art-subtitle-gap': string
'--art-subtitle-bottom': string
@@ -908,13 +911,6 @@ export interface CssVar {
'--art-scrollbar-background': string
'--art-scrollbar-background-hover': string
'--art-mini-progress-height': string
'--art-shadow-low': string
'--art-shadow-medium': string
'--art-shadow-high': string
'--art-shadow-elevated': string
'--art-icon-small-size': string
'--art-overlay-dim': string
'--art-overlay-strong': string
}
export interface Config {
@@ -999,6 +995,8 @@ export interface Config {
]
}
export interface Selector {
/**
* Whether the default is selected
@@ -1130,6 +1128,18 @@ export interface ComponentOption {
onSelect?: (this: Artplayer, selector: Selector, element: HTMLElement, event: Event) => void
}
export type {
Config,
Events,
@@ -1319,5 +1329,5 @@ export default class Artplayer extends Player {
} & Record<string, unknown>
}
export = Artplayer
export as namespace Artplayer;
export = Artplayer;
export as namespace Artplayer;