diff --git a/app/ui/components/video_player.py b/app/ui/components/video_player.py index 43ca7eb..14e2a3b 100644 --- a/app/ui/components/video_player.py +++ b/app/ui/components/video_player.py @@ -96,6 +96,9 @@ class VideoPlayer: sub_folder = params.get('subfolder', [''])[0] if filename: title = self._["previewing"] + ": " + (f"{sub_folder}/{filename}" if sub_folder else filename) + if Path(filename).suffix.lower() != ".mp4": + await self.app.snack_bar.show_snack_bar(self._["unsupported_play_on_web"]) + return else: title = self._["view_stream_source_now"] await self.create_video_dialog(title, source, is_file_path, room_url) diff --git a/locales/en.json b/locales/en.json index eb0e7a4..f69a838 100644 --- a/locales/en.json +++ b/locales/en.json @@ -339,7 +339,7 @@ "empty_recording_folder": "Empty Recording Folder", "go_back": "Go Back", "previewing": "Previewing", - "unsupported_file_type": "Unsupported file type", + "unsupported_file_type":"⚠️ Unsupported file type", "no_video_file":"⚠️ No video file found", "no_recording_folder":"⚠️ No recording folder found", "copy_stream_url": "Copy Stream URL", @@ -351,6 +351,7 @@ "open_live_room_page": "Open Live Room Page", "stream_source": "Stream Source", "previewing": "Previewing", - "view_stream_source_now": "Accessing live stream source" + "view_stream_source_now": "Accessing live stream source", + "unsupported_play_on_web": "⚠️ Only MP4 files can be previewed on the web." } } \ No newline at end of file diff --git a/locales/zh_CN.json b/locales/zh_CN.json index 9c7f8cd..68b55b8 100644 --- a/locales/zh_CN.json +++ b/locales/zh_CN.json @@ -341,7 +341,7 @@ "empty_recording_folder": "录制文件夹为空,暂无录制的直播视频", "go_back": "返回上一级", "previewing": "正在预览", - "unsupported_file_type": "不支持的文件类型", + "unsupported_file_type":"⚠️ 不支持的文件类型", "no_video_file":"⚠️ 未找到视频文件", "no_recording_folder":"⚠️ 录制目录不存在", "copy_stream_url": "复制直播源地址", @@ -353,6 +353,7 @@ "open_live_room_page": "打开直播间页面", "stream_source": "直播源", "previewing":"正在预览", - "view_stream_source_now": "正在访问直播源" + "view_stream_source_now": "正在访问直播源", + "unsupported_play_on_web": "⚠️ Web端只支持预览MP4文件" } } \ No newline at end of file