@stream-io/video-client 1.25.0 → 1.25.2
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 +12 -0
- package/dist/index.browser.es.js +57 -5
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +57 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +57 -5
- package/dist/index.es.js.map +1 -1
- package/dist/src/devices/InputMediaDeviceManager.d.ts +2 -0
- package/dist/src/devices/MicrophoneManager.d.ts +1 -0
- package/dist/src/devices/ScreenShareManager.d.ts +1 -0
- package/dist/src/devices/SpeakerManager.d.ts +2 -0
- package/dist/src/devices/devices.d.ts +8 -0
- package/package.json +1 -1
- package/src/Call.ts +6 -0
- package/src/devices/CameraManagerState.ts +1 -1
- package/src/devices/InputMediaDeviceManager.ts +13 -0
- package/src/devices/MicrophoneManager.ts +3 -0
- package/src/devices/MicrophoneManagerState.ts +4 -3
- package/src/devices/ScreenShareManager.ts +6 -3
- package/src/devices/SpeakerManager.ts +13 -0
- package/src/devices/__tests__/CameraManager.test.ts +1 -0
- package/src/devices/__tests__/InputMediaDeviceManager.test.ts +1 -0
- package/src/devices/__tests__/MicrophoneManager.test.ts +1 -0
- package/src/devices/__tests__/MicrophoneManagerRN.test.ts +1 -0
- package/src/devices/__tests__/ScreenShareManager.test.ts +1 -0
- package/src/devices/__tests__/SpeakerManager.test.ts +1 -0
- package/src/devices/devices.ts +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
## [1.25.2](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.25.1...@stream-io/video-client-1.25.2) (2025-07-02)
|
|
6
|
+
|
|
7
|
+
### Bug Fixes
|
|
8
|
+
|
|
9
|
+
- resolve `default` device id into real id ([#1839](https://github.com/GetStream/stream-video-js/issues/1839)) ([1a1037f](https://github.com/GetStream/stream-video-js/commit/1a1037f21ef2926c7da78b6461499f37742935e9))
|
|
10
|
+
|
|
11
|
+
## [1.25.1](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.25.0...@stream-io/video-client-1.25.1) (2025-06-30)
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
- correctly setup and dispose device managers ([#1836](https://github.com/GetStream/stream-video-js/issues/1836)) ([92fbe6c](https://github.com/GetStream/stream-video-js/commit/92fbe6c1da3bf06847244f430652bdc9433533bf))
|
|
16
|
+
|
|
5
17
|
## [1.25.0](https://github.com/GetStream/stream-video-js/compare/@stream-io/video-client-1.24.0...@stream-io/video-client-1.25.0) (2025-06-20)
|
|
6
18
|
|
|
7
19
|
- upgrade stream deps and improve API error code logging ([#1827](https://github.com/GetStream/stream-video-js/issues/1827)) ([8c30fef](https://github.com/GetStream/stream-video-js/commit/8c30fef80d78055f5adeae02f7347c1c3fe49b72)), closes [#1826](https://github.com/GetStream/stream-video-js/issues/1826)
|
package/dist/index.browser.es.js
CHANGED
|
@@ -5810,7 +5810,7 @@ const aggregate = (stats) => {
|
|
|
5810
5810
|
return report;
|
|
5811
5811
|
};
|
|
5812
5812
|
|
|
5813
|
-
const version = "1.25.
|
|
5813
|
+
const version = "1.25.2";
|
|
5814
5814
|
const [major, minor, patch] = version.split('.');
|
|
5815
5815
|
let sdkInfo = {
|
|
5816
5816
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -9667,6 +9667,26 @@ const disposeOfMediaStream = (stream) => {
|
|
|
9667
9667
|
stream.release();
|
|
9668
9668
|
}
|
|
9669
9669
|
};
|
|
9670
|
+
/**
|
|
9671
|
+
* Resolves `default` device id into the real device id. Some browsers (notably,
|
|
9672
|
+
* Chromium-based) report device with id `default` among audio input and output
|
|
9673
|
+
* devices. Since not every browser does that, we never want `default` id to be
|
|
9674
|
+
* used within our SDK. This function tries to find the real id for the `default`
|
|
9675
|
+
* device.
|
|
9676
|
+
*/
|
|
9677
|
+
function resolveDeviceId(deviceId, kind) {
|
|
9678
|
+
if (deviceId !== 'default')
|
|
9679
|
+
return deviceId;
|
|
9680
|
+
const devices = deviceIds$ && getCurrentValue(deviceIds$);
|
|
9681
|
+
if (!devices)
|
|
9682
|
+
return deviceId;
|
|
9683
|
+
const defaultDeviceInfo = devices.find((d) => d.deviceId === deviceId);
|
|
9684
|
+
if (!defaultDeviceInfo)
|
|
9685
|
+
return deviceId;
|
|
9686
|
+
const groupId = defaultDeviceInfo.groupId;
|
|
9687
|
+
const candidates = devices.filter((d) => d.kind === kind && d.deviceId !== 'default' && d.groupId === groupId);
|
|
9688
|
+
return candidates.length === 1 ? candidates[0].deviceId : deviceId;
|
|
9689
|
+
}
|
|
9670
9690
|
|
|
9671
9691
|
/**
|
|
9672
9692
|
* Checks if the current platform is a mobile device.
|
|
@@ -9683,6 +9703,7 @@ class InputMediaDeviceManager {
|
|
|
9683
9703
|
*/
|
|
9684
9704
|
this.stopOnLeave = true;
|
|
9685
9705
|
this.subscriptions = [];
|
|
9706
|
+
this.areSubscriptionsSetUp = false;
|
|
9686
9707
|
this.isTrackStoppedDueToTrackEnd = false;
|
|
9687
9708
|
this.filters = [];
|
|
9688
9709
|
this.statusChangeConcurrencyTag = Symbol('statusChangeConcurrencyTag');
|
|
@@ -9694,11 +9715,20 @@ class InputMediaDeviceManager {
|
|
|
9694
9715
|
*/
|
|
9695
9716
|
this.dispose = () => {
|
|
9696
9717
|
this.subscriptions.forEach((s) => s());
|
|
9718
|
+
this.subscriptions = [];
|
|
9719
|
+
this.areSubscriptionsSetUp = false;
|
|
9697
9720
|
};
|
|
9698
9721
|
this.call = call;
|
|
9699
9722
|
this.state = state;
|
|
9700
9723
|
this.trackType = trackType;
|
|
9701
9724
|
this.logger = getLogger([`${TrackType[trackType].toLowerCase()} manager`]);
|
|
9725
|
+
this.setup();
|
|
9726
|
+
}
|
|
9727
|
+
setup() {
|
|
9728
|
+
if (this.areSubscriptionsSetUp) {
|
|
9729
|
+
return;
|
|
9730
|
+
}
|
|
9731
|
+
this.areSubscriptionsSetUp = true;
|
|
9702
9732
|
if (deviceIds$ &&
|
|
9703
9733
|
!isReactNative() &&
|
|
9704
9734
|
(this.trackType === TrackType.AUDIO || this.trackType === TrackType.VIDEO)) {
|
|
@@ -10446,7 +10476,8 @@ class MicrophoneManagerState extends InputMediaDeviceManagerState {
|
|
|
10446
10476
|
}
|
|
10447
10477
|
getDeviceIdFromStream(stream) {
|
|
10448
10478
|
const [track] = stream.getAudioTracks();
|
|
10449
|
-
|
|
10479
|
+
const unresolvedDeviceId = track?.getSettings().deviceId;
|
|
10480
|
+
return resolveDeviceId(unresolvedDeviceId, 'audioinput');
|
|
10450
10481
|
}
|
|
10451
10482
|
}
|
|
10452
10483
|
|
|
@@ -10659,6 +10690,9 @@ class MicrophoneManager extends InputMediaDeviceManager {
|
|
|
10659
10690
|
super(call, new MicrophoneManagerState(disableMode), TrackType.AUDIO);
|
|
10660
10691
|
this.speakingWhileMutedNotificationEnabled = true;
|
|
10661
10692
|
this.soundDetectorConcurrencyTag = Symbol('soundDetectorConcurrencyTag');
|
|
10693
|
+
}
|
|
10694
|
+
setup() {
|
|
10695
|
+
super.setup();
|
|
10662
10696
|
this.subscriptions.push(createSafeAsyncSubscription(combineLatest([
|
|
10663
10697
|
this.call.state.callingState$,
|
|
10664
10698
|
this.call.state.ownCapabilities$,
|
|
@@ -10936,7 +10970,10 @@ class ScreenShareState extends InputMediaDeviceManagerState {
|
|
|
10936
10970
|
class ScreenShareManager extends InputMediaDeviceManager {
|
|
10937
10971
|
constructor(call) {
|
|
10938
10972
|
super(call, new ScreenShareState(), TrackType.SCREEN_SHARE);
|
|
10939
|
-
|
|
10973
|
+
}
|
|
10974
|
+
setup() {
|
|
10975
|
+
super.setup();
|
|
10976
|
+
this.subscriptions.push(createSubscription(this.call.state.settings$, (settings) => {
|
|
10940
10977
|
const maybeTargetResolution = settings?.screensharing.target_resolution;
|
|
10941
10978
|
if (maybeTargetResolution) {
|
|
10942
10979
|
this.setDefaultConstraints({
|
|
@@ -11059,6 +11096,7 @@ class SpeakerState {
|
|
|
11059
11096
|
class SpeakerManager {
|
|
11060
11097
|
constructor(call) {
|
|
11061
11098
|
this.subscriptions = [];
|
|
11099
|
+
this.areSubscriptionsSetUp = false;
|
|
11062
11100
|
/**
|
|
11063
11101
|
* Disposes the manager.
|
|
11064
11102
|
*
|
|
@@ -11066,9 +11104,18 @@ class SpeakerManager {
|
|
|
11066
11104
|
*/
|
|
11067
11105
|
this.dispose = () => {
|
|
11068
11106
|
this.subscriptions.forEach((s) => s.unsubscribe());
|
|
11107
|
+
this.subscriptions = [];
|
|
11108
|
+
this.areSubscriptionsSetUp = false;
|
|
11069
11109
|
};
|
|
11070
11110
|
this.call = call;
|
|
11071
11111
|
this.state = new SpeakerState(call.tracer);
|
|
11112
|
+
this.setup();
|
|
11113
|
+
}
|
|
11114
|
+
setup() {
|
|
11115
|
+
if (this.areSubscriptionsSetUp) {
|
|
11116
|
+
return;
|
|
11117
|
+
}
|
|
11118
|
+
this.areSubscriptionsSetUp = true;
|
|
11072
11119
|
if (deviceIds$ && !isReactNative()) {
|
|
11073
11120
|
this.subscriptions.push(combineLatest([deviceIds$, this.state.selectedDevice$]).subscribe(([devices, deviceId]) => {
|
|
11074
11121
|
if (!deviceId) {
|
|
@@ -11210,6 +11257,10 @@ class Call {
|
|
|
11210
11257
|
this.leaveCallHooks.add(registerEventHandlers(this, this.dispatcher));
|
|
11211
11258
|
this.registerEffects();
|
|
11212
11259
|
this.registerReconnectHandlers();
|
|
11260
|
+
this.camera.setup();
|
|
11261
|
+
this.microphone.setup();
|
|
11262
|
+
this.screenShare.setup();
|
|
11263
|
+
this.speaker.setup();
|
|
11213
11264
|
if (this.state.callingState === CallingState.LEFT) {
|
|
11214
11265
|
this.state.setCallingState(CallingState.IDLE);
|
|
11215
11266
|
}
|
|
@@ -11448,6 +11499,7 @@ class Call {
|
|
|
11448
11499
|
this.microphone.dispose();
|
|
11449
11500
|
this.screenShare.dispose();
|
|
11450
11501
|
this.speaker.dispose();
|
|
11502
|
+
this.deviceSettingsAppliedOnce = false;
|
|
11451
11503
|
const stopOnLeavePromises = [];
|
|
11452
11504
|
if (this.camera.stopOnLeave) {
|
|
11453
11505
|
stopOnLeavePromises.push(this.camera.disable(true));
|
|
@@ -14221,7 +14273,7 @@ class StreamClient {
|
|
|
14221
14273
|
this.getUserAgent = () => {
|
|
14222
14274
|
if (!this.cachedUserAgent) {
|
|
14223
14275
|
const { clientAppIdentifier = {} } = this.options;
|
|
14224
|
-
const { sdkName = 'js', sdkVersion = "1.25.
|
|
14276
|
+
const { sdkName = 'js', sdkVersion = "1.25.2", ...extras } = clientAppIdentifier;
|
|
14225
14277
|
this.cachedUserAgent = [
|
|
14226
14278
|
`stream-video-${sdkName}-v${sdkVersion}`,
|
|
14227
14279
|
...Object.entries(extras).map(([key, value]) => `${key}=${value}`),
|
|
@@ -14774,5 +14826,5 @@ class StreamVideoClient {
|
|
|
14774
14826
|
}
|
|
14775
14827
|
StreamVideoClient._instances = new Map();
|
|
14776
14828
|
|
|
14777
|
-
export { AudioSettingsRequestDefaultDeviceEnum, AudioSettingsResponseDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, FrameRecordingSettingsRequestModeEnum, FrameRecordingSettingsRequestQualityEnum, FrameRecordingSettingsResponseModeEnum, InputMediaDeviceManager, InputMediaDeviceManagerState, LayoutSettingsRequestNameEnum, MicrophoneManager, MicrophoneManagerState, NoiseCancellationSettingsModeEnum, OwnCapability, RTMPBroadcastRequestQualityEnum, RTMPSettingsRequestQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, ScreenShareManager, ScreenShareState, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, StartClosedCaptionsRequestLanguageEnum, StartTranscriptionRequestLanguageEnum, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoWriteableStateStore, TranscriptionSettingsRequestClosedCaptionModeEnum, TranscriptionSettingsRequestLanguageEnum, TranscriptionSettingsRequestModeEnum, TranscriptionSettingsResponseClosedCaptionModeEnum, TranscriptionSettingsResponseLanguageEnum, TranscriptionSettingsResponseModeEnum, VideoSettingsRequestCameraFacingEnum, VideoSettingsResponseCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, deviceIds$, disposeOfMediaStream, dominantSpeaker, getAudioBrowserPermission, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceState, getLogLevel, getLogger, getScreenShareStream, getSdkInfo, getVideoBrowserPermission, getVideoDevices, getVideoStream, getWebRTCInfo, hasAudio, hasScreenShare, hasScreenShareAudio, hasVideo, isPinned, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, paginatedLayoutSortPreset, pinned, publishingAudio, publishingVideo, reactionType, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setPowerState, setSdkInfo, setThermalState, setWebRTCInfo, speakerLayoutSortPreset, speaking };
|
|
14829
|
+
export { AudioSettingsRequestDefaultDeviceEnum, AudioSettingsResponseDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, FrameRecordingSettingsRequestModeEnum, FrameRecordingSettingsRequestQualityEnum, FrameRecordingSettingsResponseModeEnum, InputMediaDeviceManager, InputMediaDeviceManagerState, LayoutSettingsRequestNameEnum, MicrophoneManager, MicrophoneManagerState, NoiseCancellationSettingsModeEnum, OwnCapability, RTMPBroadcastRequestQualityEnum, RTMPSettingsRequestQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, ScreenShareManager, ScreenShareState, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, StartClosedCaptionsRequestLanguageEnum, StartTranscriptionRequestLanguageEnum, StreamSfuClient, StreamVideoClient, StreamVideoReadOnlyStateStore, StreamVideoWriteableStateStore, TranscriptionSettingsRequestClosedCaptionModeEnum, TranscriptionSettingsRequestLanguageEnum, TranscriptionSettingsRequestModeEnum, TranscriptionSettingsResponseClosedCaptionModeEnum, TranscriptionSettingsResponseLanguageEnum, TranscriptionSettingsResponseModeEnum, VideoSettingsRequestCameraFacingEnum, VideoSettingsResponseCameraFacingEnum, ViewportTracker, VisibilityState, checkIfAudioOutputChangeSupported, combineComparators, conditional, createSoundDetector, defaultSortPreset, descending, deviceIds$, disposeOfMediaStream, dominantSpeaker, getAudioBrowserPermission, getAudioDevices, getAudioOutputDevices, getAudioStream, getClientDetails, getDeviceState, getLogLevel, getLogger, getScreenShareStream, getSdkInfo, getVideoBrowserPermission, getVideoDevices, getVideoStream, getWebRTCInfo, hasAudio, hasScreenShare, hasScreenShareAudio, hasVideo, isPinned, livestreamOrAudioRoomSortPreset, logLevels, logToConsole, name, noopComparator, paginatedLayoutSortPreset, pinned, publishingAudio, publishingVideo, reactionType, resolveDeviceId, role, screenSharing, setDeviceInfo, setLogLevel, setLogger, setOSInfo, setPowerState, setSdkInfo, setThermalState, setWebRTCInfo, speakerLayoutSortPreset, speaking };
|
|
14778
14830
|
//# sourceMappingURL=index.browser.es.js.map
|