fix eslint
This commit is contained in:
parent
eab29babea
commit
24c2efeb00
|
@ -303,13 +303,13 @@ function MonitorStream(monitorData) {
|
||||||
} // end function MonitorStream
|
} // end function MonitorStream
|
||||||
|
|
||||||
async function attachVideo(id) {
|
async function attachVideo(id) {
|
||||||
await waitUntil(() => janus.isConnected() )
|
await waitUntil(() => janus.isConnected() );
|
||||||
janus.attach({
|
janus.attach({
|
||||||
plugin: "janus.plugin.streaming",
|
plugin: "janus.plugin.streaming",
|
||||||
opaqueId: "streamingtest-"+Janus.randomString(12),
|
opaqueId: "streamingtest-"+Janus.randomString(12),
|
||||||
success: function(pluginHandle) {
|
success: function(pluginHandle) {
|
||||||
streaming[id] = pluginHandle;
|
streaming[id] = pluginHandle;
|
||||||
var body = { "request": "watch", "id": id};
|
var body = {"request": "watch", "id": id};
|
||||||
streaming[id].send({"message": body});
|
streaming[id].send({"message": body});
|
||||||
},
|
},
|
||||||
error: function(error) {
|
error: function(error) {
|
||||||
|
@ -319,26 +319,26 @@ async function attachVideo(id) {
|
||||||
Janus.debug(" ::: Got a message :::");
|
Janus.debug(" ::: Got a message :::");
|
||||||
Janus.debug(msg);
|
Janus.debug(msg);
|
||||||
var result = msg["result"];
|
var result = msg["result"];
|
||||||
if(result !== null && result !== undefined) {
|
if (result !== null && result !== undefined) {
|
||||||
if(result["status"] !== undefined && result["status"] !== null) {
|
if (result["status"] !== undefined && result["status"] !== null) {
|
||||||
var status = result["status"];
|
var status = result["status"];
|
||||||
Janus.debug(status);
|
Janus.debug(status);
|
||||||
}
|
}
|
||||||
} else if(msg["error"] !== undefined && msg["error"] !== null) {
|
} else if (msg["error"] !== undefined && msg["error"] !== null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(jsep !== undefined && jsep !== null) {
|
if (jsep !== undefined && jsep !== null) {
|
||||||
Janus.debug("Handling SDP as well...");
|
Janus.debug("Handling SDP as well...");
|
||||||
Janus.debug(jsep);
|
Janus.debug(jsep);
|
||||||
// Offer from the plugin, let's answer
|
// Offer from the plugin, let's answer
|
||||||
streaming[id].createAnswer({
|
streaming[id].createAnswer({
|
||||||
jsep: jsep,
|
jsep: jsep,
|
||||||
// We want recvonly audio/video and, if negotiated, datachannels
|
// We want recvonly audio/video and, if negotiated, datachannels
|
||||||
media: { audioSend: false, videoSend: false, data: true },
|
media: {audioSend: false, videoSend: false, data: true},
|
||||||
success: function(jsep) {
|
success: function(jsep) {
|
||||||
Janus.debug("Got SDP!");
|
Janus.debug("Got SDP!");
|
||||||
Janus.debug(jsep);
|
Janus.debug(jsep);
|
||||||
var body = { "request": "start"};
|
var body = {"request": "start"};
|
||||||
streaming[id].send({"message": body, "jsep": jsep});
|
streaming[id].send({"message": body, "jsep": jsep});
|
||||||
},
|
},
|
||||||
error: function(error) {
|
error: function(error) {
|
||||||
|
@ -357,7 +357,7 @@ async function attachVideo(id) {
|
||||||
|
|
||||||
const waitUntil = (condition) => {
|
const waitUntil = (condition) => {
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
let interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
if (!condition()) {
|
if (!condition()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -365,4 +365,4 @@ const waitUntil = (condition) => {
|
||||||
resolve();
|
resolve();
|
||||||
}, 100);
|
}, 100);
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
|
|
Loading…
Reference in New Issue