@stream-io/video-client 0.3.25 → 0.3.27
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 +14 -0
- package/dist/index.browser.es.js +65 -27
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +66 -28
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +65 -27
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +12 -3
- package/dist/src/gen/coordinator/index.d.ts +289 -142
- package/dist/src/store/CallState.d.ts +12 -3
- package/dist/version.d.ts +1 -1
- package/package.json +14 -14
- package/src/Call.ts +42 -4
- package/src/__tests__/server-side/call-types.test.ts +3 -7
- package/src/gen/coordinator/index.ts +295 -147
- package/src/store/CallState.ts +28 -7
- package/src/store/__tests__/CallState.test.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
|
4
4
|
|
|
5
|
+
### [0.3.27](https://github.com/GetStream/stream-video-js/compare/client0.3.26...client0.3.27) (2023-09-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* use `@types/ws` as a regular dependency ([#1115](https://github.com/GetStream/stream-video-js/issues/1115)) ([bafad33](https://github.com/GetStream/stream-video-js/commit/bafad3317b7b899b4f2a6a3fdf3b051ad4c96c34))
|
|
11
|
+
|
|
12
|
+
### [0.3.26](https://github.com/GetStream/stream-video-js/compare/client0.3.25...client0.3.26) (2023-09-27)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **Call Preview:** Support for call thumbnails ([#1099](https://github.com/GetStream/stream-video-js/issues/1099)) ([9274f76](https://github.com/GetStream/stream-video-js/commit/9274f760ed264ee0ee6ac97c6fe679288e067fd8))
|
|
18
|
+
|
|
5
19
|
### [0.3.25](https://github.com/GetStream/stream-video-js/compare/client0.3.24...client0.3.25) (2023-09-27)
|
|
6
20
|
|
|
7
21
|
|
package/dist/index.browser.es.js
CHANGED
|
@@ -34,6 +34,26 @@ const CreateDeviceRequestPushProviderEnum = {
|
|
|
34
34
|
HUAWEI: 'huawei',
|
|
35
35
|
XIAOMI: 'xiaomi',
|
|
36
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* @export
|
|
39
|
+
*/
|
|
40
|
+
const LayoutSettingsNameEnum = {
|
|
41
|
+
SPOTLIGHT: 'spotlight',
|
|
42
|
+
GRID: 'grid',
|
|
43
|
+
SINGLE_PARTICIPANT: 'single-participant',
|
|
44
|
+
MOBILE: 'mobile',
|
|
45
|
+
CUSTOM: 'custom',
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* @export
|
|
49
|
+
*/
|
|
50
|
+
const LayoutSettingsRequestNameEnum = {
|
|
51
|
+
SPOTLIGHT: 'spotlight',
|
|
52
|
+
GRID: 'grid',
|
|
53
|
+
SINGLE_PARTICIPANT: 'single-participant',
|
|
54
|
+
MOBILE: 'mobile',
|
|
55
|
+
CUSTOM: 'custom',
|
|
56
|
+
};
|
|
37
57
|
/**
|
|
38
58
|
* All possibility of string to use
|
|
39
59
|
* @export
|
|
@@ -64,25 +84,6 @@ const OwnCapability = {
|
|
|
64
84
|
UPDATE_CALL_PERMISSIONS: 'update-call-permissions',
|
|
65
85
|
UPDATE_CALL_SETTINGS: 'update-call-settings',
|
|
66
86
|
};
|
|
67
|
-
/**
|
|
68
|
-
* @export
|
|
69
|
-
*/
|
|
70
|
-
const RecordSettingsModeEnum = {
|
|
71
|
-
AVAILABLE: 'available',
|
|
72
|
-
DISABLED: 'disabled',
|
|
73
|
-
AUTO_ON: 'auto-on',
|
|
74
|
-
};
|
|
75
|
-
/**
|
|
76
|
-
* @export
|
|
77
|
-
*/
|
|
78
|
-
const RecordSettingsQualityEnum = {
|
|
79
|
-
AUDIO_ONLY: 'audio-only',
|
|
80
|
-
_360P: '360p',
|
|
81
|
-
_480P: '480p',
|
|
82
|
-
_720P: '720p',
|
|
83
|
-
_1080P: '1080p',
|
|
84
|
-
_1440P: '1440p',
|
|
85
|
-
};
|
|
86
87
|
/**
|
|
87
88
|
* @export
|
|
88
89
|
*/
|
|
@@ -95,7 +96,6 @@ const RecordSettingsRequestModeEnum = {
|
|
|
95
96
|
* @export
|
|
96
97
|
*/
|
|
97
98
|
const RecordSettingsRequestQualityEnum = {
|
|
98
|
-
AUDIO_ONLY: 'audio-only',
|
|
99
99
|
_360P: '360p',
|
|
100
100
|
_480P: '480p',
|
|
101
101
|
_720P: '720p',
|
|
@@ -7991,6 +7991,7 @@ class CallState {
|
|
|
7991
7991
|
this.settingsSubject = new BehaviorSubject(undefined);
|
|
7992
7992
|
this.transcribingSubject = new BehaviorSubject(false);
|
|
7993
7993
|
this.endedBySubject = new BehaviorSubject(undefined);
|
|
7994
|
+
this.thumbnailsSubject = new BehaviorSubject(undefined);
|
|
7994
7995
|
this.membersSubject = new BehaviorSubject([]);
|
|
7995
7996
|
this.ownCapabilitiesSubject = new BehaviorSubject([]);
|
|
7996
7997
|
this.callingStateSubject = new BehaviorSubject(CallingState.UNKNOWN);
|
|
@@ -8251,6 +8252,7 @@ class CallState {
|
|
|
8251
8252
|
this.setCurrentValue(this.sessionSubject, call.session);
|
|
8252
8253
|
this.setCurrentValue(this.settingsSubject, call.settings);
|
|
8253
8254
|
this.setCurrentValue(this.transcribingSubject, call.transcribing);
|
|
8255
|
+
this.setCurrentValue(this.thumbnailsSubject, call.thumbnails);
|
|
8254
8256
|
};
|
|
8255
8257
|
this.updateFromMemberRemoved = (event) => {
|
|
8256
8258
|
this.setCurrentValue(this.membersSubject, (members) => members.filter((m) => event.members.indexOf(m.user_id) === -1));
|
|
@@ -8261,10 +8263,10 @@ class CallState {
|
|
|
8261
8263
|
...event.members,
|
|
8262
8264
|
]);
|
|
8263
8265
|
};
|
|
8264
|
-
this.
|
|
8266
|
+
this.updateFromHLSBroadcastStopped = () => {
|
|
8265
8267
|
this.setCurrentValue(this.egressSubject, (egress) => (Object.assign(Object.assign({}, egress), { broadcasting: false })));
|
|
8266
8268
|
};
|
|
8267
|
-
this.
|
|
8269
|
+
this.updateFromHLSBroadcastStarted = (event) => {
|
|
8268
8270
|
this.setCurrentValue(this.egressSubject, (egress) => (Object.assign(Object.assign({}, egress), { broadcasting: true, hls: Object.assign(Object.assign({}, egress.hls), { playlist_url: event.hls_playlist_url }) })));
|
|
8269
8271
|
};
|
|
8270
8272
|
this.updateFromSessionParticipantLeft = (event) => {
|
|
@@ -8362,6 +8364,7 @@ class CallState {
|
|
|
8362
8364
|
this.settings$ = this.settingsSubject.asObservable();
|
|
8363
8365
|
this.transcribing$ = this.transcribingSubject.asObservable();
|
|
8364
8366
|
this.endedBy$ = this.endedBySubject.asObservable();
|
|
8367
|
+
this.thumbnails$ = this.thumbnailsSubject.asObservable();
|
|
8365
8368
|
this.eventHandlers = {
|
|
8366
8369
|
// these events are not updating the call state:
|
|
8367
8370
|
'call.permission_request': undefined,
|
|
@@ -8375,7 +8378,10 @@ class CallState {
|
|
|
8375
8378
|
// events that update call state:
|
|
8376
8379
|
'call.accepted': (e) => this.updateFromCallResponse(e.call),
|
|
8377
8380
|
'call.created': (e) => this.updateFromCallResponse(e.call),
|
|
8378
|
-
'call.notification': (e) =>
|
|
8381
|
+
'call.notification': (e) => {
|
|
8382
|
+
this.updateFromCallResponse(e.call);
|
|
8383
|
+
this.setMembers(e.members);
|
|
8384
|
+
},
|
|
8379
8385
|
'call.rejected': (e) => this.updateFromCallResponse(e.call),
|
|
8380
8386
|
'call.ring': (e) => this.updateFromCallResponse(e.call),
|
|
8381
8387
|
'call.live_started': (e) => this.updateFromCallResponse(e.call),
|
|
@@ -8388,8 +8394,8 @@ class CallState {
|
|
|
8388
8394
|
},
|
|
8389
8395
|
'call.recording_started': () => this.setCurrentValue(this.recordingSubject, true),
|
|
8390
8396
|
'call.recording_stopped': () => this.setCurrentValue(this.recordingSubject, false),
|
|
8391
|
-
'call.
|
|
8392
|
-
'call.
|
|
8397
|
+
'call.hls_broadcasting_started': this.updateFromHLSBroadcastStarted,
|
|
8398
|
+
'call.hls_broadcasting_stopped': this.updateFromHLSBroadcastStopped,
|
|
8393
8399
|
'call.session_participant_joined': this.updateFromSessionParticipantJoined,
|
|
8394
8400
|
'call.session_participant_left': this.updateFromSessionParticipantLeft,
|
|
8395
8401
|
'call.blocked_user': this.blockUser,
|
|
@@ -8573,6 +8579,12 @@ class CallState {
|
|
|
8573
8579
|
get endedBy() {
|
|
8574
8580
|
return this.getCurrentValue(this.endedBy$);
|
|
8575
8581
|
}
|
|
8582
|
+
/**
|
|
8583
|
+
* Will provide the thumbnails of this call, if enabled in the call settings.
|
|
8584
|
+
*/
|
|
8585
|
+
get thumbnails() {
|
|
8586
|
+
return this.getCurrentValue(this.thumbnails$);
|
|
8587
|
+
}
|
|
8576
8588
|
}
|
|
8577
8589
|
|
|
8578
8590
|
/**
|
|
@@ -11846,6 +11858,32 @@ class Call {
|
|
|
11846
11858
|
unbind();
|
|
11847
11859
|
};
|
|
11848
11860
|
};
|
|
11861
|
+
/**
|
|
11862
|
+
* Binds a DOM <img> element to this call's thumbnail (if enabled in settings).
|
|
11863
|
+
*
|
|
11864
|
+
* @param imageElement the image element to bind to.
|
|
11865
|
+
* @param opts options for the binding.
|
|
11866
|
+
*/
|
|
11867
|
+
this.bindCallThumbnailElement = (imageElement, opts = {}) => {
|
|
11868
|
+
const handleError = () => {
|
|
11869
|
+
imageElement.src =
|
|
11870
|
+
opts.fallbackImageSource ||
|
|
11871
|
+
'https://getstream.io/random_svg/?name=x&id=x';
|
|
11872
|
+
};
|
|
11873
|
+
const unsubscribe = createSubscription(this.state.thumbnails$, (thumbnails) => {
|
|
11874
|
+
if (!thumbnails)
|
|
11875
|
+
return;
|
|
11876
|
+
imageElement.addEventListener('error', handleError);
|
|
11877
|
+
const thumbnailUrl = new URL(thumbnails.image_url);
|
|
11878
|
+
thumbnailUrl.searchParams.set('w', String(imageElement.clientWidth));
|
|
11879
|
+
thumbnailUrl.searchParams.set('h', String(imageElement.clientHeight));
|
|
11880
|
+
imageElement.src = thumbnailUrl.toString();
|
|
11881
|
+
});
|
|
11882
|
+
return () => {
|
|
11883
|
+
unsubscribe();
|
|
11884
|
+
imageElement.removeEventListener('error', handleError);
|
|
11885
|
+
};
|
|
11886
|
+
};
|
|
11849
11887
|
this.type = type;
|
|
11850
11888
|
this.id = id;
|
|
11851
11889
|
this.cid = `${type}:${id}`;
|
|
@@ -13180,7 +13218,7 @@ class WSConnectionFallback {
|
|
|
13180
13218
|
}
|
|
13181
13219
|
}
|
|
13182
13220
|
|
|
13183
|
-
const version = '0.3.
|
|
13221
|
+
const version = '0.3.27';
|
|
13184
13222
|
|
|
13185
13223
|
const logger = getLogger(['location']);
|
|
13186
13224
|
const HINT_URL = `https://hint.stream-io-video.com/`;
|
|
@@ -14160,5 +14198,5 @@ class StreamVideoServerClient extends StreamVideoClient {
|
|
|
14160
14198
|
}
|
|
14161
14199
|
}
|
|
14162
14200
|
|
|
14163
|
-
export { AudioSettingsDefaultDeviceEnum, AudioSettingsRequestDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, InputMediaDeviceManager, InputMediaDeviceManagerState,
|
|
14201
|
+
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, 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, isStreamVideoLocalParticipant, 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 };
|
|
14164
14202
|
//# sourceMappingURL=index.browser.es.js.map
|