@100mslive/hms-video-store
Advanced tools
Comparing version 0.2.56 to 0.2.57-1
@@ -1,6 +0,6 @@ | ||
import { HMSMessage, HMSTrackID, HMSTrackSource, IHMSPlaylistActions } from '../schema'; | ||
import { HMSMessage, HMSTrackID, HMSTrackSource, HMSChangeMultiTrackStateRequest, IHMSPlaylistActions } from '../schema'; | ||
import { IHMSActions } from '../IHMSActions'; | ||
import * as sdkTypes from './sdkTypes'; | ||
import { HMSRoleChangeRequest } from '../selectors'; | ||
import { HMSAudioPlugin, HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, HMSException as SDKHMSException, HMSLogLevel, HMSSdk, HMSSimulcastLayer, HMSTrack as SDKHMSTrack, HMSVideoPlugin } from '@100mslive/hms-video'; | ||
import { HMSAudioPlugin, HMSException as SDKHMSException, HMSLogLevel, HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, HMSSdk, HMSSimulcastLayer, HMSTrack as SDKHMSTrack, HMSVideoPlugin } from '@100mslive/hms-video'; | ||
import { IHMSStore } from '../IHMSStore'; | ||
@@ -78,2 +78,3 @@ import { HMSNotifications } from './HMSNotifications'; | ||
setRemoteTrackEnabled(trackID: HMSTrackID | HMSTrackID[], enabled: boolean): Promise<void>; | ||
setRemoteTracksEnabled(params: HMSChangeMultiTrackStateRequest): Promise<void>; | ||
setLogLevel(level: HMSLogLevel): void; | ||
@@ -80,0 +81,0 @@ private resetState; |
import { HMSConfig, HMSSimulcastLayer, HMSAudioTrackSettings, HMSVideoTrackSettings, HMSLogLevel, HMSVideoPlugin, HMSAudioPlugin } from '@100mslive/hms-video'; | ||
import { HMSPeerID, HMSRoleName, HMSTrackSource, IHMSPlaylistActions } from './schema'; | ||
import { HMSPeerID, HMSRoleName, HMSTrackSource, IHMSPlaylistActions, HMSChangeMultiTrackStateRequest } from './schema'; | ||
import { HMSRoleChangeRequest } from './selectors'; | ||
@@ -194,2 +194,7 @@ import { RTMPRecordingConfig } from './hmsSDKStore/sdkTypes'; | ||
/** | ||
* Use this to mute/unmute multipe tracks by source, role or type | ||
* @param {HMSChangeMultiTrackStateRequest} params | ||
*/ | ||
setRemoteTracksEnabled(params: HMSChangeMultiTrackStateRequest): Promise<void>; | ||
/** | ||
* Method to be called with some UI interaction after autoplay error is received | ||
@@ -196,0 +201,0 @@ */ |
@@ -0,1 +1,2 @@ | ||
import { HMSTrackSource } from '.'; | ||
import { HMSPeer, HMSPeerID, HMSTrack } from './peer'; | ||
@@ -13,2 +14,8 @@ import { HMSRoleName } from './role'; | ||
} | ||
export interface HMSChangeMultiTrackStateRequest { | ||
enabled: boolean; | ||
roles?: HMSRoleName[]; | ||
type?: 'audio' | 'video'; | ||
source?: HMSTrackSource; | ||
} | ||
export interface HMSLeaveRoomRequest { | ||
@@ -15,0 +22,0 @@ requestedBy: HMSPeer; |
@@ -172,2 +172,5 @@ import { HMSMessage, HMSPeer, HMSPeerID, HMSRoom, HMSRoomState, HMSStore } from '../schema'; | ||
mute: boolean; | ||
/** | ||
* @internal | ||
*/ | ||
changeRole: boolean; | ||
@@ -181,4 +184,11 @@ } | undefined, (res: HMSRole | null) => { | ||
mute: boolean; | ||
/** | ||
* @internal | ||
*/ | ||
changeRole: boolean; | ||
} | undefined>; | ||
/** | ||
* selector to check if all remote audio tracks are unmuted | ||
*/ | ||
export declare const selectAreRemoteAudioTracksUnmuted: import("reselect").OutputSelector<HMSStore, boolean, (res: import("../schema").HMSTrack[]) => boolean>; | ||
export declare const selectRecordingState: import("reselect").OutputSelector<HMSStore, { | ||
@@ -185,0 +195,0 @@ browser: { |
{ | ||
"version": "0.2.56", | ||
"version": "0.2.57-1", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -14,2 +14,3 @@ import { | ||
HMSTrackSource, | ||
HMSChangeMultiTrackStateRequest, | ||
IHMSPlaylistActions, | ||
@@ -42,3 +43,2 @@ } from '../schema'; | ||
HMSAudioTrack as SDKHMSAudioTrack, | ||
HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, | ||
HMSException as SDKHMSException, | ||
@@ -53,2 +53,4 @@ HMSLeaveRoomRequest as SDKHMSLeaveRoomRequest, | ||
HMSRoleChangeRequest as SDKHMSRoleChangeRequest, | ||
HMSChangeTrackStateRequest as SDKHMSChangeTrackStateRequest, | ||
HMSChangeMultiTrackStateRequest as SDKHMSChangeMultiTrackStateRequest, | ||
HMSSdk, | ||
@@ -458,2 +460,15 @@ HMSSimulcastLayer, | ||
async setRemoteTracksEnabled(params: HMSChangeMultiTrackStateRequest) { | ||
const sdkRequest: SDKHMSChangeMultiTrackStateRequest = { | ||
enabled: params.enabled, | ||
type: params.type, | ||
source: params.source, | ||
}; | ||
if (params.roles) { | ||
const rolesMap = this.store.getState(selectRolesMap); | ||
sdkRequest.roles = params.roles.map(role => rolesMap[role]); | ||
} | ||
await this.sdk.changeMultiTrackState(sdkRequest); | ||
} | ||
setLogLevel(level: HMSLogLevel) { | ||
@@ -460,0 +475,0 @@ HMSLogger.level = level; |
@@ -10,3 +10,9 @@ import { | ||
} from '@100mslive/hms-video'; | ||
import { HMSPeerID, HMSRoleName, HMSTrackSource, IHMSPlaylistActions } from './schema'; | ||
import { | ||
HMSPeerID, | ||
HMSRoleName, | ||
HMSTrackSource, | ||
IHMSPlaylistActions, | ||
HMSChangeMultiTrackStateRequest, | ||
} from './schema'; | ||
import { HMSRoleChangeRequest } from './selectors'; | ||
@@ -229,2 +235,8 @@ import { RTMPRecordingConfig } from './hmsSDKStore/sdkTypes'; | ||
/** | ||
* Use this to mute/unmute multipe tracks by source, role or type | ||
* @param {HMSChangeMultiTrackStateRequest} params | ||
*/ | ||
setRemoteTracksEnabled(params: HMSChangeMultiTrackStateRequest): Promise<void>; | ||
/** | ||
* Method to be called with some UI interaction after autoplay error is received | ||
@@ -231,0 +243,0 @@ */ |
@@ -0,1 +1,2 @@ | ||
import { HMSTrackSource } from '.'; | ||
import { HMSPeer, HMSPeerID, HMSTrack } from './peer'; | ||
@@ -16,2 +17,9 @@ import { HMSRoleName } from './role'; | ||
export interface HMSChangeMultiTrackStateRequest { | ||
enabled: boolean; | ||
roles?: HMSRoleName[]; | ||
type?: 'audio' | 'video'; | ||
source?: HMSTrackSource; | ||
} | ||
export interface HMSLeaveRoomRequest { | ||
@@ -18,0 +26,0 @@ requestedBy: HMSPeer; |
@@ -1,2 +0,10 @@ | ||
import { HMSMessage, HMSPeer, HMSPeerID, HMSRoom, HMSRoomState, HMSStore } from '../schema'; | ||
import { | ||
HMSMessage, | ||
HMSPeer, | ||
HMSPeerID, | ||
HMSRoom, | ||
HMSRoomState, | ||
HMSStore, | ||
HMSTrackID, | ||
} from '../schema'; | ||
import { createSelector } from 'reselect'; | ||
@@ -11,2 +19,3 @@ // noinspection ES6PreferShortImport | ||
isTrackEnabled, | ||
isAudio, | ||
} from './selectorUtils'; | ||
@@ -384,3 +393,32 @@ | ||
const selectRemoteAudioTracks = createSelector( | ||
selectRemotePeers, | ||
selectTracksMap, | ||
(peers, tracksMap) => { | ||
let tracks: HMSTrackID[] = []; | ||
for (const peer of peers) { | ||
if (peer.audioTrack) { | ||
tracks.push(peer.audioTrack); | ||
} | ||
for (const track of peer.auxiliaryTracks) { | ||
if (isAudio(tracksMap[track])) { | ||
tracks.push(track); | ||
} | ||
} | ||
} | ||
return tracks.map(trackID => tracksMap[trackID]); | ||
}, | ||
); | ||
/** | ||
* selector to check if all remote audio tracks are unmuted | ||
*/ | ||
export const selectAreRemoteAudioTracksUnmuted = createSelector( | ||
selectRemoteAudioTracks, | ||
remoteTracks => { | ||
return remoteTracks.some(track => track.enabled); | ||
}, | ||
); | ||
export const selectRecordingState = createSelector(selectRoom, room => room.recording); | ||
export const selectRTMPState = createSelector(selectRoom, room => room.rtmp); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1355373
15113