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

123456789101112131415161718192021222324252627
  1. 'use strict';
  2. /**
  3. * @license Angular v<unknown>
  4. * (c) 2010-2022 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. Zone.__load_patch('RTCPeerConnection', function (global, Zone, api) {
  13. var RTCPeerConnection = global['RTCPeerConnection'];
  14. if (!RTCPeerConnection) {
  15. return;
  16. }
  17. var addSymbol = api.symbol('addEventListener');
  18. var removeSymbol = api.symbol('removeEventListener');
  19. RTCPeerConnection.prototype.addEventListener = RTCPeerConnection.prototype[addSymbol];
  20. RTCPeerConnection.prototype.removeEventListener = RTCPeerConnection.prototype[removeSymbol];
  21. // RTCPeerConnection extends EventTarget, so we must clear the symbol
  22. // to allow patch RTCPeerConnection.prototype.addEventListener again
  23. RTCPeerConnection.prototype[addSymbol] = null;
  24. RTCPeerConnection.prototype[removeSymbol] = null;
  25. api.patchEventTarget(global, api, [RTCPeerConnection.prototype], { useG: false });
  26. });
  27. }));