Skip to content

Commit

Permalink
Merge branch '1.17' of https://github.com/Wicklets/wick-editor into 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxapodular committed Apr 15, 2020
2 parents 70dc46f + f575a53 commit d2d2ee2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/Editor/Modals/ExportOptions/ExportOptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ class ExportOptions extends Component {
this.props.toggle();
} else if (type === 'IMAGE_SEQUENCE') {
this.props.exportProjectAsImageSequence(args);
this.props.toggle();
} else if (type === 'AUDIO_TRACK') {
this.props.exportProjectAsAudioTrack(args);
this.props.toggle();
Expand Down
26 changes: 24 additions & 2 deletions src/Editor/export/VideoExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@ class VideoExport {
*/
static renderVideo = async (args) => {
setLogging(ENABLE_LOGGING);
let logger = ENABLE_LOGGING ? (({message}) => console.log(message)) : (()=>{});
const worker = createWorker({
logger: logger,
logger: ({message}) => {
if(ENABLE_LOGGING) {
console.log(message);
}
VideoExport._parseProgressMessage(message, args);
},
});

args.worker = worker;
Expand Down Expand Up @@ -174,6 +178,24 @@ class VideoExport {
height: newHeight
};
}

static _parseProgressMessage (message, args) {
if(!message) return
if(!message.includes('pts_time:')) return;

var time;

time = message.split('pts_time');
if(!time) return;
time = time[1];
if(!time) return;
time = time.split('pos');
if(!time) return;
time = time[0];
if(!time) return;

args.onProgress('Rendered ' + time + ' seconds', 85);
}
}

export default VideoExport;

0 comments on commit d2d2ee2

Please sign in to comment.