Skip to content

Break classes that extend RTCPeerConnection #1112

@matiaslopezd

Description

@matiaslopezd
  • I have provided steps to reproduce (e.g. a link to a jsfiddle)
  • I have provided the browser name, version, and adapter.js version
  • This issue only happens when adapter.js is used

Versions affected

  • Safari iOS 15.2 (Error visible on Devtools)
  • Safari macOS 15.6 (Error visible on Devtools)
  • Chrome 104.0.5112.79 Linux
  • Firefox 104.0.2 Linux
  • Chrome

adapter.js: 8.0.0

Warning
The provided example uses the latest CDN version!

Description

I'm using a custom class that extends RTCPeerConnection.

class MyCustomPeer extends RTCPeerConnection {...}

On the constructor, I call a static method which triggers a TypeError:

TypeError: this.constructor.myStaticMethod is not a function. (In 'this.constructor.myStaticMethod()', 'this.constructor.myStaticMethod' is undefined)

Mainly only shows on iOS and Mac (Safari), meanwhile, Chrome and Firefox on any OS do not trigger an error but the behavior is volatile like sometimes not dispatching the icecandidate and track events.

Steps to reproduce

Note
Use Safari on Mac or iOS, the only browsers returning a visible error.

  1. Go to the example with adapter, and open Devtools.
  2. Go to the example without adapter, and open Devtools.

Expected results

Create a class that extends RTCPeerConnection without issues.

Actual results

Overrides all static and non-static methods.

Related issue

#1010

Screenshot

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions