mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-25 03:33:14 +01:00
Don't try to seek when no duration
Also don't allow cuttin without a valid start/end (yes i removed this earlier) https://github.com/mifi/lossless-cut/issues/10#issuecomment-290183019
This commit is contained in:
parent
ea3c0a21dd
commit
0090bf8573
@ -20,6 +20,8 @@ function getVideo() {
|
||||
|
||||
function seekAbs(val) {
|
||||
const video = getVideo();
|
||||
if (val == null || isNaN(val)) return;
|
||||
|
||||
let outVal = val;
|
||||
if (outVal < 0) outVal = 0;
|
||||
if (outVal > video.duration) outVal = video.duration;
|
||||
@ -230,6 +232,9 @@ class App extends React.Component {
|
||||
const cutStartTime = this.state.cutStartTime;
|
||||
const cutEndTime = this.state.cutEndTime;
|
||||
const filePath = this.state.filePath;
|
||||
if (cutStartTime === undefined || cutEndTime === undefined) {
|
||||
return alert('Please select both start and end time');
|
||||
}
|
||||
if (cutStartTime >= cutEndTime) {
|
||||
return alert('Start time must be before end time');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user