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