Skip to content

Commit 9623f15

Browse files
committed
fix conflict
2 parents 63c55c3 + c779a92 commit 9623f15

File tree

34 files changed

+1212
-47
lines changed

34 files changed

+1212
-47
lines changed

Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/AGApplication.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,29 @@ private void createRtcEngine() {
5858

5959
mEventHandler = new MyEngineEventHandler();
6060
try {
61+
// Creates an RtcEngine instance
6162
mRtcEngine = RtcEngine.create(context, appId, mEventHandler);
6263
} catch (Exception e) {
6364
log.error(Log.getStackTraceString(e));
6465
throw new RuntimeException("NEED TO check rtc sdk init fatal error\n" + Log.getStackTraceString(e));
6566
}
6667

68+
/*
69+
Sets the channel profile of the Agora RtcEngine.
70+
The Agora RtcEngine differentiates channel profiles and applies different optimization
71+
algorithms accordingly. For example, it prioritizes smoothness and low latency for a
72+
video call, and prioritizes video quality for a video broadcast.
73+
*/
6774
mRtcEngine.setChannelProfile(Constants.CHANNEL_PROFILE_COMMUNICATION);
75+
// Enables the video module.
6876
mRtcEngine.enableVideo();
77+
/*
78+
Enables the onAudioVolumeIndication callback at a set time interval to report on which
79+
users are speaking and the speakers' volume.
80+
Once this method is enabled, the SDK returns the volume indication in the
81+
onAudioVolumeIndication callback at the set time interval, regardless of whether any user
82+
is speaking in the channel.
83+
*/
6984
mRtcEngine.enableAudioVolumeIndication(200, 3, false);
7085

7186
mConfig = new EngineConfig();

Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/model/MyEngineEventHandler.java

Lines changed: 219 additions & 0 deletions
Large diffs are not rendered by default.

Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/BaseActivity.java

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,17 @@ protected final int getActionBarHeight() {
259259
return actionBarHeight;
260260
}
261261

262+
/**
263+
*
264+
* Starts/Stops the local video preview
265+
*
266+
* Before calling this method, you must:
267+
* Call the enableVideo method to enable the video.
268+
*
269+
* @param start Whether to start/stop the local preview
270+
* @param view The SurfaceView in which to render the preview
271+
* @param uid User ID.
272+
*/
262273
protected void preview(boolean start, SurfaceView view, int uid) {
263274
if (start) {
264275
rtcEngine().setupLocalVideo(new VideoCanvas(view, VideoCanvas.RENDER_MODE_HIDDEN, uid));
@@ -268,6 +279,26 @@ protected void preview(boolean start, SurfaceView view, int uid) {
268279
}
269280
}
270281

282+
/**
283+
* Allows a user to join a channel.
284+
*
285+
* Users in the same channel can talk to each other, and multiple users in the same channel can start a group chat. Users with different App IDs cannot call each other.
286+
*
287+
* You must call the leaveChannel method to exit the current call before joining another channel.
288+
*
289+
* A successful joinChannel method call triggers the following callbacks:
290+
*
291+
* The local client: onJoinChannelSuccess.
292+
* The remote client: onUserJoined, if the user joining the channel is in the Communication profile, or is a BROADCASTER in the Live Broadcast profile.
293+
*
294+
* When the connection between the client and Agora's server is interrupted due to poor
295+
* network conditions, the SDK tries reconnecting to the server. When the local client
296+
* successfully rejoins the channel, the SDK triggers the onRejoinChannelSuccess callback
297+
* on the local client.
298+
*
299+
* @param channel The unique channel name for the AgoraRTC session in the string format.
300+
* @param uid User ID.
301+
*/
271302
public final void joinChannel(final String channel, int uid) {
272303
String accessToken = getApplicationContext().getString(R.string.agora_access_token);
273304
if (TextUtils.equals(accessToken, "") || TextUtils.equals(accessToken, "<#YOUR ACCESS TOKEN#>")) {
@@ -280,6 +311,23 @@ public final void joinChannel(final String channel, int uid) {
280311
log.debug("joinChannel " + channel + " " + uid);
281312
}
282313

314+
/**
315+
* Allows a user to leave a channel.
316+
*
317+
* After joining a channel, the user must call the leaveChannel method to end the call before
318+
* joining another channel. This method returns 0 if the user leaves the channel and releases
319+
* all resources related to the call. This method call is asynchronous, and the user has not
320+
* exited the channel when the method call returns. Once the user leaves the channel,
321+
* the SDK triggers the onLeaveChannel callback.
322+
*
323+
* A successful leaveChannel method call triggers the following callbacks:
324+
*
325+
* The local client: onLeaveChannel.
326+
* The remote client: onUserOffline, if the user leaving the channel is in the
327+
* Communication channel, or is a BROADCASTER in the Live Broadcast profile.
328+
*
329+
* @param channel Channel Name
330+
*/
283331
public final void leaveChannel(String channel) {
284332
log.debug("leaveChannel " + channel);
285333
config().mChannel = null;
@@ -288,6 +336,9 @@ public final void leaveChannel(String channel) {
288336
config().reset();
289337
}
290338

339+
/**
340+
* Enables image enhancement and sets the options.
341+
*/
291342
protected void enablePreProcessor() {
292343
if (Constant.BEAUTY_EFFECT_ENABLED) {
293344
rtcEngine().setBeautyEffectOptions(true, Constant.BEAUTY_OPTIONS);
@@ -300,6 +351,10 @@ public final void setBeautyEffectParameters(float lightness, float smoothness, f
300351
Constant.BEAUTY_OPTIONS.rednessLevel = redness;
301352
}
302353

354+
355+
/**
356+
* Disables image enhancement.
357+
*/
303358
protected void disablePreProcessor() {
304359
// do not support null when setBeautyEffectOptions to false
305360
rtcEngine().setBeautyEffectOptions(false, Constant.BEAUTY_OPTIONS);
@@ -312,6 +367,7 @@ protected void configEngine(VideoEncoderConfiguration.VideoDimensions videoDimen
312367
}
313368

314369
log.debug("configEngine " + videoDimension + " " + fps + " " + encryptionMode);
370+
// Set the Resolution, FPS. Bitrate and Orientation of the video
315371
rtcEngine().setVideoEncoderConfiguration(new VideoEncoderConfiguration(videoDimension,
316372
fps,
317373
VideoEncoderConfiguration.STANDARD_BITRATE,

Group-Video/OpenVideoCall-Android/app/src/main/java/io/agora/openvcall/ui/CallActivity.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,18 @@ private void doConfigEngine(String encryptionKey, String encryptionMode) {
378378

379379
public void onSwitchCameraClicked(View view) {
380380
RtcEngine rtcEngine = rtcEngine();
381+
// Switches between front and rear cameras.
381382
rtcEngine.switchCamera();
382383
}
383384

384385
public void onSwitchSpeakerClicked(View view) {
385386
RtcEngine rtcEngine = rtcEngine();
387+
/*
388+
Enables/Disables the audio playback route to the speakerphone.
389+
This method sets whether the audio is routed to the speakerphone or earpiece.
390+
After calling this method, the SDK returns the onAudioRouteChanged callback
391+
to indicate the changes.
392+
*/
386393
rtcEngine.setEnableSpeakerphone(mAudioRouting != Constants.AUDIO_ROUTE_SPEAKERPHONE);
387394
}
388395

@@ -545,6 +552,13 @@ public void run() {
545552
return;
546553
}
547554

555+
/*
556+
Creates the video renderer view.
557+
CreateRendererView returns the SurfaceView type. The operation and layout of the
558+
view are managed by the app, and the Agora SDK renders the view provided by the
559+
app. The video display view must be created using this method instead of
560+
directly calling SurfaceView.
561+
*/
548562
SurfaceView surfaceV = RtcEngine.CreateRendererView(getApplicationContext());
549563
mUidsList.put(uid, surfaceV);
550564

@@ -553,6 +567,11 @@ public void run() {
553567
surfaceV.setZOrderOnTop(true);
554568
surfaceV.setZOrderMediaOverlay(true);
555569

570+
/*
571+
Initializes the video view of a remote user.
572+
This method initializes the video view of a remote stream on the local device. It affects only the video view that the local user sees.
573+
Call this method to bind the remote video stream to a video view and to set the rendering and mirror modes of the video view.
574+
*/
556575
rtcEngine().setupRemoteVideo(new VideoCanvas(surfaceV, VideoCanvas.RENDER_MODE_HIDDEN, uid));
557576

558577
if (useDefaultLayout) {

Group-Video/OpenVideoCall-Web/src/pages/index/index.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import { RESOLUTION_ARR } from "@/utils/Settings";
1111
import Polyfill from "@/utils/Polyfill";
1212
import Validator from "@/utils/Validate";
1313

14+
// Parses the query params from the url
15+
1416
const getParameterByName = (name, url) => {
1517
if (!url) {
1618
url = window.location.href;
@@ -23,6 +25,8 @@ const getParameterByName = (name, url) => {
2325
return decodeURIComponent(results[2].replace(/\+/g, " "));
2426
};
2527

28+
29+
// Intializes the ui with necessary video profile options. (resolution, framerate, bitrate etc.)
2630
const uiInit = () => {
2731
document.querySelector(
2832
".login-title"
@@ -73,6 +77,8 @@ const uiInit = () => {
7377
}
7478
};
7579

80+
// Channel name validator
81+
7682
const validate = channelName => {
7783
if (Validator.isNonEmpty(channelName)) {
7884
return "Cannot be empty!";
@@ -90,6 +96,8 @@ const validate = channelName => {
9096
return "";
9197
};
9298

99+
100+
93101
const subscribeMouseEvent = () => {
94102
// Click Join and go to the meeting room
95103
$("#joinBtn").on("click", () => {
@@ -112,6 +120,7 @@ const subscribeMouseEvent = () => {
112120
$("#channel").addClass("is-success");
113121
validateIcon.append(`<i class="ag-icon icon-correct"></i>`);
114122

123+
// This config data is added to the cookies to be used in other pages.
115124
let postData = {
116125
baseMode: document.querySelector("#baseMode").dataset.value,
117126
transcode: $('input[name="transcode"]:checked').val(),

0 commit comments

Comments
 (0)