现阶段通知中心播放暂停切换功能已实现,但是上下一曲功能暂时消失,需要后续优化,这个commit是snapshot
This commit is contained in:
@@ -44,27 +44,27 @@ class PlaybackService {
|
||||
}
|
||||
|
||||
// ---------- 控制 ----------
|
||||
void pause() {
|
||||
Future<void> pause() async {
|
||||
if (_initialized && _player != null) {
|
||||
_player!.pause();
|
||||
await _player!.pause();
|
||||
}
|
||||
}
|
||||
|
||||
void resume() {
|
||||
Future<void> resume() async {
|
||||
if (_initialized && _player != null) {
|
||||
_player!.play();
|
||||
await _player!.play();
|
||||
}
|
||||
}
|
||||
|
||||
void stop() {
|
||||
Future<void> stop() async {
|
||||
if (_initialized && _player != null) {
|
||||
_player!.stop();
|
||||
await _player!.stop();
|
||||
}
|
||||
}
|
||||
|
||||
void seek(Duration position) {
|
||||
Future<void> seek(Duration position) async {
|
||||
if (_initialized && _player != null) {
|
||||
_player!.seek(position);
|
||||
await _player!.seek(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user