Skip to content

Commit

Permalink
Merge pull request #138 from AgoraIO-Community/remote-user-fix
Browse files Browse the repository at this point in the history
update mainAgoraUser logic
  • Loading branch information
Meherdeep committed Jun 13, 2023
2 parents b51ba32 + bf34c18 commit 5eca240
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 39 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.3.4

- Fixes error [#137](https://github.com/AgoraIO-Community/VideoUIKit-Flutter/issues/137)

## 1.3.3

- BREAKING CHANGE: VideoSourceType for `onFirstLocalVideoFrame` callback
Expand Down
2 changes: 1 addition & 1 deletion example/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ subprojects {
project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
2 changes: 1 addition & 1 deletion example/macos/Podfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
platform :osx, '10.11'
platform :osx, '10.14'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
11 changes: 6 additions & 5 deletions example/macos/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
archiveVersion = 1;
classes = {
};
objectVersion = 51;
objectVersion = 54;
objects = {

/* Begin PBXAggregateTarget section */
Expand Down Expand Up @@ -202,7 +202,7 @@
isa = PBXProject;
attributes = {
LastSwiftUpdateCheck = 0920;
LastUpgradeCheck = 0930;
LastUpgradeCheck = 1300;
ORGANIZATIONNAME = "";
TargetAttributes = {
33CC10EC2044A3C60003C045 = {
Expand Down Expand Up @@ -255,6 +255,7 @@
/* Begin PBXShellScriptBuildPhase section */
3399D490228B24CF009A79C7 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 2147483647;
files = (
);
Expand Down Expand Up @@ -386,7 +387,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down Expand Up @@ -465,7 +466,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = macosx;
Expand Down Expand Up @@ -512,7 +513,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.11;
MACOSX_DEPLOYMENT_TARGET = 10.14;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = macosx;
SWIFT_COMPILATION_MODE = wholemodule;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1000"
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
2 changes: 1 addition & 1 deletion example/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void main() {
expect(
find.byWidgetPredicate(
(Widget widget) =>
widget is Text && widget.data.startsWith('Running on:'),
widget is Text && widget.data!.startsWith('Running on:'),
),
findsOneWidget,
);
Expand Down
10 changes: 2 additions & 8 deletions lib/agora_uikit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,8 @@ export 'package:agora_rtc_engine/agora_rtc_engine.dart'
RtmpStreamingEvent,
UploadErrorReason;
export 'package:agora_rtm/agora_rtm.dart'
show
AgoraRtmMessage,
AgoraRtmMember,
AgoraRtmChannelAttribute,
AgoraRtmChannelException,
AgoraRtmClientException,
AgoraRtmLocalInvitation,
AgoraRtmRemoteInvitation;
show AgoraRtmChannelException, AgoraRtmClientException, AgoraRtmMessage;

export 'package:permission_handler/permission_handler.dart';

export 'models/agora_channel_data.dart' show AgoraChannelData;
Expand Down
10 changes: 4 additions & 6 deletions lib/controllers/rtc_event_handlers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ Future<RtcEngineEventHandler> rtcEngineEventHandler(
SessionController sessionController,
) async {
const String tag = "AgoraVideoUIKit";
return RtcEngineEventHandler(onApiCallExecuted: (err, api, result) {
agoraEventHandlers.onApiCallExecuted?.call(err, api, result);
}, onRejoinChannelSuccess: (connection, elapsed) {
return RtcEngineEventHandler(onRejoinChannelSuccess: (connection, elapsed) {
agoraEventHandlers.onRejoinChannelSuccess?.call(connection, elapsed);
}, onLocalUserRegistered: (uid, userAccount) {
agoraEventHandlers.onLocalUserRegistered?.call(uid, userAccount);
Expand Down Expand Up @@ -60,9 +58,9 @@ Future<RtcEngineEventHandler> rtcEngineEventHandler(
}, onFirstLocalAudioFramePublished: (connection, elapsed) {
agoraEventHandlers.onFirstLocalAudioFramePublished
?.call(connection, elapsed);
}, onFirstLocalVideoFrame: (videoSourceType, width, height, elapsed) {
}, onFirstLocalVideoFrame: (connection, width, height, elapsed) {
agoraEventHandlers.onFirstLocalVideoFrame
?.call(videoSourceType, width, height, elapsed);
?.call(connection, width, height, elapsed);
}, onFirstLocalVideoFramePublished: (connection, elapsed) {
agoraEventHandlers.onFirstLocalVideoFramePublished
?.call(connection, elapsed);
Expand Down Expand Up @@ -235,7 +233,7 @@ Future<RtcEngineEventHandler> rtcEngineEventHandler(
if (state == RemoteVideoState.remoteVideoStateStopped) {
sessionController.updateUserVideo(uid: remoteUid, videoDisabled: true);
} else if (state == RemoteVideoState.remoteVideoStateDecoding &&
(reason == RemoteVideoState.remoteVideoStateStarting ||
(state == RemoteVideoState.remoteVideoStateStarting ||
reason ==
RemoteVideoStateReason.remoteVideoStateReasonRemoteUnmuted)) {
sessionController.updateUserVideo(uid: remoteUid, videoDisabled: false);
Expand Down
12 changes: 1 addition & 11 deletions lib/models/agora_rtc_event_handlers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class AgoraRtcEventHandlers {
/// * [height] The height (px) of the first local video frame.
/// * [elapsed] Time elapsed (ms) from the local user calling joinChannel [2/2] until the SDK triggers this callback. If you call startPreview before calling joinChannel [2/2], then this parameter is the time elapsed from calling the startPreview method until the SDK triggers this callback.
final void Function(
VideoSourceType videoSourceType, int width, int height, int elapsed)?
RtcConnection connection, int width, int height, int elapsed)?
onFirstLocalVideoFrame;

/// Occurs when the first video frame is published.
Expand Down Expand Up @@ -273,15 +273,6 @@ class AgoraRtcEventHandlers {
final void Function(RtcConnection connection, int remoteUid, bool enabled)?
onUserEnableLocalVideo;

/// Occurs when a method is executed by the SDK.
///
///
/// * [err] The error code returned by the SDK when the method call fails. If the SDK returns 0, then the method call is successful.
/// * [api] The method executed by the SDK.
/// * [result] The result of the method call.
final void Function(ErrorCodeType err, String api, String result)?
onApiCallExecuted;

/// Reports the statistics of the local audio stream.
/// The SDK triggers this callback once every two seconds.
///
Expand Down Expand Up @@ -777,7 +768,6 @@ class AgoraRtcEventHandlers {
this.onUserEnableVideo,
this.onUserStateChanged,
this.onUserEnableLocalVideo,
this.onApiCallExecuted,
this.onLocalAudioStats,
this.onRemoteAudioStats,
this.onLocalVideoStats,
Expand Down
4 changes: 3 additions & 1 deletion lib/src/layout/floating_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ class _FloatingLayoutState extends State<FloatingLayout> {
),
),
widget.client.sessionController.value.mainAgoraUser.uid !=
widget.client.sessionController.value.localUid
widget.client.sessionController.value.localUid &&
widget.client.sessionController.value.mainAgoraUser.uid !=
0
? Expanded(
child: Stack(
children: [
Expand Down
8 changes: 4 additions & 4 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ homepage: https://www.agora.io/en/
repository: https://github.com/AgoraIO-Community/VideoUIKit-Flutter

environment:
sdk: ">=2.12.0 <3.0.0"
sdk: ">=2.19.0 <3.0.0"
flutter: ">=2.2.0"

dependencies:
agora_rtc_engine: ">= 6.1.0 <6.2.0"
agora_rtm: ^1.5.0
agora_rtc_engine: 6.1.0
agora_rtm: 1.5.0
flutter:
sdk: flutter
http: ^0.13.5
http: ^1.0.0
lints: ">=1.0.1 <2.1.0"
permission_handler: ^10.2.0

Expand Down

0 comments on commit 5eca240

Please sign in to comment.