mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-20 23:37:33 +09:00
Issue #2332 - Have addIceCandidate take a dictionary
Backport of https://bugzilla.mozilla.org/show_bug.cgi?id=1263312 part 2
This commit is contained in:
parent
ddf29677d9
commit
80a3c49ba2
3 changed files with 24 additions and 18 deletions
|
|
@ -985,12 +985,15 @@ RTCPeerConnection.prototype = {
|
|||
containsTrickle(topSection) || sections.every(containsTrickle);
|
||||
},
|
||||
|
||||
|
||||
addIceCandidate: function(c, onSuccess, onError) {
|
||||
return this._legacyCatchAndCloseGuard(onSuccess, onError, () => {
|
||||
if (!c.candidate && !c.sdpMLineIndex) {
|
||||
throw new this._win.DOMException("Invalid candidate passed to addIceCandidate!",
|
||||
"InvalidParameterError");
|
||||
if (!c) {
|
||||
// TODO: Implement processing for end-of-candidates (bug 1318167)
|
||||
return Promise.resolve();
|
||||
}
|
||||
if (c.sdpMid === null && c.sdpMLineIndex === null) {
|
||||
throw new this._win.DOMException("Invalid candidate (both sdpMid and sdpMLineIndex are null).",
|
||||
"TypeError");
|
||||
}
|
||||
return this._chain(() => new this._win.Promise((resolve, reject) => {
|
||||
this._onAddIceCandidateSuccess = resolve;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue