Skip to content

Commit

Permalink
no refresh toast
Browse files Browse the repository at this point in the history
  • Loading branch information
orz12 committed Jul 24, 2024
1 parent 9e588c9 commit c57fded
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
1 change: 0 additions & 1 deletion lib/plugin/pl_player/controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,6 @@ class PlPlayerController {
/// 播放视频
/// TODO _duration.value丢失
Future<void> play({bool repeat = false, bool hideControls = true}) async {
SmartDialog.showToast('play, ${_playerCount.value}');
if (_playerCount.value == 0) return;
// // SmartDialog.showToast(
// // (await audioSessionHandler.setActive(true)).toString());
Expand Down
38 changes: 22 additions & 16 deletions lib/services/audio_handler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,21 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
// print('当前调用栈为:');
// print(StackTrace.current);

SmartDialog.showToast(data.title+"a");
if (!PlPlayerController.instanceExists()) return;
SmartDialog.showToast(data.title+"b");
if (data == null) return;

SmartDialog.showToast(data.title+"c");
// SmartDialog.showToast(data.title+"a");
if (!PlPlayerController.instanceExists()) {
SmartDialog.showToast(data.title + "b");
return;
}
if (data == null) {
SmartDialog.showToast(data.title + "c");
return;
}

late MediaItem? mediaItem;
if (data is VideoDetailData) {

SmartDialog.showToast("${data.title}d");
// SmartDialog.showToast("${data.title}d");
if ((data.pages?.length ?? 0) > 1) {
SmartDialog.showToast("${data.title}e");
// SmartDialog.showToast("${data.title}e");
final current = data.pages?.firstWhere((element) => element.cid == cid);
mediaItem = MediaItem(
id: UniqueKey().toString(),
Expand All @@ -147,8 +149,7 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
artUri: Uri.parse(data.pic ?? ""),
);
} else {

SmartDialog.showToast("${data.title}f");
// SmartDialog.showToast("${data.title}f");
mediaItem = MediaItem(
id: UniqueKey().toString(),
title: data.title ?? "",
Expand All @@ -169,14 +170,19 @@ class VideoPlayerServiceHandler extends BaseAudioHandler with SeekHandler {
);
}

SmartDialog.showToast("${data.title}g");
if (mediaItem == null) return;
// SmartDialog.showToast("${data.title}g");
if (mediaItem == null) {
SmartDialog.showToast("${data.title}h");
return;
}

SmartDialog.showToast("${data.title}h");
// SmartDialog.showToast("${data.title}h");
// print("exist: ${PlPlayerController.instanceExists()}");
if (!PlPlayerController.instanceExists()) return;
if (!PlPlayerController.instanceExists()) {
SmartDialog.showToast("${data.title}i");
return;
}

SmartDialog.showToast("${data.title}i");
SmartDialog.showToast(mediaItem.title ?? "无");
// _item.add(mediaItem);
setMediaItem(mediaItem);
Expand Down

0 comments on commit c57fded

Please sign in to comment.