janus: optional audio for each client

This commit is contained in:
Maxim Devaev
2022-11-27 06:51:00 +03:00
parent 900d7e1112
commit 9b4f3229f2
4 changed files with 68 additions and 43 deletions

View File

@@ -189,7 +189,7 @@ The client-side JavaScript application uses the following control flow:
success: function (pluginHandle) {
uStreamerPluginHandle = pluginHandle;
// Instruct the µStreamer Janus plugin to initiate streaming.
uStreamerPluginHandle.send({ message: { request: "watch" } });
uStreamerPluginHandle.send({ message: { request: "watch", params: {audio: true} } });
},
// Callback function if the server fails to attach the plugin.
@@ -197,13 +197,6 @@ The client-side JavaScript application uses the following control flow:
// Callback function for processing messages from the Janus server.
onmessage: function (msg, jsepOffer) {
// 503 indicates that the plugin is not ready to stream yet. Retry the
// watch request until the video stream is available.
if (msg.error_code === 503) {
uStreamerPluginHandle.send({ message: { request: "watch" } });
return;
}
// If there is a JSEP offer, respond to it. This starts the WebRTC
// connection.
if (jsepOffer) {