mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-24 14:32:37 +01:00
fix: Videoplayer filenames
This commit is contained in:
parent
f17ae118d0
commit
89f32bd4c3
@ -66,8 +66,7 @@ class _AudioPlayerState extends State<AudioPlayerWidget> {
|
||||
await widget.event.downloadAndDecryptAttachmentCached();
|
||||
if (matrixFile == null) throw ('Download failed');
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final fileName =
|
||||
widget.event.content.tryGet<String>('filename') ?? matrixFile.name;
|
||||
final fileName = widget.event.infoMap['url'] as String;
|
||||
final file = File('${tempDir.path}/$fileName');
|
||||
await file.writeAsBytes(matrixFile.bytes);
|
||||
|
||||
|
@ -40,8 +40,9 @@ class _EventVideoPlayerState extends State<EventVideoPlayer> {
|
||||
final blob = html.Blob([videoFile.bytes]);
|
||||
_networkUri = html.Url.createObjectUrlFromBlob(blob);
|
||||
} else {
|
||||
final tmpDir = await getTemporaryDirectory();
|
||||
final file = File(tmpDir.path + videoFile.name);
|
||||
final tempDir = await getTemporaryDirectory();
|
||||
final fileName = widget.event.infoMap['url'] as String;
|
||||
final file = File('${tempDir.path}/$fileName');
|
||||
if (await file.exists() == false) {
|
||||
await file.writeAsBytes(videoFile.bytes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user