fix: 开启后台播放后二次播放,未判空导致播放异常

This commit is contained in:
orz12
2024-02-17 13:31:56 +08:00
parent cda2acc4ca
commit f271377f6b
2 changed files with 7 additions and 3 deletions

View File

@@ -72,9 +72,11 @@ class BottomControl extends StatelessWidget implements PreferredSizeWidget {
),
Row(
children: [
PlayOrPauseButton(
controller: _,
),
controller != null
? PlayOrPauseButton(
controller: _,
)
: nil,
const SizedBox(width: 4),
// 播放时间
Obx(() {

View File

@@ -149,6 +149,8 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
));
if (_item.isNotEmpty) {
_item.removeLast();
}
if (_item.isNotEmpty) {
setMediaItem(_item.last);
}
if (_item.isEmpty) {