Skip to content

Commit

Permalink
Merge branch 'qa' into data-residency-workspace-1may2024
Browse files Browse the repository at this point in the history
  • Loading branch information
mntrspace authored Jun 12, 2024
2 parents 46019f0 + caf12d3 commit b470264
Show file tree
Hide file tree
Showing 31 changed files with 913 additions and 130 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default redirect('/v3/100ms-v3/basics');

This is needed because we need it to route somewhere if someone hits `/v3` this would redirect it to `/v3/100ms-v3/basics` i.e the MDX file `/v3/100ms-v3/basics.mdx`

Then follow the Steps in 1. to add docs to it.
Then follow the steps in 1 to add docs to it.

### 3. Aliasing Repeating Content

Expand Down
28 changes: 28 additions & 0 deletions docs/android/v2/how-to-guides/captions/live-captions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,31 @@ To check if WebRTC (not hls) captions are enabled in a room. Look for any transc
Implement `fun onTranscripts(transcripts: HmsTranscripts)` in the `HMSUpdateListener` callback.

For an example implementation look at [`TranscriptionUseCase.kt`](https://github.com/100mslive/100ms-android/blob/ac66fa76503ec990322c293f8ce6a504c0c3c444/room-kit/src/main/java/live/hms/roomkit/ui/meeting/TranscriptionUseCase.kt#L44) in the 100ms-android [sample app](https://github.com/100mslive/100ms-android/blob/ac66fa76503ec990322c293f8ce6a504c0c3c444/room-kit/src/main/java/live/hms/roomkit/ui/meeting/TranscriptionUseCase.kt#L44) repository.

## Toggling Live Transcripts
To save on cost, live transcriptions can be disabled for everyone at runtime and toggled on again when required.

```kotlin
// Start Real Time Transcription
hmsSDK.startRealTimeTranscription(

TranscriptionsMode.CAPTION,

object : HMSActionResultListener {
override fun onError(error: HMSException) {}
override fun onSuccess() {}
})

```

```kotlin
// Stop Real Time Transcription
hmsSDK.stopRealTimeTranscription(

TranscriptionsMode.CAPTION,

object : HMSActionResultListener {
override fun onError(error: HMSException) {}
override fun onSuccess() {}
})
```
87 changes: 16 additions & 71 deletions docs/android/v2/how-to-guides/install-the-sdk/size.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,88 +2,33 @@
title: SDK Size Impact
nav: 3.4
---
There are several libraries provided for 100ms-android. Generally the SDK core is required for doing anything with meetings and you can add each individual library if you want it.

Each library has its own size impact that can vary been ABIs (x86, arm64-v8a etc), the table below lists them all.

These sizes are caculated by building release versions of abi split apks from the same project, and then subtracting the size of the same project without any 100ms libraries added.

You can take a look at the reference project [here](https://github.com/100mslive/Android-Size-Reference-App/)

These are accuarate for sdk version `2.9.59` and room-kit version `1.2.13`.
These are accurate for sdk version `2.9.59` and room-kit version `1.2.13`.

## Increase in Android APK size:

| Phone Architecture | Room Kit |
| --------------------------------- | --------- |
| (armeabi-v7) | **10.9MB** |
| (arm64-v8a) **(most common one)** | **11.8MB** |
| (x86_64) | **12.7MB** |
| (x86) | **12.5MB** |
| Module Name | arm64-v8a | armeabi-v7 | x86 | x86_64
| -------------------|--------------|----------------|-----------|-------|
| Android Sdk | **6.7MB** | **5.7MB** | **7.3MB** | **7.6MB** |
| Video View | **8.5KB** | **8.5KB** | **8.5KB** | **8.5KB** |
| Virtual Background | **15.4MB** | **12.9MB** | **4.0MB** | **4.0MB** |
| Noise Cancellation | **5.6MB** | **5.6MB** | **5.6MB** | **5.6MB** |
| Video Filters | **20.7KB** | **25.0KB** | **20.7KB** | **21.1KB** |
| Hls Player | **959.4KB** | **959.4KB** | **959.4KB** | **959.4KB** |
| Hls Player Stats | **463.3KB** | **463.3KB** | **463.3KB** | **463.3KB** |

### Room Kit

The base `room-kit` already includes the following libraries:
| Module Name | arm64-v8a | armeabi-v7 | x86 | x86_64
| -------------------|--------------|----------------|-----------|-------|
| Room Kit | **12.0MB** | **11.0MB** | **12.6MB** | **12.8MB** |

The `room-kit` module already includes the following libraries:
- `android-sdk`
- `video-view`
- `hls-player`
- `video-filters`

To add, for instance `noise-cancellation`, take a look at the table below.

## SDK and each addon library
> Note: Most SDK addon libraries cannot be used without the sdk.
| Phone Architecture | Android Sdk |
| --------------------------------- | --------- |
| (armeabi-v7) | **5.7MB** |
| (arm64-v8a) **(most common one)** | **6.7MB** |
| (x86_64) | **7.6MB** |
| (x86) | **7.3MB** |

| Phone Architecture | Video View |
| --------------------------------- | --------- |
| (armeabi-v7) | **8.5KB** |
| (arm64-v8a) **(most common one)** | **8.5KB** |
| (x86_64) | **8.5KB** |
| (x86) | **8.5KB** |


| Phone Architecture | Virtual Background |
| --------------------------------- | --------- |
| (armeabi-v7) | **12.9MB** |
| (arm64-v8a) **(most common one)** | **15.4MB** |
| (x86_64) | **4.0MB** |
| (x86) | **4.0MB** |


| Phone Architecture | Video Filters |
| --------------------------------- | --------- |
| (armeabi-v7) | **24.9KB** |
| (arm64-v8a) **(most common one)** | **20.6KB** |
| (x86_64) | **21.0KB** |
| (x86) | **20.6KB** |


| Phone Architecture | Noise Cancellation |
| --------------------------------- | --------- |
| (armeabi-v7) | **5.6MB** |
| (arm64-v8a) **(most common one)** | **5.6MB** |
| (x86_64) | **5.6MB** |
| (x86) | **5.6MB** |


| Phone Architecture | Hls Player Stats |
| --------------------------------- | --------- |
| (armeabi-v7) | **443.2KB** |
| (arm64-v8a) **(most common one)** | **443.2KB** |
| (x86_64) | **443.2KB** |
| (x86) | **443.2KB** |


| Phone Architecture | Hls Player |
| --------------------------------- | --------- |
| (armeabi-v7) | **939.4KB** |
| (arm64-v8a) **(most common one)** | **939.4KB** |
| (x86_64) | **939.4KB** |
| (x86) | **939.4KB** |

4 changes: 4 additions & 0 deletions docs/android/v2/release-notes/release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import AndroidSdkVersionShield from '@/common/android-sdk-version-shield.md';
| live.100ms:video-filters: |<AndroidSdkVersionShield />|
| live.100ms:virtual-background: |<AndroidSdkVersionShield />|

## v2.9.60 - 2024-06-07
### Added
- New API `VideoFrameInfoListener` to receive `rotatedWidth`, `rotatedHeight` and `rotation` to help change the virtual background on orientation changes to avoid stretching.

## v2.9.59 - 2024-05-31
### Added
- Transcriptions for live video can now be toggled on and off in realtime.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var audioTrackSetting = HMSAudioTrackSetting(
/// Create Instance of `HMSTrackSetting`
var trackSettings = HMSTrackSetting(
audioTrackSetting: HMSAudioTrackSetting(
enableNoiseCancellation: isNoiseCancellationEnabled),
enableNoiseCancellation: true),
videoTrackSetting: HMSVideoTrackSetting(
trackInitialState: joinWithMutedVideo
? HMSTrackInitState.MUTED
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
---
title: Virtual Background Plugin (Beta)
nav: 13.4
---

Virtual Background plugin helps customise one’s background by replacing the background with a static image or blurring the background. This guide provides an overview of using the Virtual Background plugin of 100ms.

<video loop="true" autoplay="autoplay" controls="controls" id="vid" muted height="700" width="300">
<source src="/docs/guides/virtual-background-ui-demo.mov" type="video/mp4" />
</video>
<br />

## Supported Versions/Resolutions

- Minimum 100ms SDK version it can work with is `1.10.3`

## Limitations

- Has poor fps on older android phones
- Minimum iOS version required to support Virtual Background plugin is `iOS 15`
- Virtual background plugin is in beta stage and may have performance issues on iPhone X, 8, 7, 6 and other older devices. We recommend that you use this feature on a high performance device for smooth experience.

## Add dependency

To add virtual background to your application add `hms_video_plugin` to your application's `pubspec.yaml` file.

```yaml
hms_video_plugin:
```
## How to Integrate Virtual Background Plugin:
> 🔑 Note: `hms_video_plugin` cannot be used independently. Always call the virtual background APIs after `onJoin` or `onPreview`.

<div className="steps-container">

### Step 1: Set the isVirtualBackgroundEnabled property in HMSVideoTrackSetting as true

```dart
var videoTrackSetting = HMSVideoTrackSetting(
trackInitialState: joinWithMutedVideo
? HMSTrackInitState.MUTED
: HMSTrackInitState.UNMUTED,
isVirtualBackgroundEnabled: true);
```

### Step 2: Pass the Track Settings to the HMSSDK constructor

```dart
/// Create Instance of `HMSTrackSetting`
var trackSettings = HMSTrackSetting(
audioTrackSetting: HMSAudioTrackSetting(),
videoTrackSetting: videoTrackSetting);

/// Set the track settings to HMSSDK
var hmsSDK = HMSSDK(
hmsTrackSetting: trackSettings);
```
### Step 3: Check for Virtual Background availability
```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{

...

bool isVirtualBackgroundSupported = false;

/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}

...
}
```

### Step 4: If Virtual Background is available, enable it

To enable virtual background, call the `enable` method.

```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{
...
bool isVirtualBackgroundSupported = false;
/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}
void enableVirtualBackground(Uint8List? image) async{
///[image] is the image to be set as background
if(isVirtualBackgroundSupported){
HMSException? isEnabled = await HMSVideoPlugin.enable(image: image);
if(isEnabled == null){
///Virtual background started successfully
}else{
///Error enabling virtual background
}
}
}
...
}
```

To enabled background blur, call the `enableBlur` method.

```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{
...
bool isVirtualBackgroundSupported = false;
/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}
void enableBackgroundBlur(int blurRadius) async{
///[blurRadius] is the radius of the blur effect
if(isVirtualBackgroundSupported){
HMSException? isEnabled = await HMSVideoPlugin.enableBlur(blurRadius: blurRadius);
if(isEnabled == null){
///Background blur started successfully
}else{
///Error enabling blur
}
}
}
...
}
```

### Step 5: To change virtual background image use changeVirtualBackground method

```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{
...
bool isVirtualBackgroundSupported = false;
/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}
///If virtual background is enabled, then we can change the virtual background image
void changeVirtualBackground(Uint8List? image) {
///[image] is the image new image to be set as background
///[isVirtualBackgroundSupported] is the flag to check if virtual background is supported
///[isVirtualBackgroundEnabled] is the flag to check if virtual background is enabled
if(isVirtualBackgroundSupported && isVirtualBackgroundEnabled){
HMSVideoPlugin.changeVirtualBackground(image: image);
}
}
...
}
```

### Step 6: To disable Virtual Background use disable methods

To disable virtual background, call the `disable` method.

```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{
...
bool isVirtualBackgroundSupported = false;
/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}
void disableVirtualBackground() async{
if(isVirtualBackgroundSupported){
HMSException? isDisabled = await HMSVideoPlugin.disable();
if(isDisabled == null){
///Virtual Background disabled successfully
}else{
///Error disabling virtual background
}
}
}
...
}
```

To disable background blur use `disableBlur` method

```dart
class Meeting implements HMSUpdateListener, HMSActionResultListener{
...
bool isVirtualBackgroundSupported = false;
/// This method checks the virtual background availability
void checkIsVirtualBackgroundSupported() async {
isVirtualBackgroundSupported = await HMSVideoPlugin.isSupported();
}
void disableBackgroundBlur() async{
if(isVirtualBackgroundSupported){
HMSException? isDisabled = await HMSVideoPlugin.disableBlur();
if(isDisabled == null){
///Background blur disabled successfully
}else{
///Error disabling blur
}
}
}
...
}
```

</div>
Loading

0 comments on commit b470264

Please sign in to comment.