chore: Follow up videoplayer

Signed-off-by: Christian Kußowski <c.kussowski@famedly.com>
This commit is contained in:
Christian Kußowski 2025-05-11 11:31:18 +02:00
commit f3c36e0b09
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
2 changed files with 78 additions and 60 deletions

View file

@ -68,49 +68,52 @@ class EventVideoPlayer extends StatelessWidget {
child: SizedBox(
width: width,
height: height,
child: Stack(
children: [
if (event.hasThumbnail)
MxcImage(
event: event,
isThumbnail: true,
width: width,
height: height,
fit: BoxFit.cover,
placeholder: (context) => BlurHash(
child: Hero(
tag: event.eventId,
child: Stack(
children: [
if (event.hasThumbnail)
MxcImage(
event: event,
isThumbnail: true,
width: width,
height: height,
fit: BoxFit.cover,
placeholder: (context) => BlurHash(
blurhash: blurHash,
width: width,
height: height,
fit: BoxFit.cover,
),
)
else
BlurHash(
blurhash: blurHash,
width: width,
height: height,
fit: BoxFit.cover,
),
)
else
BlurHash(
blurhash: blurHash,
width: width,
height: height,
fit: BoxFit.cover,
),
Center(
child: CircleAvatar(
child: supportsVideoPlayer
? const Icon(Icons.play_arrow_outlined)
: const Icon(Icons.file_download_outlined),
),
),
if (duration != null)
Positioned(
bottom: 8,
left: 16,
child: Text(
'${duration.inMinutes.toString().padLeft(2, '0')}:${(duration.inSeconds % 60).toString().padLeft(2, '0')}',
style: TextStyle(
color: Colors.white,
backgroundColor: Colors.black.withAlpha(32),
),
Center(
child: CircleAvatar(
child: supportsVideoPlayer
? const Icon(Icons.play_arrow_outlined)
: const Icon(Icons.file_download_outlined),
),
),
],
if (duration != null)
Positioned(
bottom: 8,
left: 16,
child: Text(
'${duration.inMinutes.toString().padLeft(2, '0')}:${(duration.inSeconds % 60).toString().padLeft(2, '0')}',
style: TextStyle(
color: Colors.white,
backgroundColor: Colors.black.withAlpha(32),
),
),
),
],
),
),
),
),