-
Notifications
You must be signed in to change notification settings - Fork 443
Expand file tree
/
Copy pathagora_rtc_engine_ext.dart
More file actions
98 lines (83 loc) · 2.71 KB
/
Copy pathagora_rtc_engine_ext.dart
File metadata and controls
98 lines (83 loc) · 2.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart' show MethodCall;
import '/src/agora_media_player.dart';
import '/src/agora_rtc_engine.dart';
import '/src/agora_rtc_engine_ex.dart';
import '/src/impl/agora_rtc_engine_impl.dart';
import '/src/impl/agora_rtc_engine_impl.dart' as impl;
import '/src/impl/media_player_impl.dart';
import '/src/agora_pip_controller.dart';
import '/src/impl/agora_pip_controller_impl.dart';
/// @nodoc
extension RtcEngineExt on RtcEngine {
/// Get the actual absolute path of an asset from its relative asset path.
///
/// * [assetPath] The flutter -> assets field configured in the pubspec.yaml file.
///
/// Returns
/// The actual path of the asset.
Future<String?> getAssetAbsolutePath(String assetPath) async {
final impl = this as RtcEngineImpl;
return impl.getAssetAbsolutePath(assetPath);
}
/// @nodoc
int getApiEngineHandle() {
final impl = this as RtcEngineImpl;
return impl.getApiEngineHandle();
}
/// @nodoc
AgoraPipController createPipController() {
return AgoraPipControllerImpl(this);
}
/// @nodoc
@optionalTypeArgs
Future<T?> invokeAgoraMethod<T>(String method, [dynamic arguments]) {
final impl = this as RtcEngineImpl;
return impl.invokeAgoraMethod<T>(method, arguments);
}
/// @nodoc
Future<void> registerMethodChannelHandler(
String method,
Future<dynamic> Function(MethodCall call) handler,
) {
final impl = this as RtcEngineImpl;
return impl.registerMethodChannelHandler(method, handler);
}
/// @nodoc
Future<void> unregisterMethodChannelHandler(
String method,
Future<dynamic> Function(MethodCall call)? handler,
) {
final impl = this as RtcEngineImpl;
return impl.unregisterMethodChannelHandler(method, handler);
}
/// @nodoc
void setEnableArgusCounters(bool enabled) {
if (this is RtcEngineImpl) {
(this as RtcEngineImpl).setEnableArgusCounters(enabled);
}
}
}
/// Error code and description.
class AgoraRtcException implements Exception {
/// @nodoc
AgoraRtcException({required this.code, this.message});
/// Error code. See ErrorCodeType.
final int code;
/// Error description.
final String? message;
@override
String toString() => 'AgoraRtcException($code, $message)';
}
/// @nodoc
RtcEngine createAgoraRtcEngine({Object? sharedNativeHandle}) {
return impl.RtcEngineImpl.create(sharedNativeHandle: sharedNativeHandle);
}
/// @nodoc
RtcEngineEx createAgoraRtcEngineEx({Object? sharedNativeHandle}) {
return impl.RtcEngineImpl.create(sharedNativeHandle: sharedNativeHandle);
}
/// @nodoc
MediaPlayerCacheManager getMediaPlayerCacheManager(RtcEngine rtcEngine) {
return MediaPlayerCacheManagerImpl.create(rtcEngine);
}