diff --git a/frontend/public/locales/en-US/application.json b/frontend/public/locales/en-US/application.json index a1435408..83247b2e 100644 --- a/frontend/public/locales/en-US/application.json +++ b/frontend/public/locales/en-US/application.json @@ -230,6 +230,7 @@ "color": "Color", "fontSize": "Font size", "disableSubtitle": "Disable subtitle", + "loop": "Loop", "noSubtitle": "No ASS/SRT/VTT subtitle files found under current folder.", "subtitleStyles": "Subtitle styles", "subtitles": "Subtitles", diff --git a/frontend/public/locales/zh-CN/application.json b/frontend/public/locales/zh-CN/application.json index 1b58829e..5baaa67a 100644 --- a/frontend/public/locales/zh-CN/application.json +++ b/frontend/public/locales/zh-CN/application.json @@ -230,6 +230,7 @@ "color": "颜色", "fontSize": "字体大小", "disableSubtitle": "禁用字幕", + "loop": "循环播放", "noSubtitle": "没有在当前目录下找到 ASS/SRT/VTT 字幕文件。", "subtitleStyles": "字幕样式", "subtitles": "字幕", diff --git a/frontend/src/component/Viewers/Video/VideoViewer.tsx b/frontend/src/component/Viewers/Video/VideoViewer.tsx index eac93061..a0d5899e 100644 --- a/frontend/src/component/Viewers/Video/VideoViewer.tsx +++ b/frontend/src/component/Viewers/Video/VideoViewer.tsx @@ -469,6 +469,26 @@ const VideoViewer = () => { fontSize: `${subtitleStyle.fontSize ?? 20}px`, }, }, + settings: [ + { + name: "loop", + html: t("application:fileManager.loop"), + switch: false, + mounted(item: any) { + const enabled = this.storage.get("loop") === true; + if (enabled) { + item.switch = true; + this.loop = true; + } + }, + onSwitch(item: any) { + const next = !item.switch; + this.loop = next; + this.storage.set("loop", next); + return next; + }, + }, + ], plugins: [], lang: t("artPlayerLocaleCode", { ns: "common" }), // TODO: review }}