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>
The current release of RTCPeerConnection wrapper no longer contains a
TraceablePeerConnection attribute, so the wrapped RTCPeerConnection is
now a direct child of the wrapper instead of a child of the
TraceablePeerConnection.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The localmedia version (which is inherited by the WebRTC "class") is
newer than the one used with SimpleWebRTC 2.2.3, so the function calls
need to be adjusted to the new API.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
The connection object passed to SimpleWebRTC will be always the
signaling object, so there is no need to support socketioconnection.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
File transfer does not need to be supported by the WebRTC code, so it
was removed from SimpleWebRTC to limit the needed dependencies.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
For consistency with the rest of the files, the indentation of imported
files was changed to use tabs.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
SimpleWebRTC 2.2.3 is the same version provided by the current
"js/simplewebrtc.js" file. This file will be eventually removed and
replaced by a custom bundle of the imported files and its dependencies.
The dependencies are mostly defined in "package.json" but, just like
SimpleWebRTC itself, some of the dependencies will need to be
customized; the dependencies to be customized are getscreenmedia 5.1.2
and localmedia 5.2.0. Note that the imported SimpleWebRTC has other
dependencies too, but their uses will be removed from the code and thus
are not needed.
The relevant files were imported into "js/simplewebrtc/".
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>