mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-18 02:21:20 -08:00
- Deleted ARCHITECTURE.md file to streamline project documentation. - Refactored AudioEngine, EventTarget, MediaBunnyEngine, VideoEngine, VideoShim, and index.js for improved readability by adding consistent line breaks and spacing. - Enhanced code structure by ensuring single-responsibility principles and clearer flow in methods. - Updated TypeScript definitions for better clarity on options available in the artplayer-proxy-mediabunny package.
artplayer-proxy-mediabunny
MediaBunny proxy for ArtPlayer - A high-performance video playback solution using WebCodecs and Canvas.
Features
- 🚀 Hardware-accelerated video decoding via WebCodecs API
- 🎨 Canvas-based rendering for maximum flexibility
- 🎵 Web Audio API for audio playback
- 🔄 Precise audio-video synchronization
- 📦 Support for multiple media formats
- ⚡ Optimized for modern browsers
Installation
npm install artplayer-proxy-mediabunny
Usage
import Artplayer from 'artplayer'
import artplayerProxyMediabunny from 'artplayer-proxy-mediabunny'
const art = new Artplayer({
container: '.artplayer-app',
url: 'path/to/video.mp4',
customType: {
mediabunny: artplayerProxyMediabunny({
// Options
loadTimeout: 12000,
timeupdateInterval: 250,
avSyncTolerance: 0.12,
dropLateFrames: false,
poster: 'path/to/poster.jpg',
}),
},
type: 'mediabunny',
})
Options
| Option | Type | Default | Description |
|---|---|---|---|
loadTimeout |
number |
12000 |
Timeout for loading media (ms) |
timeupdateInterval |
number |
250 |
Interval for timeupdate events (ms) |
avSyncTolerance |
number |
0.12 |
Audio-video sync tolerance (seconds) |
dropLateFrames |
boolean |
false |
Drop late video frames |
poster |
string |
'' |
Poster image URL |
source |
string|Blob|ReadableStream |
- | Media source |
preflightRange |
boolean |
false |
Check range support before loading |
volume |
number |
0.7 |
Initial volume (0-1) |
muted |
boolean |
false |
Initial muted state |
Demo
Browser Support
Requires browsers with WebCodecs API support:
- Chrome 94+
- Edge 94+
- Opera 80+
License
MIT © Harvey Zack