Skip to content

Instantly share code, notes, and snippets.

@B-R-Bender
Last active February 3, 2021 09:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save B-R-Bender/8e71e8f9b72584e53748f607199814ad to your computer and use it in GitHub Desktop.
Save B-R-Bender/8e71e8f9b72584e53748f607199814ad to your computer and use it in GitHub Desktop.
Janus gateway handleRemoteJsep.dengeroslyCustomizeSdp callback
function prepareWebrtcPeer(handleId, callbacks) {
callbacks = callbacks || {};
callbacks.success = (typeof callbacks.success == "function") ? callbacks.success : Janus.noop;
callbacks.error = (typeof callbacks.error == "function") ? callbacks.error : webrtcError;
callbacks.dangerouslyCustomizeSdp = (typeof callbacks.dangerouslyCustomizeSdp == "function") ? callbacks.dangerouslyCustomizeSdp : Janus.noop;
...
if (jsep) {
if (!config.pc) {
Janus.warn("Wait, no PeerConnection?? if this is an answer, use createAnswer and not handleRemoteJsep");
callbacks.error("No PeerConnection: if this is an answer, use createAnswer and not handleRemoteJsep");
return;
}
callbacks.dangerouslyCustomizeSdp(jsep);
config.pc.setRemoteDescription(jsep)
...
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment