@techsee/techsee-media-service 999.19.3-alphasap → 999.19.6-nodejs20

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 (213) hide show
  1. package/README.md +27 -28
  2. package/lib/LocalStreamManager.d.ts +1 -0
  3. package/lib/LocalStreamManager.d.ts.map +1 -1
  4. package/lib/LocalStreamManager.js +82 -84
  5. package/lib/LocalStreamManager.js.map +1 -1
  6. package/lib/MediaConstants.d.ts +20 -3
  7. package/lib/MediaConstants.d.ts.map +1 -1
  8. package/lib/MediaConstants.js +31 -13
  9. package/lib/MediaConstants.js.map +1 -1
  10. package/lib/MediaContracts.d.ts +7 -1
  11. package/lib/MediaContracts.d.ts.map +1 -1
  12. package/lib/MediaContracts.js +1 -4
  13. package/lib/MediaContracts.js.map +1 -1
  14. package/lib/MediaPublisher.d.ts +1 -0
  15. package/lib/MediaPublisher.d.ts.map +1 -1
  16. package/lib/MediaPublisher.js +7 -10
  17. package/lib/MediaPublisher.js.map +1 -1
  18. package/lib/MediaServiceBase.d.ts +1 -0
  19. package/lib/MediaServiceBase.d.ts.map +1 -1
  20. package/lib/MediaServiceBase.js +169 -198
  21. package/lib/MediaServiceBase.js.map +1 -1
  22. package/lib/MediaSession/MediaServer.d.ts +1 -0
  23. package/lib/MediaSession/MediaServer.d.ts.map +1 -1
  24. package/lib/MediaSession/MediaServer.js +62 -74
  25. package/lib/MediaSession/MediaServer.js.map +1 -1
  26. package/lib/MediaSession/MediaSessionBase.d.ts +1 -0
  27. package/lib/MediaSession/MediaSessionBase.d.ts.map +1 -1
  28. package/lib/MediaSession/MediaSessionBase.js +19 -23
  29. package/lib/MediaSession/MediaSessionBase.js.map +1 -1
  30. package/lib/MediaSession/SessionOpentok.d.ts +1 -0
  31. package/lib/MediaSession/SessionOpentok.d.ts.map +1 -1
  32. package/lib/MediaSession/SessionOpentok.js +51 -80
  33. package/lib/MediaSession/SessionOpentok.js.map +1 -1
  34. package/lib/MediaSession/SessionTurn.d.ts +1 -0
  35. package/lib/MediaSession/SessionTurn.d.ts.map +1 -1
  36. package/lib/MediaSession/SessionTurn.js +109 -151
  37. package/lib/MediaSession/SessionTurn.js.map +1 -1
  38. package/lib/MediaSession/TurnConstants.d.ts +1 -0
  39. package/lib/MediaSession/TurnConstants.d.ts.map +1 -1
  40. package/lib/MediaSession/TurnConstants.js +1 -16
  41. package/lib/MediaSession/TurnConstants.js.map +1 -1
  42. package/lib/MediaSubscriber.d.ts +1 -0
  43. package/lib/MediaSubscriber.d.ts.map +1 -1
  44. package/lib/MediaSubscriber.js +37 -43
  45. package/lib/MediaSubscriber.js.map +1 -1
  46. package/lib/MediaUtils/Compatibility.d.ts +3 -0
  47. package/lib/MediaUtils/Compatibility.d.ts.map +1 -1
  48. package/lib/MediaUtils/Compatibility.js +76 -34
  49. package/lib/MediaUtils/Compatibility.js.map +1 -1
  50. package/lib/MediaUtils/MediaDomUtils.d.ts +4 -2
  51. package/lib/MediaUtils/MediaDomUtils.d.ts.map +1 -1
  52. package/lib/MediaUtils/MediaDomUtils.js +64 -62
  53. package/lib/MediaUtils/MediaDomUtils.js.map +1 -1
  54. package/lib/MediaUtils/MediaTracer.d.ts +1 -0
  55. package/lib/MediaUtils/MediaTracer.d.ts.map +1 -1
  56. package/lib/MediaUtils/MediaTracer.js +2 -5
  57. package/lib/MediaUtils/MediaTracer.js.map +1 -1
  58. package/lib/MediaUtils/index.d.ts +2 -0
  59. package/lib/MediaUtils/index.d.ts.map +1 -0
  60. package/lib/MediaUtils/index.js +6 -0
  61. package/lib/MediaUtils/index.js.map +1 -0
  62. package/lib/MultiParty/DetectWebRtcService.d.ts +17 -14
  63. package/lib/MultiParty/DetectWebRtcService.d.ts.map +1 -1
  64. package/lib/MultiParty/DetectWebRtcService.js +98 -54
  65. package/lib/MultiParty/DetectWebRtcService.js.map +1 -1
  66. package/lib/MultiParty/MediaCapabilitiesService.d.ts +18 -0
  67. package/lib/MultiParty/MediaCapabilitiesService.d.ts.map +1 -0
  68. package/lib/MultiParty/MediaCapabilitiesService.js +158 -0
  69. package/lib/MultiParty/MediaCapabilitiesService.js.map +1 -0
  70. package/lib/MultiParty/MediaCapabilitiesUtils.d.ts +6 -0
  71. package/lib/MultiParty/MediaCapabilitiesUtils.d.ts.map +1 -0
  72. package/lib/MultiParty/MediaCapabilitiesUtils.js +123 -0
  73. package/lib/MultiParty/MediaCapabilitiesUtils.js.map +1 -0
  74. package/lib/MultiParty/MediaTracer.d.ts +4 -0
  75. package/lib/MultiParty/MediaTracer.d.ts.map +1 -0
  76. package/lib/MultiParty/MediaTracer.js +10 -0
  77. package/lib/MultiParty/MediaTracer.js.map +1 -0
  78. package/lib/MultiParty/MultiPartyService.d.ts +49 -0
  79. package/lib/MultiParty/MultiPartyService.d.ts.map +1 -0
  80. package/lib/MultiParty/MultiPartyService.js +30 -0
  81. package/lib/MultiParty/MultiPartyService.js.map +1 -0
  82. package/lib/MultiParty/MultiPartyServiceFactory.d.ts +4 -0
  83. package/lib/MultiParty/MultiPartyServiceFactory.d.ts.map +1 -0
  84. package/lib/MultiParty/MultiPartyServiceFactory.js +13 -0
  85. package/lib/MultiParty/MultiPartyServiceFactory.js.map +1 -0
  86. package/lib/MultiParty/MultipartyServiceEventTypes.d.ts +89 -0
  87. package/lib/MultiParty/MultipartyServiceEventTypes.d.ts.map +1 -0
  88. package/lib/MultiParty/MultipartyServiceEventTypes.js +16 -0
  89. package/lib/MultiParty/MultipartyServiceEventTypes.js.map +1 -0
  90. package/lib/MultiParty/index.d.ts +7 -0
  91. package/lib/MultiParty/index.d.ts.map +1 -0
  92. package/lib/MultiParty/index.js +25 -0
  93. package/lib/MultiParty/index.js.map +1 -0
  94. package/lib/MultiParty/opentok/OpentokMultiPartyService.d.ts +38 -0
  95. package/lib/MultiParty/opentok/OpentokMultiPartyService.d.ts.map +1 -0
  96. package/lib/MultiParty/opentok/OpentokMultiPartyService.js +492 -0
  97. package/lib/MultiParty/opentok/OpentokMultiPartyService.js.map +1 -0
  98. package/lib/MultiParty/opentok/OpentokPublisher.d.ts +34 -0
  99. package/lib/MultiParty/opentok/OpentokPublisher.d.ts.map +1 -0
  100. package/lib/MultiParty/opentok/OpentokPublisher.js +121 -0
  101. package/lib/MultiParty/opentok/OpentokPublisher.js.map +1 -0
  102. package/lib/MultiParty/opentok/OpentokPublisherEventMapper.d.ts +20 -0
  103. package/lib/MultiParty/opentok/OpentokPublisherEventMapper.d.ts.map +1 -0
  104. package/lib/MultiParty/opentok/OpentokPublisherEventMapper.js +49 -0
  105. package/lib/MultiParty/opentok/OpentokPublisherEventMapper.js.map +1 -0
  106. package/lib/MultiParty/opentok/OpentokScreenPublisher.d.ts +6 -0
  107. package/lib/MultiParty/opentok/OpentokScreenPublisher.d.ts.map +1 -0
  108. package/lib/MultiParty/opentok/OpentokScreenPublisher.js +48 -0
  109. package/lib/MultiParty/opentok/OpentokScreenPublisher.js.map +1 -0
  110. package/lib/MultiParty/opentok/OpentokSubscriber.d.ts +2 -0
  111. package/lib/MultiParty/opentok/OpentokSubscriber.d.ts.map +1 -0
  112. package/lib/MultiParty/opentok/OpentokSubscriber.js +26 -0
  113. package/lib/MultiParty/opentok/OpentokSubscriber.js.map +1 -0
  114. package/lib/MultiParty/opentok/OpentokVideoPublisher.d.ts +19 -0
  115. package/lib/MultiParty/opentok/OpentokVideoPublisher.d.ts.map +1 -0
  116. package/lib/MultiParty/opentok/OpentokVideoPublisher.js +182 -0
  117. package/lib/MultiParty/opentok/OpentokVideoPublisher.js.map +1 -0
  118. package/lib/MultiParty/opentok/trace.d.ts +3 -0
  119. package/lib/MultiParty/opentok/trace.d.ts.map +1 -0
  120. package/lib/MultiParty/opentok/trace.js +18 -0
  121. package/lib/MultiParty/opentok/trace.js.map +1 -0
  122. package/lib/MultiParty/opentok.d.ts +463 -0
  123. package/lib/MultiParty/types.d.ts +33 -0
  124. package/lib/MultiParty/types.d.ts.map +1 -0
  125. package/lib/MultiParty/types.js +3 -0
  126. package/lib/MultiParty/types.js.map +1 -0
  127. package/lib/MultiParty/utils.d.ts +10 -0
  128. package/lib/MultiParty/utils.d.ts.map +1 -0
  129. package/lib/MultiParty/utils.js +17 -0
  130. package/lib/MultiParty/utils.js.map +1 -0
  131. package/lib/TechseeMediaStream.d.ts +1 -0
  132. package/lib/TechseeMediaStream.d.ts.map +1 -1
  133. package/lib/TechseeMediaStream.js +9 -12
  134. package/lib/TechseeMediaStream.js.map +1 -1
  135. package/lib/qos/raw-qos.d.ts +29 -0
  136. package/lib/qos/raw-qos.d.ts.map +1 -0
  137. package/lib/qos/raw-qos.js +84 -145
  138. package/lib/qos/raw-qos.js.map +1 -1
  139. package/lib/webrtc-ie-shim.d.ts +4 -0
  140. package/lib/webrtc-ie-shim.d.ts.map +1 -0
  141. package/lib/webrtc-ie-shim.js +1896 -2950
  142. package/lib/webrtc-ie-shim.js.map +1 -1
  143. package/package.json +66 -60
  144. package/lib/MultiParty/Contracts.d.ts +0 -11
  145. package/lib/MultiParty/Contracts.d.ts.map +0 -1
  146. package/lib/MultiParty/Contracts.js +0 -6
  147. package/lib/MultiParty/Contracts.js.map +0 -1
  148. package/lib/MultiParty/MediaCapabilitiesHelper.d.ts +0 -12
  149. package/lib/MultiParty/MediaCapabilitiesHelper.d.ts.map +0 -1
  150. package/lib/MultiParty/MediaCapabilitiesHelper.js +0 -167
  151. package/lib/MultiParty/MediaCapabilitiesHelper.js.map +0 -1
  152. package/lib/MultiParty/MultiParty.d.ts +0 -21
  153. package/lib/MultiParty/MultiParty.d.ts.map +0 -1
  154. package/lib/MultiParty/MultiParty.js +0 -155
  155. package/lib/MultiParty/MultiParty.js.map +0 -1
  156. package/lib/MultiParty/MultipartyFactory.d.ts +0 -2
  157. package/lib/MultiParty/MultipartyFactory.d.ts.map +0 -1
  158. package/lib/MultiParty/MultipartyFactory.js +0 -15
  159. package/lib/MultiParty/MultipartyFactory.js.map +0 -1
  160. package/lib/MultiParty/OpentokMultiparty.d.ts +0 -24
  161. package/lib/MultiParty/OpentokMultiparty.d.ts.map +0 -1
  162. package/lib/MultiParty/OpentokMultiparty.js +0 -408
  163. package/lib/MultiParty/OpentokMultiparty.js.map +0 -1
  164. package/lib/oldCode/constants.js +0 -20
  165. package/lib/oldCode/constants.js.map +0 -1
  166. package/lib/oldCode/event-emitter.js +0 -39
  167. package/lib/oldCode/event-emitter.js.map +0 -1
  168. package/lib/oldCode/index.js +0 -64
  169. package/lib/oldCode/index.js.map +0 -1
  170. package/lib/oldCode/opentok/session.js +0 -310
  171. package/lib/oldCode/opentok/session.js.map +0 -1
  172. package/lib/oldCode/opentok/stream.js +0 -310
  173. package/lib/oldCode/opentok/stream.js.map +0 -1
  174. package/lib/oldCode/publisher.js +0 -143
  175. package/lib/oldCode/publisher.js.map +0 -1
  176. package/lib/oldCode/service.js +0 -395
  177. package/lib/oldCode/service.js.map +0 -1
  178. package/lib/oldCode/session.js +0 -110
  179. package/lib/oldCode/session.js.map +0 -1
  180. package/lib/oldCode/stream.js +0 -195
  181. package/lib/oldCode/stream.js.map +0 -1
  182. package/lib/oldCode/subscriber.js +0 -90
  183. package/lib/oldCode/subscriber.js.map +0 -1
  184. package/lib/oldCode/tracer.d.ts +0 -36
  185. package/lib/oldCode/tracer.d.ts.map +0 -1
  186. package/lib/oldCode/tracer.js +0 -161
  187. package/lib/oldCode/tracer.js.map +0 -1
  188. package/lib/oldCode/utils/ImageFixer.d.ts +0 -1
  189. package/lib/oldCode/utils/ImageFixer.d.ts.map +0 -1
  190. package/lib/oldCode/utils/ImageFixer.js +0 -59
  191. package/lib/oldCode/utils/ImageFixer.js.map +0 -1
  192. package/lib/oldCode/webrtc/constants.js +0 -114
  193. package/lib/oldCode/webrtc/constants.js.map +0 -1
  194. package/lib/oldCode/webrtc/helper.js +0 -173
  195. package/lib/oldCode/webrtc/helper.js.map +0 -1
  196. package/lib/oldCode/webrtc/session-kms.js +0 -558
  197. package/lib/oldCode/webrtc/session-kms.js.map +0 -1
  198. package/lib/oldCode/webrtc/session-loopback.js +0 -336
  199. package/lib/oldCode/webrtc/session-loopback.js.map +0 -1
  200. package/lib/oldCode/webrtc/session-turn.js +0 -880
  201. package/lib/oldCode/webrtc/session-turn.js.map +0 -1
  202. package/lib/oldCode/webrtc/session-turn.v2.js +0 -583
  203. package/lib/oldCode/webrtc/session-turn.v2.js.map +0 -1
  204. package/lib/oldCode/webrtc/session.js +0 -52
  205. package/lib/oldCode/webrtc/session.js.map +0 -1
  206. package/lib/oldCode/webrtc/stream.js +0 -674
  207. package/lib/oldCode/webrtc/stream.js.map +0 -1
  208. package/lib/oldCode/webrtc/temasys/adapter-loader.js +0 -12
  209. package/lib/oldCode/webrtc/temasys/adapter-loader.js.map +0 -1
  210. package/lib/oldCode/webrtc/temasys/adapter.js +0 -5861
  211. package/lib/oldCode/webrtc/temasys/adapter.js.map +0 -1
  212. package/lib/oldCode/webrtc/webrtc-ie-shim.js +0 -3007
  213. package/lib/oldCode/webrtc/webrtc-ie-shim.js.map +0 -1
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMediaTracer = void 0;
4
+ var MediaTracer_1 = require("./MediaTracer");
5
+ Object.defineProperty(exports, "getMediaTracer", { enumerable: true, get: function () { return MediaTracer_1.getMediaTracer; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/MediaUtils/index.ts"],"names":[],"mappings":";;;AAAA,6CAA6C;AAArC,6GAAA,cAAc,OAAA"}
@@ -1,16 +1,19 @@
1
1
  import { ClientWebRtcInfo } from '@techsee/techsee-common/lib/data-contracts/ClientInfo';
2
- export declare const DETECT_RTC_ADVISED_TIMEOUT = 20;
3
- export interface WebRtcNativeService extends ClientWebRtcInfo {
4
- load(doneCb: Function): void;
5
- }
6
- export interface IWebRtcDetector {
7
- getWebRtcInfo(): Promise<ClientWebRtcInfo>;
8
- }
9
- export declare class DetectWebRtcService implements IWebRtcDetector {
10
- private _cachedResult;
11
- private readonly _nativeService;
12
- private readonly _detectionTimeoutSec;
13
- constructor(detectionTimeoutSec: number);
14
- getWebRtcInfo(): Promise<ClientWebRtcInfo>;
15
- private static getDefaultResult;
2
+ export declare const DETECT_RTC_ADVISED_TIMEOUT = 20000;
3
+ export declare const defaultWebRtcResult: {
4
+ isWebRTCSupported: boolean;
5
+ isWebsiteHasWebcamPermissions: boolean;
6
+ isWebsiteHasMicrophonePermissions: boolean;
7
+ isGetUserMediaSupported: boolean;
8
+ isApplyConstraintsSupported: boolean;
9
+ };
10
+ export declare class DetectWebRtcService {
11
+ private static instance?;
12
+ private static initPromise;
13
+ private cachedResult;
14
+ private constructor();
15
+ static get: () => Promise<DetectWebRtcService>;
16
+ private init;
17
+ getWebRtcInfo: () => ClientWebRtcInfo;
16
18
  }
19
+ //# sourceMappingURL=DetectWebRtcService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/MultiParty/DetectWebRtcService.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,gBAAgB,EAAC,MAAM,uDAAuD,CAAC;AAKvF,eAAO,MAAM,0BAA0B,KAAK,CAAC;AAE7C,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAEzD,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC5B,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC9C;AAED,qBAAa,mBAAoB,YAAW,eAAe;IACvD,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAgC;IAC/D,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;gBAElC,mBAAmB,EAAE,MAAM;IAMvC,aAAa,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAsC1C,OAAO,CAAC,MAAM,CAAC,gBAAgB;CASlC","file":"DetectWebRtcService.d.ts","sourcesContent":["import {Nullable} from '@techsee/techsee-common';\nimport {ClientWebRtcInfo} from '@techsee/techsee-common/lib/data-contracts/ClientInfo';\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nimport detectRTC from '@techsee/techsee-common/lib/detectrtc.js';\n\nexport const DETECT_RTC_ADVISED_TIMEOUT = 20;\n\nexport interface WebRtcNativeService extends ClientWebRtcInfo {\n // eslint-disable-next-line @typescript-eslint/ban-types\n load(doneCb: Function): void;\n}\n\nexport interface IWebRtcDetector {\n getWebRtcInfo(): Promise<ClientWebRtcInfo>;\n}\n\nexport class DetectWebRtcService implements IWebRtcDetector {\n private _cachedResult: Nullable<ClientWebRtcInfo>;\n private readonly _nativeService: Nullable<WebRtcNativeService>;\n private readonly _detectionTimeoutSec: number;\n\n constructor(detectionTimeoutSec: number) {\n this._cachedResult = null;\n this._nativeService = detectRTC;\n this._detectionTimeoutSec = detectionTimeoutSec * 1000;\n }\n\n getWebRtcInfo(): Promise<ClientWebRtcInfo> {\n if (this._cachedResult) {\n return Promise.resolve(this._cachedResult);\n }\n\n if (!this._nativeService) {\n this._cachedResult = DetectWebRtcService.getDefaultResult();\n\n return Promise.resolve(this._cachedResult);\n }\n\n return new Promise((resolve) => {\n let timeoutPtr: any = setTimeout(() => {\n timeoutPtr = null;\n this._cachedResult = DetectWebRtcService.getDefaultResult();\n resolve(this._cachedResult);\n }, this._detectionTimeoutSec);\n\n this._nativeService!.load(() => {\n if (timeoutPtr === null) {\n return;\n }\n\n clearTimeout(timeoutPtr);\n\n this._cachedResult = {\n isWebRTCSupported: this._nativeService!.isWebRTCSupported,\n isWebsiteHasWebcamPermissions: this._nativeService!.isWebsiteHasWebcamPermissions,\n isWebsiteHasMicrophonePermissions: this._nativeService!.isWebsiteHasMicrophonePermissions,\n isGetUserMediaSupported: this._nativeService!.isGetUserMediaSupported,\n isApplyConstraintsSupported: this._nativeService!.isApplyConstraintsSupported\n };\n\n resolve(this._cachedResult);\n });\n });\n }\n\n private static getDefaultResult() {\n return {\n isWebRTCSupported: false,\n isWebsiteHasWebcamPermissions: false,\n isWebsiteHasMicrophonePermissions: false,\n isGetUserMediaSupported: false,\n isApplyConstraintsSupported: false\n };\n }\n}\n"]}
1
+ {"version":3,"file":"DetectWebRtcService.d.ts","sourceRoot":"","sources":["../../src/MultiParty/DetectWebRtcService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,gBAAgB,EAAC,MAAM,uDAAuD,CAAC;AAEvF,eAAO,MAAM,0BAA0B,QAAQ,CAAC;AAEhD,eAAO,MAAM,mBAAmB;;;;;;CAM/B,CAAC;AAEF,qBAAa,mBAAmB;IAE5B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAsB;IAC9C,OAAO,CAAC,MAAM,CAAC,WAAW,CAAoC;IAE9D,OAAO,CAAC,YAAY,CAAyC;IAE7D,OAAO;IAEP,OAAc,GAAG,QAAa,QAAQ,mBAAmB,CAAC,CAWxD;IAEF,OAAO,CAAC,IAAI,CAyBL;IAEA,aAAa,QAAO,gBAAgB,CAAsB;CACpE"}
@@ -1,63 +1,107 @@
1
1
  "use strict";
2
-
3
- var __importDefault = undefined && undefined.__importDefault || function (mod) {
4
- return mod && mod.__esModule ? mod : { "default": mod };
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ var __importDefault = (this && this.__importDefault) || function (mod) {
39
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
40
  };
6
41
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.DetectWebRtcService = exports.DETECT_RTC_ADVISED_TIMEOUT = void 0;
8
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
9
- // @ts-ignore
42
+ exports.DetectWebRtcService = exports.defaultWebRtcResult = exports.DETECT_RTC_ADVISED_TIMEOUT = void 0;
10
43
  var detectrtc_js_1 = __importDefault(require("@techsee/techsee-common/lib/detectrtc.js"));
11
- exports.DETECT_RTC_ADVISED_TIMEOUT = 20;
12
- var DetectWebRtcService = /** @class */function () {
13
- function DetectWebRtcService(detectionTimeoutSec) {
14
- this._cachedResult = null;
15
- this._nativeService = detectrtc_js_1.default;
16
- this._detectionTimeoutSec = detectionTimeoutSec * 1000;
17
- }
18
- DetectWebRtcService.prototype.getWebRtcInfo = function () {
44
+ exports.DETECT_RTC_ADVISED_TIMEOUT = 20000;
45
+ exports.defaultWebRtcResult = {
46
+ isWebRTCSupported: false,
47
+ isWebsiteHasWebcamPermissions: false,
48
+ isWebsiteHasMicrophonePermissions: false,
49
+ isGetUserMediaSupported: false,
50
+ isApplyConstraintsSupported: false
51
+ };
52
+ var DetectWebRtcService = (function () {
53
+ function DetectWebRtcService() {
19
54
  var _this = this;
20
- if (this._cachedResult) {
21
- return Promise.resolve(this._cachedResult);
22
- }
23
- if (!this._nativeService) {
24
- this._cachedResult = DetectWebRtcService.getDefaultResult();
25
- return Promise.resolve(this._cachedResult);
26
- }
27
- return new Promise(function (resolve) {
28
- var timeoutPtr = setTimeout(function () {
29
- timeoutPtr = null;
30
- _this._cachedResult = DetectWebRtcService.getDefaultResult();
31
- resolve(_this._cachedResult);
32
- }, _this._detectionTimeoutSec);
33
- _this._nativeService.load(function () {
34
- if (timeoutPtr === null) {
35
- return;
36
- }
37
- clearTimeout(timeoutPtr);
38
- _this._cachedResult = {
39
- isWebRTCSupported: _this._nativeService.isWebRTCSupported,
40
- isWebsiteHasWebcamPermissions: _this._nativeService.isWebsiteHasWebcamPermissions,
41
- isWebsiteHasMicrophonePermissions: _this._nativeService.isWebsiteHasMicrophonePermissions,
42
- isGetUserMediaSupported: _this._nativeService.isGetUserMediaSupported,
43
- isApplyConstraintsSupported: _this._nativeService.isApplyConstraintsSupported
44
- };
45
- resolve(_this._cachedResult);
55
+ this.cachedResult = exports.defaultWebRtcResult;
56
+ this.init = function () { return __awaiter(_this, void 0, void 0, function () {
57
+ var _this = this;
58
+ return __generator(this, function (_b) {
59
+ return [2, new Promise(function (resolve, reject) {
60
+ var timeoutPtr = setTimeout(function () {
61
+ timeoutPtr = null;
62
+ _this.cachedResult = exports.defaultWebRtcResult;
63
+ reject();
64
+ }, exports.DETECT_RTC_ADVISED_TIMEOUT);
65
+ detectrtc_js_1.default.load(function () {
66
+ if (timeoutPtr === null) {
67
+ return;
68
+ }
69
+ clearTimeout(timeoutPtr);
70
+ _this.cachedResult = {
71
+ isWebRTCSupported: detectrtc_js_1.default.isWebRTCSupported,
72
+ isWebsiteHasWebcamPermissions: detectrtc_js_1.default.isWebsiteHasWebcamPermissions,
73
+ isWebsiteHasMicrophonePermissions: detectrtc_js_1.default.isWebsiteHasMicrophonePermissions,
74
+ isGetUserMediaSupported: detectrtc_js_1.default.isGetUserMediaSupported,
75
+ isApplyConstraintsSupported: detectrtc_js_1.default.isApplyConstraintsSupported
76
+ };
77
+ resolve();
78
+ });
79
+ })];
46
80
  });
81
+ }); };
82
+ this.getWebRtcInfo = function () { return _this.cachedResult; };
83
+ }
84
+ var _a;
85
+ _a = DetectWebRtcService;
86
+ DetectWebRtcService.initPromise = Promise.resolve();
87
+ DetectWebRtcService.get = function () { return __awaiter(void 0, void 0, void 0, function () {
88
+ return __generator(_a, function (_b) {
89
+ switch (_b.label) {
90
+ case 0: return [4, DetectWebRtcService.initPromise];
91
+ case 1:
92
+ _b.sent();
93
+ if (!!DetectWebRtcService.instance) return [3, 3];
94
+ DetectWebRtcService.instance = new DetectWebRtcService();
95
+ DetectWebRtcService.initPromise = DetectWebRtcService.instance.init();
96
+ return [4, DetectWebRtcService.initPromise];
97
+ case 2:
98
+ _b.sent();
99
+ _b.label = 3;
100
+ case 3: return [2, DetectWebRtcService.instance];
101
+ }
47
102
  });
48
- };
49
- DetectWebRtcService.getDefaultResult = function () {
50
- return {
51
- isWebRTCSupported: false,
52
- isWebsiteHasWebcamPermissions: false,
53
- isWebsiteHasMicrophonePermissions: false,
54
- isGetUserMediaSupported: false,
55
- isApplyConstraintsSupported: false
56
- };
57
- };
103
+ }); };
58
104
  return DetectWebRtcService;
59
- }();
105
+ }());
60
106
  exports.DetectWebRtcService = DetectWebRtcService;
61
-
62
- //# sourceMappingURL=DetectWebRtcService.js.map
63
- //# sourceMappingURL=DetectWebRtcService.js.map
107
+ //# sourceMappingURL=DetectWebRtcService.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["MultiParty/DetectWebRtcService.js"],"names":["__importDefault","mod","__esModule","Object","defineProperty","exports","value","DetectWebRtcService","DETECT_RTC_ADVISED_TIMEOUT","detectrtc_js_1","require","detectionTimeoutSec","_cachedResult","_nativeService","default","_detectionTimeoutSec","prototype","getWebRtcInfo","_this","Promise","resolve","getDefaultResult","timeoutPtr","setTimeout","load","clearTimeout","isWebRTCSupported","isWebsiteHasWebcamPermissions","isWebsiteHasMicrophonePermissions","isGetUserMediaSupported","isApplyConstraintsSupported"],"mappings":"AAAA;;AACA,IAAIA,kBAAmB,aAAQ,UAAKA,eAAd,IAAkC,UAAUC,GAAV,EAAe;AACnE,WAAQA,OAAOA,IAAIC,UAAZ,GAA0BD,GAA1B,GAAgC,EAAE,WAAWA,GAAb,EAAvC;AACH,CAFD;AAGAE,OAAOC,cAAP,CAAsBC,OAAtB,EAA+B,YAA/B,EAA6C,EAAEC,OAAO,IAAT,EAA7C;AACAD,QAAQE,mBAAR,GAA8BF,QAAQG,0BAAR,GAAqC,KAAK,CAAxE;AACA;AACA;AACA,IAAIC,iBAAiBT,gBAAgBU,QAAQ,0CAAR,CAAhB,CAArB;AACAL,QAAQG,0BAAR,GAAqC,EAArC;AACA,IAAID,sBAAsB,aAAe,YAAY;AACjD,aAASA,mBAAT,CAA6BI,mBAA7B,EAAkD;AAC9C,aAAKC,aAAL,GAAqB,IAArB;AACA,aAAKC,cAAL,GAAsBJ,eAAeK,OAArC;AACA,aAAKC,oBAAL,GAA4BJ,sBAAsB,IAAlD;AACH;AACDJ,wBAAoBS,SAApB,CAA8BC,aAA9B,GAA8C,YAAY;A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Service.js","sourcesContent":["\"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DetectWebRtcService = exports.DETECT_RTC_ADVISED_TIMEOUT = void 0;\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\nvar detectrtc_js_1 = __importDefault(require(\"@techsee/techsee-common/lib/detectrtc.js\"));\nexports.DETECT_RTC_ADVISED_TIMEOUT = 20;\nvar DetectWebRtcService = /** @class */ (function () {\n function DetectWebRtcService(detectionTimeoutSec) {\n this._cachedResult = null;\n this._nativeService = detectrtc_js_1.default;\n this._detectionTimeoutSec = detectionTimeoutSec * 1000;\n }\n DetectWebRtcService.prototype.getWebRtcInfo = function () {\n var _this = this;\n if (this._cachedResult) {\n return Promise.resolve(this._cachedResult);\n }\n if (!this._nativeService) {\n this._cachedResult = DetectWebRtcService.getDefaultResult();\n return Promise.resolve(this._cachedResult);\n }\n return new Promise(function (resolve) {\n var timeoutPtr = setTimeout(function () {\n timeoutPtr = null;\n _this._cachedResult = DetectWebRtcService.getDefaultResult();\n resolve(_this._cachedResult);\n }, _this._detectionTimeoutSec);\n _this._nativeService.load(function () {\n if (timeoutPtr === null) {\n return;\n }\n clearTimeout(timeoutPtr);\n _this._cachedResult = {\n isWebRTCSupported: _this._nativeService.isWebRTCSupported,\n isWebsiteHasWebcamPermissions: _this._nativeService.isWebsiteHasWebcamPermissions,\n isWebsiteHasMicrophonePermissions: _this._nativeService.isWebsiteHasMicrophonePermissions,\n isGetUserMediaSupported: _this._nativeService.isGetUserMediaSupported,\n isApplyConstraintsSupported: _this._nativeService.isApplyConstraintsSupported\n };\n resolve(_this._cachedResult);\n });\n });\n };\n DetectWebRtcService.getDefaultResult = function () {\n return {\n isWebRTCSupported: false,\n isWebsiteHasWebcamPermissions: false,\n isWebsiteHasMicrophonePermissions: false,\n isGetUserMediaSupported: false,\n isApplyConstraintsSupported: false\n };\n };\n return DetectWebRtcService;\n}());\nexports.DetectWebRtcService = DetectWebRtcService;\n\n//# sourceMappingURL=DetectWebRtcService.js.map\n"]}
1
+ {"version":3,"file":"DetectWebRtcService.js","sourceRoot":"","sources":["../../src/MultiParty/DetectWebRtcService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,0FAAiE;AAGpD,QAAA,0BAA0B,GAAG,KAAK,CAAC;AAEnC,QAAA,mBAAmB,GAAG;IAC/B,iBAAiB,EAAE,KAAK;IACxB,6BAA6B,EAAE,KAAK;IACpC,iCAAiC,EAAE,KAAK;IACxC,uBAAuB,EAAE,KAAK;IAC9B,2BAA2B,EAAE,KAAK;CACrC,CAAC;AAEF;IAOI;QAAA,iBAAwB;QAFhB,iBAAY,GAAqB,2BAAmB,CAAC;QAiBrD,SAAI,GAAG;;;gBACX,WAAA,IAAI,OAAO,CAAC,UAAC,OAAO,EAAE,MAAM;wBACxB,IAAI,UAAU,GAA0B,UAAU,CAAC;4BAC/C,UAAU,GAAG,IAAI,CAAC;4BAClB,KAAI,CAAC,YAAY,GAAG,2BAAmB,CAAC;4BACxC,MAAM,EAAE,CAAC;wBACb,CAAC,EAAE,kCAA0B,CAAC,CAAC;wBAE/B,sBAAS,CAAC,IAAI,CAAC;4BACX,IAAI,UAAU,KAAK,IAAI,EAAE;gCACrB,OAAO;6BACV;4BAED,YAAY,CAAC,UAAU,CAAC,CAAC;4BAEzB,KAAI,CAAC,YAAY,GAAG;gCAChB,iBAAiB,EAAE,sBAAS,CAAC,iBAAiB;gCAC9C,6BAA6B,EAAE,sBAAS,CAAC,6BAA6B;gCACtE,iCAAiC,EAAE,sBAAS,CAAC,iCAAiC;gCAC9E,uBAAuB,EAAE,sBAAS,CAAC,uBAAuB;gCAC1D,2BAA2B,EAAE,sBAAS,CAAC,2BAA2B;6BACrE,CAAC;4BAEF,OAAO,EAAE,CAAC;wBACd,CAAC,CAAC,CAAC;oBACP,CAAC,CAAC,EAAA;;aAAA,CAAC;QAEA,kBAAa,GAAG,cAAwB,OAAA,KAAI,CAAC,YAAY,EAAjB,CAAiB,CAAC;IA1C1C,CAAC;;;IAJT,+BAAW,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IAMhD,uBAAG,GAAG;;;wBAChB,WAAM,mBAAmB,CAAC,WAAW,EAAA;;oBAArC,SAAqC,CAAC;yBAElC,CAAC,mBAAmB,CAAC,QAAQ,EAA7B,cAA6B;oBAC7B,mBAAmB,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAC;oBACzD,mBAAmB,CAAC,WAAW,GAAG,mBAAmB,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;oBAEtE,WAAM,mBAAmB,CAAC,WAAW,EAAA;;oBAArC,SAAqC,CAAC;;wBAG1C,WAAO,mBAAmB,CAAC,QAAQ,EAAC;;;SACvC,CAAC;IA8BN,0BAAC;CAAA,AAlDD,IAkDC;AAlDY,kDAAmB"}
@@ -0,0 +1,18 @@
1
+ export declare class MediaCapabilitiesService {
2
+ private static instance;
3
+ private static initPromise;
4
+ private webRtcSupportInfo;
5
+ private devicesList;
6
+ private environmentService;
7
+ private constructor();
8
+ static getInstance(): Promise<MediaCapabilitiesService>;
9
+ private init;
10
+ hasCamera(): boolean;
11
+ hasMicrophone(): boolean;
12
+ hasWebRTC(): boolean;
13
+ updateDevicesList(reverse?: boolean): Promise<void>;
14
+ get supportSwitchCamera(): boolean;
15
+ get backCameraDeviceId(): string;
16
+ get frontCameraDeviceId(): string;
17
+ }
18
+ //# sourceMappingURL=MediaCapabilitiesService.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaCapabilitiesService.d.ts","sourceRoot":"","sources":["../../src/MultiParty/MediaCapabilitiesService.ts"],"names":[],"mappings":"AAYA,qBAAa,wBAAwB;IAEjC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAA2B;IAClD,OAAO,CAAC,MAAM,CAAC,WAAW,CAAoC;IAE9D,OAAO,CAAC,iBAAiB,CAAyC;IAElE,OAAO,CAAC,WAAW,CAGjB;IAEF,OAAO,CAAC,kBAAkB,CAA6B;IAEvD,OAAO;WAEa,WAAW,IAAI,OAAO,CAAC,wBAAwB,CAAC;YAatD,IAAI;IAUX,SAAS,IAAI,OAAO;IAIpB,aAAa,IAAI,OAAO;IAQxB,SAAS,IAAI,OAAO;IAId,iBAAiB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAchE,IAAW,mBAAmB,IAAI,OAAO,CAExC;IAED,IAAW,kBAAkB,IAAI,MAAM,CAEtC;IAED,IAAW,mBAAmB,IAAI,MAAM,CAEvC;CACJ"}
@@ -0,0 +1,158 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.MediaCapabilitiesService = void 0;
40
+ var ts_environment_detect_1 = require("@techsee/techsee-common/lib/helpers/ts-environment-detect");
41
+ var MediaTracer_1 = require("./MediaTracer");
42
+ var DetectWebRtcService_1 = require("./DetectWebRtcService");
43
+ var trace = (0, MediaTracer_1.getMediaTracer)('MediaCapabilitiesService');
44
+ var MediaCapabilitiesService = (function () {
45
+ function MediaCapabilitiesService() {
46
+ this.webRtcSupportInfo = DetectWebRtcService_1.defaultWebRtcResult;
47
+ this.devicesList = {
48
+ video: [],
49
+ audio: []
50
+ };
51
+ this.environmentService = new ts_environment_detect_1.TsEnvironmentDetect();
52
+ }
53
+ MediaCapabilitiesService.getInstance = function () {
54
+ return __awaiter(this, void 0, void 0, function () {
55
+ return __generator(this, function (_a) {
56
+ switch (_a.label) {
57
+ case 0: return [4, this.initPromise];
58
+ case 1:
59
+ _a.sent();
60
+ if (!!this.instance) return [3, 3];
61
+ this.instance = new MediaCapabilitiesService();
62
+ this.initPromise = this.instance.init();
63
+ return [4, this.initPromise];
64
+ case 2:
65
+ _a.sent();
66
+ _a.label = 3;
67
+ case 3: return [2, this.instance];
68
+ }
69
+ });
70
+ });
71
+ };
72
+ MediaCapabilitiesService.prototype.init = function () {
73
+ return __awaiter(this, void 0, void 0, function () {
74
+ var detectWebRtcService;
75
+ return __generator(this, function (_a) {
76
+ switch (_a.label) {
77
+ case 0: return [4, DetectWebRtcService_1.DetectWebRtcService.get()];
78
+ case 1:
79
+ detectWebRtcService = _a.sent();
80
+ this.webRtcSupportInfo = detectWebRtcService.getWebRtcInfo();
81
+ return [4, this.updateDevicesList()];
82
+ case 2:
83
+ _a.sent();
84
+ trace.info('initialize media capabilities helper successfully');
85
+ return [2];
86
+ }
87
+ });
88
+ });
89
+ };
90
+ MediaCapabilitiesService.prototype.hasCamera = function () {
91
+ return this.devicesList.video.length > 0 && this.webRtcSupportInfo.isGetUserMediaSupported;
92
+ };
93
+ MediaCapabilitiesService.prototype.hasMicrophone = function () {
94
+ var userMediaSupported = this.webRtcSupportInfo.isGetUserMediaSupported;
95
+ return this.environmentService.isIOS()
96
+ ? userMediaSupported
97
+ : this.devicesList.audio.length > 0 && userMediaSupported;
98
+ };
99
+ MediaCapabilitiesService.prototype.hasWebRTC = function () {
100
+ return this.webRtcSupportInfo.isWebRTCSupported;
101
+ };
102
+ MediaCapabilitiesService.prototype.updateDevicesList = function (reverse) {
103
+ var _a;
104
+ return __awaiter(this, void 0, void 0, function () {
105
+ var localDevicesList, _b;
106
+ return __generator(this, function (_c) {
107
+ switch (_c.label) {
108
+ case 0:
109
+ if (!this.webRtcSupportInfo.isWebRTCSupported) return [3, 2];
110
+ return [4, ((_a = navigator === null || navigator === void 0 ? void 0 : navigator.mediaDevices) === null || _a === void 0 ? void 0 : _a.enumerateDevices())];
111
+ case 1:
112
+ _b = (_c.sent()) || [];
113
+ return [3, 3];
114
+ case 2:
115
+ _b = [];
116
+ _c.label = 3;
117
+ case 3:
118
+ localDevicesList = _b;
119
+ this.devicesList = {
120
+ video: localDevicesList.filter(function (device) { return device.kind.toLowerCase() === 'videoinput'; }),
121
+ audio: localDevicesList.filter(function (device) { return device.kind.toLowerCase() === 'audioinput'; })
122
+ };
123
+ if (reverse) {
124
+ this.devicesList.video.reverse();
125
+ }
126
+ return [2];
127
+ }
128
+ });
129
+ });
130
+ };
131
+ Object.defineProperty(MediaCapabilitiesService.prototype, "supportSwitchCamera", {
132
+ get: function () {
133
+ return this.devicesList.video.length > 1 && !this.environmentService.isDesktop();
134
+ },
135
+ enumerable: false,
136
+ configurable: true
137
+ });
138
+ Object.defineProperty(MediaCapabilitiesService.prototype, "backCameraDeviceId", {
139
+ get: function () {
140
+ var _a;
141
+ return ((_a = this.devicesList.video[this.devicesList.video.length - 1]) === null || _a === void 0 ? void 0 : _a.deviceId) || '';
142
+ },
143
+ enumerable: false,
144
+ configurable: true
145
+ });
146
+ Object.defineProperty(MediaCapabilitiesService.prototype, "frontCameraDeviceId", {
147
+ get: function () {
148
+ var _a;
149
+ return ((_a = this.devicesList.video[0]) === null || _a === void 0 ? void 0 : _a.deviceId) || '';
150
+ },
151
+ enumerable: false,
152
+ configurable: true
153
+ });
154
+ MediaCapabilitiesService.initPromise = Promise.resolve();
155
+ return MediaCapabilitiesService;
156
+ }());
157
+ exports.MediaCapabilitiesService = MediaCapabilitiesService;
158
+ //# sourceMappingURL=MediaCapabilitiesService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaCapabilitiesService.js","sourceRoot":"","sources":["../../src/MultiParty/MediaCapabilitiesService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAA8F;AAC9F,6CAA6C;AAC7C,6DAA+E;AAG/E,IAAM,KAAK,GAAG,IAAA,4BAAc,EAAC,0BAA0B,CAAC,CAAC;AAOzD;IAcI;QATQ,sBAAiB,GAAqB,yCAAmB,CAAC;QAE1D,gBAAW,GAA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AW,CAAC,KAAK,CAAC,CAAC,CAAC,0CAAE,QAAQ,KAAI,EAAE,CAAC;QACrD,CAAC;;;OAAA;IA5Ec,oCAAW,GAAkB,OAAO,CAAC,OAAO,EAAE,CAAC;IA6ElE,+BAAC;CAAA,AAhFD,IAgFC;AAhFY,4DAAwB"}
@@ -0,0 +1,6 @@
1
+ export declare const checkIsMobile: () => boolean;
2
+ export declare const checkWebRtc: () => Promise<boolean>;
3
+ export declare function checkVideoCapabilities(): Promise<boolean>;
4
+ export declare function checkAudioCapabilities(): Promise<boolean>;
5
+ export declare function checkSupportSwitchCamera(): Promise<boolean>;
6
+ //# sourceMappingURL=MediaCapabilitiesUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaCapabilitiesUtils.d.ts","sourceRoot":"","sources":["../../src/MultiParty/MediaCapabilitiesUtils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,aAAa,QAAO,OAIhC,CAAC;AAEF,eAAO,MAAM,WAAW,QAAa,QAAQ,OAAO,CAQnD,CAAC;AAEF,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAQ/D;AAED,wBAAsB,sBAAsB,IAAI,OAAO,CAAC,OAAO,CAAC,CAQ/D;AAED,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,OAAO,CAAC,CAQjE"}
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.checkSupportSwitchCamera = exports.checkAudioCapabilities = exports.checkVideoCapabilities = exports.checkWebRtc = exports.checkIsMobile = void 0;
40
+ var ts_environment_detect_1 = require("@techsee/techsee-common/lib/helpers/ts-environment-detect");
41
+ var MediaTracer_1 = require("./MediaTracer");
42
+ var MediaCapabilitiesService_1 = require("./MediaCapabilitiesService");
43
+ var trace = (0, MediaTracer_1.getMediaTracer)('MediaCapabilitiesUtils');
44
+ var checkIsMobile = function () {
45
+ var environmentService = new ts_environment_detect_1.TsEnvironmentDetect();
46
+ return environmentService.isMobile();
47
+ };
48
+ exports.checkIsMobile = checkIsMobile;
49
+ var checkWebRtc = function () { return __awaiter(void 0, void 0, void 0, function () {
50
+ var err_1;
51
+ return __generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ _a.trys.push([0, 2, , 3]);
55
+ return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
56
+ case 1: return [2, (_a.sent()).hasWebRTC()];
57
+ case 2:
58
+ err_1 = _a.sent();
59
+ trace.error(JSON.stringify(err_1));
60
+ return [3, 3];
61
+ case 3: return [2, false];
62
+ }
63
+ });
64
+ }); };
65
+ exports.checkWebRtc = checkWebRtc;
66
+ function checkVideoCapabilities() {
67
+ return __awaiter(this, void 0, void 0, function () {
68
+ var err_2;
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ _a.trys.push([0, 2, , 3]);
73
+ return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
74
+ case 1: return [2, (_a.sent()).hasCamera()];
75
+ case 2:
76
+ err_2 = _a.sent();
77
+ trace.error(JSON.stringify(err_2));
78
+ return [3, 3];
79
+ case 3: return [2, false];
80
+ }
81
+ });
82
+ });
83
+ }
84
+ exports.checkVideoCapabilities = checkVideoCapabilities;
85
+ function checkAudioCapabilities() {
86
+ return __awaiter(this, void 0, void 0, function () {
87
+ var err_3;
88
+ return __generator(this, function (_a) {
89
+ switch (_a.label) {
90
+ case 0:
91
+ _a.trys.push([0, 2, , 3]);
92
+ return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
93
+ case 1: return [2, (_a.sent()).hasMicrophone()];
94
+ case 2:
95
+ err_3 = _a.sent();
96
+ trace.error(JSON.stringify(err_3));
97
+ return [3, 3];
98
+ case 3: return [2, false];
99
+ }
100
+ });
101
+ });
102
+ }
103
+ exports.checkAudioCapabilities = checkAudioCapabilities;
104
+ function checkSupportSwitchCamera() {
105
+ return __awaiter(this, void 0, void 0, function () {
106
+ var err_4;
107
+ return __generator(this, function (_a) {
108
+ switch (_a.label) {
109
+ case 0:
110
+ _a.trys.push([0, 2, , 3]);
111
+ return [4, MediaCapabilitiesService_1.MediaCapabilitiesService.getInstance()];
112
+ case 1: return [2, (_a.sent()).supportSwitchCamera];
113
+ case 2:
114
+ err_4 = _a.sent();
115
+ trace.error(JSON.stringify(err_4));
116
+ return [3, 3];
117
+ case 3: return [2, false];
118
+ }
119
+ });
120
+ });
121
+ }
122
+ exports.checkSupportSwitchCamera = checkSupportSwitchCamera;
123
+ //# sourceMappingURL=MediaCapabilitiesUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaCapabilitiesUtils.js","sourceRoot":"","sources":["../../src/MultiParty/MediaCapabilitiesUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mGAA8F;AAC9F,6CAA6C;AAC7C,uEAAoE;AAEpE,IAAM,KAAK,GAAG,IAAA,4BAAc,EAAC,wBAAwB,CAAC,CAAC;AAEhD,IAAM,aAAa,GAAG;IACzB,IAAM,kBAAkB,GAAG,IAAI,2CAAmB,EAAE,CAAC;IAErD,OAAO,kBAAkB,CAAC,QAAQ,EAAE,CAAC;AACzC,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB;AAEK,IAAM,WAAW,GAAG;;;;;;gBAEX,WAAM,mDAAwB,CAAC,WAAW,EAAE,EAAA;oBAApD,WAAO,CAAC,SAA4C,CAAC,CAAC,SAAS,EAAE,EAAC;;;gBAElE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAG,CAAC,CAAC,CAAC;;oBAGrC,WAAO,KAAK,EAAC;;;KAChB,CAAC;AARW,QAAA,WAAW,eAQtB;AAEF,SAAsB,sBAAsB;;;;;;;oBAE5B,WAAM,mDAAwB,CAAC,WAAW,EAAE,EAAA;wBAApD,WAAO,CAAC,SAA4C,CAAC,CAAC,SAAS,EAAE,EAAC;;;oBAElE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAG,CAAC,CAAC,CAAC;;wBAGrC,WAAO,KAAK,EAAC;;;;CAChB;AARD,wDAQC;AAED,SAAsB,sBAAsB;;;;;;;oBAE5B,WAAM,mDAAwB,CAAC,WAAW,EAAE,EAAA;wBAApD,WAAO,CAAC,SAA4C,CAAC,CAAC,aAAa,EAAE,EAAC;;;oBAEtE,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAG,CAAC,CAAC,CAAC;;wBAGrC,WAAO,KAAK,EAAC;;;;CAChB;AARD,wDAQC;AAED,SAAsB,wBAAwB;;;;;;;oBAE9B,WAAM,mDAAwB,CAAC,WAAW,EAAE,EAAA;wBAApD,WAAO,CAAC,SAA4C,CAAC,CAAC,mBAAmB,EAAC;;;oBAE1E,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,KAAG,CAAC,CAAC,CAAC;;wBAGrC,WAAO,KAAK,EAAC;;;;CAChB;AARD,4DAQC"}
@@ -0,0 +1,4 @@
1
+ import { ITechseeTracer } from '@techsee/techsee-common/lib/core/Tracer';
2
+ export declare const TECHSEE_MEDIA_TRACER = "MediaTracer";
3
+ export declare function getMediaTracer(postfixName: string): ITechseeTracer;
4
+ //# sourceMappingURL=MediaTracer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaTracer.d.ts","sourceRoot":"","sources":["../../src/MultiParty/MediaTracer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,cAAc,EAAC,MAAM,yCAAyC,CAAC;AAElF,eAAO,MAAM,oBAAoB,gBAAgB,CAAC;AAElD,wBAAgB,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,cAAc,CAElE"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMediaTracer = exports.TECHSEE_MEDIA_TRACER = void 0;
4
+ var Tracer_1 = require("@techsee/techsee-common/lib/core/Tracer");
5
+ exports.TECHSEE_MEDIA_TRACER = 'MediaTracer';
6
+ function getMediaTracer(postfixName) {
7
+ return (0, Tracer_1.getTracer)(exports.TECHSEE_MEDIA_TRACER, postfixName);
8
+ }
9
+ exports.getMediaTracer = getMediaTracer;
10
+ //# sourceMappingURL=MediaTracer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaTracer.js","sourceRoot":"","sources":["../../src/MultiParty/MediaTracer.ts"],"names":[],"mappings":";;;AAAA,kEAAkF;AAErE,QAAA,oBAAoB,GAAG,aAAa,CAAC;AAElD,SAAgB,cAAc,CAAC,WAAmB;IAC9C,OAAO,IAAA,kBAAS,EAAC,4BAAoB,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC;AAFD,wCAEC"}