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( Row(
children: [ children: [
PlayOrPauseButton( controller != null
? PlayOrPauseButton(
controller: _, controller: _,
), )
: nil,
const SizedBox(width: 4), const SizedBox(width: 4),
// 播放时间 // 播放时间
Obx(() { Obx(() {

View File

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