@reactoo/watchtogether-sdk-js 2.7.13 → 2.7.14
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @reactoo/watchtogether-sdk-js
|
|
3
|
-
* @version 2.7.
|
|
3
|
+
* @version 2.7.14
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -10282,7 +10282,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
10282
10282
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10283
10283
|
|
|
10284
10284
|
"use strict";
|
|
10285
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\nconst getUserMediaConstraints = _ref => {\n let {\n hasVideo,\n hasAudio = true,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n width =
|
|
10285
|
+
eval("__webpack_require__.r(__webpack_exports__);\n\n\nconst getUserMediaConstraints = _ref => {\n let {\n hasVideo,\n hasAudio = true,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n width = 1920,\n height = 1080\n } = _ref;\n // optional: Array (6)\n // • 0: {googEchoCancellation: true}\n // • 1: {googEchoCancellation2: true}\n // • 2: {googAutoGainControl: true}\n // • 3: {googNoiseSuppression: true}\n // » 4: {googHighpassFilter: true}\n // • 5: {googAudioMirroring: true}\n // googTypingNoiseDetection\n\n let audioOnlyConstraints = {\n audio: {\n ...(aDeviceId && {\n deviceId: {\n exact: aDeviceId\n }\n }),\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\n }\n };\n let videoOnlyConstraints = {\n video: {\n ...(vDeviceId && {\n deviceId: {\n exact: vDeviceId\n }\n }),\n facingMode: {\n ideal: \"user\"\n },\n frameRate: {\n ideal: 30,\n max: 30\n },\n width: {\n ideal: width\n },\n height: {\n ideal: height\n }\n }\n };\n return {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n //TODO: add more constraints\n applyConstraints(_ref2) {\n let {\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n stream = null,\n width,\n height\n } = _ref2;\n if (stream) {\n let fullConstraints = getUserMediaConstraints({\n hasVideo: true,\n hasAudio: true,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n width,\n height\n });\n let returnPromises = [];\n const videoTrack = stream.getVideoTracks()[0];\n if (videoTrack) {\n returnPromises.push(videoTrack.applyConstraints(fullConstraints.video));\n }\n const audioTrack = stream.getAudioTracks()[0];\n if (audioTrack) {\n returnPromises.push(audioTrack.applyConstraints(fullConstraints.audio));\n }\n return Promise.all(returnPromises).then(() => {\n return stream;\n });\n } else return Promise.resolve(null);\n },\n getUserStream() {\n let {\n hasVideo,\n hasAudio = true,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n muteAudio = false,\n muteVideo = false,\n width = 1920,\n height = 1080\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fullConstraints = getUserMediaConstraints({\n hasVideo,\n hasAudio,\n aDeviceId,\n vDeviceId,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n width,\n height\n });\n return navigator.mediaDevices.getUserMedia(fullConstraints).then(stream => {\n stream.getAudioTracks().forEach(track => track.enabled = !muteAudio);\n stream.getVideoTracks().forEach(track => track.enabled = !muteVideo);\n return stream;\n });\n },\n getHostStream() {\n let {\n hasAudio,\n hasVideo,\n aDeviceId,\n vDeviceId,\n autoGainControl = false,\n echoCancellation = false,\n noiseSuppression = false,\n channelCount = 1,\n width = 1920,\n height = 1080\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let audioOnlyConstraints = {\n audio: {\n ...(aDeviceId && {\n deviceId: {\n exact: aDeviceId\n }\n }),\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\n }\n };\n let videoOnlyConstraints = {\n video: {\n ...(vDeviceId && {\n deviceId: {\n exact: vDeviceId\n }\n }),\n frameRate: {\n ideal: 30,\n max: 30\n },\n width,\n height\n }\n };\n let fullConstraints = {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n return navigator.mediaDevices.getUserMedia(fullConstraints);\n },\n getDisplayMedia() {\n const constraints = {\n video: {\n cursor: \"always\",\n displaySurface: \"monitor\",\n logicalSurface: false\n },\n surfaceSwitching: \"include\",\n selfBrowserSurface: \"exclude\",\n systemAudio: \"exclude\"\n };\n return navigator.mediaDevices.getDisplayMedia(constraints);\n }\n});\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/utils.js?");
|
|
10286
10286
|
|
|
10287
10287
|
/***/ }),
|
|
10288
10288
|
|