Skip to content

Commit

Permalink
Merge branch 'staging' of https://github.com/AgoraIO/Doc-Source-Private
Browse files Browse the repository at this point in the history
… into staging
  • Loading branch information
atovpeko committed Oct 20, 2023
2 parents 9c2f6fb + b31d7f7 commit dfd4295
Show file tree
Hide file tree
Showing 24 changed files with 725 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ To enable and change virtual backgrounds, you add a button to the user interface
public void setVirtualBackground(View view){

if (!agoraEngine.isFeatureAvailableOnDevice(Constants.FEATURE_VIDEO_VIRTUAL_BACKGROUND)) {
showMessage("Virtual background feature is not available on ths device");
showMessage("Virtual background feature is not available on this device");
return;
}

counter++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ To enable and change virtual backgrounds, you add a button to the user interface

```javascript
VirtualBackgroundSource,
SegmentationProperty
SegmentationProperty,
FeatureType
```

1. **Define variables to keep track of the virtual background state**
Expand All @@ -31,11 +32,21 @@ To enable and change virtual backgrounds, you add a button to the user interface

2. **Enable virtual background**

When a user presses the button, you call `enableVirtualBackground` to enable background blur. When the user presses the button again, you change the virtual background to a solid color. On the next button press, you set a `.jpg` or `.png` image as the virtual background. To specify these background effects, you configure `virtualBackgroundSource` and `SegmentationProperty`. To do this, in `preload.js`, add the following method before `document.getElementById("join").onclick = async function ()`:
When a user presses the button, you check if the user's device supports the virtual background feature. If `isFeatureAvailableOnDevice` returns true, you call `enableVirtualBackground` to enable background blur.
- When the user presses the button again, you change the virtual background to a solid color.
- On the next button press, you set a `.jpg` or `.png` image as the virtual background.

To specify these background effects, you configure `virtualBackgroundSource` and `SegmentationProperty`. To do this, in `preload.js`, add the following method before `document.getElementById("join").onclick = async function ()`:

```javascript
document.getElementById("virtualBackground").onclick = async function ()
{
if (
!agoraEngine.isFeatureAvailableOnDevice(FeatureType.VideoVirtualBackground)
) {
console.log("Your device does not support virtual background");
return;
}
counter++;
if (counter > 3)
{
Expand Down Expand Up @@ -82,4 +93,4 @@ To enable and change virtual backgrounds, you add a button to the user interface
virtualBackgroundSource, segmentationProperty);
}
```
</PlatformWrapper>
</PlatformWrapper>
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,16 @@ To enable and change virtual backgrounds, you add a button to the user interface

2. **Enable virtual background**

When a user presses the button, you call `enableVirtualBackground` to enable background blur. When the user presses the button again, you change the virtual background to a solid color. On the next button press, you set a `.jpg` or `.png` image as the virtual background. To specify these background effects, you configure `virtualBackgroundSource` and `SegmentationProperty`. To do this, add the following method to the `_MyAppState` class:
When a user presses the button, you check if the user's device supports the virtual background feature. If `isFeatureAvailableOnDevice` returns true, you call `enableVirtualBackground` to enable background blur. When the user presses the button again, you change the virtual background to a solid color. On the next button press, you set a `.jpg` or `.png` image as the virtual background. To specify these background effects, you configure `virtualBackgroundSource` and `SegmentationProperty`. To do this, add the following method to the `_MyAppState` class:

```dart
void setVirtualBackground() {
Future<void> setVirtualBackground() async {
if (!await agoraEngine.isFeatureAvailableOnDevice(FeatureType.videoVirtualBackground)) {
showMessage("Virtual background feature is not available on this device");
return;
}
counter++;
if (counter > 3) {
counter = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,35 +28,45 @@ To enable and change virtual backgrounds, you add a button to the user interface

2. **Enable virtual background**

When a user presses the button, you call `EnableVirtualBackground` to enable background blur. When the user presses the button again, you change the virtual background to a solid color. On the next button press, you set a `.jpg` or `.png` image as the virtual background. To specify these background effects, you configure `VirtualBackgroundSource` and `SegmentationProperty`. To implement this workflow, in your script file, add the following method to the `NewBehaviourScript` class:
When a user presses the button, you check if the user's device supports the virtual background feature. If `IsFeatureAvailableOnDevice` returns true, you call `EnableVirtualBackground` to enable background blur. When the user presses the button again, you change the virtual background to a solid color. On the next button press, you set a `.jpg` or `.png` image as the virtual background. To specify these background effects, you configure `VirtualBackgroundSource` and `SegmentationProperty`. To implement this workflow, in your script file, add the following method to the `NewBehaviourScript` class:

```csharp
public void setVirtualBackground()
{
if(!RtcEngine.IsFeatureAvailableOnDevice(FeatureType.VIDEO_VIRTUAL_BACKGROUND))
{
Debug.Log("Your device does not support virtual background");
return;
}

counter++;
if (counter > 3)
if (counter > 3)
{
counter = 0;
isVirtualBackGroundEnabled = false;
Debug.Log("Virtual background turned off");
}
else
}
else
{
isVirtualBackGroundEnabled = true;
}
VirtualBackgroundSource virtualBackgroundSource = new VirtualBackgroundSource();

// Set the type of virtual background
if (counter == 1) { // Set background blur
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_BLUR;
if (counter == 1)
{ // Set background blur
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_BLUR;
virtualBackgroundSource.blur_degree = BACKGROUND_BLUR_DEGREE.BLUR_DEGREE_HIGH;
Debug.Log("Blur background enabled");
} else if (counter == 2) { // Set a solid background color
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_COLOR;
}
else if (counter == 2)
{ // Set a solid background color
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_COLOR;
virtualBackgroundSource.color = 0x0000FF;
Debug.Log("Color background enabled");
} else if (counter == 3) { // Set a background image
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_IMG;
}
else if (counter == 3)
{ // Set a background image
virtualBackgroundSource.background_source_type = BACKGROUND_SOURCE_TYPE.BACKGROUND_IMG;
virtualBackgroundSource.source = "<absolute path to an image file>";
Debug.Log("Image background enabled");
}
Expand All @@ -68,7 +78,7 @@ To enable and change virtual backgrounds, you add a button to the user interface
// Enable or disable virtual background
RtcEngine.EnableVirtualBackground(
isVirtualBackGroundEnabled,
isVirtualBackGroundEnabled,
virtualBackgroundSource, segmentationProperty);
}
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Integrate the virtual background extension, and implement the virtual background

```typescript
// Create a client object
var client = AgoraRTC.createClient({mode: "rtc", codec: "vp8"});
var client = AgoraRTC.createClient({mode: "rtc", codec: "vp9"});
// Create a VirtualBackgroundExtension instance
const extension = new VirtualBackgroundExtension();
// Check browser compatibility virtual background extension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### API reference

- <Link to="{{global.API_REF_FLUTTER_ROOT}}/class_irtcengine.html#api_irtcengine_isfeatureavailableondevice">isFeatureAvailableOnDevice</Link>

- <Link to="{{global.API_REF_FLUTTER_ROOT}}/class_irtcengine.html#api_irtcengine_enablevirtualbackground">enableVirtualBackground</Link>

- <Link to="{{global.API_REF_FLUTTER_ROOT}}/rtc_api_data_type.html#class_virtualbackgroundsource">VirtualBackgroundSource</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### API reference

- <Link to="{{global.API_REF_UNITY_ROOT}}/class_irtcengine.html#api_irtcengine_isfeatureavailableondevice">IsFeatureAvailableOnDevice</Link>

- <Link to="{{global.API_REF_UNITY_ROOT}}/class_irtcengine.html#api_irtcengine_enablevirtualbackground">enableVirtualBackground</Link>

- <Link to="{{global.API_REF_UNITY_ROOT}}/rtc_api_data_type.html#class_virtualbackgroundsource">VirtualBackgroundSource</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import AgoraRTC from "agora-rtc-sdk-ng";
import VirtualBackgroundExtension from "agora-extension-virtual-background";

// Create a client object
var client = AgoraRTC.createClient({mode: "rtc", codec: "vp8"});
var client = AgoraRTC.createClient({mode: "rtc", codec: "vp9"});
// Create a VirtualBackgroundExtension instance
const extension = new VirtualBackgroundExtension();
// Register the extension
Expand Down
2 changes: 1 addition & 1 deletion shared/media-pull/reference/_release-notes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ The changes for earlier releases include adding support for the following:
- Streaming encapsulation formats: FLV, MP4, MPEG-TS, Matroska (MKV), MP3.
- Playback scheduling. Set the start time of playing online media streams to schedule playback.
- Restricted access area. Specify the region where the online media stream is played in the request, to ensure the transmission quality of the media stream.
- On-demand stream loop playback.
- On-demand stream loop playback.
21 changes: 11 additions & 10 deletions shared/video-sdk/develop/_ensure-channel-quality.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -188,53 +188,54 @@ The recommended settings for these different scenarios are:
| 480p_8 | 848 × 480 | 15 | 610 |
| 480p_9 | 848 × 480 | 30 | 930 |
| 480p_10 | 640 × 480 | 10 | 400 |
| **540p (Default)**| **960 × 540** | **15** | **1100** |
| 540p | 960 × 540 | 15 | 1100 |
| 720p | 1280 × 720 | 15 | 1130 |
| 720p_1 | 1280 × 720 | 15 | 1130 |
| 720p_2 | 1280 × 720 | 30 | 2000 |
| 720p_3 | 1280 × 720 | 30 | 1710 |
| 720p_5 | 960 × 720 | 15 | 910 |
| 720p_6 | 960 × 720 | 30 | 1380 |
| 720p_auto | 1280 × 720 | 30 | 3000 |
| 1080p | 1920 × 1080 | 15 | 2080 |
| 1080p_1 | 1920 × 1080 | 15 | 2080 |
| 1080p_2 | 1920 × 1080 | 30 | 3000 |
| 1080p_3 | 1920 × 1080 | 30 | 3150 |
| 1080p_5 | 1920 × 1080 | 60 | 4780 |

<PlatformWrapper platform="android">
For more details, see <Link to="{{Global.API_REF_ANDROID_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_ANDROID_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="ios">
For more details, see <Link to="{{Global.API_REF_IOS_ROOT_RTC_KIT}}/agoravideoencoderconfiguration">AgoraVideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_IOS_ROOT_RTC_KIT}}/agoravideoencoderconfiguration">AgoraVideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="web">
For more details, see <Link to="{{Global.API_REF_WEB_ROOT}}/globals.html#videoencoderconfigurationpreset">VideoEncoderConfigurationPreset</Link>.
The default video profile is 480p_1. For more details, see <Link to="{{Global.API_REF_WEB_ROOT}}/globals.html#videoencoderconfigurationpreset">VideoEncoderConfigurationPreset</Link>.
</PlatformWrapper>

<PlatformWrapper platform="macos">
For more details, see <Link to="{{Global.API_REF_MACOS_ROOT_RTC_KIT}}/agoravideoencoderconfiguration">AgoraVideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_MACOS_ROOT_RTC_KIT}}/agoravideoencoderconfiguration">AgoraVideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="windows">
For more details, see <Link to="{{Global.API_REF_CPP_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_CPP_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="electron">
For more details, see <Link to="{{Global.API_REF_ELECTRON_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_ELECTRON_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="unity">
For more details, see <Link to="{{Global.API_REF_UNITY_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_UNITY_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="flutter">
For more details, see <Link to="{{Global.API_REF_FLUTTER_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_FLUTTER_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

<PlatformWrapper platform="react-native">
For more details, see <Link to="{{Global.API_REF_RN_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
The default video profile is 540p. For more details, see <Link to="{{Global.API_REF_RN_ROOT}}/class_videoencoderconfiguration.html">VideoEncoderConfiguration</Link>.
</PlatformWrapper>

### Mainstream video profiles
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
```yaml
dependencies:
...
# For x.y.z, fill in a specific SDK version number. For example, 6.0.0
# For x.y.z, fill in a specific SDK version number. For example, 6.2.3
agora_rtc_engine: ^x.y.z
permission_handler: ^9.2.0
...
Expand Down
29 changes: 27 additions & 2 deletions shared/video-sdk/reference/_known-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,24 @@ import * as data from '@site/data/variables';

import Web from '@docs/shared/video-sdk/reference/known-issues/web.mdx';
import Android from '@docs/shared/video-sdk/reference/known-issues/android.mdx';
import Flutter from '@docs/shared/video-sdk/reference/known-issues/flutter.mdx';
import ReactNative from '@docs/shared/video-sdk/reference/known-issues/react-native.mdx';
import Unity from '@docs/shared/video-sdk/reference/known-issues/unity.mdx';

<PlatformWrapper notAllowed="web">
<PlatformWrapper notAllowed="android">
<PlatformWrapper platform="ios">
There are no known issues for this platform.
</PlatformWrapper>

<PlatformWrapper platform="macos">
There are no known issues for this platform.
</PlatformWrapper>

<PlatformWrapper platform="windows">
There are no known issues for this platform.
</PlatformWrapper>

<PlatformWrapper platform="electron">
There are no known issues for this platform.
</PlatformWrapper>

<PlatformWrapper platform="web">
Expand All @@ -16,3 +29,15 @@ There are no known issues for this platform.
<PlatformWrapper platform="android">
<Android />
</PlatformWrapper>

<PlatformWrapper platform="flutter">
<Flutter />
</PlatformWrapper>

<PlatformWrapper platform="unity">
<Unity />
</PlatformWrapper>

<PlatformWrapper platform="react-native">
<ReactNative />
</PlatformWrapper>
17 changes: 17 additions & 0 deletions shared/video-sdk/reference/known-issues/flutter.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<PlatformWrapper platform="flutter">

This page lists the known issues and limitations of using the Flutter SDK.

This page is continuously updated as the systems evolve. Agora suggests you regularly upgrade to the latest version of the SDK, which includes new features, bug fixes and improvements.

### Flutter SDK v4.2.3

**Android 14 screen sharing issue**

Due to changes in the screen sharing behavior of Android 14 system, using devices with this version for screen sharing may entail the following issues:

- Switching between the landscape and portrait mode during screen sharing can interrupt the current screen sharing process and a window will pop up asking if you want to start recording the screen. Once confirmed, screen sharing can be started.

- When integrating the SDK, setting the Android `targetSdkVersion` to 34 may cause the screen sharing feature to be unavailable or even cause the application to crash.

</PlatformWrapper>
17 changes: 17 additions & 0 deletions shared/video-sdk/reference/known-issues/react-native.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<PlatformWrapper platform="react-native">

This page lists the known issues and limitations of using the React Native SDK.

This page is continuously updated as the systems evolve. Agora suggests you regularly upgrade to the latest version of the SDK, which includes new features, bug fixes and improvements.

### React Native SDK v4.2.3

**Android 14 screen sharing issue**

Due to changes in the screen sharing behavior of Android 14 system, using devices with this version for screen sharing may entail the following issues:

- Switching between the landscape and portrait mode during screen sharing can interrupt the current screen sharing process and a window will pop up asking if you want to start recording the screen. Once confirmed, screen sharing can be started.

- When integrating the SDK, setting the Android `targetSdkVersion` to 34 may cause the screen sharing feature to be unavailable or even cause the application to crash.

</PlatformWrapper>
17 changes: 17 additions & 0 deletions shared/video-sdk/reference/known-issues/unity.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<PlatformWrapper platform="unity">

This page lists the known issues and limitations of using the Unity SDK.

This page is continuously updated as the systems evolve. Agora suggests you regularly upgrade to the latest version of the SDK, which includes new features, bug fixes and improvements.

### Unity SDK v4.2.3

**Android 14 screen sharing issue**

Due to changes in the screen sharing behavior of Android 14 system, using devices with this version for screen sharing may entail the following issues:

- Switching between the landscape and portrait mode during screen sharing can interrupt the current screen sharing process and a window will pop up asking if you want to start recording the screen. Once confirmed, screen sharing can be started.

- When integrating the SDK, setting the Android `targetSdkVersion` to 34 may cause the screen sharing feature to be unavailable or even cause the application to crash.

</PlatformWrapper>
Loading

0 comments on commit dfd4295

Please sign in to comment.