Fix audio player bar height: center it instead of expanding

This commit is contained in:
Leon Bösche
2026-01-25 01:19:37 +01:00
parent b819fee208
commit f346b628ed

View File

@@ -55,7 +55,13 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
// Initialize video controller if it's a video file
if (_isVideoFile()) {
_initializeVideoPlayer();
try {
await _initializeVideoPlayer();
} catch (e) {
setState(() {
_error = 'Video format not supported in browser. Please download the file.';
});
}
}
} catch (e) {
setState(() {
@@ -181,9 +187,11 @@ class _PublicFileViewerState extends State<PublicFileViewer> {
),
);
} else if (_isAudioFile()) {
return AudioPlayerBar(
fileName: _fileData!['fileName'] ?? 'Audio',
fileUrl: viewUrl,
return Center(
child: AudioPlayerBar(
fileName: _fileData!['fileName'] ?? 'Audio',
fileUrl: viewUrl,
),
);
} else if (_isDocumentFile()) {
return Expanded(