Fork me on GitHub

Demo details

Note well! This demo is known not to work as expected, at the moment, due to two different bugs in Chrome with respect to captureStream: the first bug causes media from a captured video not to be sent on a PeerConnection, which is what we try to do in this demo; the second bug causes audio not to be sent if the source video element is muted, despite the video itself containing an audio stream. Until both issues are fixed in Chrome, this demo will basically do nothing, and so no point in trying it out.

This is a variant of the Echo Test demo meant to showcase the support for multichannel Opus, and so surround audio: everything is exactly the same in term of available controls, features, and the like, with the substantial difference that the media being captured and sent does not come from webcam and microphone, but from a pre-recorded surround file instead. More precisely, we downloaded a surround demo video from Fraunhofer's multichannel tests and, using captureStream on the video element, get access to the MediaStream to send via WebRTC. As a result, a surround audio/video stream is sent to the EchoTest plugin via WebRTC, which echoes it back, allowing you to demonstrate how the surround properties are preserved through the PeerConnection journey via Janus. The file will loop back to the beginning when it ends, since it's quite short.

Notice that you'll need a recent version of Chrome for this to work, since it's only implemented there and not really available publicly. As a matter of fact, Chrome will by default not offer multiopus support by default, and will even reject it when offered: it's up to you to munge the SDP to force multiopus support for a conversation. The janus.js library will NOT do it for you: this demo uses the customizeSdp callback to mess with the SDP in an ugly way. In other contexts (e.g., VideoRoom subscribers) you'll need to do something similar when creating the answer instead.

Press the Start button above to launch the demo.

Local Stream

Remote Stream