- + + {" "} {scene.title ? scene.title - : TextUtils.fileNameFromPath(file?.path ?? "")} + : TextUtils.fileNameFromPath( + file?.path ?? "" + )}{" "}
{file?.path ?? ""}
diff --git a/ui/v2.5/src/components/SceneDuplicateChecker/styles.scss b/ui/v2.5/src/components/SceneDuplicateChecker/styles.scss index 9177a9367c9..750e4466fdd 100644 --- a/ui/v2.5/src/components/SceneDuplicateChecker/styles.scss +++ b/ui/v2.5/src/components/SceneDuplicateChecker/styles.scss @@ -8,7 +8,8 @@ } .separator { - height: 50px; + border-top: 1px solid white; + height: 10px; } .form-group .row { diff --git a/ui/v2.5/src/components/ScenePlayer/ScenePlayer.tsx b/ui/v2.5/src/components/ScenePlayer/ScenePlayer.tsx index bb28f61f3dc..b7df466c08e 100644 --- a/ui/v2.5/src/components/ScenePlayer/ScenePlayer.tsx +++ b/ui/v2.5/src/components/ScenePlayer/ScenePlayer.tsx @@ -23,12 +23,6 @@ import "./big-buttons"; import "./track-activity"; import "./vrmode"; import cx from "classnames"; -// @ts-ignore -import airplay from "@silvermine/videojs-airplay"; -// @ts-ignore -import chromecast from "@silvermine/videojs-chromecast"; -airplay(videojs); -chromecast(videojs); import { useSceneSaveActivity, useSceneIncrementPlayCount, @@ -46,6 +40,17 @@ import { languageMap } from "src/utils/caption"; import { VIDEO_PLAYER_ID } from "./util"; import { IUIConfig } from "src/core/config"; +// @ts-ignore +import airplay from "@silvermine/videojs-airplay"; +// @ts-ignore +import chromecast from "@silvermine/videojs-chromecast"; +import abLoopPlugin from "videojs-abloop"; + +// register videojs plugins +airplay(videojs); +chromecast(videojs); +abLoopPlugin(window, videojs); + function handleHotkeys(player: VideoJsPlayer, event: videojs.KeyboardEvent) { function seekStep(step: number) { const time = player.currentTime() + step; @@ -73,6 +78,21 @@ function handleHotkeys(player: VideoJsPlayer, event: videojs.KeyboardEvent) { player.currentTime(time); } + function toggleABLooping() { + const opts = player.abLoopPlugin.getOptions(); + if (!opts.start) { + opts.start = player.currentTime(); + } else if (!opts.end) { + opts.end = player.currentTime(); + opts.enabled = true; + } else { + opts.start = 0; + opts.end = 0; + opts.enabled = false; + } + player.abLoopPlugin.setOptions(opts); + } + let seekFactor = 10; if (event.shiftKey) { seekFactor = 5; @@ -111,6 +131,9 @@ function handleHotkeys(player: VideoJsPlayer, event: videojs.KeyboardEvent) { if (player.isFullscreen()) player.exitFullscreen(); else player.requestFullscreen(); break; + case 76: // l + toggleABLooping(); + break; case 38: // up arrow player.volume(player.volume() + 0.1); break; @@ -340,6 +363,16 @@ export const ScenePlayer: React.FC