summaryrefslogtreecommitdiff
path: root/public/bundle.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-21 22:05:51 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-21 22:05:51 +0200
commit0a2bc7f1bf214b2099c1f8139a67288c10249565 (patch)
tree64a855ca9468ff28f3dd01de88e2d2a1e142caa7 /public/bundle.js
parent79751151d57176188ed36b0d718ac3aaad641afb (diff)
better messaging when saving video
Diffstat (limited to 'public/bundle.js')
-rw-r--r--public/bundle.js19
1 files changed, 16 insertions, 3 deletions
diff --git a/public/bundle.js b/public/bundle.js
index c38ea73..e3c2955 100644
--- a/public/bundle.js
+++ b/public/bundle.js
@@ -893,6 +893,7 @@ var App = function (_Component) {
value: function toggleRecording() {
if (this.props.opt.recording) {
(0, _player3.stopRecording)();
+ this.props.actions.pause();
} else {
(0, _player3.startRecording)();
}
@@ -956,10 +957,10 @@ var App = function (_Component) {
(0, _preact.h)(
_button2.default,
{
- title: this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video',
+ title: this.props.opt.savingVideo ? 'Saving video...' : this.props.opt.recording ? 'Recording (' + timeInSeconds(this.props.opt.recordFrames) + ')' : 'Record video',
onClick: this.toggleRecording
},
- this.props.opt.recording ? 'Recording' : 'Record'
+ this.props.opt.savingVideo ? 'Saving' : this.props.opt.recording ? 'Recording' : 'Record'
),
(0, _preact.h)(
_button2.default,
@@ -1160,7 +1161,11 @@ function startRecording() {
}
function stopRecording() {
+ if (!recording) return;
recording = false;
+ _store.store.dispatch({
+ type: 'SAVING_VIDEO'
+ });
videoWriter.compile(false, function (blob) {
console.log(blob);
_store.store.dispatch({
@@ -1329,11 +1334,19 @@ var liveReducer = function liveReducer() {
FileSaver.saveAs(action.blob, state.opt.checkpoint_name + "_" + state.opt.sequence + "_" + (0, _moment2.default)().format("YYYYMMDD_HHmm") + ".png");
return state;
+ case 'SAVING_VIDEO':
+ return _extends({}, state, {
+ opt: _extends({}, state.opt, {
+ savingVideo: true
+ })
+ });
case 'SAVE_VIDEO':
FileSaver.saveAs(action.blob, state.opt.checkpoint_name + "_" + state.opt.sequence + "_" + (0, _moment2.default)().format("YYYYMMDD_HHmm") + ".webm");
return _extends({}, state, {
opt: _extends({}, state.opt, {
- recording: false
+ recording: false,
+ savingVideo: false,
+ recordFrames: 0
})
});