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
|
// Video file detection
|
||||||
final videoExtensions = [
|
final videoExtensions = [
|
||||||
'.mp4', '.webm', '.mov', '.avi', '.mkv', '.flv', '.wmv', '.m4v',
|
'.mp4',
|
||||||
'.ogv', '.3gp', '.ts', '.mpg', '.mpeg',
|
'.webm',
|
||||||
|
'.mov',
|
||||||
|
'.avi',
|
||||||
|
'.mkv',
|
||||||
|
'.flv',
|
||||||
|
'.wmv',
|
||||||
|
'.m4v',
|
||||||
|
'.ogv',
|
||||||
|
'.3gp',
|
||||||
|
'.ts',
|
||||||
|
'.mpg',
|
||||||
|
'.mpeg',
|
||||||
];
|
];
|
||||||
final isVideo = videoExtensions.any(
|
final isVideo = videoExtensions.any(
|
||||||
(ext) => file.name.toLowerCase().endsWith(ext),
|
(ext) => file.name.toLowerCase().endsWith(ext),
|
||||||
@@ -891,8 +902,10 @@ class _FileExplorerState extends State<FileExplorer> {
|
|||||||
context.read<FileBrowserBloc>().add(NavigateToFolder(file.path));
|
context.read<FileBrowserBloc>().add(NavigateToFolder(file.path));
|
||||||
} else if (isVideo) {
|
} else if (isVideo) {
|
||||||
// Open video files in video viewer
|
// Open video files in video viewer
|
||||||
final videoUrl = await getIt<FileService>()
|
final videoUrl = await getIt<FileService>().getDownloadUrl(
|
||||||
.getDownloadUrl(widget.orgId, file.path);
|
widget.orgId,
|
||||||
|
file.path,
|
||||||
|
);
|
||||||
_showVideoViewer(
|
_showVideoViewer(
|
||||||
file.name,
|
file.name,
|
||||||
'${getIt<FileService>().baseUrl}$videoUrl',
|
'${getIt<FileService>().baseUrl}$videoUrl',
|
||||||
|
|||||||
Reference in New Issue
Block a user