WebphoneLib icon indicating copy to clipboard operation
WebphoneLib copied to clipboard

Replace EventEmitter with EventTarget

Open confususs opened this issue 5 years ago • 2 comments

Version

(no versions yet)

File / Feature

  • src/autoplay.ts
  • src/client.ts
  • src/media.ts
  • src/reconnectable-transport.ts
  • src/session-media.ts
  • src/session-stats.ts

Summary

I assumed that when the browser supports WebRTC it would also support EventTarget, but that is not always the case. (looking at you "Safari")

Screenshot_2019-09-11_10-01-51 Screenshot_2019-09-11_10-02-31

I'm guessing we should keep using EventEmitter, it does not add additional package overhead because that is also used by sip.js.

Screenshot_2019-09-11_10-06-39

confususs avatar Sep 11 '19 08:09 confususs

Just putting this here for documentation purposes & triggering possible discussions

confususs avatar Sep 11 '19 08:09 confususs

We could also use a polyfill for Safari: https://www.npmjs.com/package/event-target-shim

c0deaddict avatar Sep 12 '19 11:09 c0deaddict