mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-07-02 05:17:11 +08:00
Fix issue with audio file with spaces not playing
This commit is contained in:
@ -5,6 +5,7 @@ import 'package:bluebubbles/models/models.dart';
|
||||
import 'package:bluebubbles/services/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:universal_io/io.dart';
|
||||
|
||||
class AudioPlayer extends StatefulWidget {
|
||||
final PlatformFile file;
|
||||
@ -51,6 +52,10 @@ class _AudioPlayerState extends OptimizedState<AudioPlayer> with AutomaticKeepAl
|
||||
void initBytes() async {
|
||||
if (attachment != null) controller = cvController?.audioPlayers[attachment!.guid];
|
||||
if (controller == null) {
|
||||
final uriPath = Uri.parse(file.path!).path;
|
||||
if (!(await File(uriPath).exists())) {
|
||||
await File(file.path!).copy(uriPath);
|
||||
}
|
||||
controller = PlayerController()..addListener(() {
|
||||
setState(() {});
|
||||
});
|
||||
|
Reference in New Issue
Block a user