The RTCSessionDescription removes custom payload attributes in it's toJSON
method. The one value we set is the nick, so we need to toJSON and toObject
the description and add the nick to the payload again.
{@see https://developer.mozilla.org/en-US/docs/Web/API/RTCSessionDescription/toJSON}
Signed-off-by: Joas Schilling <coding@schilljs.com>
The old callback based version is deprecated, and it seems to be no
longer supported by WebRTC Adapter nor some browsers, like Firefox 67
or Chromium 71. Therefore now the promise based version is used instead.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Most features of the RTCPeerConnection wrapper are not used, so the
wrapper can be replaced by the standard RTCPeerConnection plus some code
to handle offers and answers.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Edge supports screen sharing through the standard
"MediaDevices.getDisplayMedia".
The browser detection had to be changed, as the user agent of Edge
matches with "Chrome"; the code used to detect Chromium/Chrome and Edge
is based on the code of "detectBrowser" in webrtc-adapter "utils.js".
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Latest "attachMediaStream" release sets "scaleX(1)" transform on the
video if it is not mirrored, but that causes the video to be moved to a
wrong position in some browsers. As "scaleX(1)" should have no effect
the transform is simply removed.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"getUserMedia" should resolve the promise only if all the constraints
are satisfied, but Edge resolves it also if both are requested (audio
and video) but only one of them is satisfied. The callbacks are used to
set the local audio and video as available or not available, so the Edge
behaviour is now handled to return the right information to the
callbacks.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This property was removed in localmedia 3.x, but it is used in several
places in SimpleWebRTC 2.3.3, so for now it is restored.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The normalization of errors by the "getUserMedia" module should be
covered by current webrtc-adapter releases, so it should not be needed.
Besides that, the NPM package contains a "node_modules" directory with
the code of an old "webrtc-adapter" release, and the bundling tool gets
confused when this directory is present and bundles that old code
instead of the most recent one.
Due to all this, the module is replaced by a custom wrapper that just
calls the given callbacks as needed.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
"getScreenMedia" was heavily customized in the old bundle, so the
default implementation in the new bundle is fully replaced by it.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>