@100mslive/hms-video-store 0.14.6 → 0.14.7
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/dist/events/EventBus.d.ts +2 -1
- package/dist/index.cjs.js +25 -8
- package/dist/index.cjs.js.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -8
- package/dist/index.js.map +3 -3
- package/dist/interfaces/index.d.ts +1 -0
- package/dist/interfaces/preview-listener.d.ts +2 -1
- package/dist/interfaces/track-interruption.d.ts +20 -0
- package/dist/interfaces/update-listener.d.ts +2 -1
- package/dist/media/tracks/HMSAudioTrack.d.ts +1 -0
- package/dist/media/tracks/HMSLocalAudioTrack.d.ts +59 -0
- package/dist/media/tracks/HMSLocalVideoTrack.d.ts +52 -1
- package/dist/playlist-manager/AudioContextManager.d.ts +3 -1
- package/dist/reactive-store/HMSNotifications.d.ts +1 -0
- package/dist/reactive-store/HMSSDKActions.d.ts +3 -2
- package/dist/schema/notification.d.ts +11 -3
- package/dist/schema/peer.d.ts +8 -0
- package/dist/sdk/index.d.ts +1 -0
- package/dist/sdk/store/Store.d.ts +1 -1
- package/dist/selectors/selectors.d.ts +13 -0
- package/dist/utils/constants.d.ts +1 -0
- package/dist/utils/support.d.ts +6 -0
- package/package.json +2 -2
|
@@ -12,6 +12,7 @@ export type { HMSSimulcastLayerDefinition, SimulcastLayer, RID, HMSPreferredSimu
|
|
|
12
12
|
export { HMSSimulcastLayer, simulcastMapping } from './simulcast-layers';
|
|
13
13
|
export * from './track-settings';
|
|
14
14
|
export * from './devices';
|
|
15
|
+
export * from './track-interruption';
|
|
15
16
|
export * from './playlist';
|
|
16
17
|
export * from './rtmp-recording-config';
|
|
17
18
|
export * from './hls-config';
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DeviceChangeListener } from './devices';
|
|
2
2
|
import { HMSPeer } from './peer';
|
|
3
3
|
import { HMSRoom } from './room';
|
|
4
|
+
import { TrackInterruptionListener } from './track-interruption';
|
|
4
5
|
import { HMSPeerUpdate, HMSRoomUpdate, HMSTrackUpdate } from './update-listener';
|
|
5
6
|
import { HMSException } from '../error/HMSException';
|
|
6
7
|
import { HMSTrack } from '../media/tracks/HMSTrack';
|
|
7
|
-
export interface HMSPreviewListener extends DeviceChangeListener {
|
|
8
|
+
export interface HMSPreviewListener extends DeviceChangeListener, TrackInterruptionListener {
|
|
8
9
|
onPreview(room: HMSRoom, localTracks: HMSTrack[]): void;
|
|
9
10
|
onError(exception: HMSException): void;
|
|
10
11
|
onReconnecting(error: HMSException): void;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Emitted when a local track stops/starts producing media because the OS or another app took over
|
|
3
|
+
* the device - a phone call or a native voip app.
|
|
4
|
+
*
|
|
5
|
+
* Only raised for a device the user can do something about: the page is visible and the device is
|
|
6
|
+
* really not capturing. Backgrounding the tab on mobile stops the device too, but it is handed back
|
|
7
|
+
* on return, so that on its own is not reported - if it does not come back, the interruption is
|
|
8
|
+
* raised once the page is visible again.
|
|
9
|
+
*/
|
|
10
|
+
export interface HMSTrackInterruption {
|
|
11
|
+
/** true when the interruption starts, false when it ends */
|
|
12
|
+
started: boolean;
|
|
13
|
+
/** what triggered the interruption, eg. track-muted-natively, visibility-change */
|
|
14
|
+
reason: string;
|
|
15
|
+
type: 'audio' | 'video';
|
|
16
|
+
trackId: string;
|
|
17
|
+
}
|
|
18
|
+
export interface TrackInterruptionListener {
|
|
19
|
+
onTrackInterruption?(interruption: HMSTrackInterruption): void;
|
|
20
|
+
}
|
|
@@ -6,6 +6,7 @@ import { HMSRoleChangeRequest } from './role-change-request';
|
|
|
6
6
|
import { HMSRoom } from './room';
|
|
7
7
|
import { HMSPoll, HMSWhiteboard, SessionStoreUpdate } from './session-store';
|
|
8
8
|
import { HMSSpeaker } from './speaker';
|
|
9
|
+
import { TrackInterruptionListener } from './track-interruption';
|
|
9
10
|
import { HMSException } from '../error/HMSException';
|
|
10
11
|
import { HMSTrack } from '../media/tracks/HMSTrack';
|
|
11
12
|
import { MessageNotification } from '../notification-manager';
|
|
@@ -65,7 +66,7 @@ export interface InteractivityListener {
|
|
|
65
66
|
onPollsUpdate(type: HMSPollsUpdate, polls: HMSPoll[]): void;
|
|
66
67
|
onWhiteboardUpdate(whiteboard: HMSWhiteboard): void;
|
|
67
68
|
}
|
|
68
|
-
export interface HMSUpdateListener extends DeviceChangeListener, SessionStoreListener, InteractivityListener {
|
|
69
|
+
export interface HMSUpdateListener extends DeviceChangeListener, SessionStoreListener, InteractivityListener, TrackInterruptionListener {
|
|
69
70
|
onJoin(room: HMSRoom): void;
|
|
70
71
|
onRoomUpdate(type: HMSRoomUpdate, room: HMSRoom): void;
|
|
71
72
|
onPeerUpdate(type: HMSPeerUpdate, peer: HMSPeer | HMSPeer[] | null): void;
|
|
@@ -17,5 +17,6 @@ export declare class HMSAudioTrack extends HMSTrack {
|
|
|
17
17
|
getOutputDevice(): MediaDeviceInfo | undefined;
|
|
18
18
|
cleanup(): void;
|
|
19
19
|
setOutputDevice(device?: MediaDeviceInfo): Promise<void>;
|
|
20
|
+
private logSetSinkIdSkipped;
|
|
20
21
|
protected subscribeToAudio(value: boolean): Promise<void>;
|
|
21
22
|
}
|
|
@@ -21,6 +21,17 @@ export declare class HMSLocalAudioTrack extends HMSAudioTrack {
|
|
|
21
21
|
*/
|
|
22
22
|
private tracksCreated;
|
|
23
23
|
private permissionState?;
|
|
24
|
+
/**
|
|
25
|
+
* Set when the OS or another app takes the mic - an incoming call, a native voip app, or safari
|
|
26
|
+
* being backgrounded on iOS. The native track flags cannot be trusted once that has happened:
|
|
27
|
+
* iOS hands back a track that reports live and unmuted while its capture unit stays stopped, so
|
|
28
|
+
* recovery is driven off this instead of shouldReacquireTrack alone.
|
|
29
|
+
*/
|
|
30
|
+
private interrupted;
|
|
31
|
+
/** whether the app has been told about an interruption, keeps the start/end pair intact */
|
|
32
|
+
private interruptionNotified;
|
|
33
|
+
/** in flight interruption recovery, see endInterruption */
|
|
34
|
+
private recovery?;
|
|
24
35
|
audioLevelMonitor?: TrackAudioLevelMonitor;
|
|
25
36
|
/**
|
|
26
37
|
* see the doc in HMSLocalVideoTrack
|
|
@@ -36,6 +47,33 @@ export declare class HMSLocalAudioTrack extends HMSAudioTrack {
|
|
|
36
47
|
getManuallySelectedDeviceId(): string | undefined;
|
|
37
48
|
resetManuallySelectedDeviceId(): void;
|
|
38
49
|
private handleVisibilityChange;
|
|
50
|
+
private handleForegrounded;
|
|
51
|
+
/**
|
|
52
|
+
* The mic cannot come back while the permission is not granted, so an interruption that is still
|
|
53
|
+
* open is raised now, on a visible page. Only one that was actually recorded: reaching here does
|
|
54
|
+
* not mean anything was taken away, since a peer that joined muted holds an empty track that
|
|
55
|
+
* reports itself as needing reacquisition for the whole session and never granted the permission.
|
|
56
|
+
*/
|
|
57
|
+
private handlePermissionNotGranted;
|
|
58
|
+
/**
|
|
59
|
+
* The mic did not come back, and the user is now here to see it. Either signal is enough: the
|
|
60
|
+
* flags lie after an iOS interruption, where only `interrupted` - cleared once the track has
|
|
61
|
+
* actually been replaced - says whether recovery worked, and a mic that died without ever firing
|
|
62
|
+
* mute was never recorded as interrupted but does report it.
|
|
63
|
+
*/
|
|
64
|
+
private notifyIfStillInterrupted;
|
|
65
|
+
private handleBackgrounded;
|
|
66
|
+
/**
|
|
67
|
+
* Interruption end. Both triggers - the native unmute and coming back to the foreground - have to
|
|
68
|
+
* do the same three things:
|
|
69
|
+
* 1. get a track that actually captures. Only a fresh getUserMedia is reliable here, the
|
|
70
|
+
* interrupted track can report live and unmuted and still produce nothing.
|
|
71
|
+
* 2. re-publish the enabled state. On interruption start biz is told mute=true, on which every
|
|
72
|
+
* remote peer unsubscribes from this peer's audio - they resubscribe only on the next update.
|
|
73
|
+
* 3. resume the remote playback the OS paused along with capture.
|
|
74
|
+
*/
|
|
75
|
+
private endInterruption;
|
|
76
|
+
private restoreCapture;
|
|
39
77
|
/**
|
|
40
78
|
* Replace the new track in stream and update native track
|
|
41
79
|
* @param track
|
|
@@ -83,9 +121,30 @@ export declare class HMSLocalAudioTrack extends HMSAudioTrack {
|
|
|
83
121
|
private addTrackEventListeners;
|
|
84
122
|
private removeTrackEventListeners;
|
|
85
123
|
private trackPermissions;
|
|
124
|
+
private sendInterruptionAnalytics;
|
|
125
|
+
/**
|
|
126
|
+
* app facing interruption event, for a mic that is actually not capturing and a user who is there
|
|
127
|
+
* to see it. Two things it deliberately stays quiet about:
|
|
128
|
+
*
|
|
129
|
+
* - a hidden page. Backgrounding is not an interruption to prompt about even when the OS does stop
|
|
130
|
+
* the mic, because the mic is reacquired on the way back. If it does not come back,
|
|
131
|
+
* handleForegrounded raises it once the page is visible, which is the first moment a prompt is
|
|
132
|
+
* worth anything.
|
|
133
|
+
* - an unpaired event. An end is only published after the mic has actually recovered, so a prompt
|
|
134
|
+
* stays up while the mic is still unusable, and never for a start that was never published.
|
|
135
|
+
*
|
|
136
|
+
* The analytics events are not gated with it - interruption.start/stop record every interruption,
|
|
137
|
+
* including the ones the user never had to hear about.
|
|
138
|
+
*/
|
|
139
|
+
private notifyInterruption;
|
|
86
140
|
private handleTrackMute;
|
|
87
141
|
/** @internal */
|
|
88
142
|
handleTrackUnmute: () => Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* A track that went through an interruption has to be replaced even when it reports live and
|
|
145
|
+
* unmuted - see `interrupted`.
|
|
146
|
+
*/
|
|
147
|
+
private reacquireStaleTrack;
|
|
89
148
|
private replaceSenderTrack;
|
|
90
149
|
private shouldReacquireTrack;
|
|
91
150
|
private buildNewSettings;
|
|
@@ -16,6 +16,19 @@ export declare class HMSLocalVideoTrack extends HMSVideoTrack {
|
|
|
16
16
|
private _layerDefinitions;
|
|
17
17
|
private TAG;
|
|
18
18
|
private enabledStateBeforeBackground;
|
|
19
|
+
/**
|
|
20
|
+
* Set when the OS or another app takes the camera - a video call, a native app, or safari being
|
|
21
|
+
* backgrounded on iOS. The native track flags cannot be trusted once that has happened, the
|
|
22
|
+
* resumed track can report live and unmuted while producing frozen frames, so recovery is driven
|
|
23
|
+
* off this.
|
|
24
|
+
*/
|
|
25
|
+
private interrupted;
|
|
26
|
+
/** whether the app has been told about an interruption, keeps the start/end pair intact */
|
|
27
|
+
private interruptionNotified;
|
|
28
|
+
/** in flight interruption recovery, see endInterruption */
|
|
29
|
+
private recovery?;
|
|
30
|
+
/** the visibilitychange handler is only attached on mobile, see the constructor */
|
|
31
|
+
private recoversOnForeground;
|
|
19
32
|
private permissionState?;
|
|
20
33
|
/**
|
|
21
34
|
* true if it's screenshare and current tab is what is being shared. Browser dependent, Chromium only
|
|
@@ -51,7 +64,7 @@ export declare class HMSLocalVideoTrack extends HMSVideoTrack {
|
|
|
51
64
|
* use this function to set the enabled state of a track. If true the track will be unmuted and muted otherwise.
|
|
52
65
|
* @param value
|
|
53
66
|
*/
|
|
54
|
-
setEnabled(value: boolean): Promise<void>;
|
|
67
|
+
setEnabled(value: boolean, skipcheck?: boolean, reason?: string): Promise<void>;
|
|
55
68
|
private processPlugins;
|
|
56
69
|
addStreamPlugins(plugins: HMSMediaStreamPlugin[]): Promise<void>;
|
|
57
70
|
removeStreamPlugins(plugins: HMSMediaStreamPlugin[]): Promise<void>;
|
|
@@ -153,6 +166,34 @@ export declare class HMSLocalVideoTrack extends HMSVideoTrack {
|
|
|
153
166
|
private addTrackEventListeners;
|
|
154
167
|
private removeTrackEventListeners;
|
|
155
168
|
private trackPermissions;
|
|
169
|
+
private sendInterruptionAnalytics;
|
|
170
|
+
/**
|
|
171
|
+
* app facing interruption event, for a camera that is actually not capturing and a user who is
|
|
172
|
+
* there to see it. Two things it deliberately stays quiet about:
|
|
173
|
+
*
|
|
174
|
+
* - a hidden page. The camera is released on the way out - by us, in handleBackgrounded - and
|
|
175
|
+
* reacquired on the way back, so backgrounding on its own is nothing to prompt about. If the
|
|
176
|
+
* camera does not come back, handleForegrounded raises it once the page is visible, which is the
|
|
177
|
+
* first moment a prompt is worth anything.
|
|
178
|
+
* - an unpaired event. An end is only published after the camera has actually been reacquired, so
|
|
179
|
+
* a prompt stays up while the tile is still frozen, and never for a start that was never
|
|
180
|
+
* published.
|
|
181
|
+
*
|
|
182
|
+
* The analytics events are not gated with it - interruption.start/stop record every interruption,
|
|
183
|
+
* including the ones the user never had to see.
|
|
184
|
+
*/
|
|
185
|
+
private notifyInterruption;
|
|
186
|
+
/**
|
|
187
|
+
* Interruption end, from either trigger - the native unmute or coming back to the foreground.
|
|
188
|
+
* The camera is reacquired only when it has to be, ie. the background path turned it off or the
|
|
189
|
+
* track reports it is not publishing; when the OS restarts capture itself, replaying the sinks is
|
|
190
|
+
* enough and a getUserMedia would only add a few hundred ms of frozen tile. Either way the enabled
|
|
191
|
+
* state is re-published, because interruption start published mute=true and remote peers stop
|
|
192
|
+
* rendering this peer's video until they see an update.
|
|
193
|
+
* @param enable the state to restore the camera to
|
|
194
|
+
*/
|
|
195
|
+
private endInterruption;
|
|
196
|
+
private restoreCapture;
|
|
156
197
|
private handleTrackMute;
|
|
157
198
|
/** @internal */
|
|
158
199
|
handleTrackUnmuteNatively: () => Promise<void>;
|
|
@@ -163,4 +204,14 @@ export declare class HMSLocalVideoTrack extends HMSVideoTrack {
|
|
|
163
204
|
*/
|
|
164
205
|
private removeOrReplaceProcessedTrack;
|
|
165
206
|
private handleVisibilityChange;
|
|
207
|
+
private handleForegrounded;
|
|
208
|
+
/**
|
|
209
|
+
* The camera did not come back, and the user is now here to see it. Either signal is enough.
|
|
210
|
+
* `interrupted` - cleared only once the camera is actually back - carries what the flags cannot:
|
|
211
|
+
* both failure paths leave a track that looks healthy, backgrounding swaps in a blank canvas track
|
|
212
|
+
* and a failed reacquire installs one too, so isTrackNotPublishing() is false in exactly the case
|
|
213
|
+
* worth prompting about. The flags carry the rest, a reacquire that handed back a muted camera.
|
|
214
|
+
*/
|
|
215
|
+
private notifyIfStillInterrupted;
|
|
216
|
+
private handleBackgrounded;
|
|
166
217
|
}
|
|
@@ -5,9 +5,11 @@ export declare class AudioContextManager {
|
|
|
5
5
|
private readonly TAG;
|
|
6
6
|
constructor(element: HTMLMediaElement);
|
|
7
7
|
/**
|
|
8
|
-
* Resume AudioContext if it is
|
|
8
|
+
* Resume AudioContext if it is not running
|
|
9
9
|
* Note: when the browser tab is muted by default, AudioContext will be in suspended state
|
|
10
10
|
* It has to be resumed for the video/audio to be played.
|
|
11
|
+
* Safari also reports a non standard 'interrupted' state after an OS audio interruption - an
|
|
12
|
+
* incoming call or another app taking the audio session - which a check for 'suspended' misses.
|
|
11
13
|
*/
|
|
12
14
|
resumeContext(): Promise<void>;
|
|
13
15
|
getAudioTrack(): MediaStreamTrack;
|
|
@@ -23,6 +23,7 @@ export declare class HMSNotifications<T extends HMSGenericTypes = {
|
|
|
23
23
|
sendChangeTrackStateRequest(request: HMSChangeTrackStateRequest): void;
|
|
24
24
|
sendChangeMultiTrackStateRequest(request: HMSChangeMultiTrackStateRequest): void;
|
|
25
25
|
sendPollUpdate(type: sdkTypes.HMSPollsUpdate, pollID: string): void;
|
|
26
|
+
sendTrackInterruption(interruption: sdkTypes.HMSTrackInterruption): void;
|
|
26
27
|
sendTranscriptionUpdate(transcriptions?: sdkTypes.HMSTranscriptionInfo[]): void;
|
|
27
28
|
private emitEvent;
|
|
28
29
|
private createNotification;
|
|
@@ -3,7 +3,7 @@ import { Diagnostics } from '../diagnostics';
|
|
|
3
3
|
import { HMSSessionFeedback } from '../end-call-feedback';
|
|
4
4
|
import { IHMSActions } from '../IHMSActions';
|
|
5
5
|
import { IHMSStore } from '../IHMSStore';
|
|
6
|
-
import { HMSAudioPlugin, HMSChangeMultiTrackStateRequest as SDKHMSChangeMultiTrackStateRequest, HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, HMSException as SDKHMSException, HMSLocalAudioTrack as SDKHMSLocalAudioTrack, HMSLocalTrack as SDKHMSLocalTrack, HMSLogLevel, HMSMediaStreamPlugin, HMSPluginSupportResult, HMSScreenShareConfig, HMSTrack as SDKHMSTrack, HMSVideoPlugin } from '../internal';
|
|
6
|
+
import { HMSAudioPlugin, HMSChangeMultiTrackStateRequest as SDKHMSChangeMultiTrackStateRequest, HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, HMSException as SDKHMSException, HMSLocalAudioTrack as SDKHMSLocalAudioTrack, HMSLocalTrack as SDKHMSLocalTrack, HMSLocalVideoTrack as SDKHMSLocalVideoTrack, HMSLogLevel, HMSMediaStreamPlugin, HMSPluginSupportResult, HMSScreenShareConfig, HMSTrack as SDKHMSTrack, HMSVideoPlugin } from '../internal';
|
|
7
7
|
import * as sdkTypes from '../internal';
|
|
8
8
|
import { MessageNotification } from '../notification-manager';
|
|
9
9
|
import { HMSChangeMultiTrackStateParams, HMSGenericTypes, HMSMessage, HMSPeer, HMSPeerListIteratorOptions, HMSRoleName, HMSTrackID, HMSTrackSource, IHMSPlaylistActions, IHMSSessionStoreActions } from '../schema';
|
|
@@ -55,7 +55,7 @@ export declare class HMSSDKActions<T extends HMSGenericTypes = {
|
|
|
55
55
|
setAudioOutputDevice(deviceId: string): Promise<void>;
|
|
56
56
|
setPreferredLayer(trackId: string, layer: sdkTypes.HMSPreferredSimulcastLayer): Promise<void>;
|
|
57
57
|
getNativeTrackById(trackId: string): MediaStreamTrack | undefined;
|
|
58
|
-
getTrackById(trackId: string): SDKHMSTrack | SDKHMSLocalAudioTrack | undefined;
|
|
58
|
+
getTrackById(trackId: string): SDKHMSTrack | SDKHMSLocalAudioTrack | SDKHMSLocalVideoTrack | undefined;
|
|
59
59
|
getAuthTokenByRoomCode(tokenRequest: sdkTypes.TokenRequest, tokenRequestOptions?: sdkTypes.TokenRequestOptions): Promise<string>;
|
|
60
60
|
preview(config: sdkTypes.HMSPreviewConfig): Promise<void>;
|
|
61
61
|
cancelMidCallPreview(): Promise<void>;
|
|
@@ -141,6 +141,7 @@ export declare class HMSSDKActions<T extends HMSGenericTypes = {
|
|
|
141
141
|
private sdkJoinWithListeners;
|
|
142
142
|
private onSFUMigration;
|
|
143
143
|
private onRemovedFromRoom;
|
|
144
|
+
private onTrackInterruption;
|
|
144
145
|
private onDeviceChange;
|
|
145
146
|
private sdkPreviewWithListeners;
|
|
146
147
|
private onNetworkQuality;
|
|
@@ -4,7 +4,7 @@ import { HMSMessage } from './message';
|
|
|
4
4
|
import { HMSPeer, HMSTrack } from './peer';
|
|
5
5
|
import { HMSPlaylistItem } from './playlist';
|
|
6
6
|
import { HMSChangeMultiTrackStateRequest, HMSChangeTrackStateRequest, HMSLeaveRoomRequest } from './requests';
|
|
7
|
-
import { HMSPoll, HMSTranscriptionInfo } from '../internal';
|
|
7
|
+
import { HMSPoll, HMSTrackInterruption, HMSTranscriptionInfo } from '../internal';
|
|
8
8
|
interface BaseNotification {
|
|
9
9
|
id: number;
|
|
10
10
|
type: string;
|
|
@@ -59,11 +59,15 @@ export interface HMSPollNotification extends BaseNotification {
|
|
|
59
59
|
type: HMSNotificationTypes.POLL_STARTED | HMSNotificationTypes.POLL_STOPPED | HMSNotificationTypes.POLL_VOTES_UPDATED;
|
|
60
60
|
data: HMSPoll;
|
|
61
61
|
}
|
|
62
|
+
export interface HMSTrackInterruptionNotification extends BaseNotification {
|
|
63
|
+
type: HMSNotificationTypes.TRACK_INTERRUPTION_START | HMSNotificationTypes.TRACK_INTERRUPTION_END;
|
|
64
|
+
data: HMSTrackInterruption;
|
|
65
|
+
}
|
|
62
66
|
export interface HMSTranscriptionNotification extends BaseNotification {
|
|
63
67
|
type: HMSNotificationTypes.TRANSCRIPTION_STATE_UPDATED;
|
|
64
68
|
data: HMSTranscriptionInfo[];
|
|
65
69
|
}
|
|
66
|
-
export declare type HMSNotification = HMSPeerNotification | HMSPeerListNotification | HMSTrackNotification | HMSMessageNotification | HMSExceptionNotification | HMSChangeTrackStateRequestNotification | HMSChangeMultiTrackStateRequestNotification | HMSLeaveRoomRequestNotification | HMSDeviceChangeEventNotification | HMSReconnectionNotification | HMSTranscriptionNotification | HMSPlaylistItemNotification<any>;
|
|
70
|
+
export declare type HMSNotification = HMSPeerNotification | HMSPeerListNotification | HMSTrackNotification | HMSMessageNotification | HMSExceptionNotification | HMSChangeTrackStateRequestNotification | HMSChangeMultiTrackStateRequestNotification | HMSLeaveRoomRequestNotification | HMSDeviceChangeEventNotification | HMSReconnectionNotification | HMSTrackInterruptionNotification | HMSTranscriptionNotification | HMSPlaylistItemNotification<any>;
|
|
67
71
|
export declare enum HMSNotificationSeverity {
|
|
68
72
|
INFO = "info",
|
|
69
73
|
ERROR = "error"
|
|
@@ -98,7 +102,9 @@ export declare enum HMSNotificationTypes {
|
|
|
98
102
|
POLL_VOTES_UPDATED = "POLL_VOTES_UPDATED",
|
|
99
103
|
POLLS_LIST = "POLLS_LIST",
|
|
100
104
|
HAND_RAISE_CHANGED = "HAND_RAISE_CHANGED",
|
|
101
|
-
TRANSCRIPTION_STATE_UPDATED = "TRANSCRIPTION_STATE_UPDATED"
|
|
105
|
+
TRANSCRIPTION_STATE_UPDATED = "TRANSCRIPTION_STATE_UPDATED",
|
|
106
|
+
TRACK_INTERRUPTION_START = "TRACK_INTERRUPTION_START",
|
|
107
|
+
TRACK_INTERRUPTION_END = "TRACK_INTERRUPTION_END"
|
|
102
108
|
}
|
|
103
109
|
export declare type HMSNotificationMapping<T extends HMSNotificationTypes, C = any> = {
|
|
104
110
|
[HMSNotificationTypes.PEER_JOINED]: HMSPeerNotification;
|
|
@@ -132,6 +138,8 @@ export declare type HMSNotificationMapping<T extends HMSNotificationTypes, C = a
|
|
|
132
138
|
[HMSNotificationTypes.POLL_CREATED]: HMSPollNotification;
|
|
133
139
|
[HMSNotificationTypes.HAND_RAISE_CHANGED]: HMSPeerNotification;
|
|
134
140
|
[HMSNotificationTypes.TRANSCRIPTION_STATE_UPDATED]: HMSTranscriptionNotification;
|
|
141
|
+
[HMSNotificationTypes.TRACK_INTERRUPTION_START]: HMSTrackInterruptionNotification;
|
|
142
|
+
[HMSNotificationTypes.TRACK_INTERRUPTION_END]: HMSTrackInterruptionNotification;
|
|
135
143
|
}[T];
|
|
136
144
|
export declare type MappedNotifications<Type extends HMSNotificationTypes[]> = {
|
|
137
145
|
[index in keyof Type]: HMSNotificationMapping<Type[index]>;
|
package/dist/schema/peer.d.ts
CHANGED
|
@@ -61,6 +61,14 @@ interface BaseTrack {
|
|
|
61
61
|
* false for preview tracks
|
|
62
62
|
*/
|
|
63
63
|
isPublished?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* only applicable for local tracks - true while the OS or another app has taken the device, eg.
|
|
66
|
+
* an incoming call. Cleared once capture is back, however it came back.
|
|
67
|
+
*
|
|
68
|
+
* Backgrounding the tab on mobile is not reported here: the device is handed back on return. It
|
|
69
|
+
* is set on return if the device did not come back.
|
|
70
|
+
*/
|
|
71
|
+
interrupted?: boolean;
|
|
64
72
|
}
|
|
65
73
|
export interface HMSAudioTrack extends BaseTrack {
|
|
66
74
|
source: 'regular' | 'audioplaylist' | string;
|
package/dist/sdk/index.d.ts
CHANGED
|
@@ -85,6 +85,7 @@ export declare class HMSSdk implements HMSInterface {
|
|
|
85
85
|
private handlePreviewError;
|
|
86
86
|
private midCallPreview;
|
|
87
87
|
cancelMidCallPreview(): Promise<void>;
|
|
88
|
+
private handleTrackInterruption;
|
|
88
89
|
private handleDeviceChange;
|
|
89
90
|
private handleAudioPluginError;
|
|
90
91
|
/**
|
|
@@ -48,7 +48,7 @@ declare class Store {
|
|
|
48
48
|
getPeerTracks(peerId?: string): HMSTrack[];
|
|
49
49
|
getLocalPeerTracks(): HMSLocalTrack[];
|
|
50
50
|
hasTrack(track: HMSTrack): boolean;
|
|
51
|
-
getTrackById(trackId: string): HMSTrack | import("../../media/tracks").HMSLocalAudioTrack | undefined;
|
|
51
|
+
getTrackById(trackId: string): HMSTrack | import("../../media/tracks").HMSLocalAudioTrack | import("../../media/tracks").HMSLocalVideoTrack | undefined;
|
|
52
52
|
getPeerByTrackId(trackId: string): HMSPeer | undefined;
|
|
53
53
|
getSpeakers(): HMSSpeaker[];
|
|
54
54
|
getSpeakerPeers(): HMSPeer[];
|
|
@@ -192,6 +192,19 @@ export declare const selectIsLocalAudioEnabled: (store: HMSStore) => boolean;
|
|
|
192
192
|
* and the video from your camera is shared to remote peers
|
|
193
193
|
*/
|
|
194
194
|
export declare const selectIsLocalVideoEnabled: (store: HMSStore) => boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Select a boolean denoting whether the OS or another app has taken your microphone, eg. an
|
|
197
|
+
* incoming call. Cleared once capture is back, however it came back.
|
|
198
|
+
*
|
|
199
|
+
* Backgrounding the tab on mobile does not set this - the mic is handed back on return. It is set
|
|
200
|
+
* on return if the mic did not come back.
|
|
201
|
+
*/
|
|
202
|
+
export declare const selectIsLocalAudioInterrupted: (store: HMSStore) => boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Select a boolean denoting whether the OS or another app has taken your camera.
|
|
205
|
+
* @see selectIsLocalAudioInterrupted
|
|
206
|
+
*/
|
|
207
|
+
export declare const selectIsLocalVideoInterrupted: (store: HMSStore) => boolean;
|
|
195
208
|
/**
|
|
196
209
|
* Select a boolean denoting whether you've chosen to unmute and share your local video.
|
|
197
210
|
*
|
package/dist/utils/support.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export declare enum ENV {
|
|
|
18
18
|
}
|
|
19
19
|
export declare const isSupported: boolean;
|
|
20
20
|
export declare const isMobile: () => boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Handheld platforms do not hand capture back to a backgrounded page, so anything that reacquires a
|
|
23
|
+
* device has to wait for the foreground there. Tablets behave like phones for this and iPads are the
|
|
24
|
+
* common case, so neither the tablet device type nor iPadOS can be left out.
|
|
25
|
+
*/
|
|
26
|
+
export declare const isMobileOrTablet: () => boolean;
|
|
21
27
|
export declare const isPageHidden: () => boolean;
|
|
22
28
|
export declare const isIOS: () => boolean;
|
|
23
29
|
export declare const isSafari: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.14.
|
|
2
|
+
"version": "0.14.7",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"conferencing",
|
|
73
73
|
"100ms"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "0bea9e63f6501bae6109370f02b97e493e0c84c7"
|
|
76
76
|
}
|