@reactoo/watchtogether-sdk-js 2.7.2 → 2.7.3
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.3
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -8700,7 +8700,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
8700
8700
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
8701
8701
|
|
|
8702
8702
|
"use strict";
|
|
8703
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\nconst getUserMediaConstraints = _ref => {\n let {\n hasVideo,\n hasAudio = true,\n isHd,\n aDeviceId,\n vDeviceId,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1\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 ...(lfps ? {\n frameRate: {\n ideal: 10,\n max: 30\n }\n } : {\n frameRate: {\n ideal: 30,\n max: 30\n }\n }),\n width: {\n ideal: isHd ? 1280 : 320\n },\n height: {\n ideal: isHd ? 720 : 240\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 isHd,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n stream = null\n } = _ref2;\n if (stream) {\n let fullConstraints = getUserMediaConstraints({\n hasVideo: true,\n hasAudio: true,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n isHd,\n lfps\n });\n let returnPromises = [];\n\n // const videoTrack = stream.getVideoTracks()[0];\n // if(videoTrack) {\n // returnPromises.push(videoTrack.applyConstraints(fullConstraints.video));\n // }\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 isHd,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n muteAudio = false,\n muteVideo = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fullConstraints = getUserMediaConstraints({\n hasVideo,\n hasAudio,\n isHd,\n aDeviceId,\n vDeviceId,\n lfps,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\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 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 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?");
|
|
8703
|
+
eval("__webpack_require__.r(__webpack_exports__);\n\n\nconst getUserMediaConstraints = _ref => {\n let {\n hasVideo,\n hasAudio = true,\n isHd,\n aDeviceId,\n vDeviceId,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1\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 ...(lfps ? {\n frameRate: {\n ideal: 10,\n max: 30\n }\n } : {\n frameRate: {\n ideal: 30,\n max: 30\n }\n }),\n width: {\n ideal: isHd ? 1280 : 320\n },\n height: {\n ideal: isHd ? 720 : 240\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 isHd,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n stream = null\n } = _ref2;\n if (stream) {\n let fullConstraints = getUserMediaConstraints({\n hasVideo: true,\n hasAudio: true,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount,\n isHd,\n lfps\n });\n let returnPromises = [];\n\n // const videoTrack = stream.getVideoTracks()[0];\n // if(videoTrack) {\n // returnPromises.push(videoTrack.applyConstraints(fullConstraints.video));\n // }\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 isHd,\n lfps,\n autoGainControl = false,\n echoCancellation = true,\n noiseSuppression = true,\n channelCount = 1,\n muteAudio = false,\n muteVideo = false\n } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n let fullConstraints = getUserMediaConstraints({\n hasVideo,\n hasAudio,\n isHd,\n aDeviceId,\n vDeviceId,\n lfps,\n autoGainControl,\n echoCancellation,\n noiseSuppression,\n channelCount\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?");
|
|
8704
8704
|
|
|
8705
8705
|
/***/ }),
|
|
8706
8706
|
|