webapis-rtc-peer-connection.umd.js 1.3 KB

123456789101112131415161718192021222324252627282930
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2025 Google LLC. https://angular.io/
  5. * License: MIT
  6. */
  7. (function (factory) {
  8. typeof define === 'function' && define.amd ? define(factory) :
  9. factory();
  10. })((function () {
  11. 'use strict';
  12. function patchRtcPeerConnection(Zone) {
  13. Zone.__load_patch('RTCPeerConnection', function (global, Zone, api) {
  14. var RTCPeerConnection = global['RTCPeerConnection'];
  15. if (!RTCPeerConnection) {
  16. return;
  17. }
  18. var addSymbol = api.symbol('addEventListener');
  19. var removeSymbol = api.symbol('removeEventListener');
  20. RTCPeerConnection.prototype.addEventListener = RTCPeerConnection.prototype[addSymbol];
  21. RTCPeerConnection.prototype.removeEventListener = RTCPeerConnection.prototype[removeSymbol];
  22. // RTCPeerConnection extends EventTarget, so we must clear the symbol
  23. // to allow patch RTCPeerConnection.prototype.addEventListener again
  24. RTCPeerConnection.prototype[addSymbol] = null;
  25. RTCPeerConnection.prototype[removeSymbol] = null;
  26. api.patchEventTarget(global, api, [RTCPeerConnection.prototype], { useG: false });
  27. });
  28. }
  29. patchRtcPeerConnection(Zone);
  30. }));