/* * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. */ /* * Add integers, wrapping at 2^32. This uses 16-bit operations internally * to work around bugs in some JS interpreters. */ /* * Bitwise rotate a 32-bit number to the left. */ /* * Browser-compatible JavaScript MD5 * * Modification of JavaScript MD5 * https://github.com/blueimp/JavaScript-MD5 * * Copyright 2011, Sebastian Tschan * https://blueimp.net * * Licensed under the MIT license: * https://opensource.org/licenses/MIT * * Based on * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet * Distributed under the BSD License * See http://pajhome.org.uk/crypt/md5 for more info. */ /* * Calculate the MD5 of an array of little-endian words, and a bit length. */ /* * Convert an array bytes to an array of little-endian words * Characters >255 have their high-byte silently ignored. */ /* * Convert an array of little-endian words to an array of bytes */ /* * These functions implement the four basic operations the algorithm uses. */ /* .version */ /* Note: this will include stats of all senders that * send a track with the same id as sender.track as * it is not possible to identify the RTCRtpSender. */ /* append padding */ /* binding */ /* eslint-env node */ /* filter getStats for a sender/receiver track. */ /* global Reflect, Promise */ /* harmony default export */ /* harmony export */ /* iterates the stats graph recursively. */ /* not yet if (transceiver.iceGatherer) { transceiver.iceGatherer.close(); } */ /* reexport */ /* remove a=extmap-allow-mixed for webrtc.org < M71 */ /* shims RTCConnectionState by pretending it is the same as iceConnectionState. * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12 * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect * since DTLS failures would be hidden. See * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827 * for the Firefox tracking bug. */ /* webpack/runtime/compat get default export */ /*! Copyright (C) 2013-2017 by Andrea Giammarchi - @WebReflection Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /*#__PURE__*/ /** * Calls a registered RPC method on server. * @method * @param {String} method - RPC method name * @param {Object|Array} params - optional method parameters * @param {Number} timeout - RPC reply timeout value * @param {Object} ws_opts - options passed to ws * @return {Promise} */ /** * Can be overridden in environments where MediaStream is not natively present * @returns true if input is a MediaStream, false otherwise */ /** * Can be overridden in environments where RTCPeerConnection is not natively present * @returns new RTCPeerConnection */ /** * Closes a WebSocket connection gracefully. * @method * @param {Number} code - socket close code * @param {String} data - optional data to be sent before closing * @return {Undefined} */ /** * Closes an underlying socket * @method * @param {Number} code - status code explaining why the connection is being closed * @param {String} reason - a description why the connection is closing * @return {Undefined} * @throws {Error} */ /** * Connect to the Bandwidth WebRTC platform * @param authParams connection credentials * @param options additional connection options; usually unnecessary */ /** * Connection/Message handler. * @method * @private * @param {String} address - WebSocket API address * @param {Object} options - ws options object * @return {Undefined} */ /** * Construct a new instance of BandwidthRtc * @param logLevel desired log level for logs that will appear in the browser's console, optional */ /** * Creates the delegate object using the specific version * @param authParams connection credentials with version * @returns */ /** * DTMF Sender that layers DTMF tones onto an existing stream. * @param tone The DTMF tones to send - a string composed of the characters [0-9,*,#,\,]* * @param streamId The optional stream id to play on. */ /** * Disconnect from the Bandwidth WebRTC platform, and tear down all published streams */ /** * Enable/disable the camera (video tracks) * @param enabled whether video streams should be enabled * @param stream specific stream to operate on; optional, defaults to all streams */ /** * Enable/disable the mic (audio tracks) * @param enabled whether audio streams should be enabled * @param stream specific stream to operate on; optional, defaults to all streams */ /** * Fetches a list of client's methods registered on server. * @method * @return {Array} */ /** * Logins with the other side of the connection. * @method * @param {Object} params - Login credentials object * @return {Promise} */ /** * Normalizes the amplitude of Uint8Array audio samples into the range of 0 - 1 * Samples are originally in the range of 0-256, where the midpoint of 128 is * silent and the values in either direction are progressively loud, into an * equivalent value between 0 and 1, where 0 is silent and 1 is maximally loud. * @param sample The unsigned integer sample * @returns The amplitude of the audio sample, in the range of 0 - 1 */ /** * Publish media to the Bandwidth WebRTC platform * * This function can publish an existing MediaStream, or it can create and publish a new media stream from MediaStreamConstraints * @param input existing media or specific constraints to publish (optional, defaults to basic audio/video constraints) * @param audioLevelChangeHandler handler that can be called when the audio level of the published stream changes (optional) * @param alias stream alias/tag that will be included in subscription events and billing records, should not be PII (optional) * @param codecPreferences preferred audio and video codecs (optional, should almost never be needed) */ /** * Publish media to the Bandwidth WebRTC platform * * This function can publish an existing MediaStream, or it can create and publish a new media stream from MediaStreamConstraints * @param input existing media or specific constraints to publish; optional, defaults to basic audio/video constraints * @param audioLevelChangeHandler handler that can be called when the audio level of the published stream changes (optional) * @param alias stream alias/tag that will be included in subscription events and billing records, should not be PII (optional) */ /** * Returns an array of available audio input devices */ /** * Returns an array of available audio output devices */ /** * Returns an array of available media devices, optionally filtered by device kind * @param filter Device kind to filter on */ /** * Returns an array of available video input devices */ /** * Sends a JSON-RPC 2.0 notification to server. * @method * @param {String} method - RPC method name * @param {Object} params - optional method parameters * @return {Promise} */ /** * Set the function that will be called when a subscribed stream becomes available * @param callback callback function */ /** * Set the function that will be called when a subscribed stream becomes unavailable * @param callback callback function */ /** * Set the log level for logs that will appear in the browser's console * Defaults to "warn" * @param logLevel log level */ /** * Subscribes for a defined event. * @method * @param {String|Array} event - event name * @return {Undefined} * @throws {Error} */ /** * Unpublish one or more streams. * @param streams streams to unpublish; leave empty to unpublish all streams */ /** * Unsubscribes from a defined event. * @method * @param {String|Array} event - event name * @return {Undefined} * @throws {Error} */ /** * Connects to a defined server if not connected already. * @method * @return {Undefined} */ /** * Instantiate a Client class. * @constructor * @param {webSocketFactory} webSocketFactory - factory method for WebSocket * @param {String} address - url to a websocket server * @param {Object} options - ws options object with reconnect parameters * @param {Function} generate_request_id - custom generation request Id * @return {CommonClient} */ /** * Sends data through a websocket connection * @method * @param {(String|Object)} data - data to be sent via websocket * @param {Object} optionsOrCallback - ws options * @param {Function} callback - a callback called once the data is sent * @return {Undefined} */ /** * "Client" wraps "ws" or a browser-implemented "WebSocket" library * according to the environment providing JSON RPC 2.0 support on top. * @module Client */ /** * Add a listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ /** * Add a listener for a given event. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} once Specify if the listener is a one-time listener. * @returns {EventEmitter} * @private */ /** * Add a one-time listener for a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn The listener function. * @param {*} [context=this] The context to invoke the listener with. * @returns {EventEmitter} `this`. * @public */ /** * Browser detector. * * @return {object} result containing browser and version * properties. */ /** * Calculate output length with padding and bit length */ /** * Calls each of the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Boolean} `true` if the event had listeners, else `false`. * @public */ /** * Checks if something is an object. * * @param {*} val The something you want to check. * @return true if val is an object, false otherwise. */ /** * Clear event by name. * * @param {EventEmitter} emitter Reference to the `EventEmitter` instance. * @param {(String|Symbol)} evt The Event name. * @private */ /** * Constructor to create a storage for our `EE` objects. * An `Events` instance is a plain object whose properties are event names. * * @constructor * @private */ /** * Convert array of 16 byte values to UUID string format of the form: * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX */ /** * Copyright (c) 2014-present, Facebook, Inc. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ /** * Disable or enable deprecation warnings * @param {!boolean} bool set to true to disable warnings. */ /** * Extract browser version out of the provided user agent string. * * @param {!string} uastring userAgent string. * @param {!string} expr Regular expression used as match criteria. * @param {!number} pos position in the version string to be returned. * @return {!number} browser version. */ /** * Minimal `EventEmitter` interface that is molded against the Node.js * `EventEmitter` interface. * * @constructor * @public */ /** * Remove all empty objects and undefined values * from a nested object -- an enhanced and vanilla version * of Lodash's `compact`. */ /** * Remove all listeners, or those of the specified event. * * @param {(String|Symbol)} [event] The event name. * @returns {EventEmitter} `this`. * @public */ /** * Remove the listeners of a given event. * * @param {(String|Symbol)} event The event name. * @param {Function} fn Only remove the listeners that match this function. * @param {*} context Only remove the listeners that have this context. * @param {Boolean} once Only remove one-time listeners. * @returns {EventEmitter} `this`. * @public */ /** * Representation of a single event listener. * * @param {Function} fn The listener function. * @param {*} context The context to invoke the listener with. * @param {Boolean} [once=false] Specify if the listener is a one-time listener. * @constructor * @private */ /** * Return an array listing the events for which the emitter has registered * listeners. * * @returns {Array} * @public */ /** * Return the listeners registered for a given event. * * @param {(String|Symbol)} event The event name. * @returns {Array} The registered listeners. * @public */ /** * Return the number of listeners listening to a given event. * * @param {(String|Symbol)} event The event name. * @returns {Number} The number of listeners. * @public */ /** * Shows a deprecation warning suggesting the modern and spec-compatible API. */ /** * WebSocket implements a browser-side WebSocket specification. * @module Client */ /** * factory method for common WebSocket instance * @method * @param {String} address - url to a websocket server * @param {(Object)} options - websocket options * @return {Undefined} */ /** @class */ /** @deprecated */ /** @deprecated Deprecated in 0.3.0, will be removed in 0.4.0. Use runExclusive instead. */ /** Instantiate a WebSocket class * @constructor * @param {String} address - url to a websocket server * @param {(Object)} options - websocket options * @param {(String|Array)} protocols - a list of protocols * @return {WebSocketBrowserImpl} - returns a WebSocket instance */ /************************************************************************/ /******/ /***/ /*break*/ /*endfinally*/ /*return*/ /*yield*/ // // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419 // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 // data does not reach the other peer reliably. // every implementation we know supports receiving 65536 bytes. // message size can be reset for all data channels at a later stage. // becomes rejected. // get the fingerprint line as input. See also getIceParameters. // get the ice-ufrag and ice-pwd lines as input. // https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#dictionary-rtcsrtpsdesparameters-members // https://rawgit.com/aboba/edgertc/master/msortc-rs4.html#rtcsrtpkeyparam* // https://tools.ietf.org/html/draft-ietf-mmusic-sdp-simulcast-03 // see https://github.com/openpeer/ortc/issues/569 // "Software"), to deal in the Software without restriction, including // "consumed" by the delegate iterator. If context.method was // "return" to "throw", let that override the TypeError below. // "return", allow the original .return call to continue in the // "undefined" in the uuid) // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so // (Re)publish any existing media streams // (Use "/" to avoid 32-bit truncation when bit-shifting high-order bytes) // (which is not yet the same as the WebRTC 1.0 transceiver) // * changing the order of codecs // **`v1()` - Generate time-based UUID** // - Invalid input values for the RFC `version` or `variant` fields // - One or more input array values don't map to a hex octet (leading to // .constructor.prototype properties for functions that return Generator // .throw, and .return (see defineIteratorMethods). // .throw, and .return methods. // 1) stun: filtered after 14393 unless ?transport=udp is present // 2) turn: that does not have all of turn:host:port?transport=udp // 3) turn: with ipv6 addresses // 4) turn: occurring muliple times // @@iterator function is called on it. Some browsers' implementations of the // @ts-ignore // A .throw or .return when the delegate iterator has no .throw // A Generator should always return itself as the iterator object when the // A parser should be an API 1:1 compatible with JSON // Adapted from Chris Veness' SHA1 code at // Add a serializer that does not serialize the extra attributes. // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb. // Add event.transceiver member over deprecated event.receiver // Add identity mapping for consistency with addTrack. // Adding the second element, need to change to array. // Alias methods names because people roll like that. // Alias of parseParams(). // All tracks are available // Allow `EventEmitter` to be imported as module namespace. // Also deals with vbr=on; cng=on // Also note that after the createoffer we are not 100% sure that // As usual, adapter.js has to do an 'ugly worakaround' // Assign the result of the finished delegate to the temporary // Assigning the media stream as the srcObject of an Audio element // AsyncIterator objects; they just return a Promise for the value of // At least give some kind of context to the user // Attempt to fix ONN in plan-b mode. // Attempt to restart ice if connection fails // Augment the native candidate with the parsed fields. // Avoid TypeError: "type" is read-only, in old versions. 34-43ish // Avoid propagating failures to Promises returned by later // BFCP https://tools.ietf.org/html/rfc4583 // Backwards-compat with node 0.10.x // Be forgiving, per 25.3.3.3.3 of the spec: // Browser shims. // Build the mline. // By default EventEmitters will print a warning if more than 10 listeners are // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/index.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/md5.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/parse.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/regex.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/rng.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/sha1.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/stringify.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v1.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v35.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/v4.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/validate.js // CONCATENATED MODULE: ./node_modules/uuid/dist/esm-browser/version.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/adapter_core.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/adapter_factory.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/chrome/getusermedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/common_shim.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/edge/edge_shim.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/edge/filtericeservers.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/edge/getdisplaymedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/edge/getusermedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/firefox/getusermedia.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/safari/safari_shim.js // CONCATENATED MODULE: ./node_modules/webrtc-adapter/src/js/utils.js // CSP to forbid Function, and you're not willing to fix either of those // Calculate intersection of capabilities. // Call delegate.iterator[context.method](context.arg) and handle the // Cast or create a MediaStream from the input // Check for listener leak // Check if module is in cache // Check if the init options were applied. If not we do this in an // Check if the remote is FF. // Check if we can use BUNDLE and dispose transports. // Chrome 74 removed webkitGetUserMedia on http as well so we need the // Chrome decided to not expose .sctp in plan-b mode. // Chrome, Chromium, Webview, Opera. // Clone is necessary for local demos mostly, attaching directly // Compute hash of namespace and value, Per 4.3 // Consistency check for valid UUID. If this throws, it's likely due to one // Convert Array-like to Array // Copy bytes to buffer, if provided // Copyright Joyent, Inc. and other Node contributors. // Create ICE transport and DTLS transport. // Create M-lines for recvonly streams. // Create a dummy RTCSctpTransport object and the 'maxMessageSize' // Create a new module (and put it into the cache) // Create the publishing RTCPeerConnection if this is the first time publishing // Current SDP revision for the subscribing peer; used to reject outdated SDP offers // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR // DTMF // Default fallthrough: not supported. // Define Generator.prototype.{next,throw,return} in terms of the // Define the unified helper method that is used to implement .next, // Delay close event until internal state is updated // Deliberately forget the last sent value so that we don't // Destroy ICE gatherer, ICE transport and DTLS transport. // Determine final maximum message size // Determine whether to fire the negotiationneeded event. // Determines the intersection of local and remote capabilities. // Dispatch the exception by looping back around to the // Don't block on this, we should try multiple times // Dummy constructor functions that we use as the .constructor and // ESM COMPAT FLAG // EXPORTS // EXTERNAL MODULE: ./node_modules/rtcpeerconnection-shim/rtcpeerconnection.js // EXTERNAL MODULE: ./node_modules/sdp/sdp.js // Edge 10547 yet. // Edge currently only implements the RTCDtmfSender, not the // Edge does not like // Edge emits an empty object for RTCIceCandidateComplete‥ // Edge uses the compound attribute instead of reducedSize // Edge's internal representation adds some fields therefore // Edge. // Emit candidate. Also emit null candidate when all gatherers are // Emits a 'removeListener' event if and only if the listener was removed. // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia // EventEmitters, we do not listen for `error` events here. // EventTarget does not have `error` event semantics like Node // Every implementation we know can send at least 64 KiB. // Exception thrown outside of any try block that could handle // Execute the module function // Export to the adapter global object visible in the browser. // Expose the prefix. // Extracts DTLS parameters from SDP media section or sessionpart. // Extracts all SDES paramters. // Extracts the MID (RFC 5888) from a media section. // FF 57 has a slightly incorrect default remote max message size, so // FF < 57 will send in 16 KiB chunks using the deprecated PPID // FIXME: actually the receiver should be created later. // FIXME: also need to determine .parameters // FIXME: clean up tracks, local streams, remote streams, etc // FIXME: does not work with Plan B. // FIXME: ensure the mediaSection has rtcp-mux set. // FIXME: fecMechanisms // FIXME: for consistency with other functions this should only // FIXME: look at direction. // FIXME: parse rtcp. // FIXME: sess-id should be an NTP timestamp. // FIXME: special handling for trr-int? // FIXME: this should be written by writeRtpDescription. // FIXME: write fecMechanisms. // Fail early if it's not a browser // Firefox 68+ emits and processes {candidate: "", ...}, ignore // Firefox ignores the init sendEncodings options passed to addTransceiver // Firefox. // Fixed in 15025 (or earlier) // For CommonJS default export support // For backward compatibility - alias will be removed in 3.0.0 // For each track, create an ice gatherer, ice transport, // For the native GeneratorFunction constructor, the best we can // Function#name is not settable on some platforms (#270) // Future: Use spread syntax when supported on all platforms, e.g. `bytes = // GenStateExecuting and loop back for another invocation. // Generate a session ID for SDP. // Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters. // Generate an a=rtpmap line from RTCRtpCodecCapability or // Generate an alphanumeric identifier for cname or mids. // Generates a=extmap line from RTCRtpHeaderExtensionParameters or // Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters. // Generates parts of the SDP media section describing the capabilities / // Get the maximum message size the local peer is capable of sending // Gets the direction from the mediaSection or the sessionpart. // Gets the first SSRC. Note tha with RTX there might be multiple // Helper for defining the .next, .throw, and .return methods of the // Helper function to add the track to the stream and // Hook up the augmented candidate in onicecandidate and // ICETransport.completed and connected are the same for this purpose. // IE 8 has a broken Object.defineProperty that only works on DOM objects. // IE does not have builtin `{ once: true }` support so we // If `Object.create(null)` is not supported we prefix the event names with a // If a rejected Promise was yielded, throw the rejection back // If an exception is thrown from innerFn, we leave state === // If context.method was "throw" but the delegate handled the // If enqueue has been called before, then we want to wait until // If maybeInvokeDelegate(context) changed context.method from // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator. // If selector is a function then we are in the old style stats so just // If sendEncodings params are provided, validate grammar // If the delegate iterator has a return method, give it a // If the dispatched exception was caught by a catch block, // If the maximum message size is not present in the remote SDP and // If there is no 'error' event listener then throw. // Ignore Chrome's invalid candidates since Edge does not like them. // Ignore RTCP candidates, we assume RTCP-MUX. // Ignore the finally entry if control is not jumping to a // Inject DTMF into one audio track in the stream // Inspired by https://github.com/LiosK/UUID.js // Iterate over each of the samples // Iterator interface in terms of a single ._invoke method. // Keeps a mapping stream.id => [stream, rtpsenders...] // LIFO order // Leave callback version alone; misc old uses of forEach before Map // Load entry module and return exports // Look for matches in label, or use last cam for back (typical). // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv. // Lookup maps for streams, keyed by mediastream id (msid) // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN // Map DTLS parameters to SDP. // Map ICE parameters (ufrag, pwd) to SDP. // Map of streams to tracks, used to deduplicate streamAvailable/streamUnavailable events // Munge the SDP to change the setup from "actpass" to "passive" // Munge the SDP to change the setup to "actpass" // NAMESPACE OBJECT: ./node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js // NAMESPACE OBJECT: ./node_modules/webrtc-adapter/src/js/common_shim.js // NAMESPACE OBJECT: ./node_modules/webrtc-adapter/src/js/edge/edge_shim.js // NAMESPACE OBJECT: ./node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js // NAMESPACE OBJECT: ./node_modules/webrtc-adapter/src/js/safari/safari_shim.js // NB: candidate has three optional chunks, so %void middles one if it's missing // NB: sessionId will be a String in most cases because it is huge // NB: special - pushes to session // NB: we discard excess arguments - they are typically undefined from makeLine // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, // No error code for this since it is a Warning // Not sure about the optimal order of these conditions: // Note that Edge does not support unmuxed RTCP. // Note that simple async functions are implemented on top of // Note2: 'algorithm' is not case sensitive except in Edge. // Note: 65536 bytes is the default value from the SDP spec. Also, // Note: Although Chrome is technically able to send up to 256 KiB, the // Note: Although Firefox >= 57 has a native implementation, the maximum // Note: Be careful editing this code! It's been tuned for performance // Note: The comments on the `throw` lines are intentional, they show // Note: ["return"] must be used for ES3 parsing compatibility. // Note: a=setup line is ignored since we use the 'auto' role. // Note: pranswer is not supported. // Note: we rely on the high-level addTrack/dtmf shim to // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // ORTC defines the DTMF sender a bit different. // ORTC has replaceTrack -- https://github.com/w3c/ortc/issues/614 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // Obviously not all Emitters should be limited to 10. This function allows // Only the first a=fmtp: is considered. // Optimize the case of one listener. Don't need the extra array object. // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack. // Parse ########-....-....-....-............ // Parse ........-####-....-....-............ // Parse ........-....-####-....-............ // Parse ........-....-....-####-............ // Parse ........-....-....-....-############ // Parse both variants. // Parses ICE information from SDP media section or sessionpart. // Parses a=crypto lines into // Parses an ICE candidate line. Sample input: // Parses an RFC 5576 ssrc media attribute. Sample input: // Parses an a=extmap line (headerextension from RFC 5285). Sample input: // Parses an ftmp line, returns dictionary. Sample input: // Parses an ice-options line, returns an array of option tags. // Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input: // Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input: // Parses the SDP media section and returns RTCRtpParameters. // Parses the SDP media section and returns an array of // Parses the crypto key parameters into // Per 4.1.4 - Convert from unix epoch to Gregorian epoch // Per 4.2.1.2 Throw error if too many uuids are requested // Per 4.2.1.2, Bump clockseq on clock regression // Per 4.2.1.2, use count of uuid's generated during the current clock // Per 4.2.2, randomize (14 bit) clockseq // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) // Perform SDP negotiation with Bandwidth WebRTC // Permission is hereby granted, free of charge, to any person obtaining a // Prevents concurrent modification to RTCPeerConnection state (can cause race conditions) // RFC version 26 for SCTP over DTLS // RFC4570 // RFC7273 // RTCDTMFSender alias. See http://draft.ortc.org/#rtcdtmfsender2* // RTCIceCandidate doesn't have a component, needs to be added // RTCRtpCodecParameters. // RTCRtpEncodingParameters. // RTCRtpHeaderExtension. // RTX // Rather than returning an object with a next method, we keep // Re-assign `events` because a newListener handler could have caused the // Regardless of whether this script is executing as a CommonJS module // Reject Chrome legacy constraints. // Reject datachannels which are not implemented yet. // Remove the a= which shouldn't be part of the candidate string. // Replace Firefox 44+'s deprecation warning with unprefixed version. // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new // Reset the array, or remove it completely if we have no more listeners. // Resetting context._sent for legacy support of Babel's // Resume execution at the desired location (see delegateYield). // Return an iterator with no values. // Return the exports of the module // Returned result object. // Returns lines that start with a certain prefix. // SCTP // SDP helpers. // SSRCs. // Safari orders by track id. // Safari. // Search for the native stream the senders track belongs to. // See https://github.com/facebook/regenerator/issues/274 for more details. // See https://github.com/uuidjs/uuid for API details // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697 // Serializes DTLS parameters to SDP. // Serializes ICE parameters to SDP. // Setting context._sent for legacy support of Babel's // Shim browser if found. // Shim facingMode for mobile & surface pro. // Shim only promise getStats with spec-hyphens in type names // Shimming starts here. // Speaking loudly // Speaking softly // Splits SDP into lines, dealing with both CRLF and LF. // Splits SDP into sessionpart and mediasections. Ensures CRLF. // Start the RTCRtpReceiver now. The RTPSender is started in // Start the RTCRtpSender. The RTCRtpReceiver for this // Start the RTP Sender and Receiver for a transceiver. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS // TODO: Is there a better solution for detecting Firefox? // TODO: add timeout so we dont loop here forever // TODO: check the modifier a bit more. // TODO: emit this as an error from an EventEmitter // TODO: make this a more informative error message // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier // TODO: needs to go into ops queue. // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams // TODO: rtp/fmtp should be filtered by the payloads found here? // TODO: this is dangerous in the case where a non-rejected m-line // TODO: this one can actually be parsed properly... // TODO: this one can also be parsed properly // TODO: use UUIDs instead? https://gist.github.com/jed/982883 // Test for NaN (yes, this is ugly) // The ._invoke method unifies the implementations of the .next, // The RTCP CNAME used by all peerconnections from the same JS. // The above copyright notice and this permission notice shall be included // The context.catch method must only be called with a location // The default parser is the native JSON. // The delegate iterator is finished, so forget it and continue with // The module cache // The require function // The root entry object (effectively a try statement without a catch // This entry module is referenced by other modules so it can't be inlined // This environment has a native %IteratorPrototype%; use it instead // This hack is needed because the `__proto__` property is still inherited in // This is a polyfill for %IteratorPrototype% for environments that // This is an ugly hack, but at the same time is way more robust than // This module should not be running in strict mode, so the above // This unfortunately seems to be required // To avoid creating an additional object, we just hang the .value // To avoid recursion in the case that type === "newListener"! Before // Translates a candidate object into SDP candidate attribute. // Trigger ONN async. // Try to emulate Chrome's behaviour of adding in audio-video order. // Try/catch helper to minimize deoptimizations. Returns a completion // USE OR OTHER DEALINGS IN THE SOFTWARE. // UTF8 escape // UUID timestamps are 100 nano-second units since the Gregorian epoch, // Unhandled 'error' event // Unique ID creation requires a high quality random # generator. In the browser we therefore // Unless this is being used with a stream from addTrack. // Update the connection state. // Update the ice connection state. // Update the signaling state. // Utils. // VERY limited support for SDP munging. Limited to: // Version matches Chrome/WebRTC version. // We can not yet check for sender instanceof RTCRtpSender // We try to not inherit from `Object.prototype`. In some engines creating an // When a yielded Promise is resolved, its final value becomes // When spec-style getStats is supported, return those when called with // Within the body of any async function, `await x` is transformed to // Without triggering the callbacks. // Wraps the peerconnection event eventNameToWrap in a function // Write boilder plate for start of SDP // [[associated MediaStreams]] internal slot. // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) // `clock_seq_low` // `hasOwn.call(value, "__await")` to determine if the yielded value is // `node` // `time_high_and_version` // `time_low` // `time_mid` // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test // a very naive interpretation of a valid SDP. // a=bundle-only // a=candidate:0 1 UDP 2113667327 203.0.113.1 54400 typ host // a=candidate:1162875081 1 udp 2113937151 192.168.34.75 60017 typ host generation 0 network-id 3 network-cost 10 // a=candidate:229815620 1 tcp 1518280447 192.168.150.19 60017 typ host tcptype active generation 0 network-id 3 network-cost 10 // a=candidate:3289912957 2 tcp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 tcptype passive generation 0 network-id 3 network-cost 10 // a=candidate:3289912957 2 udp 1845501695 193.84.77.194 60017 typ srflx raddr 192.168.34.75 rport 60017 generation 0 network-id 3 network-cost 10 // a=confid:1 // a=connection:new // a=content:main // a=control:streamid=0 // a=crypto:1 AES_CM_128_HMAC_SHA1_80 inline:PS1uQCVeeCFCanVmcjkpPywjNWhcYD0mXXtxaVBR|2^20|1:32 // a=end-of-candidates (keep after the candidates line for readability) // a=extmap-allow-mixed // a=extmap:1/recvonly URI-gps-string // a=extmap:2 urn:ietf:params:rtp-hdrext:toffset // a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset // a=extmap:3 urn:ietf:params:rtp-hdrext:encrypt urn:ietf:params:rtp-hdrext:smpte-tc 25@600/24 // a=fingerprint:SHA-1 00:11:22:33:44:55:66:77:88:99:AA:BB:CC:DD:EE:FF:00:11:22:33 // a=floorctrl:c-s // a=floorid:1 // a=fmtp:108 profile-level-id=24;object=23;bitrate=64000 // a=fmtp:111 minptime=10; useinbandfec=1 // a=fmtp:96 vbr=on;cng=on // a=framerate:25 // a=framerate:29.97 // a=group:BUNDLE audio video // a=ice-lite // a=ice-options:foo bar // a=ice-options:google-ice // a=ice-pwd:x9cml/YzichV2+XlhiMu8g // a=ice-ufrag:F7gI // a=imageattr:* send [x=800,y=640] recv * // a=imageattr:100 recv [x=320,y=240] // a=imageattr:97 // a=imageattr:97 send [x=800,y=640,sar=1.1,q=0.6] [x=480,y=320] recv [x=330,y=250] // a=keywds:keywords // a=label:1 // a=maxptime:60 // a=mediaclk:direct=963214424 // a=mid:1 // a=msid-semantic: WMS Jvlam5X3SX1OP6pn20zWogvaKJz5Hjf9OnlV // a=msid:0c8b064d-d807-43b4-b434-f92a889d8587 98178685-d409-46e0-8e16-7ef0db0db64a // a=ptime:20 // a=remote-candidates:1 203.0.113.1 54400 2 203.0.113.1 54401 ... // a=rid:1 send max-width=1280;max-height=720;max-fps=30;depend=0 // a=rtcp-fb:98 nack rpsi // a=rtcp-fb:98 trr-int 100 // a=rtcp-mux // a=rtcp-rsize // a=rtcp:65179 IN IP4 193.84.77.194 // a=rtpmap:110 opus/48000/2 // a=rtpmap:111 opus/48000/2 // a=sctpmap:5000 webrtc-datachannel 1024 // a=sendrecv // a=setup:actpass // a=simulcast: // a=simulcast: recv pt=97;98 send pt=97 // a=simulcast: send rid=5;6;7 paused=6,7 // a=simulcast:recv 1;4,5 send 6;7 // a=simulcast:send 1,2,3;~4,~5 recv 6;~7,~8 // a=source-filter: incl IN IP4 239.5.2.31 10.1.15.5 // a=ssrc-group:FEC 1 2 // a=ssrc-group:FEC-FR 3004364195 1080772241 // a=ssrc:2566107569 cname:t9YU8M1UxTF8Y1A1 // a=ssrc:3735928559 cname:something // a=ts-refclk:ptp=IEEE1588-2008:39-A7-94-FF-FE-07-CB-D0:37 // a=userid:1 // a=x-google-flag:conference // accidentally pass it on to the delegate. // addEventListener('icecandidate', ...) // added to it. This is a useful default which helps finding memory leaks. // adding it to the listeners, first emit "newListener". // address is an alias for ip. // again, only one needed, do not use the RegExp for this replacement // algorithm is case-sensitive in Edge. // all previous Promises have been resolved before calling invoke, // already have an existing method we want to call, so there's no need // also ensures that the minifier will not anonymize the function. // also shim pc.getLocalStreams when addTrack is shimmed // also the usernameFragment. TODO: update SDP to take both variants. // always offer BUNDLE and dispose on return if not supported. // and .done properties off the next function object itself. This // and http://docs.python.org/library/uuid.html // and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434 // any a= that we don't understand is kept verbatim on media.invalid // any necessary setup in a predictable way. This predictability // argument that corresponds to a known catch block. // as the draft-ietf-mmusic-sctp-sdp-05 format (indicated by the m-line // as well as ignoring {sdpMid, candidate: ""} // assignment should always work unless something is misconfigured. Just // async functions in terms of async generators, it is especially // asynchronous way and save the promise reference in a global object. // attribute. // augment addTrack when getSenders is not available. // b=AS:4000 // be generated randomly // blank object that will be pushed // both local and remote are Firefox, the remote peer can receive // but right now this should be acceptable and within the right range // by adding level-asymmetry-allowed=1 // c=IN IP4 10.47.197.26 // call invoke immediately, without waiting on a callback to fire, // candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8 // chance to clean up. // character to make sure that the built-in object properties are not // check if any listeners are attached and forward event // check whether addIceCandidate({}) was called within four seconds after // checking the sender parameters before and after the createOffer // complete. // compound is !reducedSize // console.log(lvl, key, path); // constraints. // context.dispatchException(context.arg) call above. // context.method was "next", forget context.arg since it has been // copy of this software and associated documentation files (the // create the sender with a dtmf sender. // current iteration. // customized util.format - discards excess arguments and can void middle ones // cycle to simulate higher resolution clock // dedicated Object parser // deepcopy // default parsing of these only (though some of these feel outdated) // define __esModule on exports // define getter functions for harmony exports // delegate iterator, or by modifying context.method and context.arg, // determine common feedback mechanisms // dispatch the event ourselves. // distribute, sublicense, and/or sell copies of the Software, and to permit // do is to check its .name property. // don't natively support it. // dtls transport, potentially rtpsender and rtpreceiver. // either no arguments or the selector argument is null. // emit already gathered candidates. // emit removeListener for all listeners on all events // emitted in unified-plan. Unfortunately this means we need // enqueue has not been called before, then it is important to // ensure certain properties exist // ensure no special char involved on deserialization // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types // eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line no-empty // eslint-disable-next-line no-restricted-syntax // eslint-disable-next-line prefer-spread // eslint-disable-next-lisne @typescript-eslint/explicit-module-boundary-types // even if RTCRtpTransceiver is in window, it is only used and // everything that is needed to describe a SDP m-line. // exception, let the outer generator proceed normally. If // execute code before the first await. Since we implement simple // executor callback, and why async functions synchronously // extension handling, in particular ufrag // fast Array reconstruction // filter RTX until additional stuff needed for RTX is implemented // filter STUN unconditionally. // find all codecs from mline[3..] // find the complete implementation of crypto (msCrypto) on IE11. // first pass should be ignored, since it's just the initial object // following conditions: // for Chrome. // for Chrome. Legacy should no longer be required. // for backward compability. // for mLine and push attributes // for subsequent offers, we might have to re-use the payload // foundation is arbitrarily chosen as an indicator for full support for // fragmentation. // from https://heycam.github.io/webidl/#idl-DOMException-error-names // function which returns a Promise, it does not accept spec-style // function.sent implementation. // general JSON RPC 2.0 events // generate an ssrc now, to be used later in rtpSender.send // generators (like Math.random()). // getDefaultExport function for compatibility with non-harmony modules // getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also, // getSourceId is a function that returns a promise resolving with // getStats is special. It doesn't have a spec legacy method yet we support // getStats(something, cb) without error callbacks. // has a stable shape and so hopefully should be cheap to allocate. // hashfunc([...namespace, ... value])` // have been (and was previously) designed to take a closure to be // have to do it manually. // http://www.movable-type.co.uk/scripts/sha1.html // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851 // https://bugzilla.mozilla.org/show_bug.cgi?id=1396918 // https://github.com/w3c/ortc/issues/714 // https://github.com/webrtcHacks/adapter/issues/998#issuecomment-516921647 // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-5 // https://tools.ietf.org/html/draft-ietf-mmusic-sctp-sdp-26#section-6 // https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1 // https://w3c.github.io/mediacapture-main/#mediastream // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface // ice transport. And avoid adding candidates added in the SDP. // if a Content Security Policy forbids using Function, but in that case // if a new object should be returned // if object isn't referring to parent object, add to the // if this is the last track of the stream, remove the stream. This // important to get this right, even though it requires care. // in adapter.js // in all copies or substantial portions of the Software. // in case runtime.js accidentally runs in strict mode, in modern engines // in every case, so we don't have to touch the arguments object. The // in older versions. // in older versions. Native support planned for Chrome M77. // in this case only first char is important // include version // injected easily by `bin/regenerator --include-runtime script.js`. // instance in this way is faster than calling `Object.create(null)` directly. // internal helper to create a transceiver object. // into the async generator function so it can be handled there. // invocations of the iterator. // invoked without arguments, but in all the cases we care about we // is action=setLocalDescription with type allowed in signalingState // is required by Chrome in some circumstances to actually start // is why the Promise constructor synchronously invokes its // it should expose stringify and parse methods. // it, so set the completion value of the entire function to // iterator prototype chain incorrectly implement this, causing the Generator // k: [{}], // outdated thing ignored // key cannot contain specialChar but could be not a string // keys should be normalized back here // legacy alias, got renamed back to channels in ORTC. // legacy callback shims. Should be moved to adapter.js some days. // legacy error codes from https://heycam.github.io/webidl/#idl-DOMException-error-names // legacy fmt // let's call it here rather than "too late" // link it up // location outside the try/catch block. // locations where there is no enclosing try statement. // loop through outerOrder for matching properties on session // m=video 51744 RTP/AVP 126 97 98 34 31 // meant to be awaited. // method always terminates the yield* loop. // migrate from non-spec RTCIceServer.url to RTCIceServer.urls // minifier not to mangle the names of these two functions. // missing argument // more complicated fallback to webkitRTCPeerConnection. // ms // ms; // no module.id needed // no module.loaded needed // no need to replace all value (better performance) // node and clockseq need to be initialized to random values if they're not // not all fieldѕ are taken into account. // not listening for removeListener, no need to emit // number of channels is the highest common number of channels // o=- 20518 0 IN IP4 203.0.113.1 // object path stack. Otherwise it is already there. // object to not be returned from this call. This ensures that doesn't happen. // objects. For full spec compliance, you may wish to configure your // of the following: // of the polyfill. // old simulcast draft 03 (implemented by Firefox) // onaddstream does not fire when a track is added to an existing // onerror does not set state to failed by itself. // only additional allocation required is the completion record, which // only keys need the RegExp // opportunity to recreate offer. // or a finally block) gives us a place to store values thrown from // or if there's some key to drop // or not, return the runtime object so that we can declare the variable // otherwise, named location or root // outer generator. // outputs the draft-ietf-mmusic-sctp-sdp-26 version that all browsers // overridden or used as an attack vector. // parameters. // parse FEC mechanisms from rtpmap lines. // parse lines we understand // parses draft-ietf-mmusic-sctp-sdp-26 first and falls back // parses either a=msid: or a=ssrc:... msid lines and returns // parses http://draft.ortc.org/#rtcrtcpparameters* // parses the rtcp-mux attrіbute. // pass back the original getStats format to avoid breaking old users. // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ... // persons to whom the Software is furnished to do so, subject to the // points at where properties go under (one of the above) // polyfill since RTCIceGatherer.state is not implemented in // possibly one JSON does not encode // possibly one encodeURIComponent does not encode // probably media.peerconnection.enabled=false in about:config // problems, please detail your unique predicament in a GitHub issue. // promise-support // protocol of DTLS/SCTP -- without UDP/ or TCP/) // push rCodec so we reply with offerer payload type // recommends using a cryptographically random +ve 64-bit value // record like context.tryEntries[i].completion. This interface could // recycle a rejected transceiver. // regeneratorRuntime in the outer scope, which allows this module to be // reject early since server's response is invalid // reject if no codecs. // relying on the same odd chrome behaviour as above. // remove RTX field in Edge 14942 // remove sender // rename DataChannel to RTCDataChannel (native fix in FF60): // replace the internal stream id with the external one and // require the crypto API and do not support built-in fallback to lower quality random number // result, either by returning a { value, done } result from the // return a copy of the internal state. // returns the MID or undefined if no mid line was found. // returns the individual media sections. // returns the session description. // right now this char is '~' but this might change in the future // role for a=setup to use in answers. // root is an empty string // rport 55996" // run as microtask so that pending queue messages are resolved first // sessId argument is optional - if not supplied it will // sessUser is optional and defaults to 'thisisadapterortc' // sessVersion is optional and defaults to 2 // set sensible defaults to avoid polluting the grammar with boring details // set up event handlers on prototype // setLocalDescription. // setRemoteDescription. // setting context.delegate to null, and returning the ContinueSentinel. // shim RTCPeerConnection.getStats(track). // shim addTrack and removeTrack. // shim addTrack/removeTrack with native variants in order to make // shim away need for obsolete RTCIceCandidate/RTCSessionDescription. // shim getStats with maplike support // shim implicit creation of RTCSessionDescription/RTCIceCandidate // shim not needed in Safari 12.1 // shim receiver stats. // shim sender stats. // should be a not so common char // since we shim RTPSender. So we check if sender._pc is set. // skip parts[6] == 'typ' // so that results are always delivered in the correct order. If // so that the async generator function has the opportunity to do // some old browsers like Android 4, iPhone 5.1, Opera 11 and Safari 5. // spec. // specified. We do this lazily to minimize issues related to insufficient // start gathering from an RTCIceGatherer. // startup // stream. But stream.onaddtrack is implemented so we use that. // strict mode using a global Function call. This could conceivably fail // support bit values // support by now receiving in this format, unless we originally parsed // support for addIceCandidate(null or undefined) // system entropy. See #189 // t=0 0 // takes care of any shimmed _senders. // that to be increased. Set to zero for unlimited. // the .value of the Promise<{value,done}> result for the // the audio flowing through the Web Audio API nodes // the edge shim implements the full RTCIceCandidate object. // the event). // the final result produced by the iterator. // the id of the MediaStream and MediaStreamTrack. // the interactions with legacy getLocalStreams behave as in other browsers. // the method takes exactly one argument, since that happens to be true // the outer generator. // the params were asynchronously applied so we might miss the // the proper solution is to fix the accidental strict mode problem. If // the replacer has rights to decide // the sourceId of the screen/window/tab to be shared. // then for each media line, follow the innerOrder // then let that catch block handle the exception normally. // things simple and return the next function itself. // this is not fully correct but all we can manage without // this is using odd Chrome behaviour, use with caution: // this._events to be assigned to a new object // throw the exception. // time interval // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' // to cover up the mess. // to create a new function object. We can even get away with assuming // to draft-ietf-mmusic-sctp-sdp-05 // to return the original streams. // to two different senders does not work (build 10547). // to unconditionally wrap the event. // token-char = %x21 / %x23-27 / %x2A-2B / %x2D-2E / %x30-39 / %x41-5A / %x5E-7E // transceiver has already been started in setRemoteDescription. // type of the last offer. // unified ._invoke helper method. // up in Node's output if this results in an unhandled exception. // update local description. // update the remoteDescription. // using for-loop instead of unshift/spread because performance is better // value as it is // variable specified by delegate.resultName (see delegateYield). // very basic support for old versions. // vice versa. // was: clockrate // we can explicitly access globalThis. In older engines we can escape // we need to adjust it here to avoid a failure when sending. // we support both b=AS and b=TIAS but interpret AS as TIAS. // webpackBootstrap // when using bundle, avoid adding candidates to the wrong // which returns the modified event object (or false to prevent // without limitation the rights to use, copy, modify, merge, publish, // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552 // wrap static methods. Currently just generateCertificate. // you've misconfigured your bundler to force strict mode and applied a // ~2 GiB. //# sourceMappingURL=jwt-decode.esm.js.map //Create a diagnostics data channel //Create a heartbeat data channel