diff --git a/CHANGELOG.md b/CHANGELOG.md index 066d4fe..12f0fe1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/example/android/build.gradle b/example/android/build.gradle index 28e1075..caf0b01 100644 --- a/example/android/build.gradle +++ b/example/android/build.gradle @@ -25,6 +25,6 @@ subprojects { project.evaluationDependsOn(':app') } -task clean(type: Delete) { +tasks.register("clean", Delete) { delete rootProject.buildDir } diff --git a/example/macos/Podfile b/example/macos/Podfile index dade8df..049abe2 100644 --- a/example/macos/Podfile +++ b/example/macos/Podfile @@ -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' diff --git a/example/macos/Runner.xcodeproj/project.pbxproj b/example/macos/Runner.xcodeproj/project.pbxproj index 5d90408..cf65902 100644 --- a/example/macos/Runner.xcodeproj/project.pbxproj +++ b/example/macos/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXAggregateTarget section */ @@ -202,7 +202,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0920; - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { 33CC10EC2044A3C60003C045 = { @@ -255,6 +255,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3399D490228B24CF009A79C7 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -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; @@ -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; @@ -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; diff --git a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 7ff3e1d..384334e 100644 --- a/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/example/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - widget is Text && widget.data.startsWith('Running on:'), + widget is Text && widget.data!.startsWith('Running on:'), ), findsOneWidget, ); diff --git a/lib/agora_uikit.dart b/lib/agora_uikit.dart index ddfd8be..675808a 100644 --- a/lib/agora_uikit.dart +++ b/lib/agora_uikit.dart @@ -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; diff --git a/lib/controllers/rtc_event_handlers.dart b/lib/controllers/rtc_event_handlers.dart index 391e76b..1e5d833 100644 --- a/lib/controllers/rtc_event_handlers.dart +++ b/lib/controllers/rtc_event_handlers.dart @@ -15,9 +15,7 @@ Future 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); @@ -60,9 +58,9 @@ Future 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); @@ -235,7 +233,7 @@ Future 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); diff --git a/lib/models/agora_rtc_event_handlers.dart b/lib/models/agora_rtc_event_handlers.dart index 91338b7..cd2ca50 100644 --- a/lib/models/agora_rtc_event_handlers.dart +++ b/lib/models/agora_rtc_event_handlers.dart @@ -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. @@ -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. /// @@ -777,7 +768,6 @@ class AgoraRtcEventHandlers { this.onUserEnableVideo, this.onUserStateChanged, this.onUserEnableLocalVideo, - this.onApiCallExecuted, this.onLocalAudioStats, this.onRemoteAudioStats, this.onLocalVideoStats, diff --git a/lib/src/layout/floating_layout.dart b/lib/src/layout/floating_layout.dart index 27fdfe1..118250b 100644 --- a/lib/src/layout/floating_layout.dart +++ b/lib/src/layout/floating_layout.dart @@ -439,7 +439,9 @@ class _FloatingLayoutState extends State { ), ), 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: [ diff --git a/pubspec.yaml b/pubspec.yaml index 5e67b32..549e801 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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