AudioMessagePlayer class

语音消息播放器。

对外保持 play / stopPlaying / dispose 语义,业务层不需要感知底层插件; 内部统一走 lib/platform 能力层,由能力层决定本地路径校验、平台支持和错误语义。

Constructors

AudioMessagePlayer({MediaPlayerService? service, ProximitySensorService? proximitySensor})

Properties

currentPlayingId → String?
当前正在播放的消息 id,未播放时为 null。
no setter
hashCode → int
The hash code for this object.
no setterinherited
isPlaying → bool
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pause() → Future<void>
play(String messageId, String localPath, {VoidCallback? onPlayComplete, VoidCallback? onPlayFailed}) → Future<void>
播放本地语音文件。onPlayComplete 在播放结束或不可播放时都会回调, 与迁移前实现保持一致,避免调用方状态卡在“播放中”。
resume() → Future<void>
stopPlaying() → Future<void>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited