mirror of
https://github.com/BlueBubblesApp/bluebubbles-app.git
synced 2025-07-02 22:12:47 +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:bluebubbles/services/services.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:universal_io/io.dart';
|
||||||
|
|
||||||
class AudioPlayer extends StatefulWidget {
|
class AudioPlayer extends StatefulWidget {
|
||||||
final PlatformFile file;
|
final PlatformFile file;
|
||||||
@ -51,6 +52,10 @@ class _AudioPlayerState extends OptimizedState<AudioPlayer> with AutomaticKeepAl
|
|||||||
void initBytes() async {
|
void initBytes() async {
|
||||||
if (attachment != null) controller = cvController?.audioPlayers[attachment!.guid];
|
if (attachment != null) controller = cvController?.audioPlayers[attachment!.guid];
|
||||||
if (controller == null) {
|
if (controller == null) {
|
||||||
|
final uriPath = Uri.parse(file.path!).path;
|
||||||
|
if (!(await File(uriPath).exists())) {
|
||||||
|
await File(file.path!).copy(uriPath);
|
||||||
|
}
|
||||||
controller = PlayerController()..addListener(() {
|
controller = PlayerController()..addListener(() {
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user