mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-25 03:33:14 +01:00
remember certain settings across file loads #85
This commit is contained in:
parent
2ad9433d36
commit
edd80ff6cb
@ -82,7 +82,7 @@ class App extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
const defaultState = {
|
const localState = {
|
||||||
working: false,
|
working: false,
|
||||||
filePath: '', // Setting video src="" prevents memory leak in chromium
|
filePath: '', // Setting video src="" prevents memory leak in chromium
|
||||||
html5FriendlyPath: undefined,
|
html5FriendlyPath: undefined,
|
||||||
@ -94,20 +94,26 @@ class App extends React.Component {
|
|||||||
cutEndTime: undefined,
|
cutEndTime: undefined,
|
||||||
cutEndTimeManual: undefined,
|
cutEndTimeManual: undefined,
|
||||||
fileFormat: undefined,
|
fileFormat: undefined,
|
||||||
captureFormat: 'jpeg',
|
|
||||||
rotation: 360,
|
rotation: 360,
|
||||||
cutProgress: undefined,
|
cutProgress: undefined,
|
||||||
includeAllStreams: false,
|
|
||||||
stripAudio: false,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.state = _.cloneDeep(defaultState);
|
const globalState = {
|
||||||
|
stripAudio: false,
|
||||||
|
includeAllStreams: false,
|
||||||
|
captureFormat: 'jpeg',
|
||||||
|
};
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
...localState,
|
||||||
|
...globalState,
|
||||||
|
};
|
||||||
|
|
||||||
const resetState = () => {
|
const resetState = () => {
|
||||||
const video = getVideo();
|
const video = getVideo();
|
||||||
video.currentTime = 0;
|
video.currentTime = 0;
|
||||||
video.playbackRate = 1;
|
video.playbackRate = 1;
|
||||||
this.setState(defaultState);
|
this.setState(localState);
|
||||||
};
|
};
|
||||||
|
|
||||||
const load = (filePath, html5FriendlyPath) => {
|
const load = (filePath, html5FriendlyPath) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user