fix: address native cursor review findings
This commit is contained in:
@@ -89,6 +89,15 @@ import {
|
||||
import { UnsavedChangesDialog } from "./UnsavedChangesDialog";
|
||||
import VideoPlayback, { VideoPlaybackRef } from "./VideoPlayback";
|
||||
|
||||
function isClickInteractionType(interactionType: string | null | undefined) {
|
||||
return (
|
||||
interactionType === "click" ||
|
||||
interactionType === "double-click" ||
|
||||
interactionType === "right-click" ||
|
||||
interactionType === "middle-click"
|
||||
);
|
||||
}
|
||||
|
||||
export default function VideoEditor() {
|
||||
const {
|
||||
state: editorState,
|
||||
|
||||
@@ -188,6 +188,25 @@ function getResolvedVideoDuration(video: HTMLVideoElement): number | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
function getEndedVideoDuration(video: HTMLVideoElement): number | null {
|
||||
const currentTime = video.currentTime;
|
||||
if (!Number.isFinite(currentTime) || currentTime <= 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (video.ended) {
|
||||
return currentTime;
|
||||
}
|
||||
|
||||
const resolvedDuration = getResolvedVideoDuration(video);
|
||||
const durationEpsilonSeconds = 0.05;
|
||||
if (resolvedDuration && currentTime >= resolvedDuration - durationEpsilonSeconds) {
|
||||
return resolvedDuration;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
const VideoPlayback = forwardRef<VideoPlaybackRef, VideoPlaybackProps>(
|
||||
(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user