Skip to content

Commit

Permalink
docs: updated inline code comments in JS Doc format
Browse files Browse the repository at this point in the history
  • Loading branch information
ygit committed Nov 29, 2024
1 parent ed69e81 commit 2b3deb0
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 30 deletions.
49 changes: 35 additions & 14 deletions packages/hms-video-store/src/IHMSActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ import { HMSStats } from './webrtc-stats';
* It talks to our 100ms backend and handles error reconnections, state managements
* and lots of other things so you don't have to. You can use this gateway with any
* sort of UI to make connecting to our backend easier.
* In case you use react, we also provide a HMSProvider class with very powerful hooks
* and out of box components which you can use to setup your website in minutes. Our
* components have in built integration with this interface and you won't have to worry
* In case you use React, we also provide a HMSProvider class with very powerful hooks
* and out of box components which you can use to set up your website in minutes. Our
* components have in built integration with this interface, and you won't have to worry
* about passing props if you use them.
*
* @remarks
Expand All @@ -69,25 +69,30 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
* is ignored
*
* @param config join config with room id, required for joining the room
* @returns Promise<void> - resolves when the room is joined
*/
join(config: HMSConfig): Promise<void>;

/**
* This function can be used to leave the room, if the call is repeated it's ignored.
* This function also cleans up the store and removes all the tracks and participants.
* @returns Promise<void> - resolves when the room is left
*/
leave(): Promise<void>;

/**
* stop tracks fetched during midcall preview and general cleanup
* @returns Promise<void> - resolves when the tracks are stopped
*/
cancelMidCallPreview(): Promise<void>;

/**
* If you want to enable screenshare for the local peer this class can be called.
* The store will be populated with the incoming track, and the subscriber(or
* react component if our hook is used) will be notified/rerendered
* @param enabled boolean
* @param enabled boolean - true to enable screenshare, false to disable
* @param config check the config object for details about the fields
* @returns Promise<void> - resolves when the screenshare is enabled
*/
setScreenShareEnabled(enabled: boolean, config?: HMSScreenShareConfig): Promise<void>;

Expand Down Expand Up @@ -217,7 +222,9 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<

/**
* set the quality of the selected videoTrack for simulcast.
* @alpha
* @param trackId HMSTrackID - trackId of the video track
* @param layer HMSSimulcastLayer - layer to be set
* @returns Promise<void> - resolves when the layer is set
*/
setPreferredLayer(trackId: HMSTrackID, layer: HMSPreferredSimulcastLayer): Promise<void>;

Expand Down Expand Up @@ -399,21 +406,21 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
stopTranscription(params: TranscriptionConfig): Promise<void>;

/**
* @alpha
* Used to define date range metadata in a media playlist.
* This api adds EXT-X-DATERANGE tags to the media playlist.
* It is useful for defining timed metadata for interstitial regions such as advertisements,
* but can be used to define any timed metadata needed by your stream.
* usage (e.g)
* ```js
* const metadataList = `[{
* payload: "some string 1",
* duration: 2
* },
* {
* payload: "some string 2",
* duration: 3
* payload: "some string 1",
* duration: 2
* },
* {
* payload: "some string 2",
* duration: 3
* }]`
* sendHLSTimedMetadata(metadataList);
* ```
*/
sendHLSTimedMetadata(metadataList: HLSTimedMetadata[]): Promise<void>;

Expand Down Expand Up @@ -549,13 +556,23 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
*/
getNativeTrackById(trackId: string): MediaStreamTrack | undefined;

/**
* Get the track object by trackId
* @param trackId string - ID of the track
* @returns HMSTrack | undefined - track object
*/
getTrackById(trackId: string): HMSTrack | undefined;

/**
* Get the auth token for the room code. This is useful when you want to join a room using a room code.
* @param tokenRequest - token request object
* @param tokenRequestOptions - token request options
*/
getAuthTokenByRoomCode(tokenRequest: TokenRequest, tokenRequestOptions?: TokenRequestOptions): Promise<string>;

/**
* enable sending audio speaker data to beam
* @alpha
* @returns Promise<void> - resolves when the speaker data is enabled
*/
enableBeamSpeakerLabelsLogging(): Promise<void>;

Expand All @@ -567,6 +584,10 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
*/
sessionStore: IHMSSessionStoreActions<T['sessionStore']>;

/**
* interactivityCenter contains all actions that can be performed on the interactivity center
* This will be available after joining the room
*/
interactivityCenter: IHMSInteractivityCenter;

raiseLocalPeerHand(): Promise<void>;
Expand Down
3 changes: 1 addition & 2 deletions packages/hms-video-store/src/interfaces/hls-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ export interface HLSMeetingURLVariant {
*/
meetingURL: string;
/**
* additional metadata for this URL for example - landscape/portrait, the field is not currently supported
* @alpha
* additional metadata for this URL for example - landscape/portrait
*/
metadata?: string;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* experience in the session.
* Note that this is not an absolute measure, a bandwidth of 1 MBPs may be good
* for a 1:1 call but poor for a large call.
* @alpha
*/
export interface HMSConnectionQuality {
peerID: string;
Expand Down
3 changes: 0 additions & 3 deletions packages/hms-video-store/src/interfaces/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ export interface HMSHLSRecording {

export interface HMSRTMP {
running: boolean;
/**
* @alpha
**/
startedAt?: Date;
state?: HMSStreamingState;
error?: HMSException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ export interface HMSInteractivityCenter {
fetchLeaderboard(pollID: string, offset: number, count: number): Promise<HMSQuizLeaderboardResponse>;
getPollResponses(poll: HMSPoll, self: boolean): Promise<void>;
getPolls(): Promise<HMSPoll[]>;
/** @alpha */
whiteboard: HMSWhiteboardInteractivityCenter;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@ export class HMSReactiveStore<T extends HMSGenericTypes = { sessionStore: Record
}

/**
* By default store.subscribe does not call the handler with the current state at time of subscription,
* By default, store.subscribe does not call the handler with the current state at time of subscription,
* this behaviour can be modified by calling this function. What it means is that instead of calling the
* handler only for changes which happen post subscription we'll also call it exactly once at the time
* of subscription with the current state. This behaviour is similar to that of BehaviourSubject in RxJS.
* This will be an irreversible change
*
* Note: you don't need this if you're using our react hooks, it takes care of this requirement.
* Note: you don't need this if you're using our React hooks, it takes care of this requirement.
*/
triggerOnSubscribe(): void {
if (this.initialTriggerOnSubscribe) {
Expand Down Expand Up @@ -125,9 +125,6 @@ export class HMSReactiveStore<T extends HMSGenericTypes = { sessionStore: Record
return { onNotification: this.notifications.onNotification };
}

/**
* @alpha
*/
getStats = (): IHMSStatsStoreReadOnly => {
if (!this.stats) {
this.stats = new HMSStats(this.store as unknown as IHMSStore, this.sdk);
Expand Down
1 change: 0 additions & 1 deletion packages/hms-video-store/src/schema/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ export interface HMSStore<T extends HMSGenericTypes = { sessionStore: Record<str
polls: Record<string, HMSPoll>;
/** @internal */
hideLocalPeer: boolean;
/** @alpha */
whiteboards: Record<string, HMSWhiteboard>;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/roomkit-react/src/Prebuilt/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ export const HMSPrebuilt = React.forwardRef<HMSPrebuiltRefType, HMSPrebuiltProps

return (
<HMSThemeProvider
// issue is with stichtes caching the theme using the theme name / class
// issue is with stitches caching the theme using the theme name / class
// no updates to the themes are fired if the name is same.
// TODO: cache the theme and do deep check to trigger name change in the theme
themeType={`${theme.name}-${Date.now()}`}
theme={{
//@ts-ignore: Prebuilt theme to match stiches theme
//@ts-ignore: Prebuilt theme to match stitches theme
colors: theme.palette,
fonts: {
//@ts-ignore: font list to match token types of stiches
//@ts-ignore: font list to match token types of stitches
sans: fontFamily,
},
}}
Expand Down

0 comments on commit 2b3deb0

Please sign in to comment.