diff options
Diffstat (limited to 'public/bundle.js')
| -rw-r--r-- | public/bundle.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/public/bundle.js b/public/bundle.js index 693561b..c38ea73 100644 --- a/public/bundle.js +++ b/public/bundle.js @@ -956,7 +956,7 @@ var App = function (_Component) { (0, _preact.h)( _button2.default, { - title: 'Record video', + title: this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video', onClick: this.toggleRecording }, this.props.opt.recording ? 'Recording' : 'Record' @@ -1096,6 +1096,9 @@ var App = function (_Component) { return App; }(_preact.Component); +function timeInSeconds(n) { + return (n / 10).toFixed(1) + ' s.'; +} var mapStateToProps = function mapStateToProps(state) { return { opt: state.live.opt, @@ -1184,6 +1187,9 @@ function onFrame(data) { if (recording) { console.log('record frame'); videoWriter.add(canvas); + _store.store.dispatch({ + type: 'ADD_RECORD_FRAME' + }); } if (saving) { saving = false; @@ -1312,6 +1318,12 @@ var liveReducer = function liveReducer() { recording: true }) }); + case 'ADD_RECORD_FRAME': + return _extends({}, state, { + opt: _extends({}, state.opt, { + recordFrames: (state.opt.recordFrames || 0) + 1 + }) + }); case 'SAVE_FRAME': FileSaver.saveAs(action.blob, state.opt.checkpoint_name + "_" + state.opt.sequence + "_" + (0, _moment2.default)().format("YYYYMMDD_HHmm") + ".png"); |
