Browse Source

上传音频状态同步问题

newdev_shunjiawei
liwei1dao 2 years ago
parent
commit
d091bfeb71
  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(); await _spotifService.initialize();
_spotifService.play(card['url'] as String); _spotifService.play(card['url'] as String);
isPlay.value = true; isPlay.value = true;
audiourl.value = card['url'] as String;
} catch (e) { } catch (e) {
Logger.error('加载异常: $e'); Logger.error('加载异常: $e');
} }

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

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

Loading…
Cancel
Save