Node Dash Client
a sample tiny dash client for Nodejs, only implement the main function of dash.
sample usage
import { NodeDashClient } from 'node-dash-client';
const app: NodeDashClient = new NodeDashClient({
mpdFile: 'https://example.com/radio.mpd'
});
await app.init();
const data: Buffer[] = [];
const firstFregment: TFirstFregment = await app.getFirstFregment();
data.push(firstFregment.data);
while(true) {
const mediaFregment: {fregmentId: number, data: Buffer} = await app.getMediaFregment();
data.push(mediaFregment.data);
}
...
Buffer.contat(data); // radio.mp4