@stream-io/video-client 1.16.2 → 1.16.4
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 +62 -26
- package/dist/index.browser.es.js.map +1 -1
- package/dist/index.cjs.js +63 -25
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +62 -26
- package/dist/index.es.js.map +1 -1
- package/dist/src/Call.d.ts +11 -6
- package/dist/src/gen/coordinator/index.d.ts +122 -7
- package/dist/src/rtc/BasePeerConnection.d.ts +1 -1
- package/dist/src/rtc/Publisher.d.ts +8 -0
- package/package.json +1 -1
- package/src/Call.ts +29 -23
- package/src/gen/coordinator/index.ts +128 -7
- package/src/rtc/BasePeerConnection.ts +2 -2
- package/src/rtc/Publisher.ts +19 -0
- package/src/rtc/__tests__/Publisher.test.ts +10 -0
- package/src/rtc/__tests__/mocks/webrtc.mocks.ts +1 -1
package/dist/index.es.js
CHANGED
|
@@ -32,6 +32,22 @@ const CreateDeviceRequestPushProviderEnum = {
|
|
|
32
32
|
HUAWEI: 'huawei',
|
|
33
33
|
XIAOMI: 'xiaomi',
|
|
34
34
|
};
|
|
35
|
+
/**
|
|
36
|
+
* @export
|
|
37
|
+
*/
|
|
38
|
+
const FrameRecordingSettingsRequestModeEnum = {
|
|
39
|
+
AVAILABLE: 'available',
|
|
40
|
+
DISABLED: 'disabled',
|
|
41
|
+
AUTO_ON: 'auto-on',
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* @export
|
|
45
|
+
*/
|
|
46
|
+
const FrameRecordingSettingsResponseModeEnum = {
|
|
47
|
+
AVAILABLE: 'available',
|
|
48
|
+
DISABLED: 'disabled',
|
|
49
|
+
AUTO_ON: 'auto-on',
|
|
50
|
+
};
|
|
35
51
|
/**
|
|
36
52
|
* @export
|
|
37
53
|
*/
|
|
@@ -73,10 +89,12 @@ const OwnCapability = {
|
|
|
73
89
|
SEND_VIDEO: 'send-video',
|
|
74
90
|
START_BROADCAST_CALL: 'start-broadcast-call',
|
|
75
91
|
START_CLOSED_CAPTIONS_CALL: 'start-closed-captions-call',
|
|
92
|
+
START_FRAME_RECORD_CALL: 'start-frame-record-call',
|
|
76
93
|
START_RECORD_CALL: 'start-record-call',
|
|
77
94
|
START_TRANSCRIPTION_CALL: 'start-transcription-call',
|
|
78
95
|
STOP_BROADCAST_CALL: 'stop-broadcast-call',
|
|
79
96
|
STOP_CLOSED_CAPTIONS_CALL: 'stop-closed-captions-call',
|
|
97
|
+
STOP_FRAME_RECORD_CALL: 'stop-frame-record-call',
|
|
80
98
|
STOP_RECORD_CALL: 'stop-record-call',
|
|
81
99
|
STOP_TRANSCRIPTION_CALL: 'stop-transcription-call',
|
|
82
100
|
UPDATE_CALL: 'update-call',
|
|
@@ -5186,15 +5204,6 @@ class BasePeerConnection {
|
|
|
5186
5204
|
this.isIceRestarting = false;
|
|
5187
5205
|
this.isDisposed = false;
|
|
5188
5206
|
this.subscriptions = [];
|
|
5189
|
-
/**
|
|
5190
|
-
* Disposes the `RTCPeerConnection` instance.
|
|
5191
|
-
*/
|
|
5192
|
-
this.dispose = () => {
|
|
5193
|
-
this.onUnrecoverableError = undefined;
|
|
5194
|
-
this.isDisposed = true;
|
|
5195
|
-
this.detachEventHandlers();
|
|
5196
|
-
this.pc.close();
|
|
5197
|
-
};
|
|
5198
5207
|
/**
|
|
5199
5208
|
* Handles events synchronously.
|
|
5200
5209
|
* Consecutive events are queued and executed one after the other.
|
|
@@ -5331,6 +5340,15 @@ class BasePeerConnection {
|
|
|
5331
5340
|
this.pc.addEventListener('icegatheringstatechange', this.onIceGatherChange);
|
|
5332
5341
|
this.pc.addEventListener('signalingstatechange', this.onSignalingChange);
|
|
5333
5342
|
}
|
|
5343
|
+
/**
|
|
5344
|
+
* Disposes the `RTCPeerConnection` instance.
|
|
5345
|
+
*/
|
|
5346
|
+
dispose() {
|
|
5347
|
+
this.onUnrecoverableError = undefined;
|
|
5348
|
+
this.isDisposed = true;
|
|
5349
|
+
this.detachEventHandlers();
|
|
5350
|
+
this.pc.close();
|
|
5351
|
+
}
|
|
5334
5352
|
/**
|
|
5335
5353
|
* Detaches the event handlers from the `RTCPeerConnection`.
|
|
5336
5354
|
*/
|
|
@@ -5691,7 +5709,9 @@ class Publisher extends BasePeerConnection {
|
|
|
5691
5709
|
this.addTransceiver(trackToPublish, publishOption);
|
|
5692
5710
|
}
|
|
5693
5711
|
else {
|
|
5712
|
+
const previousTrack = transceiver.sender.track;
|
|
5694
5713
|
await transceiver.sender.replaceTrack(trackToPublish);
|
|
5714
|
+
previousTrack?.stop();
|
|
5695
5715
|
}
|
|
5696
5716
|
}
|
|
5697
5717
|
};
|
|
@@ -5783,6 +5803,14 @@ class Publisher extends BasePeerConnection {
|
|
|
5783
5803
|
transceiver.sender.track?.stop();
|
|
5784
5804
|
}
|
|
5785
5805
|
};
|
|
5806
|
+
/**
|
|
5807
|
+
* Stops all the cloned tracks that are being published to the SFU.
|
|
5808
|
+
*/
|
|
5809
|
+
this.stopAllTracks = () => {
|
|
5810
|
+
for (const { transceiver } of this.transceiverCache.items()) {
|
|
5811
|
+
transceiver.sender.track?.stop();
|
|
5812
|
+
}
|
|
5813
|
+
};
|
|
5786
5814
|
this.changePublishQuality = async (videoSender) => {
|
|
5787
5815
|
const { trackType, layers, publishOptionId } = videoSender;
|
|
5788
5816
|
const enabledLayers = layers.filter((l) => l.active);
|
|
@@ -5991,6 +6019,13 @@ class Publisher extends BasePeerConnection {
|
|
|
5991
6019
|
// abort any ongoing negotiation
|
|
5992
6020
|
withCancellation('publisher.negotiate', () => Promise.resolve());
|
|
5993
6021
|
}
|
|
6022
|
+
/**
|
|
6023
|
+
* Disposes this Publisher instance.
|
|
6024
|
+
*/
|
|
6025
|
+
dispose() {
|
|
6026
|
+
super.dispose();
|
|
6027
|
+
this.stopAllTracks();
|
|
6028
|
+
}
|
|
5994
6029
|
}
|
|
5995
6030
|
|
|
5996
6031
|
/**
|
|
@@ -7414,7 +7449,7 @@ const aggregate = (stats) => {
|
|
|
7414
7449
|
return report;
|
|
7415
7450
|
};
|
|
7416
7451
|
|
|
7417
|
-
const version = "1.16.
|
|
7452
|
+
const version = "1.16.4";
|
|
7418
7453
|
const [major, minor, patch] = version.split('.');
|
|
7419
7454
|
let sdkInfo = {
|
|
7420
7455
|
type: SdkType.PLAIN_JAVASCRIPT,
|
|
@@ -11541,6 +11576,19 @@ class Call {
|
|
|
11541
11576
|
this.stopRTMPBroadcast = async (name) => {
|
|
11542
11577
|
return this.streamClient.post(`${this.streamClientBasePath}/rtmp_broadcasts/${name}/stop`);
|
|
11543
11578
|
};
|
|
11579
|
+
/**
|
|
11580
|
+
* Starts frame by frame recording.
|
|
11581
|
+
* Sends call.frame_recording_started events
|
|
11582
|
+
*/
|
|
11583
|
+
this.startFrameRecording = async (data) => {
|
|
11584
|
+
return this.streamClient.post(`${this.streamClientBasePath}/start_frame_recording`, data);
|
|
11585
|
+
};
|
|
11586
|
+
/**
|
|
11587
|
+
* Stops frame recording.
|
|
11588
|
+
*/
|
|
11589
|
+
this.stopFrameRecording = async () => {
|
|
11590
|
+
return this.streamClient.post(`${this.streamClientBasePath}/stop_frame_recording`);
|
|
11591
|
+
};
|
|
11544
11592
|
/**
|
|
11545
11593
|
* Updates the call settings or custom data.
|
|
11546
11594
|
*
|
|
@@ -11698,25 +11746,13 @@ class Call {
|
|
|
11698
11746
|
* @param rating Rating between 1 and 5 denoting the experience of the user in the call
|
|
11699
11747
|
* @param reason The reason/description for the rating
|
|
11700
11748
|
* @param custom Custom data
|
|
11701
|
-
* @returns
|
|
11702
11749
|
*/
|
|
11703
11750
|
this.submitFeedback = async (rating, { reason, custom, } = {}) => {
|
|
11704
|
-
if (rating < 1 || rating > 5) {
|
|
11705
|
-
throw new Error('Rating must be between 1 and 5');
|
|
11706
|
-
}
|
|
11707
|
-
const callSessionId = this.state.session?.id;
|
|
11708
|
-
if (!callSessionId) {
|
|
11709
|
-
throw new Error('Feedback can be submitted only in the context of a call session');
|
|
11710
|
-
}
|
|
11711
11751
|
const { sdkName, sdkVersion, ...platform } = getSdkSignature(getClientDetails());
|
|
11712
|
-
|
|
11713
|
-
// until we relax the backend validation, we'll send N/A
|
|
11714
|
-
const userSessionId = this.sfuClient?.sessionId ?? 'N/A';
|
|
11715
|
-
const endpoint = `${this.streamClientBasePath}/feedback/${callSessionId}`;
|
|
11716
|
-
return this.streamClient.post(endpoint, {
|
|
11752
|
+
return this.streamClient.post(`${this.streamClientBasePath}/feedback`, {
|
|
11717
11753
|
rating,
|
|
11718
11754
|
reason,
|
|
11719
|
-
user_session_id:
|
|
11755
|
+
user_session_id: this.sfuClient?.sessionId,
|
|
11720
11756
|
sdk: sdkName,
|
|
11721
11757
|
sdk_version: sdkVersion,
|
|
11722
11758
|
custom: {
|
|
@@ -13019,7 +13055,7 @@ class StreamClient {
|
|
|
13019
13055
|
return await this.wsConnection.connect(this.defaultWSTimeout);
|
|
13020
13056
|
};
|
|
13021
13057
|
this.getUserAgent = () => {
|
|
13022
|
-
const version = "1.16.
|
|
13058
|
+
const version = "1.16.4";
|
|
13023
13059
|
return (this.userAgent ||
|
|
13024
13060
|
`stream-video-javascript-client-${this.node ? 'node' : 'browser'}-${version}`);
|
|
13025
13061
|
};
|
|
@@ -13528,5 +13564,5 @@ class StreamVideoClient {
|
|
|
13528
13564
|
}
|
|
13529
13565
|
StreamVideoClient._instanceMap = new Map();
|
|
13530
13566
|
|
|
13531
|
-
export { AudioSettingsRequestDefaultDeviceEnum, AudioSettingsResponseDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, InputMediaDeviceManager, InputMediaDeviceManagerState, LayoutSettingsRequestNameEnum, MicrophoneManager, MicrophoneManagerState, NoiseCancellationSettingsModeEnum, OwnCapability, RTMPBroadcastRequestQualityEnum, RTMPSettingsRequestQualityEnum, RecordSettingsRequestModeEnum, RecordSettingsRequestQualityEnum, rxUtils as RxUtils, ScreenShareManager, ScreenShareState, events as SfuEvents, models as SfuModels, SpeakerManager, SpeakerState, 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, getDeviceInfo, getDeviceState, getLogLevel, getLogger, getOSInfo, 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 };
|
|
13567
|
+
export { AudioSettingsRequestDefaultDeviceEnum, AudioSettingsResponseDefaultDeviceEnum, browsers as Browsers, Call, CallState, CallType, CallTypes, CallingState, CameraManager, CameraManagerState, CreateDeviceRequestPushProviderEnum, DebounceType, DynascaleManager, ErrorFromResponse, FrameRecordingSettingsRequestModeEnum, 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, 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, getDeviceInfo, getDeviceState, getLogLevel, getLogger, getOSInfo, 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 };
|
|
13532
13568
|
//# sourceMappingURL=index.es.js.map
|