Skip to content

Commit

Permalink
feat: support native SDK 3.4.5
Browse files Browse the repository at this point in the history
  • Loading branch information
LichKing-2234 committed Jun 28, 2021
1 parent 9a1baae commit d1d8433
Show file tree
Hide file tree
Showing 7 changed files with 130 additions and 14 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Expand Up @@ -50,7 +50,7 @@ android {
}

dependencies {
api 'com.github.agorabuilder:native-full-sdk:3.4.2'
api 'com.github.agorabuilder:native-full-sdk:3.4.5'

implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${safeExtGet('kotlin_version', '1.3.72')}"
}
2 changes: 1 addition & 1 deletion ios/agora_rtc_engine.podspec
Expand Up @@ -17,7 +17,7 @@ Pod::Spec.new do |s|
s.source = { :path => '.' }
s.source_files = 'Classes/**/*'
s.dependency 'Flutter'
s.dependency 'AgoraRtcEngine_iOS', '3.4.2'
s.dependency 'AgoraRtcEngine_iOS', '3.4.5'
s.platform = :ios, '8.0'

# Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported.
Expand Down
46 changes: 37 additions & 9 deletions lib/src/classes.dart
Expand Up @@ -710,10 +710,20 @@ class ChannelMediaOptions {
@JsonKey(includeIfNull: false)
bool? autoSubscribeVideo;

/// TODO(doc)
@JsonKey(includeIfNull: false)
bool? publishLocalAudio;

/// TODO(doc)
@JsonKey(includeIfNull: false)
bool? publishLocalVideo;

/// Constructs a [ChannelMediaOptions]
ChannelMediaOptions({
this.autoSubscribeAudio,
this.autoSubscribeVideo,
this.publishLocalAudio,
this.publishLocalVideo,
});

/// @nodoc
Expand All @@ -739,10 +749,15 @@ class EncryptionConfig {
@JsonKey(includeIfNull: false)
String? encryptionKey;

/// TODO(doc)
@JsonKey(includeIfNull: false)
List<int>? encryptionKdfSalt;

/// Constructs a [EncryptionConfig]
EncryptionConfig({
this.encryptionMode,
this.encryptionKey,
this.encryptionKdfSalt,
});

/// @nodoc
Expand Down Expand Up @@ -1444,7 +1459,17 @@ class DataStreamConfig {

/// Configurations for the RtcEngineConfig instance.
@JsonSerializable(explicitToJson: true)
class RtcEngineConfig {
@deprecated
class RtcEngineConfig extends RtcEngineContext {
/// Constructs a [RtcEngineConfig]
RtcEngineConfig(String appId,
{List<AreaCode>? areaCode, LogConfig? logConfig})
: super(appId, areaCode: areaCode, logConfig: logConfig);
}

/// Configurations for the RtcEngineContext instance.
@JsonSerializable(explicitToJson: true)
class RtcEngineContext {
/// The App ID issued to you by Agora. See [How to get the App ID](https://docs.agora.io/en/Agora%20Platform/token#get-an-app-id).
/// Only users in apps with the same App ID can join the same channel and communicate with each other. Use an App ID to create only
/// one `RtcEngine` instance. To change your App ID, call `destroy` to destroy the current `RtcEngine` instance and then call `createWithConfig`
Expand All @@ -1465,24 +1490,27 @@ class RtcEngineConfig {
@JsonKey(includeIfNull: false)
LogConfig? logConfig;

/// Constructs a [RtcEngineConfig]
RtcEngineConfig(
/// Constructs a [RtcEngineContext]
RtcEngineContext(
this.appId, {
this.areaCode,
this.logConfig,
});

/// @nodoc
factory RtcEngineConfig.fromJson(Map<String, dynamic> json) =>
_$RtcEngineConfigFromJson(json);
factory RtcEngineContext.fromJson(Map<String, dynamic> json) =>
_$RtcEngineContextFromJson(json);

/// @nodoc
Map<String, dynamic> toJson() => _$RtcEngineConfigToJson(this);
Map<String, dynamic> toJson() => _$RtcEngineContextToJson(this);

static List<int>? _$AreaCodeListToJson(List<AreaCode>? instance) {
static int? _$AreaCodeListToJson(List<AreaCode>? instance) {
if (instance == null) return null;
return List.generate(
instance.length, (index) => AreaCodeConverter(instance[index]).value());
var areaCode = 0;
instance.forEach((element) {
areaCode |= AreaCodeConverter(element).value();
});
return areaCode;
}
}

Expand Down
45 changes: 42 additions & 3 deletions lib/src/classes.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions lib/src/enum_converter.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions lib/src/enums.dart
Expand Up @@ -110,6 +110,10 @@ enum AudioLocalError {
/// The local audio encoding fails.
@JsonValue(5)
EncodeFailure,

/// TODO(doc)
@JsonValue(8)
Interrupted,
}

/// The state of the local audio.
Expand Down Expand Up @@ -930,6 +934,14 @@ enum EncryptionMode {
/// 256-bit AES encryption, GCM mode.
@JsonValue(6)
AES256GCM,

/// TODO(doc)
@JsonValue(7)
AES128GCM2,

/// TODO(doc)
@JsonValue(8)
AES256GCM2,
}

/// Error codes occur when the SDK encounters an error that cannot be recovered automatically without any app intervention.
Expand Down Expand Up @@ -1552,6 +1564,10 @@ enum RtmpStreamingErrorCode {
/// The format of the RTMP or RTMPS streaming URL is not supported. Check whether the URL format is correct.
@JsonValue(10)
FormatNotSupported,

/// TODO(doc)
@JsonValue(100)
UnPublishOK,
}

/// The RTMP or RTMPS streaming state.
Expand Down Expand Up @@ -2111,6 +2127,10 @@ enum RtmpStreamingEvent {
/// An error occurs when you add a background image or a watermark image to the RTMP stream.
@JsonValue(1)
FailedLoadImage,

/// TODO(doc)
@JsonValue(2)
UrlAlreadyInUse,
}

/// Audio session restriction.
Expand Down
24 changes: 24 additions & 0 deletions lib/src/rtc_channel.dart
Expand Up @@ -136,11 +136,13 @@ class RtcChannel with RtcChannelInterface {
}

@override
@deprecated
Future<void> publish() {
return _invokeMethod('publish');
}

@override
@deprecated
Future<void> unpublish() {
return _invokeMethod('unpublish');
}
Expand Down Expand Up @@ -373,6 +375,20 @@ class RtcChannel with RtcChannelInterface {
'enable': enable,
});
}

@override
Future<void> muteLocalAudioStream(bool muted) {
return _invokeMethod('muteLocalAudioStream', {
'muted': muted,
});
}

@override
Future<void> muteLocalVideoStream(bool muted) {
return _invokeMethod('muteLocalVideoStream', {
'muted': muted,
});
}
}

/// @nodoc
Expand Down Expand Up @@ -488,11 +504,13 @@ mixin RtcChannelInterface
/// - This method publishes one stream only to the channel corresponding to the current [RtcChannel] instance.
/// - In a LiveBroadcasting channel, only a broadcaster can call this method. To switch the client role, call [RtcChannel.setClientRole] of the current [RtcChannel] instance.
/// - You can publish a stream to only one channel at a time. For details, see the advanced guide *Join Multiple Channels*.
@deprecated
Future<void> publish();

/// Stops publishing a stream to the channel.
///
/// If you call this method in a channel where you are not publishing streams, the SDK returns [ErrorCode.Refused].
@deprecated
Future<void> unpublish();

/// Gets the current call ID.
Expand Down Expand Up @@ -521,6 +539,9 @@ mixin RtcAudioInterface {
/// - 100: The original volume.
Future<void> adjustUserPlaybackSignalVolume(int uid, int volume);

/// TODO(doc)
Future<void> muteLocalAudioStream(bool muted);

/// Stops/Resumes receiving the audio stream of the specified user.
///
/// **Parameter** [uid] ID of the remote user whose audio stream you want to mute.
Expand Down Expand Up @@ -553,6 +574,9 @@ mixin RtcAudioInterface {

/// @nodoc
mixin RtcVideoInterface {
/// TODO(doc)
Future<void> muteLocalVideoStream(bool muted);

/// Stops/Resumes receiving the video stream of the specified user.
///
/// **Parameter** [uid] ID of the remote user whose video stream you want to mute.
Expand Down

0 comments on commit d1d8433

Please sign in to comment.