@reactoo/watchtogether-sdk-js 2.6.8 → 2.6.9
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.6.
|
|
3
|
+
* @version 2.6.9
|
|
4
4
|
*/
|
|
5
5
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
6
6
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -10114,7 +10114,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mod
|
|
|
10114
10114
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
10115
10115
|
|
|
10116
10116
|
"use strict";
|
|
10117
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getUserStream() {\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 muteAudio = false,\n muteVideo = false,\n stream = null\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 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 let fullConstraints = {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n if (stream) {\n let returnPromises = [];\n const videoTrack = stream.getVideoTracks()[0];\n const audioTrack = stream.getAudioTracks()[0];\n if (videoTrack) {\n returnPromises.push(videoTrack.applyConstraints(videoOnlyConstraints.video));\n }\n if (audioTrack) {\n returnPromises.push(audioTrack.applyConstraints(audioOnlyConstraints.audio));\n }\n return Promise.all(returnPromises).then(() => {\n
|
|
10117
|
+
eval("__webpack_require__.r(__webpack_exports__);\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getUserStream() {\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 muteAudio = false,\n muteVideo = false,\n stream = null\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 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 let fullConstraints = {\n ...(hasAudio ? audioOnlyConstraints : {\n audio: false\n }),\n ...(hasVideo ? videoOnlyConstraints : {\n video: false\n })\n };\n if (stream) {\n let returnPromises = [];\n const videoTrack = stream.getVideoTracks()[0];\n const audioTrack = stream.getAudioTracks()[0];\n console.log(stream, videoOnlyConstraints.video, audioOnlyConstraints.audio);\n if (videoTrack) {\n returnPromises.push(videoTrack.applyConstraints(videoOnlyConstraints.video));\n }\n if (audioTrack) {\n returnPromises.push(audioTrack.applyConstraints(audioOnlyConstraints.audio));\n }\n return Promise.all(returnPromises).then(() => {\n stream.getAudioTracks().forEach(track => track.enabled = !muteAudio);\n stream.getVideoTracks().forEach(track => track.enabled = !muteVideo);\n return stream;\n });\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});\n\n//# sourceURL=webpack://WatchTogetherSDK/./src/models/utils.js?");
|
|
10118
10118
|
|
|
10119
10119
|
/***/ }),
|
|
10120
10120
|
|