fixed pangea comments
This commit is contained in:
parent
e427524724
commit
3fa94eace1
2 changed files with 7 additions and 5 deletions
|
|
@ -121,15 +121,18 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
final audioPlayer = this.audioPlayer ??= AudioPlayer();
|
||||
// #Pangea
|
||||
// if (AudioPlayerWidget.currentId != widget.event.eventId) {
|
||||
// Pangea#
|
||||
if (AudioPlayerWidget.currentId != widget.event?.eventId) {
|
||||
// Pangea#
|
||||
if (AudioPlayerWidget.currentId != null) {
|
||||
if (audioPlayer.playerState.playing) {
|
||||
await audioPlayer.stop();
|
||||
setState(() {});
|
||||
}
|
||||
}
|
||||
// #Pangea
|
||||
// AudioPlayerWidget.currentId = widget.event.eventId;
|
||||
AudioPlayerWidget.currentId = widget.event?.eventId;
|
||||
// Pangea#
|
||||
}
|
||||
if (audioPlayer.playerState.playing) {
|
||||
await audioPlayer.pause();
|
||||
|
|
@ -295,7 +298,10 @@ class AudioPlayerState extends State<AudioPlayerWidget> {
|
|||
color: widget.color,
|
||||
),
|
||||
),
|
||||
// #Pangea
|
||||
// onLongPress: () => widget.event.saveFile(context),
|
||||
onLongPress: () => widget.event?.saveFile(context),
|
||||
// Pangea#
|
||||
onTap: () {
|
||||
if (status == AudioPlayerStatus.downloaded) {
|
||||
_playAction();
|
||||
|
|
|
|||
|
|
@ -26,10 +26,6 @@ class MessageAudioCardState extends State<MessageAudioCard> {
|
|||
Future<void> fetchAudio() async {
|
||||
if (!mounted) return;
|
||||
setState(() => _isLoading = true);
|
||||
// first, try to get the audio event
|
||||
// if there's not audio event, then call the API
|
||||
// Then, if on mobile, save it to a temp file and use that as audio source
|
||||
// If on web, stream the audio bytes
|
||||
|
||||
try {
|
||||
final String langCode = widget.messageEvent.messageDisplayLangCode;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue