Browse Source

上传音频状态同步问题

weicu
liwei1dao 2 years ago
parent
commit
d94ec97631
  1. 1
      lib/modules/chat/controllers/chat_controller.dart
  2. 3
      lib/modules/chat/views/chat_music_card.dart

1
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');
}

3
lib/modules/chat/views/chat_music_card.dart

@ -43,7 +43,8 @@ class ChatMusicCard extends GetView<ChatController> {
),
10.horizontalSpace,
Obx(
() => controller.isPlay.value
() => controller.audiourl.value == data?["url"] &&
controller.isPlay.value
? GestureDetector(
onTap: () {
controller.pause();

Loading…
Cancel
Save