1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-21 18:02:35 +01:00

remember certain settings across file loads #85

This commit is contained in:
Mikael Finstad 2018-09-09 18:36:08 +02:00
parent 2ad9433d36
commit edd80ff6cb

View File

@ -82,7 +82,7 @@ class App extends React.Component {
constructor(props) {
super(props);
const defaultState = {
const localState = {
working: false,
filePath: '', // Setting video src="" prevents memory leak in chromium
html5FriendlyPath: undefined,
@ -94,20 +94,26 @@ class App extends React.Component {
cutEndTime: undefined,
cutEndTimeManual: undefined,
fileFormat: undefined,
captureFormat: 'jpeg',
rotation: 360,
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 video = getVideo();
video.currentTime = 0;
video.playbackRate = 1;
this.setState(defaultState);
this.setState(localState);
};
const load = (filePath, html5FriendlyPath) => {