Skip to content

Commit

Permalink
Update publish-alpha (#3281)
Browse files Browse the repository at this point in the history
Co-authored-by: ygit <[email protected]>
Co-authored-by: Ravi theja <[email protected]>
  • Loading branch information
3 people authored Sep 23, 2024
1 parent 5b08acb commit 1021f20
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 19 deletions.
4 changes: 2 additions & 2 deletions packages/hms-video-store/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ you want to do -
passed in selector such that whenever the portion changes, the passed in callback is notified.
2. Actions - The actions interface for dispatching actions which in turn may reach
out to server and update the store. Check the interface with detailed doc
[here](src/core/IHMSActions.ts).
[here](./src/IHMSActions.ts).

We also provide optimized and efficient selectors for most common use cases. These are
available in [this folder](src/core/selectors).
available in [this folder](./src/selectors).

Important Note: The data received from either getState or Subscribe is immutable, the
object received is frozen, and it is not allowed to mutate it. You'll get an error
Expand Down
5 changes: 3 additions & 2 deletions packages/hms-video-store/src/IHMSActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
/**
* Add video plugins to the local peer video stream. Eg. Virtual Background, Face Filters etc.
* Video plugins can be added/removed at any time after the video track is available.
* @param plugin HMSMediaStreamPlugin
* @see HMSMediaStreamPlugin
* @param plugins
*/
addPluginsToVideoStream(plugins: HMSMediaStreamPlugin[]): Promise<void>;

/**
* Remove video plugins to the local peer video stream. Eg. Virtual Background, Face Filters etc.
* Video plugins can be added/removed at any time after the video track is available.
* @param plugin HMSMediaStreamPlugin
* @see HMSMediaStreamPlugin
* @param plugins
*/
removePluginsFromVideoStream(plugins: HMSMediaStreamPlugin[]): Promise<void>;

Expand Down Expand Up @@ -344,6 +344,7 @@ export interface IHMSActions<T extends HMSGenericTypes = { sessionStore: Record<
/**
* After leave send feedback to backend for call quality purpose.
* @param feedback
* @param eventEndpoint
*/
submitSessionFeedback(feedback: HMSSessionFeedback, eventEndpoint?: string): Promise<void>;

Expand Down
24 changes: 16 additions & 8 deletions packages/hms-video-store/src/media/tracks/HMSRemoteVideoTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,7 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
* @returns {boolean} isDegraded - returns true if degraded
* */
setLayerFromServer(layerUpdate: VideoTrackLayerUpdate) {
this._degraded =
this.enabled &&
(layerUpdate.publisher_degraded || layerUpdate.subscriber_degraded) &&
layerUpdate.current_layer === HMSSimulcastLayer.NONE;
this._degraded = this.getDegradationValue(layerUpdate);
this._degradedAt = this._degraded ? new Date() : this._degradedAt;
const currentLayer = layerUpdate.current_layer;
HMSLogger.d(
Expand All @@ -171,11 +168,22 @@ export class HMSRemoteVideoTrack extends HMSVideoTrack {
return this._degraded;
}

private getDegradationValue(layerUpdate: VideoTrackLayerUpdate) {
return (
this.enabled &&
(layerUpdate.publisher_degraded || layerUpdate.subscriber_degraded) &&
layerUpdate.current_layer === HMSSimulcastLayer.NONE
);
}

private async updateLayer(source: string) {
const newLayer =
(this.degraded || !this.enabled || !this.hasSinks()) && !this.disableNoneLayerRequest
? HMSSimulcastLayer.NONE
: this.preferredLayer;
let newLayer: HMSSimulcastLayer = this.preferredLayer;
if (this.enabled && this.hasSinks()) {
newLayer = this.preferredLayer;
// send none only when the flag is not set
} else if (!this.disableNoneLayerRequest) {
newLayer = HMSSimulcastLayer.NONE;
}
if (!this.shouldSendVideoLayer(newLayer, source)) {
return;
}
Expand Down
12 changes: 6 additions & 6 deletions packages/roomkit-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ export default App() {

For additional props, refer the [docs](https://www.100ms.live/docs/javascript/v2/quickstart/prebuilt-quickstart#props-for-hmsprebuilt)

## Cutomization
## Customisation
While we offer [a no-code way to customize Prebuilt](https://www.100ms.live/docs/get-started/v2/get-started/prebuilt/overview#customize-prebuilt), you can fork your copy of the Prebuilt component and make changes to the code to allow for more fine-tuning.

Prebuilt customisations are available on [100ms dashboard](https://dashboard.100ms.live)
Prebuilt customisations are available on [100ms Dashboard](https://dashboard.100ms.live).

### Understanding the Structure

Expand All @@ -58,7 +58,7 @@ The `Prebuilt` folder contains the full Prebuilt implementation.

| Component | Description |
|--|--|
| [RoomLayoutProvider](src/Prebuilt/provider/roomLayoutProvider/index.tsx) | This is a context that contains the configuration from the dashboard [customiser](dashboard.100ms.live). Whatever changes are made in the dashboard customiser are available the next time you join.|
| [RoomLayoutProvider](src/Prebuilt/provider/roomLayoutProvider/index.tsx) | This is a context that contains the configuration from the dashboard [customiser](https://dashboard.100ms.live/). Whatever changes are made in the dashboard customiser are available the next time you join.|
|[AppStateContext](src/Prebuilt/AppStateContext.tsx) | Contains the logic to switch between different screens, for example, Preview to Meeting, Meeting to Leave. These transitions are based on the roomState that is available from the reactive store (`useHMSStore(selectHMSRoomState)`). |
| [PreviewScreen](src/Prebuilt/components/Preview/PreviewScreen.tsx) | Contains the Preview implementation. Contains the Video tile, video, audio toggles and Virtual background and settings along with the name input.|
| [ConferenceScreen](src/Prebuilt/components/ConferenceScreen.tsx) | This contains the screen once you finish Preview and enter the meeting. This contains the header and footer and the main content.|
Expand All @@ -68,11 +68,11 @@ The `Prebuilt` folder contains the full Prebuilt implementation.

### Customising the Styles

[Base Config](/src/Theme/base.config.ts) has all the variables that you can use. Any changes you want for the theme can be made here. Most likely no additional changes will be required unless you want to introduce new variables.
[Base Config](./src/Theme/base.config.ts) has all the variables that you can use. Any changes you want for the theme can be made here. Most likely no additional changes will be required unless you want to introduce new variables.

When [`HMSThemeProvider`](src/Theme/ThemeProvider.tsx) is used at the top level, all the variables will be available for all the children under this component tree.
When [`HMSThemeProvider`](./src/Theme/ThemeProvider.tsx) is used at the top level, all the variables will be available for all the children under this component tree.

For components created using the base components like `Box`, `Flex`, `Button` etc, css Prop is available to modify the styles. Within the css prop, you can access the variables from the [base config](/src/Theme/base.config.ts).
For components created using the base components like `Box`, `Flex`, `Button` etc, css Prop is available to modify the styles. Within the css prop, you can access the variables from the [base config](./src/Theme/base.config.ts).


## Contributing
Expand Down
2 changes: 1 addition & 1 deletion packages/roomkit-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import '@100mslive/roomkit-web';
- An image URL as a string which is displayed in the preview screen and header.

`auth-token` (optional)
- This token is room and role specific. It can be copied from the join room modal on the [dashboard](https://dashboard.100ms.live). Read more about it [here](/get-started/v2/get-started/security-and-tokens#auth-token-for-client-sdks).
- This token is room and role specific. It can be copied from the join room modal on the [dashboard](https://dashboard.100ms.live). Read more about it [here](https://www.100ms.live/docs/get-started/v2/get-started/security-and-tokens#auth-token-for-client-sdks).

`room-id` (optional unless room-code is not being used)
- The room ID of the room you want to join. You can get the room ID from the [dashboard](https://dashboard.100ms.live). It should be specified with the role prop if the room-code is not being provided.
Expand Down

0 comments on commit 1021f20

Please sign in to comment.