{ "janus": "event", "session_id": 2912462131376610, "sender": 829988245863921, "plugindata": { "plugin": "janus.plugin.videoroom", "data": { "videoroom": "destroyed", "room": 1870 } }}
{ "janus": "detached", "session_id": 2912462131376610, "sender": 829988245863921}{
janus: "destroy",
transaction: "7fBSAVW9fMWl"
}
{ "janus": "success", "session_id": 2912462131376610, "transaction": "7fBSAVW9fMWl"}{ "janus": "error", "session_id": 2912462131376610, "transaction": "hMIA5xWfg6bt", "error": { "code": 458, "reason": "No such session 2912462131376610" }}} else if(json["janus"] === "detached") {
// A plugin asked the core to detach one of our handles Janus.debug("Got a detached event on session " + sessionId); Janus.debug(json); var sender = json["sender"]; if(sender === undefined || sender === null) { Janus.warn("Missing sender..."); return; } var pluginHandle = pluginHandles[sender]; if(pluginHandle === undefined || pluginHandle === null) { // Don't warn here because destroyHandle causes this situation. return; } pluginHandle.ondetached(); pluginHandle.detach();}var request = { "janus": "detach", "transaction": Janus.randomString(12) };
// ... some code
Janus.ajax({ type: 'POST', url: server + "/" + sessionId + "/" + handleId, async: asyncRequest, // Sometimes we need false here, or destroying in onbeforeunload won't work withCredentials: withCredentials, cache: false, contentType: "application/json", data: JSON.stringify(request), success: function(json) { Janus.log("Destroyed handle:"); Janus.debug(json); if(json["janus"] !== "success") { Janus.error("Ooops: " + json["error"].code + " " + json["error"].reason); // FIXME } delete pluginHandles[handleId]; callbacks.success(); }, error: function(XMLHttpRequest, textStatus, errorThrown) { Janus.error(textStatus + ": " + errorThrown); // FIXME // We cleanup anyway delete pluginHandles[handleId]; callbacks.success(); }, dataType: "json"});--
You received this message because you are subscribed to the Google Groups "meetecho-janus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to meetecho-janu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
pluginHandle.ondetached();pluginHandle.detach();pluginHandle.ondetached();delete pluginHandles[sender];if (pluginHandles[handleId] === 'undefined') { return;}