@nethesis/phone-island 0.7.78 → 0.7.80

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (239) hide show
  1. package/dist/App.d.ts +1 -0
  2. package/dist/App.js +1 -1
  3. package/dist/App.js.map +1 -1
  4. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  5. package/dist/_virtual/floating-ui.dom.esm.js +2 -0
  6. package/dist/_virtual/floating-ui.dom.esm.js.map +1 -0
  7. package/dist/_virtual/index.js +1 -1
  8. package/dist/_virtual/index3.js +1 -1
  9. package/dist/_virtual/index4.js +1 -1
  10. package/dist/_virtual/index5.js +1 -1
  11. package/dist/_virtual/index6.js +1 -1
  12. package/dist/_virtual/index8.js +1 -1
  13. package/dist/_virtual/index9.js +2 -0
  14. package/dist/_virtual/index9.js.map +1 -0
  15. package/dist/_virtual/react-tooltip.min.cjs.js +2 -0
  16. package/dist/_virtual/react-tooltip.min.cjs.js.map +1 -0
  17. package/dist/components/Button.js +1 -1
  18. package/dist/components/Button.js.map +1 -1
  19. package/dist/components/CallView/Actions.js +1 -1
  20. package/dist/components/CallView/Actions.js.map +1 -1
  21. package/dist/components/CallView/Avatar.js +1 -1
  22. package/dist/components/CallView/Avatar.js.map +1 -1
  23. package/dist/components/CallView/BackCall.js +1 -1
  24. package/dist/components/CallView/BackCall.js.map +1 -1
  25. package/dist/components/CallView/DisplayName.js +1 -1
  26. package/dist/components/CallView/DisplayName.js.map +1 -1
  27. package/dist/components/CallView/index.js +1 -1
  28. package/dist/components/CallView/index.js.map +1 -1
  29. package/dist/components/Events.d.ts +1 -0
  30. package/dist/components/Events.js +1 -1
  31. package/dist/components/Events.js.map +1 -1
  32. package/dist/components/Hangup.d.ts +1 -0
  33. package/dist/components/Hangup.js +1 -1
  34. package/dist/components/Hangup.js.map +1 -1
  35. package/dist/components/Island.js +1 -1
  36. package/dist/components/Island.js.map +1 -1
  37. package/dist/components/KeypadView/index.js +1 -1
  38. package/dist/components/KeypadView/index.js.map +1 -1
  39. package/dist/components/Socket.js +1 -1
  40. package/dist/components/Socket.js.map +1 -1
  41. package/dist/components/TransferView/ListAvatar.d.ts +2 -2
  42. package/dist/components/TransferView/ListAvatar.js +1 -1
  43. package/dist/components/TransferView/ListAvatar.js.map +1 -1
  44. package/dist/components/TransferView/TransferActions.js +1 -1
  45. package/dist/components/TransferView/TransferActions.js.map +1 -1
  46. package/dist/components/TransferView/TransferList.js +1 -1
  47. package/dist/components/TransferView/TransferList.js.map +1 -1
  48. package/dist/components/WebRTC.d.ts +2 -0
  49. package/dist/components/WebRTC.js +1 -1
  50. package/dist/components/WebRTC.js.map +1 -1
  51. package/dist/events/CallEvents.d.ts +3 -1
  52. package/dist/events/CallEvents.js +1 -1
  53. package/dist/events/CallEvents.js.map +1 -1
  54. package/dist/index.css +1 -1
  55. package/dist/lib/devices/devices.js +1 -1
  56. package/dist/lib/phone/call.d.ts +2 -2
  57. package/dist/lib/phone/call.js +1 -1
  58. package/dist/lib/phone/call.js.map +1 -1
  59. package/dist/lib/webrtc/messages.d.ts +6 -1
  60. package/dist/lib/webrtc/messages.js +1 -1
  61. package/dist/lib/webrtc/messages.js.map +1 -1
  62. package/dist/models/currentCall.d.ts +67 -0
  63. package/dist/models/currentCall.js +1 -1
  64. package/dist/models/currentCall.js.map +1 -1
  65. package/dist/models/motions.js +1 -1
  66. package/dist/models/motions.js.map +1 -1
  67. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js +1 -1
  68. package/dist/node_modules/@emotion/stylis/dist/stylis.browser.esm.js.map +1 -1
  69. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs.js +2 -0
  70. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs.js.map +1 -0
  71. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +2 -0
  72. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js.map +1 -0
  73. package/dist/node_modules/@fortawesome/react-fontawesome/index.es.js +1 -1
  74. package/dist/node_modules/@nethesis/nethesis-light-svg-icons/index.mjs.js +1 -1
  75. package/dist/node_modules/@nethesis/nethesis-light-svg-icons/index.mjs.js.map +1 -1
  76. package/dist/node_modules/@nethesis/nethesis-solid-svg-icons/index.mjs.js +1 -1
  77. package/dist/node_modules/@nethesis/nethesis-solid-svg-icons/index.mjs.js.map +1 -1
  78. package/dist/node_modules/@rematch/core/dist/core.esm.js +1 -1
  79. package/dist/node_modules/@rematch/core/dist/core.esm.js.map +1 -1
  80. package/dist/node_modules/bowser/es5.js +1 -1
  81. package/dist/node_modules/bowser/es5.js.map +1 -1
  82. package/dist/node_modules/classnames/index.js +7 -0
  83. package/dist/node_modules/classnames/index.js.map +1 -0
  84. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js +1 -1
  85. package/dist/node_modules/engine.io-client/build/esm/contrib/has-cors.js.map +1 -1
  86. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js +1 -1
  87. package/dist/node_modules/engine.io-client/build/esm/contrib/parseqs.js.map +1 -1
  88. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js +1 -1
  89. package/dist/node_modules/engine.io-client/build/esm/contrib/parseuri.js.map +1 -1
  90. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js +1 -1
  91. package/dist/node_modules/engine.io-client/build/esm/contrib/yeast.js.map +1 -1
  92. package/dist/node_modules/engine.io-client/build/esm/globalThis.browser.js +1 -1
  93. package/dist/node_modules/engine.io-client/build/esm/globalThis.browser.js.map +1 -1
  94. package/dist/node_modules/engine.io-client/build/esm/socket.js +1 -1
  95. package/dist/node_modules/engine.io-client/build/esm/socket.js.map +1 -1
  96. package/dist/node_modules/engine.io-client/build/esm/transport.js +1 -1
  97. package/dist/node_modules/engine.io-client/build/esm/transport.js.map +1 -1
  98. package/dist/node_modules/engine.io-client/build/esm/transports/index.js +1 -1
  99. package/dist/node_modules/engine.io-client/build/esm/transports/index.js.map +1 -1
  100. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js +1 -1
  101. package/dist/node_modules/engine.io-client/build/esm/transports/polling.js.map +1 -1
  102. package/dist/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js +1 -1
  103. package/dist/node_modules/engine.io-client/build/esm/transports/websocket-constructor.browser.js.map +1 -1
  104. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js +1 -1
  105. package/dist/node_modules/engine.io-client/build/esm/transports/websocket.js.map +1 -1
  106. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js +1 -1
  107. package/dist/node_modules/engine.io-client/build/esm/transports/xmlhttprequest.browser.js.map +1 -1
  108. package/dist/node_modules/engine.io-client/build/esm/util.js +1 -1
  109. package/dist/node_modules/engine.io-client/build/esm/util.js.map +1 -1
  110. package/dist/node_modules/engine.io-parser/build/esm/commons.js +1 -1
  111. package/dist/node_modules/engine.io-parser/build/esm/commons.js.map +1 -1
  112. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js +1 -1
  113. package/dist/node_modules/engine.io-parser/build/esm/contrib/base64-arraybuffer.js.map +1 -1
  114. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js +1 -1
  115. package/dist/node_modules/engine.io-parser/build/esm/decodePacket.browser.js.map +1 -1
  116. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js +1 -1
  117. package/dist/node_modules/engine.io-parser/build/esm/encodePacket.browser.js.map +1 -1
  118. package/dist/node_modules/engine.io-parser/build/esm/index.js +1 -1
  119. package/dist/node_modules/engine.io-parser/build/esm/index.js.map +1 -1
  120. package/dist/node_modules/framer-motion/dist/framer-motion.js +1 -1
  121. package/dist/node_modules/framer-motion/dist/framer-motion.js.map +1 -1
  122. package/dist/node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js +1 -1
  123. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js +9 -1
  124. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  125. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js +9 -1
  126. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  127. package/dist/node_modules/hoist-non-react-statics/node_modules/react-is/index.js +1 -1
  128. package/dist/node_modules/immer/dist/immer.esm.mjs.js +1 -1
  129. package/dist/node_modules/immer/dist/immer.esm.mjs.js.map +1 -1
  130. package/dist/node_modules/js-base64/base64.mjs.js +1 -1
  131. package/dist/node_modules/js-base64/base64.mjs.js.map +1 -1
  132. package/dist/node_modules/mic-check/lib/index.js +1 -1
  133. package/dist/node_modules/mic-check/lib/requestMediaPermissions.js +1 -1
  134. package/dist/node_modules/mic-check/lib/requestMediaPermissions.js.map +1 -1
  135. package/dist/node_modules/moment/moment.js +2 -2
  136. package/dist/node_modules/moment/moment.js.map +1 -1
  137. package/dist/node_modules/prop-types/checkPropTypes.js +1 -1
  138. package/dist/node_modules/prop-types/checkPropTypes.js.map +1 -1
  139. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +1 -1
  140. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js.map +1 -1
  141. package/dist/node_modules/prop-types/index.js +1 -1
  142. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js +9 -1
  143. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  144. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js +9 -1
  145. package/dist/node_modules/prop-types/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  146. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  147. package/dist/node_modules/react-is/cjs/react-is.development.js +9 -1
  148. package/dist/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  149. package/dist/node_modules/react-is/cjs/react-is.production.min.js +9 -1
  150. package/dist/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  151. package/dist/node_modules/react-is/index.js +1 -1
  152. package/dist/node_modules/react-is/index.js.map +1 -1
  153. package/dist/node_modules/react-moment/dist/index.js +2 -2
  154. package/dist/node_modules/react-moment/dist/index.js.map +1 -1
  155. package/dist/node_modules/react-redux/es/components/Context.js +1 -1
  156. package/dist/node_modules/react-redux/es/components/Context.js.map +1 -1
  157. package/dist/node_modules/react-redux/es/components/Provider.js +1 -1
  158. package/dist/node_modules/react-redux/es/components/Provider.js.map +1 -1
  159. package/dist/node_modules/react-redux/es/hooks/useDispatch.js +1 -1
  160. package/dist/node_modules/react-redux/es/hooks/useDispatch.js.map +1 -1
  161. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js +1 -1
  162. package/dist/node_modules/react-redux/es/hooks/useReduxContext.js.map +1 -1
  163. package/dist/node_modules/react-redux/es/hooks/useSelector.js +1 -1
  164. package/dist/node_modules/react-redux/es/hooks/useSelector.js.map +1 -1
  165. package/dist/node_modules/react-redux/es/hooks/useStore.js +1 -1
  166. package/dist/node_modules/react-redux/es/hooks/useStore.js.map +1 -1
  167. package/dist/node_modules/react-redux/es/utils/Subscription.js +1 -1
  168. package/dist/node_modules/react-redux/es/utils/Subscription.js.map +1 -1
  169. package/dist/node_modules/react-redux/es/utils/batch.js +1 -1
  170. package/dist/node_modules/react-redux/es/utils/batch.js.map +1 -1
  171. package/dist/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js +1 -1
  172. package/dist/node_modules/react-redux/es/utils/useIsomorphicLayoutEffect.js.map +1 -1
  173. package/dist/node_modules/react-redux/es/utils/useSyncExternalStore.js +1 -1
  174. package/dist/node_modules/react-redux/es/utils/useSyncExternalStore.js.map +1 -1
  175. package/dist/node_modules/react-redux/node_modules/react-is/cjs/react-is.development.js +10 -1
  176. package/dist/node_modules/react-redux/node_modules/react-is/cjs/react-is.development.js.map +1 -1
  177. package/dist/node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js +10 -1
  178. package/dist/node_modules/react-redux/node_modules/react-is/cjs/react-is.production.min.js.map +1 -1
  179. package/dist/node_modules/react-redux/node_modules/react-is/index.js +1 -1
  180. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.cjs.js +2 -0
  181. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.cjs.js.map +1 -0
  182. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js +2 -0
  183. package/dist/node_modules/react-tooltip/dist/react-tooltip.min.css.js.map +1 -0
  184. package/dist/node_modules/redux/es/redux.js +1 -1
  185. package/dist/node_modules/redux/es/redux.js.map +1 -1
  186. package/dist/node_modules/sdp/sdp.js +1 -1
  187. package/dist/node_modules/sdp/sdp.js.map +1 -1
  188. package/dist/node_modules/socket.io-client/build/esm/index.js +1 -1
  189. package/dist/node_modules/socket.io-client/build/esm/index.js.map +1 -1
  190. package/dist/node_modules/socket.io-client/build/esm/manager.js +1 -1
  191. package/dist/node_modules/socket.io-client/build/esm/manager.js.map +1 -1
  192. package/dist/node_modules/socket.io-client/build/esm/socket.js +1 -1
  193. package/dist/node_modules/socket.io-client/build/esm/socket.js.map +1 -1
  194. package/dist/node_modules/socket.io-client/build/esm/url.js +1 -1
  195. package/dist/node_modules/socket.io-client/build/esm/url.js.map +1 -1
  196. package/dist/node_modules/socket.io-parser/build/esm/binary.js +1 -1
  197. package/dist/node_modules/socket.io-parser/build/esm/binary.js.map +1 -1
  198. package/dist/node_modules/socket.io-parser/build/esm/index.js +1 -1
  199. package/dist/node_modules/socket.io-parser/build/esm/index.js.map +1 -1
  200. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js +1 -1
  201. package/dist/node_modules/socket.io-parser/build/esm/is-binary.js.map +1 -1
  202. package/dist/node_modules/style-inject/dist/style-inject.es.js +2 -0
  203. package/dist/node_modules/style-inject/dist/style-inject.es.js.map +1 -0
  204. package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js +1 -1
  205. package/dist/node_modules/styled-components/dist/styled-components.browser.esm.js.map +1 -1
  206. package/dist/node_modules/tslib/tslib.es6.js +1 -1
  207. package/dist/node_modules/tslib/tslib.es6.js.map +1 -1
  208. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +1 -1
  209. package/dist/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js +1 -1
  210. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  211. package/dist/node_modules/webrtc-adapter/src/js/adapter_core.js +1 -1
  212. package/dist/node_modules/webrtc-adapter/src/js/adapter_core.js.map +1 -1
  213. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js +1 -1
  214. package/dist/node_modules/webrtc-adapter/src/js/adapter_factory.js.map +1 -1
  215. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js +1 -1
  216. package/dist/node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js.map +1 -1
  217. package/dist/node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js +1 -1
  218. package/dist/node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js.map +1 -1
  219. package/dist/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js +1 -1
  220. package/dist/node_modules/webrtc-adapter/src/js/chrome/getusermedia.js.map +1 -1
  221. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js +1 -1
  222. package/dist/node_modules/webrtc-adapter/src/js/common_shim.js.map +1 -1
  223. package/dist/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js +1 -1
  224. package/dist/node_modules/webrtc-adapter/src/js/firefox/firefox_shim.js.map +1 -1
  225. package/dist/node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js +1 -1
  226. package/dist/node_modules/webrtc-adapter/src/js/firefox/getdisplaymedia.js.map +1 -1
  227. package/dist/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js +1 -1
  228. package/dist/node_modules/webrtc-adapter/src/js/firefox/getusermedia.js.map +1 -1
  229. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js +1 -1
  230. package/dist/node_modules/webrtc-adapter/src/js/safari/safari_shim.js.map +1 -1
  231. package/dist/node_modules/webrtc-adapter/src/js/utils.js +1 -1
  232. package/dist/node_modules/webrtc-adapter/src/js/utils.js.map +1 -1
  233. package/dist/services/astproxy.js +1 -1
  234. package/dist/services/astproxy.js.map +1 -1
  235. package/dist/styles/Island.styles.js +1 -1
  236. package/dist/styles/Island.styles.js.map +1 -1
  237. package/package.json +3 -2
  238. package/dist/node_modules/engine.io-client/build/esm/index.js +0 -2
  239. package/dist/node_modules/engine.io-client/build/esm/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"chrome_shim.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js"],"sourcesContent":["/*\n * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n /* eslint-env node */\n'use strict';\nimport * as utils from '../utils.js';\n\nexport {shimGetUserMedia} from './getusermedia';\nexport {shimGetDisplayMedia} from './getdisplaymedia';\n\nexport function shimMediaStream(window) {\n window.MediaStream = window.MediaStream || window.webkitMediaStream;\n}\n\nexport function shimOnTrack(window) {\n if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n window.RTCPeerConnection.prototype)) {\n Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n get() {\n return this._ontrack;\n },\n set(f) {\n if (this._ontrack) {\n this.removeEventListener('track', this._ontrack);\n }\n this.addEventListener('track', this._ontrack = f);\n },\n enumerable: true,\n configurable: true\n });\n const origSetRemoteDescription =\n window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription() {\n if (!this._ontrackpoly) {\n this._ontrackpoly = (e) => {\n // onaddstream does not fire when a track is added to an existing\n // stream. But stream.onaddtrack is implemented so we use that.\n e.stream.addEventListener('addtrack', te => {\n let receiver;\n if (window.RTCPeerConnection.prototype.getReceivers) {\n receiver = this.getReceivers()\n .find(r => r.track && r.track.id === te.track.id);\n } else {\n receiver = {track: te.track};\n }\n\n const event = new Event('track');\n event.track = te.track;\n event.receiver = receiver;\n event.transceiver = {receiver};\n event.streams = [e.stream];\n this.dispatchEvent(event);\n });\n e.stream.getTracks().forEach(track => {\n let receiver;\n if (window.RTCPeerConnection.prototype.getReceivers) {\n receiver = this.getReceivers()\n .find(r => r.track && r.track.id === track.id);\n } else {\n receiver = {track};\n }\n const event = new Event('track');\n event.track = track;\n event.receiver = receiver;\n event.transceiver = {receiver};\n event.streams = [e.stream];\n this.dispatchEvent(event);\n });\n };\n this.addEventListener('addstream', this._ontrackpoly);\n }\n return origSetRemoteDescription.apply(this, arguments);\n };\n } else {\n // even if RTCRtpTransceiver is in window, it is only used and\n // emitted in unified-plan. Unfortunately this means we need\n // to unconditionally wrap the event.\n utils.wrapPeerConnectionEvent(window, 'track', e => {\n if (!e.transceiver) {\n Object.defineProperty(e, 'transceiver',\n {value: {receiver: e.receiver}});\n }\n return e;\n });\n }\n}\n\nexport function shimGetSendersWithDtmf(window) {\n // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.\n if (typeof window === 'object' && window.RTCPeerConnection &&\n !('getSenders' in window.RTCPeerConnection.prototype) &&\n 'createDTMFSender' in window.RTCPeerConnection.prototype) {\n const shimSenderWithDtmf = function(pc, track) {\n return {\n track,\n get dtmf() {\n if (this._dtmf === undefined) {\n if (track.kind === 'audio') {\n this._dtmf = pc.createDTMFSender(track);\n } else {\n this._dtmf = null;\n }\n }\n return this._dtmf;\n },\n _pc: pc\n };\n };\n\n // augment addTrack when getSenders is not available.\n if (!window.RTCPeerConnection.prototype.getSenders) {\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n this._senders = this._senders || [];\n return this._senders.slice(); // return a copy of the internal state.\n };\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n let sender = origAddTrack.apply(this, arguments);\n if (!sender) {\n sender = shimSenderWithDtmf(this, track);\n this._senders.push(sender);\n }\n return sender;\n };\n\n const origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n origRemoveTrack.apply(this, arguments);\n const idx = this._senders.indexOf(sender);\n if (idx !== -1) {\n this._senders.splice(idx, 1);\n }\n };\n }\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._senders = this._senders || [];\n origAddStream.apply(this, [stream]);\n stream.getTracks().forEach(track => {\n this._senders.push(shimSenderWithDtmf(this, track));\n });\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._senders = this._senders || [];\n origRemoveStream.apply(this, [stream]);\n\n stream.getTracks().forEach(track => {\n const sender = this._senders.find(s => s.track === track);\n if (sender) { // remove sender\n this._senders.splice(this._senders.indexOf(sender), 1);\n }\n });\n };\n } else if (typeof window === 'object' && window.RTCPeerConnection &&\n 'getSenders' in window.RTCPeerConnection.prototype &&\n 'createDTMFSender' in window.RTCPeerConnection.prototype &&\n window.RTCRtpSender &&\n !('dtmf' in window.RTCRtpSender.prototype)) {\n const origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n const senders = origGetSenders.apply(this, []);\n senders.forEach(sender => sender._pc = this);\n return senders;\n };\n\n Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', {\n get() {\n if (this._dtmf === undefined) {\n if (this.track.kind === 'audio') {\n this._dtmf = this._pc.createDTMFSender(this.track);\n } else {\n this._dtmf = null;\n }\n }\n return this._dtmf;\n }\n });\n }\n}\n\nexport function shimGetStats(window) {\n if (!window.RTCPeerConnection) {\n return;\n }\n\n const origGetStats = window.RTCPeerConnection.prototype.getStats;\n window.RTCPeerConnection.prototype.getStats = function getStats() {\n const [selector, onSucc, onErr] = arguments;\n\n // If selector is a function then we are in the old style stats so just\n // pass back the original getStats format to avoid breaking old users.\n if (arguments.length > 0 && typeof selector === 'function') {\n return origGetStats.apply(this, arguments);\n }\n\n // When spec-style getStats is supported, return those when called with\n // either no arguments or the selector argument is null.\n if (origGetStats.length === 0 && (arguments.length === 0 ||\n typeof selector !== 'function')) {\n return origGetStats.apply(this, []);\n }\n\n const fixChromeStats_ = function(response) {\n const standardReport = {};\n const reports = response.result();\n reports.forEach(report => {\n const standardStats = {\n id: report.id,\n timestamp: report.timestamp,\n type: {\n localcandidate: 'local-candidate',\n remotecandidate: 'remote-candidate'\n }[report.type] || report.type\n };\n report.names().forEach(name => {\n standardStats[name] = report.stat(name);\n });\n standardReport[standardStats.id] = standardStats;\n });\n\n return standardReport;\n };\n\n // shim getStats with maplike support\n const makeMapStats = function(stats) {\n return new Map(Object.keys(stats).map(key => [key, stats[key]]));\n };\n\n if (arguments.length >= 2) {\n const successCallbackWrapper_ = function(response) {\n onSucc(makeMapStats(fixChromeStats_(response)));\n };\n\n return origGetStats.apply(this, [successCallbackWrapper_,\n selector]);\n }\n\n // promise-support\n return new Promise((resolve, reject) => {\n origGetStats.apply(this, [\n function(response) {\n resolve(makeMapStats(fixChromeStats_(response)));\n }, reject]);\n }).then(onSucc, onErr);\n };\n}\n\nexport function shimSenderReceiverGetStats(window) {\n if (!(typeof window === 'object' && window.RTCPeerConnection &&\n window.RTCRtpSender && window.RTCRtpReceiver)) {\n return;\n }\n\n // shim sender stats.\n if (!('getStats' in window.RTCRtpSender.prototype)) {\n const origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n if (origGetSenders) {\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n const senders = origGetSenders.apply(this, []);\n senders.forEach(sender => sender._pc = this);\n return senders;\n };\n }\n\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n if (origAddTrack) {\n window.RTCPeerConnection.prototype.addTrack = function addTrack() {\n const sender = origAddTrack.apply(this, arguments);\n sender._pc = this;\n return sender;\n };\n }\n window.RTCRtpSender.prototype.getStats = function getStats() {\n const sender = this;\n return this._pc.getStats().then(result =>\n /* Note: this will include stats of all senders that\n * send a track with the same id as sender.track as\n * it is not possible to identify the RTCRtpSender.\n */\n utils.filterStats(result, sender.track, true));\n };\n }\n\n // shim receiver stats.\n if (!('getStats' in window.RTCRtpReceiver.prototype)) {\n const origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;\n if (origGetReceivers) {\n window.RTCPeerConnection.prototype.getReceivers =\n function getReceivers() {\n const receivers = origGetReceivers.apply(this, []);\n receivers.forEach(receiver => receiver._pc = this);\n return receivers;\n };\n }\n utils.wrapPeerConnectionEvent(window, 'track', e => {\n e.receiver._pc = e.srcElement;\n return e;\n });\n window.RTCRtpReceiver.prototype.getStats = function getStats() {\n const receiver = this;\n return this._pc.getStats().then(result =>\n utils.filterStats(result, receiver.track, false));\n };\n }\n\n if (!('getStats' in window.RTCRtpSender.prototype &&\n 'getStats' in window.RTCRtpReceiver.prototype)) {\n return;\n }\n\n // shim RTCPeerConnection.getStats(track).\n const origGetStats = window.RTCPeerConnection.prototype.getStats;\n window.RTCPeerConnection.prototype.getStats = function getStats() {\n if (arguments.length > 0 &&\n arguments[0] instanceof window.MediaStreamTrack) {\n const track = arguments[0];\n let sender;\n let receiver;\n let err;\n this.getSenders().forEach(s => {\n if (s.track === track) {\n if (sender) {\n err = true;\n } else {\n sender = s;\n }\n }\n });\n this.getReceivers().forEach(r => {\n if (r.track === track) {\n if (receiver) {\n err = true;\n } else {\n receiver = r;\n }\n }\n return r.track === track;\n });\n if (err || (sender && receiver)) {\n return Promise.reject(new DOMException(\n 'There are more than one sender or receiver for the track.',\n 'InvalidAccessError'));\n } else if (sender) {\n return sender.getStats();\n } else if (receiver) {\n return receiver.getStats();\n }\n return Promise.reject(new DOMException(\n 'There is no sender or receiver for the track.',\n 'InvalidAccessError'));\n }\n return origGetStats.apply(this, arguments);\n };\n}\n\nexport function shimAddTrackRemoveTrackWithNative(window) {\n // shim addTrack/removeTrack with native variants in order to make\n // the interactions with legacy getLocalStreams behave as in other browsers.\n // Keeps a mapping stream.id => [stream, rtpsenders...]\n window.RTCPeerConnection.prototype.getLocalStreams =\n function getLocalStreams() {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n return Object.keys(this._shimmedLocalStreams)\n .map(streamId => this._shimmedLocalStreams[streamId][0]);\n };\n\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n if (!stream) {\n return origAddTrack.apply(this, arguments);\n }\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n\n const sender = origAddTrack.apply(this, arguments);\n if (!this._shimmedLocalStreams[stream.id]) {\n this._shimmedLocalStreams[stream.id] = [stream, sender];\n } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) {\n this._shimmedLocalStreams[stream.id].push(sender);\n }\n return sender;\n };\n\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n\n stream.getTracks().forEach(track => {\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n });\n const existingSenders = this.getSenders();\n origAddStream.apply(this, arguments);\n const newSenders = this.getSenders()\n .filter(newSender => existingSenders.indexOf(newSender) === -1);\n this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders);\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n delete this._shimmedLocalStreams[stream.id];\n return origRemoveStream.apply(this, arguments);\n };\n\n const origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n if (sender) {\n Object.keys(this._shimmedLocalStreams).forEach(streamId => {\n const idx = this._shimmedLocalStreams[streamId].indexOf(sender);\n if (idx !== -1) {\n this._shimmedLocalStreams[streamId].splice(idx, 1);\n }\n if (this._shimmedLocalStreams[streamId].length === 1) {\n delete this._shimmedLocalStreams[streamId];\n }\n });\n }\n return origRemoveTrack.apply(this, arguments);\n };\n}\n\nexport function shimAddTrackRemoveTrack(window, browserDetails) {\n if (!window.RTCPeerConnection) {\n return;\n }\n // shim addTrack and removeTrack.\n if (window.RTCPeerConnection.prototype.addTrack &&\n browserDetails.version >= 65) {\n return shimAddTrackRemoveTrackWithNative(window);\n }\n\n // also shim pc.getLocalStreams when addTrack is shimmed\n // to return the original streams.\n const origGetLocalStreams = window.RTCPeerConnection.prototype\n .getLocalStreams;\n window.RTCPeerConnection.prototype.getLocalStreams =\n function getLocalStreams() {\n const nativeStreams = origGetLocalStreams.apply(this);\n this._reverseStreams = this._reverseStreams || {};\n return nativeStreams.map(stream => this._reverseStreams[stream.id]);\n };\n\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n\n stream.getTracks().forEach(track => {\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n });\n // Add identity mapping for consistency with addTrack.\n // Unless this is being used with a stream from addTrack.\n if (!this._reverseStreams[stream.id]) {\n const newStream = new window.MediaStream(stream.getTracks());\n this._streams[stream.id] = newStream;\n this._reverseStreams[newStream.id] = stream;\n stream = newStream;\n }\n origAddStream.apply(this, [stream]);\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n\n origRemoveStream.apply(this, [(this._streams[stream.id] || stream)]);\n delete this._reverseStreams[(this._streams[stream.id] ?\n this._streams[stream.id].id : stream.id)];\n delete this._streams[stream.id];\n };\n\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n if (this.signalingState === 'closed') {\n throw new DOMException(\n 'The RTCPeerConnection\\'s signalingState is \\'closed\\'.',\n 'InvalidStateError');\n }\n const streams = [].slice.call(arguments, 1);\n if (streams.length !== 1 ||\n !streams[0].getTracks().find(t => t === track)) {\n // this is not fully correct but all we can manage without\n // [[associated MediaStreams]] internal slot.\n throw new DOMException(\n 'The adapter.js addTrack polyfill only supports a single ' +\n ' stream which is associated with the specified track.',\n 'NotSupportedError');\n }\n\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n const oldStream = this._streams[stream.id];\n if (oldStream) {\n // this is using odd Chrome behaviour, use with caution:\n // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815\n // Note: we rely on the high-level addTrack/dtmf shim to\n // create the sender with a dtmf sender.\n oldStream.addTrack(track);\n\n // Trigger ONN async.\n Promise.resolve().then(() => {\n this.dispatchEvent(new Event('negotiationneeded'));\n });\n } else {\n const newStream = new window.MediaStream([track]);\n this._streams[stream.id] = newStream;\n this._reverseStreams[newStream.id] = stream;\n this.addStream(newStream);\n }\n return this.getSenders().find(s => s.track === track);\n };\n\n // replace the internal stream id with the external one and\n // vice versa.\n function replaceInternalStreamId(pc, description) {\n let sdp = description.sdp;\n Object.keys(pc._reverseStreams || []).forEach(internalId => {\n const externalStream = pc._reverseStreams[internalId];\n const internalStream = pc._streams[externalStream.id];\n sdp = sdp.replace(new RegExp(internalStream.id, 'g'),\n externalStream.id);\n });\n return new RTCSessionDescription({\n type: description.type,\n sdp\n });\n }\n function replaceExternalStreamId(pc, description) {\n let sdp = description.sdp;\n Object.keys(pc._reverseStreams || []).forEach(internalId => {\n const externalStream = pc._reverseStreams[internalId];\n const internalStream = pc._streams[externalStream.id];\n sdp = sdp.replace(new RegExp(externalStream.id, 'g'),\n internalStream.id);\n });\n return new RTCSessionDescription({\n type: description.type,\n sdp\n });\n }\n ['createOffer', 'createAnswer'].forEach(function(method) {\n const nativeMethod = window.RTCPeerConnection.prototype[method];\n const methodObj = {[method]() {\n const args = arguments;\n const isLegacyCall = arguments.length &&\n typeof arguments[0] === 'function';\n if (isLegacyCall) {\n return nativeMethod.apply(this, [\n (description) => {\n const desc = replaceInternalStreamId(this, description);\n args[0].apply(null, [desc]);\n },\n (err) => {\n if (args[1]) {\n args[1].apply(null, err);\n }\n }, arguments[2]\n ]);\n }\n return nativeMethod.apply(this, arguments)\n .then(description => replaceInternalStreamId(this, description));\n }};\n window.RTCPeerConnection.prototype[method] = methodObj[method];\n });\n\n const origSetLocalDescription =\n window.RTCPeerConnection.prototype.setLocalDescription;\n window.RTCPeerConnection.prototype.setLocalDescription =\n function setLocalDescription() {\n if (!arguments.length || !arguments[0].type) {\n return origSetLocalDescription.apply(this, arguments);\n }\n arguments[0] = replaceExternalStreamId(this, arguments[0]);\n return origSetLocalDescription.apply(this, arguments);\n };\n\n // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier\n\n const origLocalDescription = Object.getOwnPropertyDescriptor(\n window.RTCPeerConnection.prototype, 'localDescription');\n Object.defineProperty(window.RTCPeerConnection.prototype,\n 'localDescription', {\n get() {\n const description = origLocalDescription.get.apply(this);\n if (description.type === '') {\n return description;\n }\n return replaceInternalStreamId(this, description);\n }\n });\n\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n if (this.signalingState === 'closed') {\n throw new DOMException(\n 'The RTCPeerConnection\\'s signalingState is \\'closed\\'.',\n 'InvalidStateError');\n }\n // We can not yet check for sender instanceof RTCRtpSender\n // since we shim RTPSender. So we check if sender._pc is set.\n if (!sender._pc) {\n throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' +\n 'does not implement interface RTCRtpSender.', 'TypeError');\n }\n const isLocal = sender._pc === this;\n if (!isLocal) {\n throw new DOMException('Sender was not created by this connection.',\n 'InvalidAccessError');\n }\n\n // Search for the native stream the senders track belongs to.\n this._streams = this._streams || {};\n let stream;\n Object.keys(this._streams).forEach(streamid => {\n const hasTrack = this._streams[streamid].getTracks()\n .find(track => sender.track === track);\n if (hasTrack) {\n stream = this._streams[streamid];\n }\n });\n\n if (stream) {\n if (stream.getTracks().length === 1) {\n // if this is the last track of the stream, remove the stream. This\n // takes care of any shimmed _senders.\n this.removeStream(this._reverseStreams[stream.id]);\n } else {\n // relying on the same odd chrome behaviour as above.\n stream.removeTrack(sender.track);\n }\n this.dispatchEvent(new Event('negotiationneeded'));\n }\n };\n}\n\nexport function shimPeerConnection(window, browserDetails) {\n if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) {\n // very basic support for old versions.\n window.RTCPeerConnection = window.webkitRTCPeerConnection;\n }\n if (!window.RTCPeerConnection) {\n return;\n }\n\n // shim implicit creation of RTCSessionDescription/RTCIceCandidate\n if (browserDetails.version < 53) {\n ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n .forEach(function(method) {\n const nativeMethod = window.RTCPeerConnection.prototype[method];\n const methodObj = {[method]() {\n arguments[0] = new ((method === 'addIceCandidate') ?\n window.RTCIceCandidate :\n window.RTCSessionDescription)(arguments[0]);\n return nativeMethod.apply(this, arguments);\n }};\n window.RTCPeerConnection.prototype[method] = methodObj[method];\n });\n }\n}\n\n// Attempt to fix ONN in plan-b mode.\nexport function fixNegotiationNeeded(window, browserDetails) {\n utils.wrapPeerConnectionEvent(window, 'negotiationneeded', e => {\n const pc = e.target;\n if (browserDetails.version < 72 || (pc.getConfiguration &&\n pc.getConfiguration().sdpSemantics === 'plan-b')) {\n if (pc.signalingState !== 'stable') {\n return;\n }\n }\n return e;\n });\n}\n"],"names":["shimAddTrackRemoveTrackWithNative","window","RTCPeerConnection","prototype","getLocalStreams","_this8","this","_shimmedLocalStreams","Object","keys","map","streamId","origAddTrack","addTrack","track","stream","apply","arguments","sender","id","indexOf","push","origAddStream","addStream","_this9","getTracks","forEach","getSenders","find","s","DOMException","existingSenders","newSenders","filter","newSender","concat","origRemoveStream","removeStream","origRemoveTrack","removeTrack","_this10","idx","splice","length","browserDetails","utils","e","pc","target","version","getConfiguration","sdpSemantics","signalingState","origGetLocalStreams","_this11","nativeStreams","_reverseStreams","_this12","_streams","newStream","MediaStream","_this13","streams","slice","call","t","alreadyExists","oldStream","Promise","resolve","then","dispatchEvent","Event","method","nativeMethod","methodObj","_this14","args","isLegacyCall","description","desc","replaceInternalStreamId","err","origSetLocalDescription","setLocalDescription","type","replaceExternalStreamId","origLocalDescription","getOwnPropertyDescriptor","defineProperty","get","_this15","_pc","streamid","sdp","internalId","externalStream","internalStream","replace","RegExp","RTCSessionDescription","_typeof","shimSenderWithDtmf","dtmf","undefined","_dtmf","kind","createDTMFSender","_senders","_this2","_this3","RTCRtpSender","origGetSenders","_this4","senders","origGetStats","getStats","_this5","_arguments","Array","selector","onSucc","onErr","fixChromeStats_","response","standardReport","result","report","standardStats","timestamp","localcandidate","remotecandidate","names","name","stat","makeMapStats","stats","Map","key","successCallbackWrapper_","reject","webkitMediaStream","_ontrack","set","f","removeEventListener","addEventListener","enumerable","configurable","origSetRemoteDescription","setRemoteDescription","_this","_ontrackpoly","te","receiver","getReceivers","r","event","transceiver","value","webkitRTCPeerConnection","RTCIceCandidate","RTCRtpReceiver","_this6","origGetReceivers","_this7","receivers","srcElement","filterStats","MediaStreamTrack"],"mappings":"oOA6WO,SAASA,EAAkCC,GAIhDA,EAAOC,kBAAkBC,UAAUC,gBACjC,WAA2B,IAAAC,EAAAC,KAEzB,OADAA,KAAKC,qBAAuBD,KAAKC,sBAAwB,CAAA,EAClDC,OAAOC,KAAKH,KAAKC,sBACrBG,KAAI,SAAAC,GAAQ,OAAIN,EAAKE,qBAAqBI,G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AAS,SAAA6C,GAE7C,OADAA,EAAE4G,SAAS9D,IAAM9C,EAAEyH,WACZzH,CACT,IACA7C,EAAOiK,eAAe/J,UAAUiH,SAAW,WACzC,IAAMsC,EAAWpJ,KACjB,OAAOA,KAAKsF,IAAIwB,WAAW9C,MAAK,SAAAwD,GAAM,OACpCjF,EAAiB2H,YAAC1C,EAAQ4B,EAAS5I,OAAO,MAEhD,CAEA,GAAM,aAAcb,EAAO8G,aAAa5G,WACpC,aAAcF,EAAOiK,eAAe/J,UADxC,CAMA,IAAMgH,EAAelH,EAAOC,kBAAkBC,UAAUiH,SACxDnH,EAAOC,kBAAkBC,UAAUiH,SAAW,WAC5C,GAAInG,UAAU0B,OAAS,GACnB1B,UAAU,aAAchB,EAAOwK,iBAAkB,CACnD,IACIvJ,EACAwI,EACAxE,EAHEpE,EAAQG,UAAU,GAuBxB,OAnBAX,KAAKqB,aAAaD,SAAQ,SAAAG,GACpBA,EAAEf,QAAUA,IACVI,EACFgE,GAAM,EAENhE,EAASW,EAGf,IACAvB,KAAKqJ,eAAejI,SAAQ,SAAAkI,GAQ1B,OAPIA,EAAE9I,QAAUA,IACV4I,EACFxE,GAAM,EAENwE,EAAWE,GAGRA,EAAE9I,QAAUA,CACrB,IACIoE,GAAQhE,GAAUwI,EACbtF,QAAQwE,OAAO,IAAI9G,aACxB,4DACA,uBACOZ,EACFA,EAAOkG,WACLsC,EACFA,EAAStC,WAEXhD,QAAQwE,OAAO,IAAI9G,aACxB,gDACA,sBACJ,CACA,OAAOqF,EAAanG,MAAMV,KAAMW,WA3ClC,CAzDA,CAsGF"}
1
+ {"version":3,"file":"chrome_shim.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/chrome_shim.js"],"sourcesContent":["/*\n * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n /* eslint-env node */\n'use strict';\nimport * as utils from '../utils.js';\n\nexport {shimGetUserMedia} from './getusermedia';\nexport {shimGetDisplayMedia} from './getdisplaymedia';\n\nexport function shimMediaStream(window) {\n window.MediaStream = window.MediaStream || window.webkitMediaStream;\n}\n\nexport function shimOnTrack(window) {\n if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n window.RTCPeerConnection.prototype)) {\n Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n get() {\n return this._ontrack;\n },\n set(f) {\n if (this._ontrack) {\n this.removeEventListener('track', this._ontrack);\n }\n this.addEventListener('track', this._ontrack = f);\n },\n enumerable: true,\n configurable: true\n });\n const origSetRemoteDescription =\n window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription() {\n if (!this._ontrackpoly) {\n this._ontrackpoly = (e) => {\n // onaddstream does not fire when a track is added to an existing\n // stream. But stream.onaddtrack is implemented so we use that.\n e.stream.addEventListener('addtrack', te => {\n let receiver;\n if (window.RTCPeerConnection.prototype.getReceivers) {\n receiver = this.getReceivers()\n .find(r => r.track && r.track.id === te.track.id);\n } else {\n receiver = {track: te.track};\n }\n\n const event = new Event('track');\n event.track = te.track;\n event.receiver = receiver;\n event.transceiver = {receiver};\n event.streams = [e.stream];\n this.dispatchEvent(event);\n });\n e.stream.getTracks().forEach(track => {\n let receiver;\n if (window.RTCPeerConnection.prototype.getReceivers) {\n receiver = this.getReceivers()\n .find(r => r.track && r.track.id === track.id);\n } else {\n receiver = {track};\n }\n const event = new Event('track');\n event.track = track;\n event.receiver = receiver;\n event.transceiver = {receiver};\n event.streams = [e.stream];\n this.dispatchEvent(event);\n });\n };\n this.addEventListener('addstream', this._ontrackpoly);\n }\n return origSetRemoteDescription.apply(this, arguments);\n };\n } else {\n // even if RTCRtpTransceiver is in window, it is only used and\n // emitted in unified-plan. Unfortunately this means we need\n // to unconditionally wrap the event.\n utils.wrapPeerConnectionEvent(window, 'track', e => {\n if (!e.transceiver) {\n Object.defineProperty(e, 'transceiver',\n {value: {receiver: e.receiver}});\n }\n return e;\n });\n }\n}\n\nexport function shimGetSendersWithDtmf(window) {\n // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack.\n if (typeof window === 'object' && window.RTCPeerConnection &&\n !('getSenders' in window.RTCPeerConnection.prototype) &&\n 'createDTMFSender' in window.RTCPeerConnection.prototype) {\n const shimSenderWithDtmf = function(pc, track) {\n return {\n track,\n get dtmf() {\n if (this._dtmf === undefined) {\n if (track.kind === 'audio') {\n this._dtmf = pc.createDTMFSender(track);\n } else {\n this._dtmf = null;\n }\n }\n return this._dtmf;\n },\n _pc: pc\n };\n };\n\n // augment addTrack when getSenders is not available.\n if (!window.RTCPeerConnection.prototype.getSenders) {\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n this._senders = this._senders || [];\n return this._senders.slice(); // return a copy of the internal state.\n };\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n let sender = origAddTrack.apply(this, arguments);\n if (!sender) {\n sender = shimSenderWithDtmf(this, track);\n this._senders.push(sender);\n }\n return sender;\n };\n\n const origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n origRemoveTrack.apply(this, arguments);\n const idx = this._senders.indexOf(sender);\n if (idx !== -1) {\n this._senders.splice(idx, 1);\n }\n };\n }\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._senders = this._senders || [];\n origAddStream.apply(this, [stream]);\n stream.getTracks().forEach(track => {\n this._senders.push(shimSenderWithDtmf(this, track));\n });\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._senders = this._senders || [];\n origRemoveStream.apply(this, [stream]);\n\n stream.getTracks().forEach(track => {\n const sender = this._senders.find(s => s.track === track);\n if (sender) { // remove sender\n this._senders.splice(this._senders.indexOf(sender), 1);\n }\n });\n };\n } else if (typeof window === 'object' && window.RTCPeerConnection &&\n 'getSenders' in window.RTCPeerConnection.prototype &&\n 'createDTMFSender' in window.RTCPeerConnection.prototype &&\n window.RTCRtpSender &&\n !('dtmf' in window.RTCRtpSender.prototype)) {\n const origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n const senders = origGetSenders.apply(this, []);\n senders.forEach(sender => sender._pc = this);\n return senders;\n };\n\n Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', {\n get() {\n if (this._dtmf === undefined) {\n if (this.track.kind === 'audio') {\n this._dtmf = this._pc.createDTMFSender(this.track);\n } else {\n this._dtmf = null;\n }\n }\n return this._dtmf;\n }\n });\n }\n}\n\nexport function shimGetStats(window) {\n if (!window.RTCPeerConnection) {\n return;\n }\n\n const origGetStats = window.RTCPeerConnection.prototype.getStats;\n window.RTCPeerConnection.prototype.getStats = function getStats() {\n const [selector, onSucc, onErr] = arguments;\n\n // If selector is a function then we are in the old style stats so just\n // pass back the original getStats format to avoid breaking old users.\n if (arguments.length > 0 && typeof selector === 'function') {\n return origGetStats.apply(this, arguments);\n }\n\n // When spec-style getStats is supported, return those when called with\n // either no arguments or the selector argument is null.\n if (origGetStats.length === 0 && (arguments.length === 0 ||\n typeof selector !== 'function')) {\n return origGetStats.apply(this, []);\n }\n\n const fixChromeStats_ = function(response) {\n const standardReport = {};\n const reports = response.result();\n reports.forEach(report => {\n const standardStats = {\n id: report.id,\n timestamp: report.timestamp,\n type: {\n localcandidate: 'local-candidate',\n remotecandidate: 'remote-candidate'\n }[report.type] || report.type\n };\n report.names().forEach(name => {\n standardStats[name] = report.stat(name);\n });\n standardReport[standardStats.id] = standardStats;\n });\n\n return standardReport;\n };\n\n // shim getStats with maplike support\n const makeMapStats = function(stats) {\n return new Map(Object.keys(stats).map(key => [key, stats[key]]));\n };\n\n if (arguments.length >= 2) {\n const successCallbackWrapper_ = function(response) {\n onSucc(makeMapStats(fixChromeStats_(response)));\n };\n\n return origGetStats.apply(this, [successCallbackWrapper_,\n selector]);\n }\n\n // promise-support\n return new Promise((resolve, reject) => {\n origGetStats.apply(this, [\n function(response) {\n resolve(makeMapStats(fixChromeStats_(response)));\n }, reject]);\n }).then(onSucc, onErr);\n };\n}\n\nexport function shimSenderReceiverGetStats(window) {\n if (!(typeof window === 'object' && window.RTCPeerConnection &&\n window.RTCRtpSender && window.RTCRtpReceiver)) {\n return;\n }\n\n // shim sender stats.\n if (!('getStats' in window.RTCRtpSender.prototype)) {\n const origGetSenders = window.RTCPeerConnection.prototype.getSenders;\n if (origGetSenders) {\n window.RTCPeerConnection.prototype.getSenders = function getSenders() {\n const senders = origGetSenders.apply(this, []);\n senders.forEach(sender => sender._pc = this);\n return senders;\n };\n }\n\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n if (origAddTrack) {\n window.RTCPeerConnection.prototype.addTrack = function addTrack() {\n const sender = origAddTrack.apply(this, arguments);\n sender._pc = this;\n return sender;\n };\n }\n window.RTCRtpSender.prototype.getStats = function getStats() {\n const sender = this;\n return this._pc.getStats().then(result =>\n /* Note: this will include stats of all senders that\n * send a track with the same id as sender.track as\n * it is not possible to identify the RTCRtpSender.\n */\n utils.filterStats(result, sender.track, true));\n };\n }\n\n // shim receiver stats.\n if (!('getStats' in window.RTCRtpReceiver.prototype)) {\n const origGetReceivers = window.RTCPeerConnection.prototype.getReceivers;\n if (origGetReceivers) {\n window.RTCPeerConnection.prototype.getReceivers =\n function getReceivers() {\n const receivers = origGetReceivers.apply(this, []);\n receivers.forEach(receiver => receiver._pc = this);\n return receivers;\n };\n }\n utils.wrapPeerConnectionEvent(window, 'track', e => {\n e.receiver._pc = e.srcElement;\n return e;\n });\n window.RTCRtpReceiver.prototype.getStats = function getStats() {\n const receiver = this;\n return this._pc.getStats().then(result =>\n utils.filterStats(result, receiver.track, false));\n };\n }\n\n if (!('getStats' in window.RTCRtpSender.prototype &&\n 'getStats' in window.RTCRtpReceiver.prototype)) {\n return;\n }\n\n // shim RTCPeerConnection.getStats(track).\n const origGetStats = window.RTCPeerConnection.prototype.getStats;\n window.RTCPeerConnection.prototype.getStats = function getStats() {\n if (arguments.length > 0 &&\n arguments[0] instanceof window.MediaStreamTrack) {\n const track = arguments[0];\n let sender;\n let receiver;\n let err;\n this.getSenders().forEach(s => {\n if (s.track === track) {\n if (sender) {\n err = true;\n } else {\n sender = s;\n }\n }\n });\n this.getReceivers().forEach(r => {\n if (r.track === track) {\n if (receiver) {\n err = true;\n } else {\n receiver = r;\n }\n }\n return r.track === track;\n });\n if (err || (sender && receiver)) {\n return Promise.reject(new DOMException(\n 'There are more than one sender or receiver for the track.',\n 'InvalidAccessError'));\n } else if (sender) {\n return sender.getStats();\n } else if (receiver) {\n return receiver.getStats();\n }\n return Promise.reject(new DOMException(\n 'There is no sender or receiver for the track.',\n 'InvalidAccessError'));\n }\n return origGetStats.apply(this, arguments);\n };\n}\n\nexport function shimAddTrackRemoveTrackWithNative(window) {\n // shim addTrack/removeTrack with native variants in order to make\n // the interactions with legacy getLocalStreams behave as in other browsers.\n // Keeps a mapping stream.id => [stream, rtpsenders...]\n window.RTCPeerConnection.prototype.getLocalStreams =\n function getLocalStreams() {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n return Object.keys(this._shimmedLocalStreams)\n .map(streamId => this._shimmedLocalStreams[streamId][0]);\n };\n\n const origAddTrack = window.RTCPeerConnection.prototype.addTrack;\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n if (!stream) {\n return origAddTrack.apply(this, arguments);\n }\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n\n const sender = origAddTrack.apply(this, arguments);\n if (!this._shimmedLocalStreams[stream.id]) {\n this._shimmedLocalStreams[stream.id] = [stream, sender];\n } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) {\n this._shimmedLocalStreams[stream.id].push(sender);\n }\n return sender;\n };\n\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n\n stream.getTracks().forEach(track => {\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n });\n const existingSenders = this.getSenders();\n origAddStream.apply(this, arguments);\n const newSenders = this.getSenders()\n .filter(newSender => existingSenders.indexOf(newSender) === -1);\n this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders);\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n delete this._shimmedLocalStreams[stream.id];\n return origRemoveStream.apply(this, arguments);\n };\n\n const origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack;\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n this._shimmedLocalStreams = this._shimmedLocalStreams || {};\n if (sender) {\n Object.keys(this._shimmedLocalStreams).forEach(streamId => {\n const idx = this._shimmedLocalStreams[streamId].indexOf(sender);\n if (idx !== -1) {\n this._shimmedLocalStreams[streamId].splice(idx, 1);\n }\n if (this._shimmedLocalStreams[streamId].length === 1) {\n delete this._shimmedLocalStreams[streamId];\n }\n });\n }\n return origRemoveTrack.apply(this, arguments);\n };\n}\n\nexport function shimAddTrackRemoveTrack(window, browserDetails) {\n if (!window.RTCPeerConnection) {\n return;\n }\n // shim addTrack and removeTrack.\n if (window.RTCPeerConnection.prototype.addTrack &&\n browserDetails.version >= 65) {\n return shimAddTrackRemoveTrackWithNative(window);\n }\n\n // also shim pc.getLocalStreams when addTrack is shimmed\n // to return the original streams.\n const origGetLocalStreams = window.RTCPeerConnection.prototype\n .getLocalStreams;\n window.RTCPeerConnection.prototype.getLocalStreams =\n function getLocalStreams() {\n const nativeStreams = origGetLocalStreams.apply(this);\n this._reverseStreams = this._reverseStreams || {};\n return nativeStreams.map(stream => this._reverseStreams[stream.id]);\n };\n\n const origAddStream = window.RTCPeerConnection.prototype.addStream;\n window.RTCPeerConnection.prototype.addStream = function addStream(stream) {\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n\n stream.getTracks().forEach(track => {\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n });\n // Add identity mapping for consistency with addTrack.\n // Unless this is being used with a stream from addTrack.\n if (!this._reverseStreams[stream.id]) {\n const newStream = new window.MediaStream(stream.getTracks());\n this._streams[stream.id] = newStream;\n this._reverseStreams[newStream.id] = stream;\n stream = newStream;\n }\n origAddStream.apply(this, [stream]);\n };\n\n const origRemoveStream = window.RTCPeerConnection.prototype.removeStream;\n window.RTCPeerConnection.prototype.removeStream =\n function removeStream(stream) {\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n\n origRemoveStream.apply(this, [(this._streams[stream.id] || stream)]);\n delete this._reverseStreams[(this._streams[stream.id] ?\n this._streams[stream.id].id : stream.id)];\n delete this._streams[stream.id];\n };\n\n window.RTCPeerConnection.prototype.addTrack =\n function addTrack(track, stream) {\n if (this.signalingState === 'closed') {\n throw new DOMException(\n 'The RTCPeerConnection\\'s signalingState is \\'closed\\'.',\n 'InvalidStateError');\n }\n const streams = [].slice.call(arguments, 1);\n if (streams.length !== 1 ||\n !streams[0].getTracks().find(t => t === track)) {\n // this is not fully correct but all we can manage without\n // [[associated MediaStreams]] internal slot.\n throw new DOMException(\n 'The adapter.js addTrack polyfill only supports a single ' +\n ' stream which is associated with the specified track.',\n 'NotSupportedError');\n }\n\n const alreadyExists = this.getSenders().find(s => s.track === track);\n if (alreadyExists) {\n throw new DOMException('Track already exists.',\n 'InvalidAccessError');\n }\n\n this._streams = this._streams || {};\n this._reverseStreams = this._reverseStreams || {};\n const oldStream = this._streams[stream.id];\n if (oldStream) {\n // this is using odd Chrome behaviour, use with caution:\n // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815\n // Note: we rely on the high-level addTrack/dtmf shim to\n // create the sender with a dtmf sender.\n oldStream.addTrack(track);\n\n // Trigger ONN async.\n Promise.resolve().then(() => {\n this.dispatchEvent(new Event('negotiationneeded'));\n });\n } else {\n const newStream = new window.MediaStream([track]);\n this._streams[stream.id] = newStream;\n this._reverseStreams[newStream.id] = stream;\n this.addStream(newStream);\n }\n return this.getSenders().find(s => s.track === track);\n };\n\n // replace the internal stream id with the external one and\n // vice versa.\n function replaceInternalStreamId(pc, description) {\n let sdp = description.sdp;\n Object.keys(pc._reverseStreams || []).forEach(internalId => {\n const externalStream = pc._reverseStreams[internalId];\n const internalStream = pc._streams[externalStream.id];\n sdp = sdp.replace(new RegExp(internalStream.id, 'g'),\n externalStream.id);\n });\n return new RTCSessionDescription({\n type: description.type,\n sdp\n });\n }\n function replaceExternalStreamId(pc, description) {\n let sdp = description.sdp;\n Object.keys(pc._reverseStreams || []).forEach(internalId => {\n const externalStream = pc._reverseStreams[internalId];\n const internalStream = pc._streams[externalStream.id];\n sdp = sdp.replace(new RegExp(externalStream.id, 'g'),\n internalStream.id);\n });\n return new RTCSessionDescription({\n type: description.type,\n sdp\n });\n }\n ['createOffer', 'createAnswer'].forEach(function(method) {\n const nativeMethod = window.RTCPeerConnection.prototype[method];\n const methodObj = {[method]() {\n const args = arguments;\n const isLegacyCall = arguments.length &&\n typeof arguments[0] === 'function';\n if (isLegacyCall) {\n return nativeMethod.apply(this, [\n (description) => {\n const desc = replaceInternalStreamId(this, description);\n args[0].apply(null, [desc]);\n },\n (err) => {\n if (args[1]) {\n args[1].apply(null, err);\n }\n }, arguments[2]\n ]);\n }\n return nativeMethod.apply(this, arguments)\n .then(description => replaceInternalStreamId(this, description));\n }};\n window.RTCPeerConnection.prototype[method] = methodObj[method];\n });\n\n const origSetLocalDescription =\n window.RTCPeerConnection.prototype.setLocalDescription;\n window.RTCPeerConnection.prototype.setLocalDescription =\n function setLocalDescription() {\n if (!arguments.length || !arguments[0].type) {\n return origSetLocalDescription.apply(this, arguments);\n }\n arguments[0] = replaceExternalStreamId(this, arguments[0]);\n return origSetLocalDescription.apply(this, arguments);\n };\n\n // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier\n\n const origLocalDescription = Object.getOwnPropertyDescriptor(\n window.RTCPeerConnection.prototype, 'localDescription');\n Object.defineProperty(window.RTCPeerConnection.prototype,\n 'localDescription', {\n get() {\n const description = origLocalDescription.get.apply(this);\n if (description.type === '') {\n return description;\n }\n return replaceInternalStreamId(this, description);\n }\n });\n\n window.RTCPeerConnection.prototype.removeTrack =\n function removeTrack(sender) {\n if (this.signalingState === 'closed') {\n throw new DOMException(\n 'The RTCPeerConnection\\'s signalingState is \\'closed\\'.',\n 'InvalidStateError');\n }\n // We can not yet check for sender instanceof RTCRtpSender\n // since we shim RTPSender. So we check if sender._pc is set.\n if (!sender._pc) {\n throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' +\n 'does not implement interface RTCRtpSender.', 'TypeError');\n }\n const isLocal = sender._pc === this;\n if (!isLocal) {\n throw new DOMException('Sender was not created by this connection.',\n 'InvalidAccessError');\n }\n\n // Search for the native stream the senders track belongs to.\n this._streams = this._streams || {};\n let stream;\n Object.keys(this._streams).forEach(streamid => {\n const hasTrack = this._streams[streamid].getTracks()\n .find(track => sender.track === track);\n if (hasTrack) {\n stream = this._streams[streamid];\n }\n });\n\n if (stream) {\n if (stream.getTracks().length === 1) {\n // if this is the last track of the stream, remove the stream. This\n // takes care of any shimmed _senders.\n this.removeStream(this._reverseStreams[stream.id]);\n } else {\n // relying on the same odd chrome behaviour as above.\n stream.removeTrack(sender.track);\n }\n this.dispatchEvent(new Event('negotiationneeded'));\n }\n };\n}\n\nexport function shimPeerConnection(window, browserDetails) {\n if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) {\n // very basic support for old versions.\n window.RTCPeerConnection = window.webkitRTCPeerConnection;\n }\n if (!window.RTCPeerConnection) {\n return;\n }\n\n // shim implicit creation of RTCSessionDescription/RTCIceCandidate\n if (browserDetails.version < 53) {\n ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n .forEach(function(method) {\n const nativeMethod = window.RTCPeerConnection.prototype[method];\n const methodObj = {[method]() {\n arguments[0] = new ((method === 'addIceCandidate') ?\n window.RTCIceCandidate :\n window.RTCSessionDescription)(arguments[0]);\n return nativeMethod.apply(this, arguments);\n }};\n window.RTCPeerConnection.prototype[method] = methodObj[method];\n });\n }\n}\n\n// Attempt to fix ONN in plan-b mode.\nexport function fixNegotiationNeeded(window, browserDetails) {\n utils.wrapPeerConnectionEvent(window, 'negotiationneeded', e => {\n const pc = e.target;\n if (browserDetails.version < 72 || (pc.getConfiguration &&\n pc.getConfiguration().sdpSemantics === 'plan-b')) {\n if (pc.signalingState !== 'stable') {\n return;\n }\n }\n return e;\n });\n}\n"],"names":["shimAddTrackRemoveTrackWithNative","window","RTCPeerConnection","prototype","getLocalStreams","this","_shimmedLocalStreams","Object","keys","map","streamId","origAddTrack","addTrack","track","stream","apply","arguments","sender","id","indexOf","push","origAddStream","addStream","getTracks","forEach","getSenders","find","s","DOMException","existingSenders","newSenders","filter","newSender","concat","origRemoveStream","removeStream","origRemoveTrack","removeTrack","idx","splice","length","browserDetails","utils","e","pc","target","version","getConfiguration","sdpSemantics","signalingState","origGetLocalStreams","nativeStreams","_reverseStreams","_streams","newStream","MediaStream","replaceInternalStreamId","description","sdp","internalId","externalStream","internalStream","replace","RegExp","RTCSessionDescription","type","replaceExternalStreamId","streams","slice","call","t","alreadyExists","oldStream","Promise","resolve","then","dispatchEvent","Event","method","nativeMethod","methodObj","args","desc","err","origSetLocalDescription","setLocalDescription","origLocalDescription","getOwnPropertyDescriptor","defineProperty","get","_pc","streamid","shimSenderWithDtmf","dtmf","undefined","_dtmf","kind","createDTMFSender","_senders","RTCRtpSender","origGetSenders","senders","origGetStats","getStats","selector","onSucc","onErr","fixChromeStats_","response","standardReport","result","report","standardStats","timestamp","localcandidate","remotecandidate","names","name","stat","makeMapStats","stats","Map","key","successCallbackWrapper_","reject","webkitMediaStream","_ontrack","set","f","removeEventListener","addEventListener","enumerable","configurable","origSetRemoteDescription","setRemoteDescription","_ontrackpoly","te","receiver","getReceivers","r","event","transceiver","value","webkitRTCPeerConnection","RTCIceCandidate","RTCRtpReceiver","origGetReceivers","receivers","srcElement","filterStats","MediaStreamTrack"],"mappings":"kKA6WO,SAASA,EAAkCC,GAIhDA,EAAOC,kBAAkBC,UAAUC,gBACjC,WAEE,OADAC,KAAKC,qBAAuBD,KAAKC,sBAAwB,CAAA,EAClDC,OAAOC,KAAKH,KAAKC,sBACrBG,KAAIC,GAAYL,KAAKC,qBAAqBI,GAAU,MAG3D,MAAMC,EAAeV,EAAOC,kBAAkBC,UAAUS,SACxDX,EAAOC,kBAAkBC,UAAUS,SACjC,SAAkBC,EAAOC,GACvB,IAAKA,EACH,OAAOH,EAAaI,MAAMV,KAAMW,WAElCX,KAAKC,qBAAuBD,KAAKC,sBAAwB,CAAA,EAEzD,MAAMW,EAASN,EAAaI,MAAMV,KAAMW,WAMxC,OALKX,KAAKC,qBAAqBQ,EAAOI,KAE+B,IAA1Db,KAAKC,qBAAqBQ,EAAOI,IAAIC,QAAQF,IACtDZ,KAAKC,qBAAqBQ,EAAOI,IAAIE,KAAKH,GAF1CZ,KAAKC,qBAAqBQ,EAAOI,IAAM,CAACJ,EAAQG,GAI3CA,GAGX,MAAMI,EAAgBpB,EAAOC,kBAAkBC,UAAUmB,UACzDrB,EAAOC,kBAAkBC,UAAUmB,UAAY,SAAmBR,GAChET,KAAKC,qBAAuBD,KAAKC,sBAAwB,CAAA,EAEzDQ,EAAOS,YAAYC,SAAQX,IAEzB,GADsBR,KAAKoB,aAAaC,MAAKC,GAAKA,EAAEd,QAAUA,IAE5D,MAAM,IAAIe,aAAa,wBACnB,qBACN,IAEF,MAAMC,EAAkBxB,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EAAQG,UAAU,GACxB,IAAIC,EACAwH,EACAtD,EAoBJ,OAnBA9E,KAAKoB,aAAaD,SAAQG,IACpBA,EAAEd,QAAUA,IACVI,EACFkE,GAAM,EAENlE,EAASU,EAEb,IAEFtB,KAAKqI,eAAelH,SAAQmH,IACtBA,EAAE9H,QAAUA,IACV4H,EACFtD,GAAM,EAENsD,EAAWE,GAGRA,EAAE9H,QAAUA,KAEjBsE,GAAQlE,GAAUwH,EACbhE,QAAQmD,OAAO,IAAIhG,aACxB,4DACA,uBACOX,EACFA,EAAOsF,WACLkC,EACFA,EAASlC,WAEX9B,QAAQmD,OAAO,IAAIhG,aACxB,gDACA,sBACJ,CACA,OAAO0E,EAAavF,MAAMV,KAAMW,WAEpC"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shimGetDisplayMedia=function(e,i){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof i?e.navigator.mediaDevices.getDisplayMedia=function(a){return i(a).then((function(i){var t=a.video&&a.video.width,o=a.video&&a.video.height,d=a.video&&a.video.frameRate;return a.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:d||3}},t&&(a.video.mandatory.maxWidth=t),o&&(a.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(a)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.shimGetDisplayMedia=function(e,i){e.navigator.mediaDevices&&"getDisplayMedia"in e.navigator.mediaDevices||e.navigator.mediaDevices&&("function"==typeof i?e.navigator.mediaDevices.getDisplayMedia=function(a){return i(a).then((i=>{const t=a.video&&a.video.width,o=a.video&&a.video.height,d=a.video&&a.video.frameRate;return a.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:i,maxFrameRate:d||3}},t&&(a.video.mandatory.maxWidth=t),o&&(a.video.mandatory.maxHeight=o),e.navigator.mediaDevices.getUserMedia(a)}))}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))};
2
2
  //# sourceMappingURL=getdisplaymedia.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getdisplaymedia.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js"],"sourcesContent":["/*\n * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\nexport function shimGetDisplayMedia(window, getSourceId) {\n if (window.navigator.mediaDevices &&\n 'getDisplayMedia' in window.navigator.mediaDevices) {\n return;\n }\n if (!(window.navigator.mediaDevices)) {\n return;\n }\n // getSourceId is a function that returns a promise resolving with\n // the sourceId of the screen/window/tab to be shared.\n if (typeof getSourceId !== 'function') {\n console.error('shimGetDisplayMedia: getSourceId argument is not ' +\n 'a function');\n return;\n }\n window.navigator.mediaDevices.getDisplayMedia =\n function getDisplayMedia(constraints) {\n return getSourceId(constraints)\n .then(sourceId => {\n const widthSpecified = constraints.video && constraints.video.width;\n const heightSpecified = constraints.video &&\n constraints.video.height;\n const frameRateSpecified = constraints.video &&\n constraints.video.frameRate;\n constraints.video = {\n mandatory: {\n chromeMediaSource: 'desktop',\n chromeMediaSourceId: sourceId,\n maxFrameRate: frameRateSpecified || 3\n }\n };\n if (widthSpecified) {\n constraints.video.mandatory.maxWidth = widthSpecified;\n }\n if (heightSpecified) {\n constraints.video.mandatory.maxHeight = heightSpecified;\n }\n return window.navigator.mediaDevices.getUserMedia(constraints);\n });\n };\n}\n"],"names":["window","getSourceId","navigator","mediaDevices","getDisplayMedia","constraints","then","sourceId","widthSpecified","video","width","heightSpecified","height","frameRateSpecified","frameRate","mandatory","chromeMediaSource","chromeMediaSourceId","maxFrameRate","maxWidth","maxHeight","getUserMedia","console","error"],"mappings":"gGASO,SAA6BA,EAAQC,GACtCD,EAAOE,UAAUC,cACnB,oBAAqBH,EAAOE,UAAUC,cAGlCH,EAAOE,UAAUC,eAKI,mBAAhBF,EAKXD,EAAOE,UAAUC,aAAaC,gBAC5B,SAAyBC,GACvB,OAAOJ,EAAYI,GAChBC,MAAK,SAAAC,GACJ,IAAMC,EAAiBH,EAAYI,OAASJ,EAAYI,MAAMC,MACxDC,EAAkBN,EAAYI,OAClCJ,EAAYI,MAAMG,OACdC,EAAqBR,EAAYI,OACrCJ,EAAYI,MAAMK,UAcpB,OAbAT,EAAYI,MAAQ,CAClBM,UAAW,CACTC,kBAAmB,UACnBC,oBAAqBV,EACrBW,aAAcL,GAAsB,IAGpCL,IACFH,EAAYI,MAAMM,UAAUI,SAAWX,GAErCG,IACFN,EAAYI,MAAMM,UAAUK,UAAYT,GAEnCX,EAAOE,UAAUC,aAAakB,aAAahB,EACpD,KA3BJiB,QAAQC,MAAM,+DA6BlB"}
1
+ {"version":3,"file":"getdisplaymedia.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/getdisplaymedia.js"],"sourcesContent":["/*\n * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\nexport function shimGetDisplayMedia(window, getSourceId) {\n if (window.navigator.mediaDevices &&\n 'getDisplayMedia' in window.navigator.mediaDevices) {\n return;\n }\n if (!(window.navigator.mediaDevices)) {\n return;\n }\n // getSourceId is a function that returns a promise resolving with\n // the sourceId of the screen/window/tab to be shared.\n if (typeof getSourceId !== 'function') {\n console.error('shimGetDisplayMedia: getSourceId argument is not ' +\n 'a function');\n return;\n }\n window.navigator.mediaDevices.getDisplayMedia =\n function getDisplayMedia(constraints) {\n return getSourceId(constraints)\n .then(sourceId => {\n const widthSpecified = constraints.video && constraints.video.width;\n const heightSpecified = constraints.video &&\n constraints.video.height;\n const frameRateSpecified = constraints.video &&\n constraints.video.frameRate;\n constraints.video = {\n mandatory: {\n chromeMediaSource: 'desktop',\n chromeMediaSourceId: sourceId,\n maxFrameRate: frameRateSpecified || 3\n }\n };\n if (widthSpecified) {\n constraints.video.mandatory.maxWidth = widthSpecified;\n }\n if (heightSpecified) {\n constraints.video.mandatory.maxHeight = heightSpecified;\n }\n return window.navigator.mediaDevices.getUserMedia(constraints);\n });\n };\n}\n"],"names":["window","getSourceId","navigator","mediaDevices","getDisplayMedia","constraints","then","sourceId","widthSpecified","video","width","heightSpecified","height","frameRateSpecified","frameRate","mandatory","chromeMediaSource","chromeMediaSourceId","maxFrameRate","maxWidth","maxHeight","getUserMedia","console","error"],"mappings":"gGASO,SAA6BA,EAAQC,GACtCD,EAAOE,UAAUC,cACnB,oBAAqBH,EAAOE,UAAUC,cAGlCH,EAAOE,UAAUC,eAKI,mBAAhBF,EAKXD,EAAOE,UAAUC,aAAaC,gBAC5B,SAAyBC,GACvB,OAAOJ,EAAYI,GAChBC,MAAKC,IACJ,MAAMC,EAAiBH,EAAYI,OAASJ,EAAYI,MAAMC,MACxDC,EAAkBN,EAAYI,OAClCJ,EAAYI,MAAMG,OACdC,EAAqBR,EAAYI,OACrCJ,EAAYI,MAAMK,UAcpB,OAbAT,EAAYI,MAAQ,CAClBM,UAAW,CACTC,kBAAmB,UACnBC,oBAAqBV,EACrBW,aAAcL,GAAsB,IAGpCL,IACFH,EAAYI,MAAMM,UAAUI,SAAWX,GAErCG,IACFN,EAAYI,MAAMM,UAAUK,UAAYT,GAEnCX,EAAOE,UAAUC,aAAakB,aAAahB,EAAY,KA1BpEiB,QAAQC,MAAM,+DA6BlB"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),r=require("../utils.js").log;exports.shimGetUserMedia=function(i,o){var t=i&&i.navigator;if(t.mediaDevices){var n=function(r){if("object"!==e.typeof(r)||r.mandatory||r.optional)return r;var i={};return Object.keys(r).forEach((function(o){if("require"!==o&&"advanced"!==o&&"mediaSource"!==o){var t="object"===e.typeof(r[o])?r[o]:{ideal:r[o]};void 0!==t.exact&&"number"==typeof t.exact&&(t.min=t.max=t.exact);var n=function(e,r){return e?e+r.charAt(0).toUpperCase()+r.slice(1):"deviceId"===r?"sourceId":r};if(void 0!==t.ideal){i.optional=i.optional||[];var a={};"number"==typeof t.ideal?(a[n("min",o)]=t.ideal,i.optional.push(a),(a={})[n("max",o)]=t.ideal,i.optional.push(a)):(a[n("",o)]=t.ideal,i.optional.push(a))}void 0!==t.exact&&"number"!=typeof t.exact?(i.mandatory=i.mandatory||{},i.mandatory[n("",o)]=t.exact):["min","max"].forEach((function(e){void 0!==t[e]&&(i.mandatory=i.mandatory||{},i.mandatory[n(e,o)]=t[e])}))}})),r.advanced&&(i.optional=(i.optional||[]).concat(r.advanced)),i},a=function(i,a){if(o.version>=61)return a(i);if((i=JSON.parse(JSON.stringify(i)))&&"object"===e.typeof(i.audio)){var d=function(e,r,i){r in e&&!(i in e)&&(e[i]=e[r],delete e[r])};d((i=JSON.parse(JSON.stringify(i))).audio,"autoGainControl","googAutoGainControl"),d(i.audio,"noiseSuppression","googNoiseSuppression"),i.audio=n(i.audio)}if(i&&"object"===e.typeof(i.video)){var c=i.video.facingMode;c=c&&("object"===e.typeof(c)?c:{ideal:c});var s,u=o.version<66;if(c&&("user"===c.exact||"environment"===c.exact||"user"===c.ideal||"environment"===c.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||u))if(delete i.video.facingMode,"environment"===c.exact||"environment"===c.ideal?s=["back","rear"]:"user"!==c.exact&&"user"!==c.ideal||(s=["front"]),s)return t.mediaDevices.enumerateDevices().then((function(e){var o=(e=e.filter((function(e){return"videoinput"===e.kind}))).find((function(e){return s.some((function(r){return e.label.toLowerCase().includes(r)}))}));return!o&&e.length&&s.includes("back")&&(o=e[e.length-1]),o&&(i.video.deviceId=c.exact?{exact:o.deviceId}:{ideal:o.deviceId}),i.video=n(i.video),r("chrome: "+JSON.stringify(i)),a(i)}));i.video=n(i.video)}return r("chrome: "+JSON.stringify(i)),a(i)},d=function(e){return o.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,r,i){a(e,(function(e){t.webkitGetUserMedia(e,r,(function(e){i&&i(d(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){var c=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(e){return a(e,(function(e){return c(e).then((function(r){if(e.audio&&!r.getAudioTracks().length||e.video&&!r.getVideoTracks().length)throw r.getTracks().forEach((function(e){e.stop()})),new DOMException("","NotFoundError");return r}),(function(e){return Promise.reject(d(e))}))}))}}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});const e=require("../utils.js").log;exports.shimGetUserMedia=function(r,o){const t=r&&r.navigator;if(!t.mediaDevices)return;const i=function(e){if("object"!=typeof e||e.mandatory||e.optional)return e;const r={};return Object.keys(e).forEach((o=>{if("require"===o||"advanced"===o||"mediaSource"===o)return;const t="object"==typeof e[o]?e[o]:{ideal:e[o]};void 0!==t.exact&&"number"==typeof t.exact&&(t.min=t.max=t.exact);const i=function(e,r){return e?e+r.charAt(0).toUpperCase()+r.slice(1):"deviceId"===r?"sourceId":r};if(void 0!==t.ideal){r.optional=r.optional||[];let e={};"number"==typeof t.ideal?(e[i("min",o)]=t.ideal,r.optional.push(e),e={},e[i("max",o)]=t.ideal,r.optional.push(e)):(e[i("",o)]=t.ideal,r.optional.push(e))}void 0!==t.exact&&"number"!=typeof t.exact?(r.mandatory=r.mandatory||{},r.mandatory[i("",o)]=t.exact):["min","max"].forEach((e=>{void 0!==t[e]&&(r.mandatory=r.mandatory||{},r.mandatory[i(e,o)]=t[e])}))})),e.advanced&&(r.optional=(r.optional||[]).concat(e.advanced)),r},n=function(r,n){if(o.version>=61)return n(r);if((r=JSON.parse(JSON.stringify(r)))&&"object"==typeof r.audio){const e=function(e,r,o){r in e&&!(o in e)&&(e[o]=e[r],delete e[r])};e((r=JSON.parse(JSON.stringify(r))).audio,"autoGainControl","googAutoGainControl"),e(r.audio,"noiseSuppression","googNoiseSuppression"),r.audio=i(r.audio)}if(r&&"object"==typeof r.video){let a=r.video.facingMode;a=a&&("object"==typeof a?a:{ideal:a});const d=o.version<66;if(a&&("user"===a.exact||"environment"===a.exact||"user"===a.ideal||"environment"===a.ideal)&&(!t.mediaDevices.getSupportedConstraints||!t.mediaDevices.getSupportedConstraints().facingMode||d)){let o;if(delete r.video.facingMode,"environment"===a.exact||"environment"===a.ideal?o=["back","rear"]:"user"!==a.exact&&"user"!==a.ideal||(o=["front"]),o)return t.mediaDevices.enumerateDevices().then((t=>{let d=(t=t.filter((e=>"videoinput"===e.kind))).find((e=>o.some((r=>e.label.toLowerCase().includes(r)))));return!d&&t.length&&o.includes("back")&&(d=t[t.length-1]),d&&(r.video.deviceId=a.exact?{exact:d.deviceId}:{ideal:d.deviceId}),r.video=i(r.video),e("chrome: "+JSON.stringify(r)),n(r)}))}r.video=i(r.video)}return e("chrome: "+JSON.stringify(r)),n(r)},a=function(e){return o.version>=64?e:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[e.name]||e.name,message:e.message,constraint:e.constraint||e.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(t.getUserMedia=function(e,r,o){n(e,(e=>{t.webkitGetUserMedia(e,r,(e=>{o&&o(a(e))}))}))}.bind(t),t.mediaDevices.getUserMedia){const e=t.mediaDevices.getUserMedia.bind(t.mediaDevices);t.mediaDevices.getUserMedia=function(r){return n(r,(r=>e(r).then((e=>{if(r.audio&&!e.getAudioTracks().length||r.video&&!e.getVideoTracks().length)throw e.getTracks().forEach((e=>{e.stop()})),new DOMException("","NotFoundError");return e}),(e=>Promise.reject(a(e))))))}}};
2
2
  //# sourceMappingURL=getusermedia.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"getusermedia.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/getusermedia.js"],"sourcesContent":["/*\n * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\nimport * as utils from '../utils.js';\nconst logging = utils.log;\n\nexport function shimGetUserMedia(window, browserDetails) {\n const navigator = window && window.navigator;\n\n if (!navigator.mediaDevices) {\n return;\n }\n\n const constraintsToChrome_ = function(c) {\n if (typeof c !== 'object' || c.mandatory || c.optional) {\n return c;\n }\n const cc = {};\n Object.keys(c).forEach(key => {\n if (key === 'require' || key === 'advanced' || key === 'mediaSource') {\n return;\n }\n const r = (typeof c[key] === 'object') ? c[key] : {ideal: c[key]};\n if (r.exact !== undefined && typeof r.exact === 'number') {\n r.min = r.max = r.exact;\n }\n const oldname_ = function(prefix, name) {\n if (prefix) {\n return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n }\n return (name === 'deviceId') ? 'sourceId' : name;\n };\n if (r.ideal !== undefined) {\n cc.optional = cc.optional || [];\n let oc = {};\n if (typeof r.ideal === 'number') {\n oc[oldname_('min', key)] = r.ideal;\n cc.optional.push(oc);\n oc = {};\n oc[oldname_('max', key)] = r.ideal;\n cc.optional.push(oc);\n } else {\n oc[oldname_('', key)] = r.ideal;\n cc.optional.push(oc);\n }\n }\n if (r.exact !== undefined && typeof r.exact !== 'number') {\n cc.mandatory = cc.mandatory || {};\n cc.mandatory[oldname_('', key)] = r.exact;\n } else {\n ['min', 'max'].forEach(mix => {\n if (r[mix] !== undefined) {\n cc.mandatory = cc.mandatory || {};\n cc.mandatory[oldname_(mix, key)] = r[mix];\n }\n });\n }\n });\n if (c.advanced) {\n cc.optional = (cc.optional || []).concat(c.advanced);\n }\n return cc;\n };\n\n const shimConstraints_ = function(constraints, func) {\n if (browserDetails.version >= 61) {\n return func(constraints);\n }\n constraints = JSON.parse(JSON.stringify(constraints));\n if (constraints && typeof constraints.audio === 'object') {\n const remap = function(obj, a, b) {\n if (a in obj && !(b in obj)) {\n obj[b] = obj[a];\n delete obj[a];\n }\n };\n constraints = JSON.parse(JSON.stringify(constraints));\n remap(constraints.audio, 'autoGainControl', 'googAutoGainControl');\n remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression');\n constraints.audio = constraintsToChrome_(constraints.audio);\n }\n if (constraints && typeof constraints.video === 'object') {\n // Shim facingMode for mobile & surface pro.\n let face = constraints.video.facingMode;\n face = face && ((typeof face === 'object') ? face : {ideal: face});\n const getSupportedFacingModeLies = browserDetails.version < 66;\n\n if ((face && (face.exact === 'user' || face.exact === 'environment' ||\n face.ideal === 'user' || face.ideal === 'environment')) &&\n !(navigator.mediaDevices.getSupportedConstraints &&\n navigator.mediaDevices.getSupportedConstraints().facingMode &&\n !getSupportedFacingModeLies)) {\n delete constraints.video.facingMode;\n let matches;\n if (face.exact === 'environment' || face.ideal === 'environment') {\n matches = ['back', 'rear'];\n } else if (face.exact === 'user' || face.ideal === 'user') {\n matches = ['front'];\n }\n if (matches) {\n // Look for matches in label, or use last cam for back (typical).\n return navigator.mediaDevices.enumerateDevices()\n .then(devices => {\n devices = devices.filter(d => d.kind === 'videoinput');\n let dev = devices.find(d => matches.some(match =>\n d.label.toLowerCase().includes(match)));\n if (!dev && devices.length && matches.includes('back')) {\n dev = devices[devices.length - 1]; // more likely the back cam\n }\n if (dev) {\n constraints.video.deviceId = face.exact ? {exact: dev.deviceId} :\n {ideal: dev.deviceId};\n }\n constraints.video = constraintsToChrome_(constraints.video);\n logging('chrome: ' + JSON.stringify(constraints));\n return func(constraints);\n });\n }\n }\n constraints.video = constraintsToChrome_(constraints.video);\n }\n logging('chrome: ' + JSON.stringify(constraints));\n return func(constraints);\n };\n\n const shimError_ = function(e) {\n if (browserDetails.version >= 64) {\n return e;\n }\n return {\n name: {\n PermissionDeniedError: 'NotAllowedError',\n PermissionDismissedError: 'NotAllowedError',\n InvalidStateError: 'NotAllowedError',\n DevicesNotFoundError: 'NotFoundError',\n ConstraintNotSatisfiedError: 'OverconstrainedError',\n TrackStartError: 'NotReadableError',\n MediaDeviceFailedDueToShutdown: 'NotAllowedError',\n MediaDeviceKillSwitchOn: 'NotAllowedError',\n TabCaptureError: 'AbortError',\n ScreenCaptureError: 'AbortError',\n DeviceCaptureError: 'AbortError'\n }[e.name] || e.name,\n message: e.message,\n constraint: e.constraint || e.constraintName,\n toString() {\n return this.name + (this.message && ': ') + this.message;\n }\n };\n };\n\n const getUserMedia_ = function(constraints, onSuccess, onError) {\n shimConstraints_(constraints, c => {\n navigator.webkitGetUserMedia(c, onSuccess, e => {\n if (onError) {\n onError(shimError_(e));\n }\n });\n });\n };\n navigator.getUserMedia = getUserMedia_.bind(navigator);\n\n // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia\n // function which returns a Promise, it does not accept spec-style\n // constraints.\n if (navigator.mediaDevices.getUserMedia) {\n const origGetUserMedia = navigator.mediaDevices.getUserMedia.\n bind(navigator.mediaDevices);\n navigator.mediaDevices.getUserMedia = function(cs) {\n return shimConstraints_(cs, c => origGetUserMedia(c).then(stream => {\n if (c.audio && !stream.getAudioTracks().length ||\n c.video && !stream.getVideoTracks().length) {\n stream.getTracks().forEach(track => {\n track.stop();\n });\n throw new DOMException('', 'NotFoundError');\n }\n return stream;\n }, e => Promise.reject(shimError_(e))));\n };\n }\n}\n"],"names":["logging","utils","window","browserDetails","navigator","mediaDevices","constraintsToChrome_","c","_typeof","mandatory","optional","cc","Object","keys","forEach","key","r","ideal","undefined","exact","min","max","oldname_","prefix","name","charAt","toUpperCase","slice","oc","push","mix","advanced","concat","shimConstraints_","constraints","func","version","JSON","parse","stringify","audio","remap","obj","a","b","video","face","facingMode","matches","getSupportedFacingModeLies","getSupportedConstraints","enumerateDevices","then","devices","dev","filter","d","kind","find","some","match","label","toLowerCase","includes","length","deviceId","shimError_","e","PermissionDeniedError","PermissionDismissedError","InvalidStateError","DevicesNotFoundError","ConstraintNotSatisfiedError","TrackStartError","MediaDeviceFailedDueToShutdown","MediaDeviceKillSwitchOn","TabCaptureError","ScreenCaptureError","DeviceCaptureError","message","constraint","constraintName","toString","this","getUserMedia","onSuccess","onError","webkitGetUserMedia","bind","origGetUserMedia","cs","stream","getAudioTracks","getVideoTracks","getTracks","track","stop","DOMException","Promise","reject"],"mappings":"0IAUMA,yBAAUC,6BAET,SAA0BC,EAAQC,GACvC,IAAMC,EAAYF,GAAUA,EAAOE,UAEnC,GAAKA,EAAUC,aAAf,CAIA,IAAMC,EAAuB,SAASC,GACpC,GAAiB,WAAbC,EAAAA,OAAOD,IAAkBA,EAAEE,WAAaF,EAAEG,SAC5C,OAAOH,EAET,IAAMI,EAAK,CAAA,EA4CX,OA3CAC,OAAOC,KAAKN,GAAGO,SAAQ,SAAAC,GACrB,GAAY,YAARA,GAA6B,aAARA,GAA8B,gBAARA,EAA/C,CAGA,IAAMC,EAAuB,WAAlBR,EAAOD,OAAAA,EAAEQ,IAAqBR,EAAEQ,GAAO,CAACE,MAAOV,EAAEQ,SAC5CG,IAAZF,EAAEG,OAA0C,iBAAZH,EAAEG,QACpCH,EAAEI,IAAMJ,EAAEK,IAAML,EAAEG,OAEpB,IAA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,KAAKE,UAAUL,IAC7BC,EAAKD,IAGRgC,EAAa,SAASC,GAC1B,OAAIhE,EAAeiC,SAAW,GACrB+B,EAEF,CACL3C,KAAM,CACJ4C,sBAAuB,kBACvBC,yBAA0B,kBAC1BC,kBAAmB,kBACnBC,qBAAsB,gBACtBC,4BAA6B,uBAC7BC,gBAAiB,mBACjBC,+BAAgC,kBAChCC,wBAAyB,kBACzBC,gBAAiB,aACjBC,mBAAoB,aACpBC,mBAAoB,cACpBX,EAAE3C,OAAS2C,EAAE3C,KACfuD,QAASZ,EAAEY,QACXC,WAAYb,EAAEa,YAAcb,EAAEc,eAC9BC,SAAW,WACT,OAAOC,KAAK3D,MAAQ2D,KAAKJ,SAAW,MAAQI,KAAKJ,OACnD,IAkBJ,GALA3E,EAAUgF,aATY,SAASlD,EAAamD,EAAWC,GACrDrD,EAAiBC,GAAa,SAAA3B,GAC5BH,EAAUmF,mBAAmBhF,EAAG8E,GAAW,SAAAlB,GACrCmB,GACFA,EAAQpB,EAAWC,GAEvB,GACF,KAEqCqB,KAAKpF,GAKxCA,EAAUC,aAAa+E,aAAc,CACvC,IAAMK,EAAmBrF,EAAUC,aAAa+E,aAC5CI,KAAKpF,EAAUC,cACnBD,EAAUC,aAAa+E,aAAe,SAASM,GAC7C,OAAOzD,EAAiByD,GAAI,SAAAnF,GAAC,OAAIkF,EAAiBlF,GAAG6C,MAAK,SAAAuC,GACxD,GAAIpF,EAAEiC,QAAUmD,EAAOC,iBAAiB5B,QACpCzD,EAAEsC,QAAU8C,EAAOE,iBAAiB7B,OAItC,MAHA2B,EAAOG,YAAYhF,SAAQ,SAAAiF,GACzBA,EAAMC,MACR,IACM,IAAIC,aAAa,GAAI,iBAE7B,OAAON,CACR,IAAE,SAAAxB,GAAC,OAAI+B,QAAQC,OAAOjC,EAAWC,UAEtC,CAzKA,CA0KF"}
1
+ {"version":3,"file":"getusermedia.js","sources":["../../../../../../node_modules/webrtc-adapter/src/js/chrome/getusermedia.js"],"sourcesContent":["/*\n * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\nimport * as utils from '../utils.js';\nconst logging = utils.log;\n\nexport function shimGetUserMedia(window, browserDetails) {\n const navigator = window && window.navigator;\n\n if (!navigator.mediaDevices) {\n return;\n }\n\n const constraintsToChrome_ = function(c) {\n if (typeof c !== 'object' || c.mandatory || c.optional) {\n return c;\n }\n const cc = {};\n Object.keys(c).forEach(key => {\n if (key === 'require' || key === 'advanced' || key === 'mediaSource') {\n return;\n }\n const r = (typeof c[key] === 'object') ? c[key] : {ideal: c[key]};\n if (r.exact !== undefined && typeof r.exact === 'number') {\n r.min = r.max = r.exact;\n }\n const oldname_ = function(prefix, name) {\n if (prefix) {\n return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n }\n return (name === 'deviceId') ? 'sourceId' : name;\n };\n if (r.ideal !== undefined) {\n cc.optional = cc.optional || [];\n let oc = {};\n if (typeof r.ideal === 'number') {\n oc[oldname_('min', key)] = r.ideal;\n cc.optional.push(oc);\n oc = {};\n oc[oldname_('max', key)] = r.ideal;\n cc.optional.push(oc);\n } else {\n oc[oldname_('', key)] = r.ideal;\n cc.optional.push(oc);\n }\n }\n if (r.exact !== undefined && typeof r.exact !== 'number') {\n cc.mandatory = cc.mandatory || {};\n cc.mandatory[oldname_('', key)] = r.exact;\n } else {\n ['min', 'max'].forEach(mix => {\n if (r[mix] !== undefined) {\n cc.mandatory = cc.mandatory || {};\n cc.mandatory[oldname_(mix, key)] = r[mix];\n }\n });\n }\n });\n if (c.advanced) {\n cc.optional = (cc.optional || []).concat(c.advanced);\n }\n return cc;\n };\n\n const shimConstraints_ = function(constraints, func) {\n if (browserDetails.version >= 61) {\n return func(constraints);\n }\n constraints = JSON.parse(JSON.stringify(constraints));\n if (constraints && typeof constraints.audio === 'object') {\n const remap = function(obj, a, b) {\n if (a in obj && !(b in obj)) {\n obj[b] = obj[a];\n delete obj[a];\n }\n };\n constraints = JSON.parse(JSON.stringify(constraints));\n remap(constraints.audio, 'autoGainControl', 'googAutoGainControl');\n remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression');\n constraints.audio = constraintsToChrome_(constraints.audio);\n }\n if (constraints && typeof constraints.video === 'object') {\n // Shim facingMode for mobile & surface pro.\n let face = constraints.video.facingMode;\n face = face && ((typeof face === 'object') ? face : {ideal: face});\n const getSupportedFacingModeLies = browserDetails.version < 66;\n\n if ((face && (face.exact === 'user' || face.exact === 'environment' ||\n face.ideal === 'user' || face.ideal === 'environment')) &&\n !(navigator.mediaDevices.getSupportedConstraints &&\n navigator.mediaDevices.getSupportedConstraints().facingMode &&\n !getSupportedFacingModeLies)) {\n delete constraints.video.facingMode;\n let matches;\n if (face.exact === 'environment' || face.ideal === 'environment') {\n matches = ['back', 'rear'];\n } else if (face.exact === 'user' || face.ideal === 'user') {\n matches = ['front'];\n }\n if (matches) {\n // Look for matches in label, or use last cam for back (typical).\n return navigator.mediaDevices.enumerateDevices()\n .then(devices => {\n devices = devices.filter(d => d.kind === 'videoinput');\n let dev = devices.find(d => matches.some(match =>\n d.label.toLowerCase().includes(match)));\n if (!dev && devices.length && matches.includes('back')) {\n dev = devices[devices.length - 1]; // more likely the back cam\n }\n if (dev) {\n constraints.video.deviceId = face.exact ? {exact: dev.deviceId} :\n {ideal: dev.deviceId};\n }\n constraints.video = constraintsToChrome_(constraints.video);\n logging('chrome: ' + JSON.stringify(constraints));\n return func(constraints);\n });\n }\n }\n constraints.video = constraintsToChrome_(constraints.video);\n }\n logging('chrome: ' + JSON.stringify(constraints));\n return func(constraints);\n };\n\n const shimError_ = function(e) {\n if (browserDetails.version >= 64) {\n return e;\n }\n return {\n name: {\n PermissionDeniedError: 'NotAllowedError',\n PermissionDismissedError: 'NotAllowedError',\n InvalidStateError: 'NotAllowedError',\n DevicesNotFoundError: 'NotFoundError',\n ConstraintNotSatisfiedError: 'OverconstrainedError',\n TrackStartError: 'NotReadableError',\n MediaDeviceFailedDueToShutdown: 'NotAllowedError',\n MediaDeviceKillSwitchOn: 'NotAllowedError',\n TabCaptureError: 'AbortError',\n ScreenCaptureError: 'AbortError',\n DeviceCaptureError: 'AbortError'\n }[e.name] || e.name,\n message: e.message,\n constraint: e.constraint || e.constraintName,\n toString() {\n return this.name + (this.message && ': ') + this.message;\n }\n };\n };\n\n const getUserMedia_ = function(constraints, onSuccess, onError) {\n shimConstraints_(constraints, c => {\n navigator.webkitGetUserMedia(c, onSuccess, e => {\n if (onError) {\n onError(shimError_(e));\n }\n });\n });\n };\n navigator.getUserMedia = getUserMedia_.bind(navigator);\n\n // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia\n // function which returns a Promise, it does not accept spec-style\n // constraints.\n if (navigator.mediaDevices.getUserMedia) {\n const origGetUserMedia = navigator.mediaDevices.getUserMedia.\n bind(navigator.mediaDevices);\n navigator.mediaDevices.getUserMedia = function(cs) {\n return shimConstraints_(cs, c => origGetUserMedia(c).then(stream => {\n if (c.audio && !stream.getAudioTracks().length ||\n c.video && !stream.getVideoTracks().length) {\n stream.getTracks().forEach(track => {\n track.stop();\n });\n throw new DOMException('', 'NotFoundError');\n }\n return stream;\n }, e => Promise.reject(shimError_(e))));\n };\n }\n}\n"],"names":["logging","utils","window","browserDetails","navigator","mediaDevices","constraintsToChrome_","c","mandatory","optional","cc","Object","keys","forEach","key","r","ideal","undefined","exact","min","max","oldname_","prefix","name","charAt","toUpperCase","slice","oc","push","mix","advanced","concat","shimConstraints_","constraints","func","version","JSON","parse","stringify","audio","remap","obj","a","b","video","face","facingMode","getSupportedFacingModeLies","getSupportedConstraints","matches","enumerateDevices","then","devices","dev","filter","d","kind","find","some","match","label","toLowerCase","includes","length","deviceId","shimError_","e","PermissionDeniedError","PermissionDismissedError","InvalidStateError","DevicesNotFoundError","ConstraintNotSatisfiedError","TrackStartError","MediaDeviceFailedDueToShutdown","MediaDeviceKillSwitchOn","TabCaptureError","ScreenCaptureError","DeviceCaptureError","message","constraint","constraintName","toString","this","getUserMedia","onSuccess","onError","webkitGetUserMedia","bind","origGetUserMedia","cs","stream","getAudioTracks","getVideoTracks","getTracks","track","stop","DOMException","Promise","reject"],"mappings":"oEAUA,MAAMA,yBAAUC,6BAET,SAA0BC,EAAQC,GACvC,MAAMC,EAAYF,GAAUA,EAAOE,UAEnC,IAAKA,EAAUC,aACb,OAGF,MAAMC,EAAuB,SAASC,GACpC,GAAiB,iBAANA,GAAkBA,EAAEC,WAAaD,EAAEE,SAC5C,OAAOF,EAET,MAAMG,EAAK,CAAA,EA4CX,OA3CAC,OAAOC,KAAKL,GAAGM,SAAQC,IACrB,GAAY,YAARA,GAA6B,aAARA,GAA8B,gBAARA,EAC7C,OAEF,MAAMC,EAAuB,iBAAXR,EAAEO,GAAqBP,EAAEO,GAAO,CAACE,MAAOT,EAAEO,SAC5CG,IAAZF,EAAEG,OAA0C,iBAAZH,EAAEG,QACpCH,EAAEI,IAAMJ,EAAEK,IAAML,EAAEG,OAEpB,MAAMG,EAAW,SAASC,EAAQC,GAChC,OAAID,EACKA,EAASC,EAAKC,OAAO,GAAGC,cAAgBF,EAAKG,MAAM,GAE3C,aAATH,EAAuB,WAAaA,GAE9C,QAAgBN,IAAZF,EAAEC,MAAqB,CACzBN,EAAGD,SAAWC,EAAGD,UAAY,GAC7B,IAAIkB,EAAK,CAAA,EACc,iBAAZZ,EAAEC,OACXW,EAAGN,EAAS,MAAOP,IAAQC,EAAEC,MAC7BN,EAAGD,SAASmB,KAAKD,GACjBA,EAAK,CAAA,EACLA,EAAGN,EAAS,MAAOP,IAAQC,EAAEC,MAC7BN,EAAGD,SAASmB,KAAKD,KAEjBA,EAAGN,EAAS,GAAIP,IAAQC,EAAEC,MAC1BN,EAAGD,SAASmB,KAAKD,GAErB,MACgBV,IAAZF,EAAEG,OAA0C,iBAAZH,EAAEG,OACpCR,EAAGF,UAAYE,EAAGF,WAAa,CAAA,EAC/BE,EAAGF,UAAU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,aAAc,CACvC,MAAMK,EAAmBpF,EAAUC,aAAa8E,aAC5CI,KAAKnF,EAAUC,cACnBD,EAAUC,aAAa8E,aAAe,SAASM,GAC7C,OAAOzD,EAAiByD,GAAIlF,GAAKiF,EAAiBjF,GAAG4C,MAAKuC,IACxD,GAAInF,EAAEgC,QAAUmD,EAAOC,iBAAiB5B,QACpCxD,EAAEqC,QAAU8C,EAAOE,iBAAiB7B,OAItC,MAHA2B,EAAOG,YAAYhF,SAAQiF,IACzBA,EAAMC,MAAM,IAER,IAAIC,aAAa,GAAI,iBAE7B,OAAON,CAAM,IACZxB,GAAK+B,QAAQC,OAAOjC,EAAWC,QAEtC,CACF"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../../../sdp/sdp.js"),n=require("./utils.js");exports.removeExtmapAllowMixed=function(e,t){if(e.RTCPeerConnection&&!("chrome"===t.browser&&t.version>=71||"safari"===t.browser&&t.version>=605)){var n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){var o=t.sdp.split("\n").filter((function(e){return"a=extmap-allow-mixed"!==e.trim()})).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:o}):t.sdp=o}return n.apply(this,arguments)}}},exports.shimAddIceCandidateNullOrEmpty=function(e,t){if(e.RTCPeerConnection&&e.RTCPeerConnection.prototype){var n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}},exports.shimConnectionState=function(e){if(e.RTCPeerConnection&&!("connectionState"in e.RTCPeerConnection.prototype)){var t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get:function(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get:function(){return this._onconnectionstatechange||null},set:function(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((function(e){var n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=function(e){var t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;var n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))}},exports.shimMaxMessageSize=function(e,n){if(e.RTCPeerConnection){"sctp"in e.RTCPeerConnection.prototype||Object.defineProperty(e.RTCPeerConnection.prototype,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp}});var o=function(e){if(!e||!e.sdp)return!1;var n=t.default.splitSections(e.sdp);return n.shift(),n.some((function(e){var n=t.default.parseMLine(e);return n&&"application"===n.kind&&-1!==n.protocol.indexOf("SCTP")}))},i=function(e){var t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;var n=parseInt(t[1],10);return n!=n?-1:n},r=function(e){var t=65536;return"firefox"===n.browser&&(t=n.version<57?-1===e?16384:2147483637:n.version<60?57===n.version?65535:65536:2147483637),t},a=function(e,o){var i=65536;"firefox"===n.browser&&57===n.version&&(i=65535);var r=t.default.matchPrefix(e.sdp,"a=max-message-size:");return r.length>0?i=parseInt(r[0].substr(19),10):"firefox"===n.browser&&-1!==o&&(i=2147483637),i},c=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===n.browser&&n.version>=76){var e=this.getConfiguration(),t=e.sdpSemantics;"plan-b"===t&&Object.defineProperty(this,"sctp",{get:function(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(o(arguments[0])){var s,p=i(arguments[0]),d=r(p),f=a(arguments[0],p);s=0===d&&0===f?Number.POSITIVE_INFINITY:0===d||0===f?Math.max(d,f):Math.min(d,f);var u={};Object.defineProperty(u,"maxMessageSize",{get:function(){return s}}),this._sctp=u}return c.apply(this,arguments)}}},exports.shimParameterlessSetLocalDescription=function(t,n){if(t.RTCPeerConnection&&t.RTCPeerConnection.prototype){var o=t.RTCPeerConnection.prototype.setLocalDescription;o&&0!==o.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){var t=this,n=arguments[0]||{};if("object"!==e.typeof(n)||n.type&&n.sdp)return o.apply(this,arguments);if(!(n={type:n.type,sdp:n.sdp}).type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":n.type="offer";break;default:n.type="answer"}if(n.sdp||"offer"!==n.type&&"answer"!==n.type)return o.apply(this,[n]);var i="offer"===n.type?this.createOffer:this.createAnswer;return i.apply(this).then((function(e){return o.apply(t,[e])}))})}},exports.shimRTCIceCandidate=function(o){if(!(!o.RTCIceCandidate||o.RTCIceCandidate&&"foundation"in o.RTCIceCandidate.prototype)){var i=o.RTCIceCandidate;o.RTCIceCandidate=function(n){if("object"===e.typeof(n)&&n.candidate&&0===n.candidate.indexOf("a=")&&((n=JSON.parse(JSON.stringify(n))).candidate=n.candidate.substr(2)),n.candidate&&n.candidate.length){var o=new i(n),r=t.default.parseCandidate(n.candidate),a=Object.assign(o,r);return a.toJSON=function(){return{candidate:a.candidate,sdpMid:a.sdpMid,sdpMLineIndex:a.sdpMLineIndex,usernameFragment:a.usernameFragment}},a}return new i(n)},o.RTCIceCandidate.prototype=i.prototype,n.wrapPeerConnectionEvent(o,"icecandidate",(function(e){return e.candidate&&Object.defineProperty(e,"candidate",{value:new o.RTCIceCandidate(e.candidate),writable:"false"}),e}))}},exports.shimRTCIceCandidateRelayProtocol=function(e){!e.RTCIceCandidate||e.RTCIceCandidate&&"relayProtocol"in e.RTCIceCandidate.prototype||n.wrapPeerConnectionEvent(e,"icecandidate",(function(e){if(e.candidate){var n=t.default.parseCandidate(e.candidate.candidate);"relay"===n.type&&(e.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return e}))},exports.shimSendThrowTypeError=function(e){if(e.RTCPeerConnection&&"createDataChannel"in e.RTCPeerConnection.prototype){var t=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){var e=t.apply(this,arguments);return o(e,this),e},n.wrapPeerConnectionEvent(e,"datachannel",(function(e){return o(e.channel,e.target),e}))}function o(e,t){var n=e.send;e.send=function(){var o=arguments[0],i=o.length||o.size||o.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../sdp/sdp.js"),t=require("./utils.js");exports.removeExtmapAllowMixed=function(e,t){if(!e.RTCPeerConnection)return;if("chrome"===t.browser&&t.version>=71)return;if("safari"===t.browser&&t.version>=605)return;const n=e.RTCPeerConnection.prototype.setRemoteDescription;e.RTCPeerConnection.prototype.setRemoteDescription=function(t){if(t&&t.sdp&&-1!==t.sdp.indexOf("\na=extmap-allow-mixed")){const n=t.sdp.split("\n").filter((e=>"a=extmap-allow-mixed"!==e.trim())).join("\n");e.RTCSessionDescription&&t instanceof e.RTCSessionDescription?arguments[0]=new e.RTCSessionDescription({type:t.type,sdp:n}):t.sdp=n}return n.apply(this,arguments)}},exports.shimAddIceCandidateNullOrEmpty=function(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(e.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===t.browser&&t.version<78||"firefox"===t.browser&&t.version<68||"safari"===t.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})},exports.shimConnectionState=function(e){if(!e.RTCPeerConnection||"connectionState"in e.RTCPeerConnection.prototype)return;const t=e.RTCPeerConnection.prototype;Object.defineProperty(t,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(t,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(e){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),e&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=e)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach((e=>{const n=t[e];t[e]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=e=>{const t=e.target;if(t._lastConnectionState!==t.connectionState){t._lastConnectionState=t.connectionState;const n=new Event("connectionstatechange",e);t.dispatchEvent(n)}return e},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}}))},exports.shimMaxMessageSize=function(t,n){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const o=function(t){if(!t||!t.sdp)return!1;const n=e.default.splitSections(t.sdp);return n.shift(),n.some((t=>{const n=e.default.parseMLine(t);return n&&"application"===n.kind&&-1!==n.protocol.indexOf("SCTP")}))},i=function(e){const t=e.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===t||t.length<2)return-1;const n=parseInt(t[1],10);return n!=n?-1:n},r=function(e){let t=65536;return"firefox"===n.browser&&(t=n.version<57?-1===e?16384:2147483637:n.version<60?57===n.version?65535:65536:2147483637),t},a=function(t,o){let i=65536;"firefox"===n.browser&&57===n.version&&(i=65535);const r=e.default.matchPrefix(t.sdp,"a=max-message-size:");return r.length>0?i=parseInt(r[0].substr(19),10):"firefox"===n.browser&&-1!==o&&(i=2147483637),i},c=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===n.browser&&n.version>=76){const{sdpSemantics:e}=this.getConfiguration();"plan-b"===e&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(o(arguments[0])){const e=i(arguments[0]),t=r(e),n=a(arguments[0],e);let o;o=0===t&&0===n?Number.POSITIVE_INFINITY:0===t||0===n?Math.max(t,n):Math.min(t,n);const c={};Object.defineProperty(c,"maxMessageSize",{get:()=>o}),this._sctp=c}return c.apply(this,arguments)}},exports.shimParameterlessSetLocalDescription=function(e,t){if(!e.RTCPeerConnection||!e.RTCPeerConnection.prototype)return;const n=e.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(e.RTCPeerConnection.prototype.setLocalDescription=function(){let e=arguments[0]||{};if("object"!=typeof e||e.type&&e.sdp)return n.apply(this,arguments);if(e={type:e.type,sdp:e.sdp},!e.type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":e.type="offer";break;default:e.type="answer"}if(e.sdp||"offer"!==e.type&&"answer"!==e.type)return n.apply(this,[e]);const t="offer"===e.type?this.createOffer:this.createAnswer;return t.apply(this).then((e=>n.apply(this,[e])))})},exports.shimRTCIceCandidate=function(n){if(!n.RTCIceCandidate||n.RTCIceCandidate&&"foundation"in n.RTCIceCandidate.prototype)return;const o=n.RTCIceCandidate;n.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const n=new o(t),i=e.default.parseCandidate(t.candidate),r=Object.assign(n,i);return r.toJSON=function(){return{candidate:r.candidate,sdpMid:r.sdpMid,sdpMLineIndex:r.sdpMLineIndex,usernameFragment:r.usernameFragment}},r}return new o(t)},n.RTCIceCandidate.prototype=o.prototype,t.wrapPeerConnectionEvent(n,"icecandidate",(e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new n.RTCIceCandidate(e.candidate),writable:"false"}),e)))},exports.shimRTCIceCandidateRelayProtocol=function(n){!n.RTCIceCandidate||n.RTCIceCandidate&&"relayProtocol"in n.RTCIceCandidate.prototype||t.wrapPeerConnectionEvent(n,"icecandidate",(t=>{if(t.candidate){const n=e.default.parseCandidate(t.candidate.candidate);"relay"===n.type&&(t.candidate.relayProtocol={0:"tls",1:"tcp",2:"udp"}[n.priority>>24])}return t}))},exports.shimSendThrowTypeError=function(e){if(!e.RTCPeerConnection||!("createDataChannel"in e.RTCPeerConnection.prototype))return;function n(e,t){const n=e.send;e.send=function(){const o=arguments[0],i=o.length||o.size||o.byteLength;if("open"===e.readyState&&t.sctp&&i>t.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+t.sctp.maxMessageSize+" bytes)");return n.apply(e,arguments)}}const o=e.RTCPeerConnection.prototype.createDataChannel;e.RTCPeerConnection.prototype.createDataChannel=function(){const e=o.apply(this,arguments);return n(e,this),e},t.wrapPeerConnectionEvent(e,"datachannel",(e=>(n(e.channel,e.target),e)))};
2
2
  //# sourceMappingURL=common_shim.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"common_shim.js","sources":["../../../../../node_modules/webrtc-adapter/src/js/common_shim.js"],"sourcesContent":["/*\n * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\n\nimport SDPUtils from 'sdp';\nimport * as utils from './utils';\n\nexport function shimRTCIceCandidate(window) {\n // foundation is arbitrarily chosen as an indicator for full support for\n // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface\n if (!window.RTCIceCandidate || (window.RTCIceCandidate && 'foundation' in\n window.RTCIceCandidate.prototype)) {\n return;\n }\n\n const NativeRTCIceCandidate = window.RTCIceCandidate;\n window.RTCIceCandidate = function RTCIceCandidate(args) {\n // Remove the a= which shouldn't be part of the candidate string.\n if (typeof args === 'object' && args.candidate &&\n args.candidate.indexOf('a=') === 0) {\n args = JSON.parse(JSON.stringify(args));\n args.candidate = args.candidate.substr(2);\n }\n\n if (args.candidate && args.candidate.length) {\n // Augment the native candidate with the parsed fields.\n const nativeCandidate = new NativeRTCIceCandidate(args);\n const parsedCandidate = SDPUtils.parseCandidate(args.candidate);\n const augmentedCandidate = Object.assign(nativeCandidate,\n parsedCandidate);\n\n // Add a serializer that does not serialize the extra attributes.\n augmentedCandidate.toJSON = function toJSON() {\n return {\n candidate: augmentedCandidate.candidate,\n sdpMid: augmentedCandidate.sdpMid,\n sdpMLineIndex: augmentedCandidate.sdpMLineIndex,\n usernameFragment: augmentedCandidate.usernameFragment,\n };\n };\n return augmentedCandidate;\n }\n return new NativeRTCIceCandidate(args);\n };\n window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype;\n\n // Hook up the augmented candidate in onicecandidate and\n // addEventListener('icecandidate', ...)\n utils.wrapPeerConnectionEvent(window, 'icecandidate', e => {\n if (e.candidate) {\n Object.defineProperty(e, 'candidate', {\n value: new window.RTCIceCandidate(e.candidate),\n writable: 'false'\n });\n }\n return e;\n });\n}\n\nexport function shimRTCIceCandidateRelayProtocol(window) {\n if (!window.RTCIceCandidate || (window.RTCIceCandidate && 'relayProtocol' in\n window.RTCIceCandidate.prototype)) {\n return;\n }\n\n // Hook up the augmented candidate in onicecandidate and\n // addEventListener('icecandidate', ...)\n utils.wrapPeerConnectionEvent(window, 'icecandidate', e => {\n if (e.candidate) {\n const parsedCandidate = SDPUtils.parseCandidate(e.candidate.candidate);\n if (parsedCandidate.type === 'relay') {\n // This is a libwebrtc-specific mapping of local type preference\n // to relayProtocol.\n e.candidate.relayProtocol = {\n 0: 'tls',\n 1: 'tcp',\n 2: 'udp',\n }[parsedCandidate.priority >> 24];\n }\n }\n return e;\n });\n}\n\nexport function shimMaxMessageSize(window, browserDetails) {\n if (!window.RTCPeerConnection) {\n return;\n }\n\n if (!('sctp' in window.RTCPeerConnection.prototype)) {\n Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', {\n get() {\n return typeof this._sctp === 'undefined' ? null : this._sctp;\n }\n });\n }\n\n const sctpInDescription = function(description) {\n if (!description || !description.sdp) {\n return false;\n }\n const sections = SDPUtils.splitSections(description.sdp);\n sections.shift();\n return sections.some(mediaSection => {\n const mLine = SDPUtils.parseMLine(mediaSection);\n return mLine && mLine.kind === 'application'\n && mLine.protocol.indexOf('SCTP') !== -1;\n });\n };\n\n const getRemoteFirefoxVersion = function(description) {\n // TODO: Is there a better solution for detecting Firefox?\n const match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\\d+)/);\n if (match === null || match.length < 2) {\n return -1;\n }\n const version = parseInt(match[1], 10);\n // Test for NaN (yes, this is ugly)\n return version !== version ? -1 : version;\n };\n\n const getCanSendMaxMessageSize = function(remoteIsFirefox) {\n // Every implementation we know can send at least 64 KiB.\n // Note: Although Chrome is technically able to send up to 256 KiB, the\n // data does not reach the other peer reliably.\n // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419\n let canSendMaxMessageSize = 65536;\n if (browserDetails.browser === 'firefox') {\n if (browserDetails.version < 57) {\n if (remoteIsFirefox === -1) {\n // FF < 57 will send in 16 KiB chunks using the deprecated PPID\n // fragmentation.\n canSendMaxMessageSize = 16384;\n } else {\n // However, other FF (and RAWRTC) can reassemble PPID-fragmented\n // messages. Thus, supporting ~2 GiB when sending.\n canSendMaxMessageSize = 2147483637;\n }\n } else if (browserDetails.version < 60) {\n // Currently, all FF >= 57 will reset the remote maximum message size\n // to the default value when a data channel is created at a later\n // stage. :(\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n canSendMaxMessageSize =\n browserDetails.version === 57 ? 65535 : 65536;\n } else {\n // FF >= 60 supports sending ~2 GiB\n canSendMaxMessageSize = 2147483637;\n }\n }\n return canSendMaxMessageSize;\n };\n\n const getMaxMessageSize = function(description, remoteIsFirefox) {\n // Note: 65536 bytes is the default value from the SDP spec. Also,\n // every implementation we know supports receiving 65536 bytes.\n let maxMessageSize = 65536;\n\n // FF 57 has a slightly incorrect default remote max message size, so\n // we need to adjust it here to avoid a failure when sending.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697\n if (browserDetails.browser === 'firefox'\n && browserDetails.version === 57) {\n maxMessageSize = 65535;\n }\n\n const match = SDPUtils.matchPrefix(description.sdp,\n 'a=max-message-size:');\n if (match.length > 0) {\n maxMessageSize = parseInt(match[0].substr(19), 10);\n } else if (browserDetails.browser === 'firefox' &&\n remoteIsFirefox !== -1) {\n // If the maximum message size is not present in the remote SDP and\n // both local and remote are Firefox, the remote peer can receive\n // ~2 GiB.\n maxMessageSize = 2147483637;\n }\n return maxMessageSize;\n };\n\n const origSetRemoteDescription =\n window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription() {\n this._sctp = null;\n // Chrome decided to not expose .sctp in plan-b mode.\n // As usual, adapter.js has to do an 'ugly worakaround'\n // to cover up the mess.\n if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) {\n const {sdpSemantics} = this.getConfiguration();\n if (sdpSemantics === 'plan-b') {\n Object.defineProperty(this, 'sctp', {\n get() {\n return typeof this._sctp === 'undefined' ? null : this._sctp;\n },\n enumerable: true,\n configurable: true,\n });\n }\n }\n\n if (sctpInDescription(arguments[0])) {\n // Check if the remote is FF.\n const isFirefox = getRemoteFirefoxVersion(arguments[0]);\n\n // Get the maximum message size the local peer is capable of sending\n const canSendMMS = getCanSendMaxMessageSize(isFirefox);\n\n // Get the maximum message size of the remote peer.\n const remoteMMS = getMaxMessageSize(arguments[0], isFirefox);\n\n // Determine final maximum message size\n let maxMessageSize;\n if (canSendMMS === 0 && remoteMMS === 0) {\n maxMessageSize = Number.POSITIVE_INFINITY;\n } else if (canSendMMS === 0 || remoteMMS === 0) {\n maxMessageSize = Math.max(canSendMMS, remoteMMS);\n } else {\n maxMessageSize = Math.min(canSendMMS, remoteMMS);\n }\n\n // Create a dummy RTCSctpTransport object and the 'maxMessageSize'\n // attribute.\n const sctp = {};\n Object.defineProperty(sctp, 'maxMessageSize', {\n get() {\n return maxMessageSize;\n }\n });\n this._sctp = sctp;\n }\n\n return origSetRemoteDescription.apply(this, arguments);\n };\n}\n\nexport function shimSendThrowTypeError(window) {\n if (!(window.RTCPeerConnection &&\n 'createDataChannel' in window.RTCPeerConnection.prototype)) {\n return;\n }\n\n // Note: Although Firefox >= 57 has a native implementation, the maximum\n // message size can be reset for all data channels at a later stage.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n\n function wrapDcSend(dc, pc) {\n const origDataChannelSend = dc.send;\n dc.send = function send() {\n const data = arguments[0];\n const length = data.length || data.size || data.byteLength;\n if (dc.readyState === 'open' &&\n pc.sctp && length > pc.sctp.maxMessageSize) {\n throw new TypeError('Message too large (can send a maximum of ' +\n pc.sctp.maxMessageSize + ' bytes)');\n }\n return origDataChannelSend.apply(dc, arguments);\n };\n }\n const origCreateDataChannel =\n window.RTCPeerConnection.prototype.createDataChannel;\n window.RTCPeerConnection.prototype.createDataChannel =\n function createDataChannel() {\n const dataChannel = origCreateDataChannel.apply(this, arguments);\n wrapDcSend(dataChannel, this);\n return dataChannel;\n };\n utils.wrapPeerConnectionEvent(window, 'datachannel', e => {\n wrapDcSend(e.channel, e.target);\n return e;\n });\n}\n\n\n/* shims RTCConnectionState by pretending it is the same as iceConnectionState.\n * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12\n * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect\n * since DTLS failures would be hidden. See\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827\n * for the Firefox tracking bug.\n */\nexport function shimConnectionState(window) {\n if (!window.RTCPeerConnection ||\n 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n const proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get() {\n return this._onconnectionstatechange || null;\n },\n set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange',\n this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n if (cb) {\n this.addEventListener('connectionstatechange',\n this._onconnectionstatechange = cb);\n }\n },\n enumerable: true,\n configurable: true\n });\n\n ['setLocalDescription', 'setRemoteDescription'].forEach((method) => {\n const origMethod = proto[method];\n proto[method] = function() {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = e => {\n const pc = e.target;\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n const newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n return e;\n };\n this.addEventListener('iceconnectionstatechange',\n this._connectionstatechangepoly);\n }\n return origMethod.apply(this, arguments);\n };\n });\n}\n\nexport function removeExtmapAllowMixed(window, browserDetails) {\n /* remove a=extmap-allow-mixed for webrtc.org < M71 */\n if (!window.RTCPeerConnection) {\n return;\n }\n if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) {\n return;\n }\n if (browserDetails.browser === 'safari' && browserDetails.version >= 605) {\n return;\n }\n const nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription(desc) {\n if (desc && desc.sdp && desc.sdp.indexOf('\\na=extmap-allow-mixed') !== -1) {\n const sdp = desc.sdp.split('\\n').filter((line) => {\n return line.trim() !== 'a=extmap-allow-mixed';\n }).join('\\n');\n // Safari enforces read-only-ness of RTCSessionDescription fields.\n if (window.RTCSessionDescription &&\n desc instanceof window.RTCSessionDescription) {\n arguments[0] = new window.RTCSessionDescription({\n type: desc.type,\n sdp,\n });\n } else {\n desc.sdp = sdp;\n }\n }\n return nativeSRD.apply(this, arguments);\n };\n}\n\nexport function shimAddIceCandidateNullOrEmpty(window, browserDetails) {\n // Support for addIceCandidate(null or undefined)\n // as well as addIceCandidate({candidate: \"\", ...})\n // https://bugs.chromium.org/p/chromium/issues/detail?id=978582\n // Note: must be called before other polyfills which change the signature.\n if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n return;\n }\n const nativeAddIceCandidate =\n window.RTCPeerConnection.prototype.addIceCandidate;\n if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) {\n return;\n }\n window.RTCPeerConnection.prototype.addIceCandidate =\n function addIceCandidate() {\n if (!arguments[0]) {\n if (arguments[1]) {\n arguments[1].apply(null);\n }\n return Promise.resolve();\n }\n // Firefox 68+ emits and processes {candidate: \"\", ...}, ignore\n // in older versions.\n // Native support for ignoring exists for Chrome M77+.\n // Safari ignores as well, exact version unknown but works in the same\n // version that also ignores addIceCandidate(null).\n if (((browserDetails.browser === 'chrome' && browserDetails.version < 78)\n || (browserDetails.browser === 'firefox'\n && browserDetails.version < 68)\n || (browserDetails.browser === 'safari'))\n && arguments[0] && arguments[0].candidate === '') {\n return Promise.resolve();\n }\n return nativeAddIceCandidate.apply(this, arguments);\n };\n}\n\n// Note: Make sure to call this ahead of APIs that modify\n// setLocalDescription.length\nexport function shimParameterlessSetLocalDescription(window, browserDetails) {\n if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n return;\n }\n const nativeSetLocalDescription =\n window.RTCPeerConnection.prototype.setLocalDescription;\n if (!nativeSetLocalDescription || nativeSetLocalDescription.length === 0) {\n return;\n }\n window.RTCPeerConnection.prototype.setLocalDescription =\n function setLocalDescription() {\n let desc = arguments[0] || {};\n if (typeof desc !== 'object' || (desc.type && desc.sdp)) {\n return nativeSetLocalDescription.apply(this, arguments);\n }\n // The remaining steps should technically happen when SLD comes off the\n // RTCPeerConnection's operations chain (not ahead of going on it), but\n // this is too difficult to shim. Instead, this shim only covers the\n // common case where the operations chain is empty. This is imperfect, but\n // should cover many cases. Rationale: Even if we can't reduce the glare\n // window to zero on imperfect implementations, there's value in tapping\n // into the perfect negotiation pattern that several browsers support.\n desc = {type: desc.type, sdp: desc.sdp};\n if (!desc.type) {\n switch (this.signalingState) {\n case 'stable':\n case 'have-local-offer':\n case 'have-remote-pranswer':\n desc.type = 'offer';\n break;\n default:\n desc.type = 'answer';\n break;\n }\n }\n if (desc.sdp || (desc.type !== 'offer' && desc.type !== 'answer')) {\n return nativeSetLocalDescription.apply(this, [desc]);\n }\n const func = desc.type === 'offer' ? this.createOffer : this.createAnswer;\n return func.apply(this)\n .then(d => nativeSetLocalDescription.apply(this, [d]));\n };\n}\n"],"names":["window","browserDetails","RTCPeerConnection","browser","version","nativeSRD","prototype","setRemoteDescription","desc","sdp","indexOf","split","filter","line","trim","join","RTCSessionDescription","arguments","type","apply","this","nativeAddIceCandidate","addIceCandidate","length","candidate","Promise","resolve","proto","Object","defineProperty","get","completed","checking","iceConnectionState","enumerable","configurable","_onconnectionstatechange","set","cb","removeEventListener","addEventListener","forEach","method","origMethod","_connectionstatechangepoly","e","pc","target","_lastConnectionState","connectionState","newEvent","Event","dispatchEvent","_sctp","sctpInDescription","description","sections","SDPUtils","splitSections","shift","some","mediaSection","mLine","parseMLine","kind","protocol","getRemoteFirefoxVersion","match","parseInt","getCanSendMaxMessageSize","remoteIsFirefox","canSendMaxMessageSize","getMaxMessageSize","maxMessageSize","matchPrefix","substr","origSetRemoteDescription","_this$getConfiguratio","getConfiguration","sdpSemantics","isFirefox","canSendMMS","remoteMMS","Number","POSITIVE_INFINITY","Math","max","min","sctp","nativeSetLocalDescription","setLocalDescription","_this","_typeof","signalingState","func","createOffer","createAnswer","then","d","RTCIceCandidate","NativeRTCIceCandidate","args","JSON","parse","stringify","nativeCandidate","parsedCandidate","parseCandidate","augmentedCandidate","assign","toJSON","sdpMid","sdpMLineIndex","usernameFragment","utils","value","writable","relayProtocol","priority","origCreateDataChannel","createDataChannel","dataChannel","wrapDcSend","channel","dc","origDataChannelSend","send","data","size","byteLength","readyState","TypeError"],"mappings":"+NAuVO,SAAgCA,EAAQC,GAE7C,GAAKD,EAAOE,qBAGmB,WAA3BD,EAAeE,SAAwBF,EAAeG,SAAW,IAGtC,WAA3BH,EAAeE,SAAwBF,EAAeG,SAAW,KAArE,CAGA,IAAMC,EAAYL,EAAOE,kBAAkBI,UAAUC,qBACrDP,EAAOE,kBAAkBI,UAAUC,qBACnC,SAA8BC,GAC5B,GAAIA,GAAQA,EAAKC,MAAuD,IAAhDD,EAAKC,IAAIC,QAAQ,0BAAkC,CACzE,IAAMD,EAAMD,EAAKC,IAAIE,MAAM,MAAMC,QAAO,SAACC,GACvC,MAAuB,yBAAhBA,EAAKC,MACd,IAAGC,KAAK,MAEJf,EAAOgB,uBACPR,aAAgBR,EAAOgB,sBACzBC,UAAU,GAAK,IAAIjB,EAAOgB,sBAAsB,CAC9CE,KAAMV,EAAKU,KACXT,IAAAA,IAGFD,EAAKC,IAAMA,CAEf,CACA,OAAOJ,EAAUc,MAAMC,KAAMH,WAnB/B,CAqBF,yCAEO,SAAwCjB,EAAQC,GAKrD,GAAMD,EAAOE,mBAAqBF,EAAOE,kBAAkBI,UAA3D,CAGA,IAAMe,EACFrB,EAAOE,kBAAkBI,UAAUgB,gBAClCD,GAA0D,IAAjCA,EAAsBE,SAGpDvB,EAAOE,kBAAkBI,UAAUgB,gBACjC,WACE,OAAKL,UAAU,IAWkB,WAA3BhB,EAAeE,SAAwBF,EAAeG,QAAU,IAClC,YAA3BH,EAAeE,SACZF,EAAeG,QAAU,IACD,WAA3BH,EAAeE,UACjBc,UAAU,IAAiC,KAA3BA,UAAU,GAAG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AAoBnG,EAAOmG,iBAAmB,kBACtDnG,EAAOmG,gBAAgB7F,WAM3B4G,EAAAA,wBAA8BlH,EAAQ,gBAAgB,SAAA6C,GACpD,GAAIA,EAAErB,UAAW,CACf,IAAMkF,EAAkBjD,EAAAA,QAASkD,eAAe9D,EAAErB,UAAUA,WAC/B,UAAzBkF,EAAgBxF,OAGlB2B,EAAErB,UAAU6F,cAAgB,CAC1B,EAAG,MACH,EAAG,MACH,EAAG,OACHX,EAAgBY,UAAY,IAElC,CACA,OAAOzE,CACT,GACF,iCA0JO,SAAgC7C,GACrC,GAAMA,EAAOE,mBACT,sBAAuBF,EAAOE,kBAAkBI,UADpD,CAsBA,IAAMiH,EACJvH,EAAOE,kBAAkBI,UAAUkH,kBACrCxH,EAAOE,kBAAkBI,UAAUkH,kBACjC,WACE,IAAMC,EAAcF,EAAsBpG,MAAMC,KAAMH,WAEtD,OADAyG,EAAWD,EAAarG,MACjBqG,GAEXP,EAAAA,wBAA8BlH,EAAQ,eAAe,SAAA6C,GAEnD,OADA6E,EAAW7E,EAAE8E,QAAS9E,EAAEE,QACjBF,CACT,GA9BA,CAMA,SAAS6E,EAAWE,EAAI9E,GACtB,IAAM+E,EAAsBD,EAAGE,KAC/BF,EAAGE,KAAO,WACR,IAAMC,EAAO9G,UAAU,GACjBM,EAASwG,EAAKxG,QAAUwG,EAAKC,MAAQD,EAAKE,WAChD,GAAsB,SAAlBL,EAAGM,YACHpF,EAAG0C,MAAQjE,EAASuB,EAAG0C,KAAKf,eAC9B,MAAM,IAAI0D,UAAU,4CAClBrF,EAAG0C,KAAKf,eAAiB,WAE7B,OAAOoD,EAAoB1G,MAAMyG,EAAI3G,WAEzC,CAaF"}
1
+ {"version":3,"file":"common_shim.js","sources":["../../../../../node_modules/webrtc-adapter/src/js/common_shim.js"],"sourcesContent":["/*\n * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved.\n *\n * Use of this source code is governed by a BSD-style license\n * that can be found in the LICENSE file in the root of the source\n * tree.\n */\n/* eslint-env node */\n'use strict';\n\nimport SDPUtils from 'sdp';\nimport * as utils from './utils';\n\nexport function shimRTCIceCandidate(window) {\n // foundation is arbitrarily chosen as an indicator for full support for\n // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface\n if (!window.RTCIceCandidate || (window.RTCIceCandidate && 'foundation' in\n window.RTCIceCandidate.prototype)) {\n return;\n }\n\n const NativeRTCIceCandidate = window.RTCIceCandidate;\n window.RTCIceCandidate = function RTCIceCandidate(args) {\n // Remove the a= which shouldn't be part of the candidate string.\n if (typeof args === 'object' && args.candidate &&\n args.candidate.indexOf('a=') === 0) {\n args = JSON.parse(JSON.stringify(args));\n args.candidate = args.candidate.substr(2);\n }\n\n if (args.candidate && args.candidate.length) {\n // Augment the native candidate with the parsed fields.\n const nativeCandidate = new NativeRTCIceCandidate(args);\n const parsedCandidate = SDPUtils.parseCandidate(args.candidate);\n const augmentedCandidate = Object.assign(nativeCandidate,\n parsedCandidate);\n\n // Add a serializer that does not serialize the extra attributes.\n augmentedCandidate.toJSON = function toJSON() {\n return {\n candidate: augmentedCandidate.candidate,\n sdpMid: augmentedCandidate.sdpMid,\n sdpMLineIndex: augmentedCandidate.sdpMLineIndex,\n usernameFragment: augmentedCandidate.usernameFragment,\n };\n };\n return augmentedCandidate;\n }\n return new NativeRTCIceCandidate(args);\n };\n window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype;\n\n // Hook up the augmented candidate in onicecandidate and\n // addEventListener('icecandidate', ...)\n utils.wrapPeerConnectionEvent(window, 'icecandidate', e => {\n if (e.candidate) {\n Object.defineProperty(e, 'candidate', {\n value: new window.RTCIceCandidate(e.candidate),\n writable: 'false'\n });\n }\n return e;\n });\n}\n\nexport function shimRTCIceCandidateRelayProtocol(window) {\n if (!window.RTCIceCandidate || (window.RTCIceCandidate && 'relayProtocol' in\n window.RTCIceCandidate.prototype)) {\n return;\n }\n\n // Hook up the augmented candidate in onicecandidate and\n // addEventListener('icecandidate', ...)\n utils.wrapPeerConnectionEvent(window, 'icecandidate', e => {\n if (e.candidate) {\n const parsedCandidate = SDPUtils.parseCandidate(e.candidate.candidate);\n if (parsedCandidate.type === 'relay') {\n // This is a libwebrtc-specific mapping of local type preference\n // to relayProtocol.\n e.candidate.relayProtocol = {\n 0: 'tls',\n 1: 'tcp',\n 2: 'udp',\n }[parsedCandidate.priority >> 24];\n }\n }\n return e;\n });\n}\n\nexport function shimMaxMessageSize(window, browserDetails) {\n if (!window.RTCPeerConnection) {\n return;\n }\n\n if (!('sctp' in window.RTCPeerConnection.prototype)) {\n Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', {\n get() {\n return typeof this._sctp === 'undefined' ? null : this._sctp;\n }\n });\n }\n\n const sctpInDescription = function(description) {\n if (!description || !description.sdp) {\n return false;\n }\n const sections = SDPUtils.splitSections(description.sdp);\n sections.shift();\n return sections.some(mediaSection => {\n const mLine = SDPUtils.parseMLine(mediaSection);\n return mLine && mLine.kind === 'application'\n && mLine.protocol.indexOf('SCTP') !== -1;\n });\n };\n\n const getRemoteFirefoxVersion = function(description) {\n // TODO: Is there a better solution for detecting Firefox?\n const match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\\d+)/);\n if (match === null || match.length < 2) {\n return -1;\n }\n const version = parseInt(match[1], 10);\n // Test for NaN (yes, this is ugly)\n return version !== version ? -1 : version;\n };\n\n const getCanSendMaxMessageSize = function(remoteIsFirefox) {\n // Every implementation we know can send at least 64 KiB.\n // Note: Although Chrome is technically able to send up to 256 KiB, the\n // data does not reach the other peer reliably.\n // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419\n let canSendMaxMessageSize = 65536;\n if (browserDetails.browser === 'firefox') {\n if (browserDetails.version < 57) {\n if (remoteIsFirefox === -1) {\n // FF < 57 will send in 16 KiB chunks using the deprecated PPID\n // fragmentation.\n canSendMaxMessageSize = 16384;\n } else {\n // However, other FF (and RAWRTC) can reassemble PPID-fragmented\n // messages. Thus, supporting ~2 GiB when sending.\n canSendMaxMessageSize = 2147483637;\n }\n } else if (browserDetails.version < 60) {\n // Currently, all FF >= 57 will reset the remote maximum message size\n // to the default value when a data channel is created at a later\n // stage. :(\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n canSendMaxMessageSize =\n browserDetails.version === 57 ? 65535 : 65536;\n } else {\n // FF >= 60 supports sending ~2 GiB\n canSendMaxMessageSize = 2147483637;\n }\n }\n return canSendMaxMessageSize;\n };\n\n const getMaxMessageSize = function(description, remoteIsFirefox) {\n // Note: 65536 bytes is the default value from the SDP spec. Also,\n // every implementation we know supports receiving 65536 bytes.\n let maxMessageSize = 65536;\n\n // FF 57 has a slightly incorrect default remote max message size, so\n // we need to adjust it here to avoid a failure when sending.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697\n if (browserDetails.browser === 'firefox'\n && browserDetails.version === 57) {\n maxMessageSize = 65535;\n }\n\n const match = SDPUtils.matchPrefix(description.sdp,\n 'a=max-message-size:');\n if (match.length > 0) {\n maxMessageSize = parseInt(match[0].substr(19), 10);\n } else if (browserDetails.browser === 'firefox' &&\n remoteIsFirefox !== -1) {\n // If the maximum message size is not present in the remote SDP and\n // both local and remote are Firefox, the remote peer can receive\n // ~2 GiB.\n maxMessageSize = 2147483637;\n }\n return maxMessageSize;\n };\n\n const origSetRemoteDescription =\n window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription() {\n this._sctp = null;\n // Chrome decided to not expose .sctp in plan-b mode.\n // As usual, adapter.js has to do an 'ugly worakaround'\n // to cover up the mess.\n if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) {\n const {sdpSemantics} = this.getConfiguration();\n if (sdpSemantics === 'plan-b') {\n Object.defineProperty(this, 'sctp', {\n get() {\n return typeof this._sctp === 'undefined' ? null : this._sctp;\n },\n enumerable: true,\n configurable: true,\n });\n }\n }\n\n if (sctpInDescription(arguments[0])) {\n // Check if the remote is FF.\n const isFirefox = getRemoteFirefoxVersion(arguments[0]);\n\n // Get the maximum message size the local peer is capable of sending\n const canSendMMS = getCanSendMaxMessageSize(isFirefox);\n\n // Get the maximum message size of the remote peer.\n const remoteMMS = getMaxMessageSize(arguments[0], isFirefox);\n\n // Determine final maximum message size\n let maxMessageSize;\n if (canSendMMS === 0 && remoteMMS === 0) {\n maxMessageSize = Number.POSITIVE_INFINITY;\n } else if (canSendMMS === 0 || remoteMMS === 0) {\n maxMessageSize = Math.max(canSendMMS, remoteMMS);\n } else {\n maxMessageSize = Math.min(canSendMMS, remoteMMS);\n }\n\n // Create a dummy RTCSctpTransport object and the 'maxMessageSize'\n // attribute.\n const sctp = {};\n Object.defineProperty(sctp, 'maxMessageSize', {\n get() {\n return maxMessageSize;\n }\n });\n this._sctp = sctp;\n }\n\n return origSetRemoteDescription.apply(this, arguments);\n };\n}\n\nexport function shimSendThrowTypeError(window) {\n if (!(window.RTCPeerConnection &&\n 'createDataChannel' in window.RTCPeerConnection.prototype)) {\n return;\n }\n\n // Note: Although Firefox >= 57 has a native implementation, the maximum\n // message size can be reset for all data channels at a later stage.\n // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831\n\n function wrapDcSend(dc, pc) {\n const origDataChannelSend = dc.send;\n dc.send = function send() {\n const data = arguments[0];\n const length = data.length || data.size || data.byteLength;\n if (dc.readyState === 'open' &&\n pc.sctp && length > pc.sctp.maxMessageSize) {\n throw new TypeError('Message too large (can send a maximum of ' +\n pc.sctp.maxMessageSize + ' bytes)');\n }\n return origDataChannelSend.apply(dc, arguments);\n };\n }\n const origCreateDataChannel =\n window.RTCPeerConnection.prototype.createDataChannel;\n window.RTCPeerConnection.prototype.createDataChannel =\n function createDataChannel() {\n const dataChannel = origCreateDataChannel.apply(this, arguments);\n wrapDcSend(dataChannel, this);\n return dataChannel;\n };\n utils.wrapPeerConnectionEvent(window, 'datachannel', e => {\n wrapDcSend(e.channel, e.target);\n return e;\n });\n}\n\n\n/* shims RTCConnectionState by pretending it is the same as iceConnectionState.\n * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12\n * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect\n * since DTLS failures would be hidden. See\n * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827\n * for the Firefox tracking bug.\n */\nexport function shimConnectionState(window) {\n if (!window.RTCPeerConnection ||\n 'connectionState' in window.RTCPeerConnection.prototype) {\n return;\n }\n const proto = window.RTCPeerConnection.prototype;\n Object.defineProperty(proto, 'connectionState', {\n get() {\n return {\n completed: 'connected',\n checking: 'connecting'\n }[this.iceConnectionState] || this.iceConnectionState;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(proto, 'onconnectionstatechange', {\n get() {\n return this._onconnectionstatechange || null;\n },\n set(cb) {\n if (this._onconnectionstatechange) {\n this.removeEventListener('connectionstatechange',\n this._onconnectionstatechange);\n delete this._onconnectionstatechange;\n }\n if (cb) {\n this.addEventListener('connectionstatechange',\n this._onconnectionstatechange = cb);\n }\n },\n enumerable: true,\n configurable: true\n });\n\n ['setLocalDescription', 'setRemoteDescription'].forEach((method) => {\n const origMethod = proto[method];\n proto[method] = function() {\n if (!this._connectionstatechangepoly) {\n this._connectionstatechangepoly = e => {\n const pc = e.target;\n if (pc._lastConnectionState !== pc.connectionState) {\n pc._lastConnectionState = pc.connectionState;\n const newEvent = new Event('connectionstatechange', e);\n pc.dispatchEvent(newEvent);\n }\n return e;\n };\n this.addEventListener('iceconnectionstatechange',\n this._connectionstatechangepoly);\n }\n return origMethod.apply(this, arguments);\n };\n });\n}\n\nexport function removeExtmapAllowMixed(window, browserDetails) {\n /* remove a=extmap-allow-mixed for webrtc.org < M71 */\n if (!window.RTCPeerConnection) {\n return;\n }\n if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) {\n return;\n }\n if (browserDetails.browser === 'safari' && browserDetails.version >= 605) {\n return;\n }\n const nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription;\n window.RTCPeerConnection.prototype.setRemoteDescription =\n function setRemoteDescription(desc) {\n if (desc && desc.sdp && desc.sdp.indexOf('\\na=extmap-allow-mixed') !== -1) {\n const sdp = desc.sdp.split('\\n').filter((line) => {\n return line.trim() !== 'a=extmap-allow-mixed';\n }).join('\\n');\n // Safari enforces read-only-ness of RTCSessionDescription fields.\n if (window.RTCSessionDescription &&\n desc instanceof window.RTCSessionDescription) {\n arguments[0] = new window.RTCSessionDescription({\n type: desc.type,\n sdp,\n });\n } else {\n desc.sdp = sdp;\n }\n }\n return nativeSRD.apply(this, arguments);\n };\n}\n\nexport function shimAddIceCandidateNullOrEmpty(window, browserDetails) {\n // Support for addIceCandidate(null or undefined)\n // as well as addIceCandidate({candidate: \"\", ...})\n // https://bugs.chromium.org/p/chromium/issues/detail?id=978582\n // Note: must be called before other polyfills which change the signature.\n if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n return;\n }\n const nativeAddIceCandidate =\n window.RTCPeerConnection.prototype.addIceCandidate;\n if (!nativeAddIceCandidate || nativeAddIceCandidate.length === 0) {\n return;\n }\n window.RTCPeerConnection.prototype.addIceCandidate =\n function addIceCandidate() {\n if (!arguments[0]) {\n if (arguments[1]) {\n arguments[1].apply(null);\n }\n return Promise.resolve();\n }\n // Firefox 68+ emits and processes {candidate: \"\", ...}, ignore\n // in older versions.\n // Native support for ignoring exists for Chrome M77+.\n // Safari ignores as well, exact version unknown but works in the same\n // version that also ignores addIceCandidate(null).\n if (((browserDetails.browser === 'chrome' && browserDetails.version < 78)\n || (browserDetails.browser === 'firefox'\n && browserDetails.version < 68)\n || (browserDetails.browser === 'safari'))\n && arguments[0] && arguments[0].candidate === '') {\n return Promise.resolve();\n }\n return nativeAddIceCandidate.apply(this, arguments);\n };\n}\n\n// Note: Make sure to call this ahead of APIs that modify\n// setLocalDescription.length\nexport function shimParameterlessSetLocalDescription(window, browserDetails) {\n if (!(window.RTCPeerConnection && window.RTCPeerConnection.prototype)) {\n return;\n }\n const nativeSetLocalDescription =\n window.RTCPeerConnection.prototype.setLocalDescription;\n if (!nativeSetLocalDescription || nativeSetLocalDescription.length === 0) {\n return;\n }\n window.RTCPeerConnection.prototype.setLocalDescription =\n function setLocalDescription() {\n let desc = arguments[0] || {};\n if (typeof desc !== 'object' || (desc.type && desc.sdp)) {\n return nativeSetLocalDescription.apply(this, arguments);\n }\n // The remaining steps should technically happen when SLD comes off the\n // RTCPeerConnection's operations chain (not ahead of going on it), but\n // this is too difficult to shim. Instead, this shim only covers the\n // common case where the operations chain is empty. This is imperfect, but\n // should cover many cases. Rationale: Even if we can't reduce the glare\n // window to zero on imperfect implementations, there's value in tapping\n // into the perfect negotiation pattern that several browsers support.\n desc = {type: desc.type, sdp: desc.sdp};\n if (!desc.type) {\n switch (this.signalingState) {\n case 'stable':\n case 'have-local-offer':\n case 'have-remote-pranswer':\n desc.type = 'offer';\n break;\n default:\n desc.type = 'answer';\n break;\n }\n }\n if (desc.sdp || (desc.type !== 'offer' && desc.type !== 'answer')) {\n return nativeSetLocalDescription.apply(this, [desc]);\n }\n const func = desc.type === 'offer' ? this.createOffer : this.createAnswer;\n return func.apply(this)\n .then(d => nativeSetLocalDescription.apply(this, [d]));\n };\n}\n"],"names":["window","browserDetails","RTCPeerConnection","browser","version","nativeSRD","prototype","setRemoteDescription","desc","sdp","indexOf","split","filter","line","trim","join","RTCSessionDescription","arguments","type","apply","this","nativeAddIceCandidate","addIceCandidate","length","candidate","Promise","resolve","proto","Object","defineProperty","get","completed","checking","iceConnectionState","enumerable","configurable","_onconnectionstatechange","set","cb","removeEventListener","addEventListener","forEach","method","origMethod","_connectionstatechangepoly","e","pc","target","_lastConnectionState","connectionState","newEvent","Event","dispatchEvent","_sctp","sctpInDescription","description","sections","SDPUtils","splitSections","shift","some","mediaSection","mLine","parseMLine","kind","protocol","getRemoteFirefoxVersion","match","parseInt","getCanSendMaxMessageSize","remoteIsFirefox","canSendMaxMessageSize","getMaxMessageSize","maxMessageSize","matchPrefix","substr","origSetRemoteDescription","sdpSemantics","getConfiguration","isFirefox","canSendMMS","remoteMMS","Number","POSITIVE_INFINITY","Math","max","min","sctp","nativeSetLocalDescription","setLocalDescription","signalingState","func","createOffer","createAnswer","then","d","RTCIceCandidate","NativeRTCIceCandidate","args","JSON","parse","stringify","nativeCandidate","parsedCandidate","parseCandidate","augmentedCandidate","assign","toJSON","sdpMid","sdpMLineIndex","usernameFragment","utils","value","writable","relayProtocol","priority","wrapDcSend","dc","origDataChannelSend","send","data","size","byteLength","readyState","TypeError","origCreateDataChannel","createDataChannel","dataChannel","channel"],"mappings":"gKAuVO,SAAgCA,EAAQC,GAE7C,IAAKD,EAAOE,kBACV,OAEF,GAA+B,WAA3BD,EAAeE,SAAwBF,EAAeG,SAAW,GACnE,OAEF,GAA+B,WAA3BH,EAAeE,SAAwBF,EAAeG,SAAW,IACnE,OAEF,MAAMC,EAAYL,EAAOE,kBAAkBI,UAAUC,qBACrDP,EAAOE,kBAAkBI,UAAUC,qBACnC,SAA8BC,GAC5B,GAAIA,GAAQA,EAAKC,MAAuD,IAAhDD,EAAKC,IAAIC,QAAQ,0BAAkC,CACzE,MAAMD,EAAMD,EAAKC,IAAIE,MAAM,MAAMC,QAAQC,GAChB,yBAAhBA,EAAKC,SACXC,KAAK,MAEJf,EAAOgB,uBACPR,aAAgBR,EAAOgB,sBACzBC,UAAU,GAAK,IAAIjB,EAAOgB,sBAAsB,CAC9CE,KAAMV,EAAKU,KACXT,QAGFD,EAAKC,IAAMA,CAEf,CACA,OAAOJ,EAAUc,MAAMC,KAAMH,WAEjC,yCAEO,SAAwCjB,EAAQC,GAKrD,IAAMD,EAAOE,oBAAqBF,EAAOE,kBAAkBI,UACzD,OAEF,MAAMe,EACFrB,EAAOE,kBAAkBI,UAAUgB,gBAClCD,GAA0D,IAAjCA,EAAsBE,SAGpDvB,EAAOE,kBAAkBI,UAAUgB,gBACjC,WACE,OAAKL,UAAU,IAWkB,WAA3BhB,EAAeE,SAAwBF,EAAeG,QAAU,IAClC,YAA3BH,EAAeE,SACZF,EAAeG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EAAErB,UAAW,CACf,MAAM+E,EAAkB9C,EAAAA,QAAS+C,eAAe3D,EAAErB,UAAUA,WAC/B,UAAzB+E,EAAgBrF,OAGlB2B,EAAErB,UAAU0F,cAAgB,CAC1B,EAAG,MACH,EAAG,MACH,EAAG,OACHX,EAAgBY,UAAY,IAElC,CACA,OAAOtE,CAAC,GAEZ,iCA0JO,SAAgC7C,GACrC,IAAMA,EAAOE,qBACT,sBAAuBF,EAAOE,kBAAkBI,WAClD,OAOF,SAAS8G,EAAWC,EAAIvE,GACtB,MAAMwE,EAAsBD,EAAGE,KAC/BF,EAAGE,KAAO,WACR,MAAMC,EAAOvG,UAAU,GACjBM,EAASiG,EAAKjG,QAAUiG,EAAKC,MAAQD,EAAKE,WAChD,GAAsB,SAAlBL,EAAGM,YACH7E,EAAGyC,MAAQhE,EAASuB,EAAGyC,KAAKd,eAC9B,MAAM,IAAImD,UAAU,4CAClB9E,EAAGyC,KAAKd,eAAiB,WAE7B,OAAO6C,EAAoBnG,MAAMkG,EAAIpG,WAEzC,CACA,MAAM4G,EACJ7H,EAAOE,kBAAkBI,UAAUwH,kBACrC9H,EAAOE,kBAAkBI,UAAUwH,kBACjC,WACE,MAAMC,EAAcF,EAAsB1G,MAAMC,KAAMH,WAEtD,OADAmG,EAAWW,EAAa3G,MACjB2G,GAEXhB,0BAA8B/G,EAAQ,eAAe6C,IACnDuE,EAAWvE,EAAEmF,QAASnF,EAAEE,QACjBF,IAEX"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../../../../../_virtual/_rollupPluginBabelHelpers.js"),t=require("../utils.js"),r=require("./getusermedia.js"),n=require("./getdisplaymedia.js");exports.shimGetUserMedia=r.shimGetUserMedia,exports.shimGetDisplayMedia=n.shimGetDisplayMedia,exports.shimAddTransceiver=function(t){if("object"===e.typeof(t)&&t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype.addTransceiver;r&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];var t=arguments[1]&&arguments[1].sendEncodings;void 0===t&&(t=[]);var n=(t=e.toConsumableArray(t)).length>0;n&&t.forEach((function(e){if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));var o=r.apply(this,arguments);if(n){var i=o.sender,a=i.getParameters();(!("encodings"in a)||1===a.encodings.length&&0===Object.keys(a.encodings[0]).length)&&(a.encodings=t,i.sendEncodings=t,this.setParametersPromises.push(i.setParameters(a).then((function(){delete i.sendEncodings})).catch((function(){delete i.sendEncodings}))))}return o})}},exports.shimCreateAnswer=function(t){if("object"===e.typeof(t)&&t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){var e=arguments,t=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return r.apply(t,e)})).finally((function(){t.setParametersPromises=[]})):r.apply(this,arguments)}}},exports.shimCreateOffer=function(t){if("object"===e.typeof(t)&&t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){var e=arguments,t=this;return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((function(){return r.apply(t,e)})).finally((function(){t.setParametersPromises=[]})):r.apply(this,arguments)}}},exports.shimGetParameters=function(t){if("object"===e.typeof(t)&&t.RTCRtpSender){var r=t.RTCRtpSender.prototype.getParameters;r&&(t.RTCRtpSender.prototype.getParameters=function(){var e=r.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})}},exports.shimOnTrack=function(t){"object"===e.typeof(t)&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})},exports.shimPeerConnection=function(t,r){if("object"===e.typeof(t)&&(t.RTCPeerConnection||t.mozRTCPeerConnection)){!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),r.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(r){var n=t.RTCPeerConnection.prototype[r],o=e.defineProperty({},r,(function(){return arguments[0]=new("addIceCandidate"===r?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}));t.RTCPeerConnection.prototype[r]=o[r]}));var n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},o=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){var e=Array.prototype.slice.call(arguments),t=e[0],i=e[1],a=e[2];return o.apply(this,[t||null]).then((function(e){if(r.version<53&&!i)try{e.forEach((function(e){e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach((function(t,r){e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(i,a)}}},exports.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},exports.shimReceiverGetStats=function(r){if("object"===e.typeof(r)&&r.RTCPeerConnection&&r.RTCRtpSender&&(!r.RTCRtpSender||!("getStats"in r.RTCRtpReceiver.prototype))){var n=r.RTCPeerConnection.prototype.getReceivers;n&&(r.RTCPeerConnection.prototype.getReceivers=function(){var e=this,t=n.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t}),t.wrapPeerConnectionEvent(r,"track",(function(e){return e.receiver._pc=e.srcElement,e})),r.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}},exports.shimRemoveStream=function(e){e.RTCPeerConnection&&!("removeStream"in e.RTCPeerConnection.prototype)&&(e.RTCPeerConnection.prototype.removeStream=function(e){var r=this;t.deprecated("removeStream","removeTrack"),this.getSenders().forEach((function(t){t.track&&e.getTracks().includes(t.track)&&r.removeTrack(t)}))})},exports.shimSenderGetStats=function(t){if("object"===e.typeof(t)&&t.RTCPeerConnection&&t.RTCRtpSender&&(!t.RTCRtpSender||!("getStats"in t.RTCRtpSender.prototype))){var r=t.RTCPeerConnection.prototype.getSenders;r&&(t.RTCPeerConnection.prototype.getSenders=function(){var e=this,t=r.apply(this,[]);return t.forEach((function(t){return t._pc=e})),t});var n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){var e=n.apply(this,arguments);return e._pc=this,e}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}};
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../utils.js"),t=require("./getusermedia.js"),n=require("./getdisplaymedia.js");exports.shimGetUserMedia=t.shimGetUserMedia,exports.shimGetDisplayMedia=n.shimGetDisplayMedia,exports.shimAddTransceiver=function(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.addTransceiver;t&&(e.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];let e=arguments[1]&&arguments[1].sendEncodings;void 0===e&&(e=[]),e=[...e];const n=e.length>0;n&&e.forEach((e=>{if("rid"in e){if(!/^[a-z0-9]{0,16}$/i.test(e.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in e&&!(parseFloat(e.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in e&&!(parseFloat(e.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")}));const r=t.apply(this,arguments);if(n){const{sender:t}=r,n=t.getParameters();(!("encodings"in n)||1===n.encodings.length&&0===Object.keys(n.encodings[0]).length)&&(n.encodings=e,t.sendEncodings=e,this.setParametersPromises.push(t.setParameters(n).then((()=>{delete t.sendEncodings})).catch((()=>{delete t.sendEncodings}))))}return r})},exports.shimCreateAnswer=function(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createAnswer;e.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}},exports.shimCreateOffer=function(e){if("object"!=typeof e||!e.RTCPeerConnection)return;const t=e.RTCPeerConnection.prototype.createOffer;e.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then((()=>t.apply(this,arguments))).finally((()=>{this.setParametersPromises=[]})):t.apply(this,arguments)}},exports.shimGetParameters=function(e){if("object"!=typeof e||!e.RTCRtpSender)return;const t=e.RTCRtpSender.prototype.getParameters;t&&(e.RTCRtpSender.prototype.getParameters=function(){const e=t.apply(this,arguments);return"encodings"in e||(e.encodings=[].concat(this.sendEncodings||[{}])),e})},exports.shimOnTrack=function(e){"object"==typeof e&&e.RTCTrackEvent&&"receiver"in e.RTCTrackEvent.prototype&&!("transceiver"in e.RTCTrackEvent.prototype)&&Object.defineProperty(e.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})},exports.shimPeerConnection=function(e,t){if("object"!=typeof e||!e.RTCPeerConnection&&!e.mozRTCPeerConnection)return;!e.RTCPeerConnection&&e.mozRTCPeerConnection&&(e.RTCPeerConnection=e.mozRTCPeerConnection),t.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach((function(t){const n=e.RTCPeerConnection.prototype[t],r={[t](){return arguments[0]=new("addIceCandidate"===t?e.RTCIceCandidate:e.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};e.RTCPeerConnection.prototype[t]=r[t]}));const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=e.RTCPeerConnection.prototype.getStats;e.RTCPeerConnection.prototype.getStats=function(){const[e,o,i]=arguments;return r.apply(this,[e||null]).then((e=>{if(t.version<53&&!o)try{e.forEach((e=>{e.type=n[e.type]||e.type}))}catch(t){if("TypeError"!==t.name)throw t;e.forEach(((t,r)=>{e.set(r,Object.assign({},t,{type:n[t.type]||t.type}))}))}return e})).then(o,i)}},exports.shimRTCDataChannel=function(e){e.DataChannel&&!e.RTCDataChannel&&(e.RTCDataChannel=e.DataChannel)},exports.shimReceiverGetStats=function(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const n=t.RTCPeerConnection.prototype.getReceivers;n&&(t.RTCPeerConnection.prototype.getReceivers=function(){const e=n.apply(this,[]);return e.forEach((e=>e._pc=this)),e}),e.wrapPeerConnectionEvent(t,"track",(e=>(e.receiver._pc=e.srcElement,e))),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}},exports.shimRemoveStream=function(t){t.RTCPeerConnection&&!("removeStream"in t.RTCPeerConnection.prototype)&&(t.RTCPeerConnection.prototype.removeStream=function(t){e.deprecated("removeStream","removeTrack"),this.getSenders().forEach((e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)}))})},exports.shimSenderGetStats=function(e){if("object"!=typeof e||!e.RTCPeerConnection||!e.RTCRtpSender)return;if(e.RTCRtpSender&&"getStats"in e.RTCRtpSender.prototype)return;const t=e.RTCPeerConnection.prototype.getSenders;t&&(e.RTCPeerConnection.prototype.getSenders=function(){const e=t.apply(this,[]);return e.forEach((e=>e._pc=this)),e});const n=e.RTCPeerConnection.prototype.addTrack;n&&(e.RTCPeerConnection.prototype.addTrack=function(){const e=n.apply(this,arguments);return e._pc=this,e}),e.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}};
2
2
  //# sourceMappingURL=firefox_shim.js.map