Ability to play video and audio

 Add media kit
This commit is contained in:
2024-11-21 23:28:02 +08:00
parent 7e63611416
commit b52811d66e
10 changed files with 717 additions and 7 deletions

View File

@ -48,7 +48,12 @@ class AttachmentList extends StatelessWidget {
borderRadius: kDefaultRadius,
),
child: AspectRatio(
aspectRatio: data[0]?.metadata['ratio']?.toDouble() ?? 1,
aspectRatio: data[0]?.metadata['ratio']?.toDouble() ??
switch (data[0]?.mimetype.split('/').firstOrNull) {
'audio' => 16 / 9,
'video' => 16 / 9,
_ => 1,
},
child: ClipRRect(
borderRadius: kDefaultRadius,
child: AttachmentItem(data: data[0], isExpandable: true),