Temasys / AdapterJS

AdapterJS Javascript Polyfill and Tools for WebRTC - Skylink WebRTC
http://skylink.io/web
Other
432 stars 100 forks source link

AJS-280: Fixes to define screensharing changes for gar.io case #233

Closed oooookk7 closed 7 years ago

oooookk7 commented 8 years ago

How to reproduce the original issue: Run getaroom.io locally with AdapterJS 0.14.0 changes and notice that if you invoke the screenshare button, nothing happens. If you check window.navigator.getUserMedia, it gives you the webrtc/adapter shim.

Note that do not test in getaroom.io production since it uses AdapterJS 0.13.4 which does not have problems.

This could be related to some browserify output changes from webrtc/adapter which causes the overrides not to work in getaroom.io. This might cause issues for people using requirejs or reactjs library as they are used by developers. In order to fix it temporarily, a timeout was set to define the screensharing changes again, and to make the code run sequentially, the AdapterJS.webrtcReady follows the same timeout value before triggering the callback ready function.

Perhaps we should move to use browserify just as what webrtc/adapter is using to make proper fixes.

PS: I doubt these fixes are the best but it works for now. I think we should consider proper fixes to prevent related errors.