Enhance video file detection in file explorer; format video extensions list and improve video URL retrieval for video viewer.
This commit is contained in:
@@ -872,8 +872,19 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
) {
|
||||
// Video file detection
|
||||
final videoExtensions = [
|
||||
'.mp4', '.webm', '.mov', '.avi', '.mkv', '.flv', '.wmv', '.m4v',
|
||||
'.ogv', '.3gp', '.ts', '.mpg', '.mpeg',
|
||||
'.mp4',
|
||||
'.webm',
|
||||
'.mov',
|
||||
'.avi',
|
||||
'.mkv',
|
||||
'.flv',
|
||||
'.wmv',
|
||||
'.m4v',
|
||||
'.ogv',
|
||||
'.3gp',
|
||||
'.ts',
|
||||
'.mpg',
|
||||
'.mpeg',
|
||||
];
|
||||
final isVideo = videoExtensions.any(
|
||||
(ext) => file.name.toLowerCase().endsWith(ext),
|
||||
@@ -891,8 +902,10 @@ class _FileExplorerState extends State<FileExplorer> {
|
||||
context.read<FileBrowserBloc>().add(NavigateToFolder(file.path));
|
||||
} else if (isVideo) {
|
||||
// Open video files in video viewer
|
||||
final videoUrl = await getIt<FileService>()
|
||||
.getDownloadUrl(widget.orgId, file.path);
|
||||
final videoUrl = await getIt<FileService>().getDownloadUrl(
|
||||
widget.orgId,
|
||||
file.path,
|
||||
);
|
||||
_showVideoViewer(
|
||||
file.name,
|
||||
'${getIt<FileService>().baseUrl}$videoUrl',
|
||||
|
||||
Reference in New Issue
Block a user