Gapless audio player for the web. Takes an array of audio tracks and uses HTML5 audio with the Web Audio API to enable seamless, gapless transitions between tracks.
Though the earnest goal is not bundle-size driven, it has only one production dependency (xstate) so it operates in a rigid manner according to a well-designed state machine.
It has a dead simple API and is easy to get up and running.
Built for Relisten.net, where playing back gapless live tracks is paramount.
Live Demo
Install
pnpm install gapless
Quick Start
import Queue from 'gapless' ; const player = new Queue ( { tracks : [ 'https://example.com/track1.mp3' , 'https://example.com/track2.mp3' , 'https://example.com/track3.mp3' , ] , onProgress : ( track ) => { console . log ( ` ${ track . currentTime } / ${ track . duration } ` ) ; } , onEnded : ( ) => { console . log ( 'Queue finished' ) ; } , } ) ; player . play ( ) ;
API
... continue reading