FakeMediaProvider class
测试用的假媒体适配(Dart VM 中没有 WebRTC,与 Web SDK 集成测试的假 LiveKit 适配相同):
连接立即成功,记下收到的凭据、续期和断开;emit 可以模拟媒体服务的事件。deeprespond_im_call 的测试也可以使用。
- Implemented types
Constructors
- FakeMediaProvider({String kind = 'livekit'})
Properties
- failNextConnect ↔ Object?
-
设置后 connect 以它失败(一次)。
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- kind → String
-
livekit。
final
-
log
→ List<
Map< String, Object?> > -
依次记下:连接时的凭据(原样)、
{'renewed': token}、{'disconnected': true}。final - microphoneError ↔ Object?
-
设置后打开麦克风以它失败(模拟没有授权)。
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
sessions
→ List<
FakeMediaSession> -
final
Methods
-
connect(
MediaCredential credential, {required String media, DRCancelToken? cancel, int? identityToUid(String identity)?}) → Future< MediaSession> -
连接媒体服务。
media为 audio 或 video(音频通话的凭据只允许发布麦克风);identityToUid把厂商的身份换成 media_uid(LiveKit 的身份是用户名,按通话快照对应)。override -
load(
) → Future< void> -
加载媒体服务的客户端库(第一次通话时调用,可以重复调用)。
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited