native tracks list for janus 1.x

This commit is contained in:
Maxim Devaev 2024-03-25 03:19:20 +02:00
parent 71e5e4d138
commit cb97f95ad6

View File

@ -235,8 +235,17 @@ export function JanusStreamer(__setActive, __setInactive, __setInfo, __orient, _
if (jsep) { if (jsep) {
__logInfo("Handling SDP:", jsep); __logInfo("Handling SDP:", jsep);
let tracks = [{"type": "video", "capture": false, "recv": true, "add": true}];
if (__allow_audio) {
tracks.push({"type": "audio", "capture": false, "recv": true, "add": true});
}
__handle.createAnswer({ __handle.createAnswer({
"jsep": jsep, "jsep": jsep,
// Janus 1.x
"tracks": tracks,
// Janus 0.x
"media": {"audioSend": false, "videoSend": false, "data": false}, "media": {"audioSend": false, "videoSend": false, "data": false},
"success": function(jsep) { "success": function(jsep) {