diff --git a/lib/modules/chat/controllers/chat_controller.dart b/lib/modules/chat/controllers/chat_controller.dart index 6a58b3044..8bafd6ac3 100644 --- a/lib/modules/chat/controllers/chat_controller.dart +++ b/lib/modules/chat/controllers/chat_controller.dart @@ -489,6 +489,7 @@ class ChatController extends GetxController { await _spotifService.initialize(); _spotifService.play(card['url'] as String); isPlay.value = true; + audiourl.value = card['url'] as String; } catch (e) { Logger.error('加载异常: $e'); } diff --git a/lib/modules/chat/views/chat_music_card.dart b/lib/modules/chat/views/chat_music_card.dart index 57ac11c18..5fcce956e 100644 --- a/lib/modules/chat/views/chat_music_card.dart +++ b/lib/modules/chat/views/chat_music_card.dart @@ -43,7 +43,8 @@ class ChatMusicCard extends GetView { ), 10.horizontalSpace, Obx( - () => controller.isPlay.value + () => controller.audiourl.value == data?["url"] && + controller.isPlay.value ? GestureDetector( onTap: () { controller.pause();