UNPKG

@100mslive/hms-video-store

Version:

@100mslive Core SDK which abstracts the complexities of webRTC while providing a reactive store for data management with a unidirectional data flow

62 lines (61 loc) 3.44 kB
import * as sdkTypes from '../internal'; import { HMSRoleChangeRequest as SDKHMSRoleChangeRequest, HMSTrack as SDKHMSTrack } from '../internal'; import { MessageNotification } from '../notification-manager'; import { HMSDeviceChangeEvent, HMSException, HMSMessage, HMSPeer, HMSPeerID, HMSPlaylistItem, HMSRole, HMSRoleChangeStoreRequest, HMSRoleName, HMSRoom, HMSScreenVideoTrack, HMSTrack, HMSTrackException, HMSVideoTrack } from '../schema'; /** * This file has conversion functions from schema defined in sdk to normalised schema defined in store. * A lot of conversions below involve deep clone as once the object goes into store it becomes unmodifiable * due to immer, so it can't be mutated later. * * Objects directly from the SDK are not stored as is and cloned because the SDK might modify it later */ export declare class SDKToHMS { static convertPeer(sdkPeer: sdkTypes.HMSPeer): Partial<HMSPeer> & Pick<HMSPeer, 'id'>; static convertTrack(sdkTrack: SDKHMSTrack, peerId?: HMSPeerID): HMSTrack; static enrichTrack(track: HMSTrack, sdkTrack: SDKHMSTrack): void; static enrichLocalTrack(track: HMSTrack, sdkTrack: SDKHMSTrack): void; static updateDeviceID(track: HMSTrack, sdkTrack: SDKHMSTrack): void; static enrichVideoTrack(track: HMSVideoTrack, sdkTrack: SDKHMSTrack): void; static enrichScreenTrack(track: HMSScreenVideoTrack, sdkTrack: SDKHMSTrack): void; static enrichPluginsDetails(track: HMSTrack, sdkTrack: SDKHMSTrack): void; static convertRoom(sdkRoom: sdkTypes.HMSRoom, sdkLocalPeerId?: string): Partial<HMSRoom>; static convertMessage(sdkMessage: MessageNotification, localPeerId: HMSPeerID): Partial<HMSMessage> & Pick<HMSMessage, 'sender'>; static convertRoles(sdkRoles: HMSRole[]): Record<HMSRoleName, HMSRole>; static convertRoleChangeRequest(req: SDKHMSRoleChangeRequest): HMSRoleChangeStoreRequest; static convertException(sdkException: sdkTypes.HMSException): HMSException | HMSTrackException; static convertDeviceChangeUpdate(sdkDeviceChangeEvent: sdkTypes.HMSDeviceChangeEvent): HMSDeviceChangeEvent; static convertPlaylist(playlistManager: sdkTypes.HMSPlaylistManager): { audio: { list: Record<string, HMSPlaylistItem<any>>; selection: { id: string | undefined; hasPrevious: boolean; hasNext: boolean; }; progress: number; volume: number; currentTime: number; playbackRate: number; }; video: { list: Record<string, HMSPlaylistItem<any>>; selection: { id: string | undefined; hasPrevious: boolean; hasNext: boolean; }; progress: number; volume: number; currentTime: number; playbackRate: number; }; }; static convertPlaylistItem<T>(playlistManager: sdkTypes.HMSPlaylistManager, playlistItem: sdkTypes.HMSPlaylistItem<T>): HMSPlaylistItem<T>; private static getConvertedPlaylistType; static convertRecordingStreamingState(recording?: sdkTypes.HMSRecording, rtmp?: sdkTypes.HMSRTMP, hls?: sdkTypes.HMSHLS, transcriptions?: sdkTypes.HMSTranscriptionInfo[]): { recording: sdkTypes.HMSRecording; rtmp: sdkTypes.HMSRTMP; hls: sdkTypes.HMSHLS; transcriptions: sdkTypes.HMSTranscriptionInfo[]; }; }