webcast.js
involves several cutting-edge technologies and, thus, require a fairly modern browser.
It takes advantage of the following Javascript APIs:
- WebSocket API: This is the transport layer. It is readily available in most modern browsers.
- MediaRecorder API: This is the API used to encode data before sending it to liquidsoap.
The library contains a single classes:
Webcast.Socket
: a specializedWebSockets
that implements thewebcast
protocol using an instance ofMediaRecorder
.
Here's a simple use of the library:
var mediaRecorder = (...);
var webcast = new Webcast.Socket({
mediaRecorder: mediaRecorder,
url: "ws://localhost:8080/mount",
info: { ... }
});
webcast.sendMetadata({
title: "My Awesome Stream",
artist: "The Dude"
});
You can also look at the example client code for a more detailed use of the library.