-
Notifications
You must be signed in to change notification settings - Fork 94
Add bind() polyfill to plugin functions #291
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
base: master
Are you sure you want to change the base?
Conversation
Will need to test, but in theory, it sounds great to me :) |
Sweet! I do believe I'm seeing infinite recursion in IE11 due to the different event listener code ( Also, would it be better if I squashed these commits into one? |
You don't need to squash the commits. I will be waiting for an update on the infinite recursion :) |
Ok, that should do it! Let me know if you'd like me to make any changes. |
Hi, SafariTake for example this sample : https://plugin.temasys.com.sg/demo/src/content/peerconnection/pc1/ Try the following code :
This is probably due to the nature of NPAPI/ActiveX plugin. When you call pc.createOffer, it's not calling the createOffer function on the pc1 instance. It's calling the createOffer function of this specific instance of PC. pc2.createOffer is a difference instance of the function. IEIE is flat out not working for me. I tried to bind pc.createOffer and I am getting an immediate error when I try to call a function after binding it. |
Whoops - thanks for the info, that is helpful. The plugin objects are a bit strange. I'll work on getting this fixed! |
Feel free to work on it as much as you want, but very honestly, I don't think that there is a clean way of fixing this. |
Thanks for the help! I think you are probably right and I'm going to start looking at a different approach than modifying AdapterJS. |
Sure, no prob. |
Hey @johache, do you have time to look at this? Thanks for your attention! |
I'm sorry, but it still doesn't seem to work.
Gives me this error and trying to preset actually calls the function :
|
In my case, when I merge this pull request in adapter, using the latest simplewebrtc I get the error "Calling method on NPObject" on " This is when I do a Safari - Chrome video call. This error only appears on Safari's side. |
The Temasys plugin returns Javascript functions that reflect a much older version of Javascript and do not support the
bind()
functionality which causes failures in our code and some plugins like rtcpeerconnection. This recursively polyfills all functions on the plugin object so they support this relatively recent Javascript functionality.