mirror of
https://github.com/yusufipk/OpenFrame.git
synced 2026-09-11 09:36:08 +00:00
feat: Introduce pauseAfterSeek option to the video player, refresh landing page content and animations, and update the dashboard image.
This commit is contained in:
+498
-817
File diff suppressed because it is too large
Load Diff
@@ -34,7 +34,11 @@ interface CommentsPaneProps {
|
|||||||
handleExportComments: (format: 'csv' | 'pdf') => void;
|
handleExportComments: (format: 'csv' | 'pdf') => void;
|
||||||
canResolveComments: boolean;
|
canResolveComments: boolean;
|
||||||
handleResolveComment: (commentId: string, currentlyResolved: boolean) => void;
|
handleResolveComment: (commentId: string, currentlyResolved: boolean) => void;
|
||||||
handleSeekToTimestamp: (timestamp: number, annotation?: string | null) => void;
|
handleSeekToTimestamp: (
|
||||||
|
timestamp: number,
|
||||||
|
annotation?: string | null,
|
||||||
|
options?: { pauseAfterSeek?: boolean }
|
||||||
|
) => void;
|
||||||
currentUserId: string | null;
|
currentUserId: string | null;
|
||||||
projectOwnerId: string;
|
projectOwnerId: string;
|
||||||
editingCommentId: string | null;
|
editingCommentId: string | null;
|
||||||
@@ -294,7 +298,7 @@ export const CommentsPane = memo(function CommentsPane({
|
|||||||
|
|
||||||
<div className="flex items-center gap-1 shrink-0">
|
<div className="flex items-center gap-1 shrink-0">
|
||||||
<button
|
<button
|
||||||
onClick={() => handleSeekToTimestamp(comment.timestamp, comment.annotationData)}
|
onClick={() => handleSeekToTimestamp(comment.timestamp, comment.annotationData, { pauseAfterSeek: true })}
|
||||||
className="flex items-center gap-1 text-xs text-primary hover:underline px-1.5 py-0.5 rounded bg-primary/10 hover:bg-primary/20 transition-colors"
|
className="flex items-center gap-1 text-xs text-primary hover:underline px-1.5 py-0.5 rounded bg-primary/10 hover:bg-primary/20 transition-colors"
|
||||||
title="Jump to this timestamp"
|
title="Jump to this timestamp"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -740,7 +740,11 @@ export function useVideoPlayer({
|
|||||||
}
|
}
|
||||||
}, [isPlaying, playerRef]);
|
}, [isPlaying, playerRef]);
|
||||||
|
|
||||||
const handleSeekToTimestamp = useCallback((timestamp: number, annotation?: string | null) => {
|
const handleSeekToTimestamp = useCallback((
|
||||||
|
timestamp: number,
|
||||||
|
annotation?: string | null,
|
||||||
|
options?: { pauseAfterSeek?: boolean }
|
||||||
|
) => {
|
||||||
setCurrentTime(timestamp);
|
setCurrentTime(timestamp);
|
||||||
if (playerRef.current?.seekTo) {
|
if (playerRef.current?.seekTo) {
|
||||||
const playerState = playerRef.current.getPlayerState?.();
|
const playerState = playerRef.current.getPlayerState?.();
|
||||||
@@ -751,7 +755,9 @@ export function useVideoPlayer({
|
|||||||
: isPlaying;
|
: isPlaying;
|
||||||
|
|
||||||
playerRef.current.seekTo(timestamp, true);
|
playerRef.current.seekTo(timestamp, true);
|
||||||
if (wasPlayingBeforeSeek) {
|
if (options?.pauseAfterSeek) {
|
||||||
|
playerRef.current.pauseVideo();
|
||||||
|
} else if (wasPlayingBeforeSeek) {
|
||||||
playerRef.current.playVideo();
|
playerRef.current.playVideo();
|
||||||
} else {
|
} else {
|
||||||
playerRef.current.pauseVideo();
|
playerRef.current.pauseVideo();
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 48 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 59 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 64 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 8.5 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 6.0 KiB |
Reference in New Issue
Block a user