diff --git a/frontend/src/components/video/ClipRangeSlider.tsx b/frontend/src/components/video/ClipRangeSlider.tsx index ae80bfa..c8622e0 100644 --- a/frontend/src/components/video/ClipRangeSlider.tsx +++ b/frontend/src/components/video/ClipRangeSlider.tsx @@ -33,7 +33,7 @@ export default function ClipRangeSlider({videoRef, setMetadata((prevState: VideoMetadata) => ({ ...prevState, startPoint: val[0], - endPoint: val[1] + duration: val[1] - val[0] } )) previousRangeSliderInput.current = val; @@ -42,7 +42,7 @@ export default function ClipRangeSlider({videoRef, return ( ) => { if (!videoRef) return; @@ -41,7 +42,7 @@ export default function PlaybackSlider({videoRef, {isPlaying ? : } - {videoMetadata.endPoint && - - } + + + ); } \ No newline at end of file diff --git a/frontend/src/pages/ClipEdit.tsx b/frontend/src/pages/ClipEdit.tsx index 992bebe..f9b3fad 100644 --- a/frontend/src/pages/ClipEdit.tsx +++ b/frontend/src/pages/ClipEdit.tsx @@ -21,7 +21,7 @@ const ClipEdit = () => { title: "", description: "", startPoint: 0, - endPoint: 5, + duration: 5, width: 1280, height: 720, fps: 30, diff --git a/frontend/src/utils/types.ts b/frontend/src/utils/types.ts index 9607b69..287a561 100644 --- a/frontend/src/utils/types.ts +++ b/frontend/src/utils/types.ts @@ -2,7 +2,7 @@ type VideoMetadata = { title: string, description: string, startPoint: number, - endPoint: number, + duration: number, fps: number, width: number, height: number, diff --git a/src/main/java/com/ddf/vodsystem/services/EditService.java b/src/main/java/com/ddf/vodsystem/services/EditService.java index 82ecf34..90b5481 100644 --- a/src/main/java/com/ddf/vodsystem/services/EditService.java +++ b/src/main/java/com/ddf/vodsystem/services/EditService.java @@ -37,7 +37,7 @@ public class EditService { private void validateClipConfig(ClipOptions clipOptions) { Float start = clipOptions.getStartPoint(); - Float end = clipOptions.getDuration(); + Float duration = clipOptions.getDuration(); Float fileSize = clipOptions.getFileSize(); Integer width = clipOptions.getWidth(); Integer height = clipOptions.getHeight(); @@ -47,12 +47,8 @@ public class EditService { throw new IllegalArgumentException("Start point cannot be negative"); } - if (end != null && end < 0) { - throw new IllegalArgumentException("End point cannot be negative"); - } - - if (start != null && end != null && end <= start) { - throw new IllegalArgumentException("End point must be greater than start point"); + if (duration != null && duration < 0) { + throw new IllegalArgumentException("Duration cannot be negative"); } if (fileSize != null && fileSize < 100) {