@stream-io/video-client 0.3.36 → 0.4.0
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.
- package/CHANGELOG.md +11 -0
- package/dist/index.browser.es.js +23 -107
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +22 -107
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +23 -107
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +0 -32
- package/dist/src/devices/InputMediaDeviceManager.d.ts +2 -2
- package/dist/src/permissions/PermissionsContext.d.ts +2 -1
- package/dist/src/rtc/flows/join.d.ts +2 -2
- package/dist/src/rtc/helpers/tracks.d.ts +1 -2
- package/dist/src/store/CallState.d.ts +7 -7
- package/dist/src/types.d.ts +1 -24
- package/package.json +1 -1
- package/src/Call.ts +7 -64
- package/src/devices/InputMediaDeviceManager.ts +1 -1
- package/src/helpers/DynascaleManager.ts +14 -27
- package/src/helpers/__tests__/DynascaleManager.test.ts +3 -22
- package/src/permissions/PermissionsContext.ts +7 -3
- package/src/rtc/Publisher.ts +1 -7
- package/src/rtc/__tests__/Publisher.test.ts +0 -4
- package/src/rtc/flows/join.ts +4 -19
- package/src/rtc/helpers/tracks.ts +1 -22
- package/src/store/CallState.ts +8 -17
- package/src/types.ts +1 -34
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [0.4.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.3.36...@stream-io/video-client-0.4.0) (2023-10-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* **react-sdk:** Universal Device Management API (#1127)
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* **react-sdk:** Universal Device Management API ([#1127](https://github.com/GetStream/stream-video-js/issues/1127)) ([aeb3561](https://github.com/GetStream/stream-video-js/commit/aeb35612745f45254b536281c5f81d1bcac2bab5))
|
|
15
|
+
|
|
5
16
|
### [0.3.36](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-0.3.35...@stream-io/video-client-0.3.36) (2023-10-25)
|
|
6
17
|
|
|
7
18
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -5736,9 +5736,6 @@ var DebounceType;
|
|
|
5736
5736
|
DebounceType[DebounceType["MEDIUM"] = 600] = "MEDIUM";
|
|
5737
5737
|
DebounceType[DebounceType["SLOW"] = 1200] = "SLOW";
|
|
5738
5738
|
})(DebounceType || (DebounceType = {}));
|
|
5739
|
-
const isStreamVideoLocalParticipant = (p) => {
|
|
5740
|
-
return !!p.isLocalParticipant;
|
|
5741
|
-
};
|
|
5742
5739
|
|
|
5743
5740
|
/**
|
|
5744
5741
|
* @generated from protobuf service stream.video.sfu.signal.SignalServer
|
|
@@ -6222,21 +6219,6 @@ const trackTypeToParticipantStreamKey = (trackType) => {
|
|
|
6222
6219
|
throw new Error(`Unknown track type: ${exhaustiveTrackTypeCheck}`);
|
|
6223
6220
|
}
|
|
6224
6221
|
};
|
|
6225
|
-
const trackTypeToDeviceIdKey = (trackType) => {
|
|
6226
|
-
switch (trackType) {
|
|
6227
|
-
case TrackType.AUDIO:
|
|
6228
|
-
return 'audioDeviceId';
|
|
6229
|
-
case TrackType.VIDEO:
|
|
6230
|
-
return 'videoDeviceId';
|
|
6231
|
-
case TrackType.SCREEN_SHARE:
|
|
6232
|
-
case TrackType.SCREEN_SHARE_AUDIO:
|
|
6233
|
-
case TrackType.UNSPECIFIED:
|
|
6234
|
-
return undefined;
|
|
6235
|
-
default:
|
|
6236
|
-
const exhaustiveTrackTypeCheck = trackType;
|
|
6237
|
-
throw new Error(`Unknown track type: ${exhaustiveTrackTypeCheck}`);
|
|
6238
|
-
}
|
|
6239
|
-
};
|
|
6240
6222
|
const muteTypeToTrackType = (muteType) => {
|
|
6241
6223
|
switch (muteType) {
|
|
6242
6224
|
case 'audio':
|
|
@@ -6628,14 +6610,11 @@ class Publisher {
|
|
|
6628
6610
|
}));
|
|
6629
6611
|
}
|
|
6630
6612
|
else {
|
|
6631
|
-
const deviceId = track.getSettings().deviceId;
|
|
6632
|
-
const audioOrVideoDeviceKey = trackTypeToDeviceIdKey(trackType);
|
|
6633
6613
|
this.state.updateParticipant(this.sfuClient.sessionId, (p) => {
|
|
6634
6614
|
return {
|
|
6635
6615
|
publishedTracks: p.publishedTracks.includes(trackType)
|
|
6636
6616
|
? p.publishedTracks
|
|
6637
6617
|
: [...p.publishedTracks, trackType],
|
|
6638
|
-
...(audioOrVideoDeviceKey && { [audioOrVideoDeviceKey]: deviceId }),
|
|
6639
6618
|
[audioOrVideoOrScreenShareStream]: mediaStream,
|
|
6640
6619
|
};
|
|
6641
6620
|
});
|
|
@@ -8477,7 +8456,7 @@ class CallState {
|
|
|
8477
8456
|
// maintain stable-sort by mutating the participants stored
|
|
8478
8457
|
// in the original subject
|
|
8479
8458
|
map$1((ps) => ps.sort(this.sortParticipantsBy)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
8480
|
-
this.localParticipant$ = this.participants$.pipe(map$1((participants) => participants.find(
|
|
8459
|
+
this.localParticipant$ = this.participants$.pipe(map$1((participants) => participants.find((p) => p.isLocalParticipant)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
8481
8460
|
this.remoteParticipants$ = this.participants$.pipe(map$1((participants) => participants.filter((p) => !p.isLocalParticipant)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
8482
8461
|
this.pinnedParticipants$ = this.participants$.pipe(map$1((participants) => participants.filter((p) => !!p.pin)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
8483
8462
|
this.dominantSpeaker$ = this.participants$.pipe(map$1((participants) => participants.find((p) => p.isDominantSpeaker)), shareReplay({ bufferSize: 1, refCount: true }));
|
|
@@ -9212,14 +9191,7 @@ const reconcileParticipantLocalState = (target, source) => {
|
|
|
9212
9191
|
if (!source)
|
|
9213
9192
|
return target;
|
|
9214
9193
|
// copy everything from source to target
|
|
9215
|
-
Object.assign(target, source);
|
|
9216
|
-
if (isStreamVideoLocalParticipant(source) &&
|
|
9217
|
-
isStreamVideoLocalParticipant(target)) {
|
|
9218
|
-
target.audioDeviceId = source.audioDeviceId;
|
|
9219
|
-
target.videoDeviceId = source.videoDeviceId;
|
|
9220
|
-
target.audioOutputDeviceId = source.audioOutputDeviceId;
|
|
9221
|
-
}
|
|
9222
|
-
return target;
|
|
9194
|
+
return Object.assign(target, source);
|
|
9223
9195
|
};
|
|
9224
9196
|
|
|
9225
9197
|
/**
|
|
@@ -9822,24 +9794,20 @@ class DynascaleManager {
|
|
|
9822
9794
|
}
|
|
9823
9795
|
});
|
|
9824
9796
|
});
|
|
9825
|
-
const sinkIdSubscription =
|
|
9826
|
-
|
|
9827
|
-
this.call.speaker.state.selectedDevice
|
|
9828
|
-
|
|
9829
|
-
|
|
9830
|
-
|
|
9831
|
-
|
|
9832
|
-
|
|
9833
|
-
// @ts-expect-error setSinkId is not yet in the lib
|
|
9834
|
-
audioElement.setSinkId(deviceId);
|
|
9835
|
-
}
|
|
9836
|
-
});
|
|
9797
|
+
const sinkIdSubscription = !('setSinkId' in audioElement)
|
|
9798
|
+
? null
|
|
9799
|
+
: this.call.speaker.state.selectedDevice$.subscribe((deviceId) => {
|
|
9800
|
+
if (deviceId) {
|
|
9801
|
+
// @ts-expect-error setSinkId is not yet in the lib
|
|
9802
|
+
audioElement.setSinkId(deviceId);
|
|
9803
|
+
}
|
|
9804
|
+
});
|
|
9837
9805
|
const volumeSubscription = this.call.speaker.state.volume$.subscribe((volume) => {
|
|
9838
9806
|
audioElement.volume = volume;
|
|
9839
9807
|
});
|
|
9840
9808
|
audioElement.autoplay = true;
|
|
9841
9809
|
return () => {
|
|
9842
|
-
sinkIdSubscription
|
|
9810
|
+
sinkIdSubscription?.unsubscribe();
|
|
9843
9811
|
volumeSubscription.unsubscribe();
|
|
9844
9812
|
updateMediaStreamSubscription.unsubscribe();
|
|
9845
9813
|
};
|
|
@@ -9888,11 +9856,12 @@ class PermissionsContext {
|
|
|
9888
9856
|
* within the call.
|
|
9889
9857
|
*
|
|
9890
9858
|
* @param permission the permission to check for.
|
|
9859
|
+
* @param settings the call settings to check against (optional).
|
|
9891
9860
|
*/
|
|
9892
|
-
this.canRequest = (permission) => {
|
|
9893
|
-
if (!
|
|
9861
|
+
this.canRequest = (permission, settings = this.settings) => {
|
|
9862
|
+
if (!settings)
|
|
9894
9863
|
return false;
|
|
9895
|
-
const { audio, video, screensharing } =
|
|
9864
|
+
const { audio, video, screensharing } = settings;
|
|
9896
9865
|
switch (permission) {
|
|
9897
9866
|
case OwnCapability.SEND_AUDIO:
|
|
9898
9867
|
return audio.access_request_enabled;
|
|
@@ -11495,15 +11464,12 @@ class Call {
|
|
|
11495
11464
|
this.state.setServerSidePins(pins);
|
|
11496
11465
|
this.reconnectAttempts = 0; // reset the reconnect attempts counter
|
|
11497
11466
|
this.state.setCallingState(CallingState.JOINED);
|
|
11498
|
-
|
|
11499
|
-
|
|
11500
|
-
|
|
11501
|
-
|
|
11502
|
-
|
|
11503
|
-
|
|
11504
|
-
catch (error) {
|
|
11505
|
-
this.logger('warn', 'Camera and/or mic init failed during join call');
|
|
11506
|
-
}
|
|
11467
|
+
try {
|
|
11468
|
+
await this.initCamera();
|
|
11469
|
+
await this.initMic();
|
|
11470
|
+
}
|
|
11471
|
+
catch (error) {
|
|
11472
|
+
this.logger('warn', 'Camera and/or mic init failed during join call');
|
|
11507
11473
|
}
|
|
11508
11474
|
// 3. once we have the "joinResponse", and possibly reconciled the local state
|
|
11509
11475
|
// we schedule a fast subscription update for all remote participants
|
|
@@ -11730,56 +11696,6 @@ class Call {
|
|
|
11730
11696
|
this.stopReportingStatsFor = (sessionId) => {
|
|
11731
11697
|
return this.statsReporter?.stopReportingStatsFor(sessionId);
|
|
11732
11698
|
};
|
|
11733
|
-
/**
|
|
11734
|
-
* Sets the used audio output device (`audioOutputDeviceId` of the [`localParticipant$`](./StreamVideoClient.md/#readonlystatestore).
|
|
11735
|
-
*
|
|
11736
|
-
* This method only stores the selection, if you're using custom UI components, you'll have to implement the audio switching, for more information see: https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/sinkId.
|
|
11737
|
-
*
|
|
11738
|
-
*
|
|
11739
|
-
* @param deviceId the selected device, `undefined` means the user wants to use the system's default audio output
|
|
11740
|
-
*
|
|
11741
|
-
* @deprecated use `call.speaker` instead
|
|
11742
|
-
*/
|
|
11743
|
-
this.setAudioOutputDevice = (deviceId) => {
|
|
11744
|
-
if (!this.sfuClient)
|
|
11745
|
-
return;
|
|
11746
|
-
this.state.updateParticipant(this.sfuClient.sessionId, {
|
|
11747
|
-
audioOutputDeviceId: deviceId,
|
|
11748
|
-
});
|
|
11749
|
-
};
|
|
11750
|
-
/**
|
|
11751
|
-
* Sets the `audioDeviceId` property of the [`localParticipant$`](./StreamVideoClient.md/#readonlystatestore)).
|
|
11752
|
-
*
|
|
11753
|
-
* This method only stores the selection, if you want to start publishing a media stream call the [`publishAudioStream` method](#publishaudiostream) that will set `audioDeviceId` as well.
|
|
11754
|
-
*
|
|
11755
|
-
*
|
|
11756
|
-
* @param deviceId the selected device, pass `undefined` to clear the device selection
|
|
11757
|
-
*
|
|
11758
|
-
* @deprecated use call.microphone.select
|
|
11759
|
-
*/
|
|
11760
|
-
this.setAudioDevice = (deviceId) => {
|
|
11761
|
-
if (!this.sfuClient)
|
|
11762
|
-
return;
|
|
11763
|
-
this.state.updateParticipant(this.sfuClient.sessionId, {
|
|
11764
|
-
audioDeviceId: deviceId,
|
|
11765
|
-
});
|
|
11766
|
-
};
|
|
11767
|
-
/**
|
|
11768
|
-
* Sets the `videoDeviceId` property of the [`localParticipant$`](./StreamVideoClient.md/#readonlystatestore).
|
|
11769
|
-
*
|
|
11770
|
-
* This method only stores the selection, if you want to start publishing a media stream call the [`publishVideoStream` method](#publishvideostream) that will set `videoDeviceId` as well.
|
|
11771
|
-
*
|
|
11772
|
-
* @param deviceId the selected device, pass `undefined` to clear the device selection
|
|
11773
|
-
*
|
|
11774
|
-
* @deprecated use call.camera.select
|
|
11775
|
-
*/
|
|
11776
|
-
this.setVideoDevice = (deviceId) => {
|
|
11777
|
-
if (!this.sfuClient)
|
|
11778
|
-
return;
|
|
11779
|
-
this.state.updateParticipant(this.sfuClient.sessionId, {
|
|
11780
|
-
videoDeviceId: deviceId,
|
|
11781
|
-
});
|
|
11782
|
-
};
|
|
11783
11699
|
/**
|
|
11784
11700
|
* Resets the last sent reaction for the user holding the given `sessionId`. This is a local action, it won't reset the reaction on the backend.
|
|
11785
11701
|
*
|
|
@@ -14015,7 +13931,7 @@ class StreamClient {
|
|
|
14015
13931
|
});
|
|
14016
13932
|
};
|
|
14017
13933
|
this.getUserAgent = () => {
|
|
14018
|
-
const version = "0.
|
|
13934
|
+
const version = "0.4.0" ;
|
|
14019
13935
|
return (this.userAgent ||
|
|
14020
13936
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
14021
13937
|
};
|
|
@@ -14549,5 +14465,5 @@ class StreamVideoServerClient extends StreamVideoClient {
|
|
|
14549
14465
|
}
|
|
14550
14466
|
}
|
|
14551
14467
|
|
|
14552
|
-
export { AudioSettingsDefaultDeviceEnum, AudioSettingsRequestDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, InputMediaDeviceManager, InputMediaDeviceManagerState, LayoutSettingsNameEnum, LayoutSettingsRequestNameEnum, MicrophoneManager, MicrophoneManagerState, OwnCapability, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, ScreenShareManager, ScreenShareState, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoServerClient, StreamVideoWriteableStateStore, TranscriptionSettingsModeEnum, TranscriptionSettingsRequestModeEnum, VideoSettingsCameraFacingEnum, VideoSettingsRequestCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, disposeOfMediaStream, dominantSpeaker, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceInfo, getLogger, getOSInfo, getScreenShareStream, getSdkInfo, getVideoDevices, getVideoStream,
|
|
14468
|
+
export { AudioSettingsDefaultDeviceEnum, AudioSettingsRequestDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, InputMediaDeviceManager, InputMediaDeviceManagerState, LayoutSettingsNameEnum, LayoutSettingsRequestNameEnum, MicrophoneManager, MicrophoneManagerState, OwnCapability, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, ScreenShareManager, ScreenShareState, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoServerClient, StreamVideoWriteableStateStore, TranscriptionSettingsModeEnum, TranscriptionSettingsRequestModeEnum, VideoSettingsCameraFacingEnum, VideoSettingsRequestCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, disposeOfMediaStream, dominantSpeaker, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceInfo, getLogger, getOSInfo, getScreenShareStream, getSdkInfo, getVideoDevices, getVideoStream, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, paginatedLayoutSortPreset, pinned, publishingAudio, publishingVideo, reactionType, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setSdkInfo, speakerLayoutSortPreset, speaking, watchForAddedDefaultAudioDevice, watchForAddedDefaultAudioOutputDevice, watchForAddedDefaultVideoDevice, watchForDisconnectedAudioDevice, watchForDisconnectedAudioOutputDevice, watchForDisconnectedVideoDevice };
|
|
14553
14469
|
//# sourceMappingURL=index.browser.es.js.map
|