package
WebRTC MediaStreams to live webm data streams.
npm install mediastream-to-webmGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Estimated unpacked size across 25 packages.
8.8 MB
Includes dependencies.
6 direct · 4 outdated
^2.2.1
3.0.0
^2.0.3
2.0.4
^2.1.3
2.4.0
^2.3.3
4.8.0
^1.0.0
2.0.0
^2.1.1
3.0.0
Converts MediaStreams to live WebM streams. Currently only for Chrome.
Allows you to send video/audio as a single outgoing data stream to many peers.
var MediaStreamToWebm = require('mediastream-to-webm')<script src="dist/mediastream-to-webm.js" />// Wrap your MediaStream into an encoder
var encodedStream = MediaStreamToWebm.EncodedStream(mediaStream)
// The encoded stream is a ReadableStream
encodedStream.pipe(socket1)
encodedStream.pipe(socket2) // pipe as many times as you want, at any time, without worrying about the structure of the stream
encodedStream.pipe(socket2)
// ...var decodedStream = MediaStreamToWebm.DecodedStream()
socket.pipe(decodedStream) // pipe the encoded stream into the decoded
// The buffered video element is available for us to watch!
var video = decodedStream.videoElement
video.autoplay = true
video.oncanplay = function () {
video.play()
}
document.body.appendChild(video) MediaStreamToWebm.EncodedStream(mediaStream, opts)Encode a MediaStream into a webm data stream.
mediaStream - The input MediaStream you want to broadcast.
opts - Options object. Default is:
{
interval: 10,
mimeType: 'video/webm; codecs="opus,vp8"'
}MediaStreamToWebm.DecodedStream(opts)Decode an encoded webm data stream. Decoded data will be buffered into a video element.
opts - Options object. Default is:
{
videoElement: null, // specify an existing video element
mimeType: 'video/webm; codecs="opus,vp8"'
}DecodedStream.videoElementThe video element that will be buffered with the decoded webm stream.
media-recorder-stream.