How to use the react-native-webrtc.RTCPeerConnection.apply function in react-native-webrtc

To help you get started, we’ve selected a few react-native-webrtc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jitsi / jitsi-meet / react / features / base / lib-jitsi-meet / native / RTCPeerConnection.js View on Github external
export default function _RTCPeerConnection(...args: any[]) {

    /* eslint-disable indent, no-invalid-this */

    RTCPeerConnection.apply(this, args);

    this.onaddstream = (...args) => // eslint-disable-line no-shadow
        (this._onaddstreamQueue
                ? this._queueOnaddstream
                : this._invokeOnaddstream)
            .apply(this, args);

    // Shadow RTCPeerConnection's onaddstream but after _RTCPeerConnection has
    // assigned to the property in question. Defining the property on
    // _RTCPeerConnection's prototype may (or may not, I don't know) work but I
    // don't want to try because the following approach appears to work and I
    // understand it.

    // $FlowFixMe
    Object.defineProperty(this, 'onaddstream', {
        configurable: true,
github jitsi / jitsi-meet-react / features / base / lib-jitsi-meet / native / polyfills-webrtc.js View on Github external
function _RTCPeerConnection() {
            RTCPeerConnection.apply(this, arguments);

            this.onaddstream = function () {
                return (
                    (this._onaddstreamQueue
                        ? this._queueOnaddstream
                        : this._invokeOnaddstream)
                        .apply(this, arguments));
            };
            // Shadow RTCPeerConnection's onaddstream but after
            // _RTCPeerConnection has assigned to the property in question.
            // Defining the property on _RTCPeerConnection's prototype may (or
            // may not, I don't know) work but I don't want to try because the
            // following approach appears to work and I understand it.
            Object.defineProperty(this, 'onaddstream', {
                configurable: true,
                enumerable: true,