Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break classes that extend RTCPeerConnection #1112

Open
3 tasks done
matiaslopezd opened this issue Sep 15, 2022 · 2 comments
Open
3 tasks done

Break classes that extend RTCPeerConnection #1112

matiaslopezd opened this issue Sep 15, 2022 · 2 comments

Comments

@matiaslopezd
Copy link

matiaslopezd commented Sep 15, 2022

  • 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

@fippo
Copy link
Member

fippo commented Sep 16, 2022

what might contribute is that the safari shim is still wrapping the peerconnection constructor here:
https://github.com/webrtcHacks/adapter/blob/master/src/js/safari/safari_shim.js#L235

@dagingaa any ideas?

@matiaslopezd
Copy link
Author

Any update? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants