From 60d7845aa5cdc9a1b96b8e0466ce1496fa76cfd8 Mon Sep 17 00:00:00 2001 From: Dasun Nirmitha Date: Fri, 5 Jul 2024 02:21:27 +0530 Subject: [PATCH] ENDOC-289 rtc weekly 0509 --- cloud-recording/overview/pricing.md | 3 +- on-premise-recording/overview/billing.md | 2 +- .../screen-sharing/project-setup/ios.mdx | 2 + .../video-sdk/develop/voice-effects/index.mdx | 2 - .../project-implementation/android.mdx | 9 +++- .../project-implementation/blueprint.mdx | 4 ++ .../project-implementation/flutter.mdx | 49 +++++++++++++++---- .../project-implementation/react-native.mdx | 4 ++ .../project-implementation/unreal.mdx | 5 ++ shared/video-sdk/reference/_pricing.mdx | 2 +- 10 files changed, 64 insertions(+), 18 deletions(-) diff --git a/cloud-recording/overview/pricing.md b/cloud-recording/overview/pricing.md index 1ccb47501..56b29b4c6 100644 --- a/cloud-recording/overview/pricing.md +++ b/cloud-recording/overview/pricing.md @@ -37,8 +37,7 @@ time to get the aggregate resolution, which categorizes video as follows: | 2K | From greater than 2,073,600 (1920 × 1080) to 3,686,400 (2560 × 1440) | | 2K+ | From greater than 3,686,400 (2560 × 1440) to 8,847,360 (4096 × 2160) | -For example, if the recording server records two 960 × 720 video streams at the same time, -the aggregate resolution is 960 × 720 + 960 × 720 = 1,382,400. The recording service is charged based on the Full HD video pricing. +For example, if the recording server records two video streams with resolutions of 1280 × 720 and 1920 × 1080 at the same time, the aggregated resolution is (1280 × 720) + (1920 × 1080) = 2,995,200. Because 2,995,200 is greater than 2,073,600 but less than 3,686,400, the recording service is charged based on the 2K video pricing. The recording fee does not depend on the recording mode you choose. Regardless of whether you use the individual mode or composite mode, the recording fee relates only to the number of the streams recorded, the recording time, and the aggregate diff --git a/on-premise-recording/overview/billing.md b/on-premise-recording/overview/billing.md index e705ebf07..a192e9285 100644 --- a/on-premise-recording/overview/billing.md +++ b/on-premise-recording/overview/billing.md @@ -101,7 +101,7 @@ Agora adds up the resolution of all the video streams recorded at the same time | 2K | From greater than 2,073,600 (1920 × 1080) to 3,686,400 (2560 × 1440) | | 2K+ | From greater than 3,686,400 (2560 × 1440) to 8,847,360 (4096 × 2160) | -For example, if the recording server records two 960 × 720 video streams at the same time, the aggregate resolution is 960 × 720 + 960 × 720 = 1,382,400. The recording service is charged based on the Full HD video pricing. +For example, if the recording server records two video streams with resolutions of 1280 × 720 and 1920 × 1080 at the same time, the aggregated resolution is (1280 × 720) + (1920 × 1080) = 2,995,200. Because 2,995,200 is greater than 2,073,600 but less than 3,686,400, the recording service is charged based on the 2K video pricing. ## Examples diff --git a/shared/video-sdk/develop/screen-sharing/project-setup/ios.mdx b/shared/video-sdk/develop/screen-sharing/project-setup/ios.mdx index 43e142c00..588a44fa2 100644 --- a/shared/video-sdk/develop/screen-sharing/project-setup/ios.mdx +++ b/shared/video-sdk/develop/screen-sharing/project-setup/ios.mdx @@ -24,6 +24,7 @@ Take the following steps to set up your project: ``` swift import ReplayKit + import AgoraReplayKitExtension class SampleHandler: AgoraReplayKitHandler { override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { @@ -37,6 +38,7 @@ Take the following steps to set up your project: ``` swift import ReplayKit + import AgoraReplayKitExtension class SampleHandler: RPBroadcastSampleHandler, AgoraReplayKitExtDelegate { override func broadcastStarted(withSetupInfo setupInfo: [String : NSObject]?) { diff --git a/shared/video-sdk/develop/voice-effects/index.mdx b/shared/video-sdk/develop/voice-effects/index.mdx index d1b907ede..ea9e0ce85 100644 --- a/shared/video-sdk/develop/voice-effects/index.mdx +++ b/shared/video-sdk/develop/voice-effects/index.mdx @@ -21,8 +21,6 @@ With you can implement voice modifying effects such as chat beau * **Customized audio effects**: Controlling the voice pitch, equalization, and reverberation. -Try the [Online Demo](https://www.agora.io/en/audio-demo?_gl=1*skmawq*_ga*MjA2MzYxMjY4Mi4xNzAzMDczMjA1*_ga_BFVGG7E02W*MTcwNzgwOTIyNS4xOC4xLjE3MDc4MTA2OTAuMC4wLjA) to experience different voice effects. - ## Prerequisites Before proceeding with the code examples on this page, make sure you have completed the [SDK quickstart](../../video-calling/get-started/get-started-sdk) guide. diff --git a/shared/video-sdk/get-started/get-started-sdk/project-implementation/android.mdx b/shared/video-sdk/get-started/get-started-sdk/project-implementation/android.mdx index 9b176c1f7..459673a2b 100644 --- a/shared/video-sdk/get-started/get-started-sdk/project-implementation/android.mdx +++ b/shared/video-sdk/get-started/get-started-sdk/project-implementation/android.mdx @@ -703,6 +703,11 @@ private String token = "<#Your token#>"; ### Initialize the engine Call `create` to initialize an `RtcEngine` instance. + + +Before initializing the SDK, make sure that the end-user is fully aware of and agrees to the privacy policy. + + ```java @@ -913,7 +918,7 @@ When a user launches your , start real-time interaction. When a ``` -2. When a user closes the , or switches the to the background, call `stopPreview` to stop the video preview and then call `leaveChannel` to leave the channel and release all session-related resources. +2. When a user closes the , or switches the to the background, call `stopPreview` to stop the video preview and then call `leaveChannel` to leave the current channel and release all session-related resources. ```java @Override protected void onDestroy() { @@ -926,7 +931,7 @@ When a user launches your , start real-time interaction. When a ``` -2. When a user closes the , or switches the to the background, call `leaveChannel` to leave the channel and release all session-related resources. +2. When a user closes the , or switches the to the background, call `leaveChannel` to leave the current channel and release all session-related resources. ```java @Override diff --git a/shared/video-sdk/get-started/get-started-sdk/project-implementation/blueprint.mdx b/shared/video-sdk/get-started/get-started-sdk/project-implementation/blueprint.mdx index 70df8edb5..5f8af0b5b 100644 --- a/shared/video-sdk/get-started/get-started-sdk/project-implementation/blueprint.mdx +++ b/shared/video-sdk/get-started/get-started-sdk/project-implementation/blueprint.mdx @@ -69,6 +69,10 @@ Add variables to create an engine instance and join a channel. ### Initialize RTC engine​ + +Before initializing the SDK, make sure that the end-user is fully aware of and agrees to the privacy policy. + + 1. If your target platform is Android, check whether system permissions have been granted before initializing the RTC engine. Refer to the following figure to create nodes for adding permissions to access the microphone and camera in the **CheckPermission** function. ![](/images/video-sdk/quickstart-implementation-blueprint-5.png) diff --git a/shared/video-sdk/get-started/get-started-sdk/project-implementation/flutter.mdx b/shared/video-sdk/get-started/get-started-sdk/project-implementation/flutter.mdx index 4cd39bb6e..caeef766e 100644 --- a/shared/video-sdk/get-started/get-started-sdk/project-implementation/flutter.mdx +++ b/shared/video-sdk/get-started/get-started-sdk/project-implementation/flutter.mdx @@ -23,7 +23,7 @@ import 'package:permission_handler/permission_handler.dart'; void main() => runApp(MyApp()); -// Fill in the App ID of the project, generated from Agora console +// Fill in the app ID obtained from the Agora console const appId = "<-- Insert App Id -->"; // Fill in the temporary token generated using Agora console const token = "<-- Insert Token -->"; @@ -139,7 +139,7 @@ import 'package:permission_handler/permission_handler.dart'; void main() => runApp(MyApp()); -// Fill in the app ID of your project, generated from Agora Console +// Fill in the app ID obtained from the Agora Console const appId = "<-- Insert app Id -->"; // Fill in the temporary token generated from Agora Console const token = "<-- Insert token -->"; @@ -248,7 +248,7 @@ class _MyAppState extends State { Center( child: _remoteVideo(), ), - Align( + Align( alignment: Alignment.topLeft, child: SizedBox( width: 100, @@ -302,7 +302,7 @@ import 'package:permission_handler/permission_handler.dart'; void main() => runApp(MyApp()); -// Fill in the app ID of your project, generated from Agora Console +// Fill in the app ID obtained from the Agora Console const appId = "<-- Insert app Id -->"; // Fill in the temporary token generated from Agora Console const token = "<-- Insert token -->"; @@ -412,7 +412,7 @@ class _MyAppState extends State { Center( child: _remoteVideo(), ), - Align( + Align( alignment: Alignment.topLeft, child: SizedBox( width: 100, @@ -466,7 +466,7 @@ import 'package:permission_handler/permission_handler.dart'; void main() => runApp(MyApp()); -// Fill in the app ID of your project, generated from Agora Console +// Fill in the app ID obtained from Agora Console const appId = "<-- Insert app Id -->"; // Fill in the temporary token generated from Agora Console const token = "<-- Insert token -->"; @@ -576,7 +576,7 @@ class _MyAppState extends State { Center( child: _remoteVideo(), ), - Align( + Align( alignment: Alignment.topLeft, child: SizedBox( width: 100, @@ -641,7 +641,7 @@ import 'package:permission_handler/permission_handler.dart'; Pass in the app ID, temporary token obtained from the Agora Console, and the channel name filled in when generating the temporary token, which will be used for subsequent initialization of the engine and joining the channel. ```dart -// Fill in the app ID of your project, generated from Agora Console +// Fill in the app ID obtained from Agora Console const appId = "<-- Insert app Id -->"; // Fill in the temporary token generated from Agora Console const token = "<-- Insert token -->"; @@ -682,6 +682,11 @@ If your target platform is iOS or macOS, add the microphone permission declarati ### Initialize the engine Call `createAgoraRtcEngine` to create an `RtcEngine` instance, then `initialize` the engine and set the channel profile. + + +Before initializing the SDK, make sure that the end-user is fully aware of and agrees to the privacy policy. + + ```dart // Create RtcEngine instance @@ -724,9 +729,16 @@ await _engine.startPreview(); ### Join a channel and publish audio and video streams​ Configure `ChannelMediaOptions` and call `joinChannel` to join a channel. In `ChannelMediaOptions`, set the `clientRoleType` to `clientRoleBroadcaster` to act as a host or `clientRoleAudience` for audience. + +Configure `ChannelMediaOptions` and call `joinChannel` to join a channel. +In `ChannelMediaOptions`: +- Set the `clientRoleType` to `clientRoleBroadcaster` to act as a host or `clientRoleAudience` for audience. +- Set `publishMicrophoneTrack` and `publishCameraTrack` to `true` to publish microphone-captured audio and camera-captured video. +- Set `autoSubscribeAudio` and `autoSubscribeVideo` to `true` to automatically subscribe to all audio and video streams. ```dart await _engine.joinChannel( + // Join a channel using a temporary token and channel name token: token, channelId: channel, options: const ChannelMediaOptions( @@ -735,6 +747,7 @@ await _engine.joinChannel( clientRoleType: ClientRoleType.clientRoleBroadcaster, audienceLatencyLevel: AudienceLatencyLevelType.audienceLatencyLevelLowLatency ), + // A uid of 0 means that the username is randomly generated within the engine. uid: 0, ); ``` @@ -742,6 +755,7 @@ await _engine.joinChannel( ```dart await _engine.joinChannel( + // Join a channel using a temporary token and channel name token: token, channelId: channel, options: const ChannelMediaOptions( @@ -750,6 +764,7 @@ await _engine.joinChannel( clientRoleType: ClientRoleType.clientRoleBroadcaster, audienceLatencyLevel: AudienceLatencyLevelType.audienceLatencyLevelUltraLowLatency ), + // A uid of 0 means that the username is randomly generated within the engine. uid: 0, ); ``` @@ -757,6 +772,7 @@ await _engine.joinChannel( ```dart await _engine.joinChannel( + // Join a channel using a temporary token and channel name token: token, channelId: channel, options: const ChannelMediaOptions( @@ -764,6 +780,7 @@ await _engine.joinChannel( // To set the user role to audience, change clientRoleBroadcaster to clientRoleAudience clientRoleType: ClientRoleType.clientRoleBroadcaster, ), + // A uid of 0 means that the username is randomly generated within the engine. uid: 0, ); ``` @@ -771,16 +788,22 @@ await _engine.joinChannel( ### Join a channel and publish the audio stream​ -Configure `ChannelMediaOptions` and call `joinChannel` to join a channel. In `ChannelMediaOptions`, set the `clientRoleType` to `clientRoleBroadcaster` to act as a host or `clientRoleAudience` for audience. +Configure `ChannelMediaOptions` and call `joinChannel` to join a channel. +In `ChannelMediaOptions`: + - Set the `clientRoleType` to `clientRoleBroadcaster` to act as a host or `clientRoleAudience` for audience. + - Set `publishMicrophoneTrack` to `true` to publish the audio captured by the microphone. + - Set `autoSubscribeAudio` to `true` to automatically subscribe to all audio streams. ```dart await _engine.joinChannel( + // Join a channel using a temporary token and channel name token: token, channelId: channel, options: const ChannelMediaOptions( // Set the user role as host // To set the user role to audience, change clientRoleBroadcaster to clientRoleAudience clientRoleType: ClientRoleType.clientRoleBroadcaster), + // A uid of 0 means that the username is randomly generated within the engine. uid: 0, ); ``` @@ -846,7 +869,13 @@ Widget _remoteVideo() { ### Leave the channel and release resources​ -When a user closes the , or switches the to the background, call `leaveChannel` to leave the channel and then `release` all session-related resources. +When a user closes the , or switches the to the background, follow the steps below to end an audio/video interaction: +1. Call `leaveChannel` to leave the current channel and release all session-related resources. +1. Call `release` to destroy the engine and release all resources used in the SDK. + + +After calling `release`, you will no longer be able to use all methods and callbacks of the SDK. To use real-time audio/video interaction again, you must create a new engine. + ```dart Future _dispose() async { diff --git a/shared/video-sdk/get-started/get-started-sdk/project-implementation/react-native.mdx b/shared/video-sdk/get-started/get-started-sdk/project-implementation/react-native.mdx index 251d9573b..154765d35 100644 --- a/shared/video-sdk/get-started/get-started-sdk/project-implementation/react-native.mdx +++ b/shared/video-sdk/get-started/get-started-sdk/project-implementation/react-native.mdx @@ -793,6 +793,10 @@ const getPermission = async () => { ### Initialize the engine Call `createAgoraRtcEngine` to create an `RtcEngine` instance, and then `initialize` the engine. + +Before initializing the SDK, make sure that the end-user is fully aware of and agrees to the privacy policy. + + ```jsx agoraEngineRef.current = createAgoraRtcEngine(); const agoraEngine = agoraEngineRef.current; diff --git a/shared/video-sdk/get-started/get-started-sdk/project-implementation/unreal.mdx b/shared/video-sdk/get-started/get-started-sdk/project-implementation/unreal.mdx index 229738804..72ad75057 100644 --- a/shared/video-sdk/get-started/get-started-sdk/project-implementation/unreal.mdx +++ b/shared/video-sdk/get-started/get-started-sdk/project-implementation/unreal.mdx @@ -844,6 +844,11 @@ Add the `AndroidPermission` library to obtain device and network permissions: ### Initialize the engine + + +Before initializing the SDK, make sure that the end-user is fully aware of and agrees to the privacy policy. + + Before calling other `IRtcEngine` methods, you create and initialize an `IRtcEngine` instance. Add the `SetupVideoSDKEngine` declaration and implementation to the following files: diff --git a/shared/video-sdk/reference/_pricing.mdx b/shared/video-sdk/reference/_pricing.mdx index ba3ba2520..4bd8c4818 100644 --- a/shared/video-sdk/reference/_pricing.mdx +++ b/shared/video-sdk/reference/_pricing.mdx @@ -110,7 +110,7 @@ Based on the aggregate resolution of all the video streams received, counts this video usage as Full HD type and bills it at the Full HD unit price. +For example, if a user subscribes to two video streams with resolutions of 1280 × 720 and 1920 × 1080 at the same time, the aggregated resolution of the user is (1280 × 720) + (1920 × 1080) = 2,995,200. Because 2,995,200 is greater than 2,073,600 but less than 3,686,400, counts this video usage as 2K type and bills it at the 2K unit price. #### Usage-based volume discounts