From 8b3e863c42b37211b6b2b112be3e26c606188650 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Ml=C3=A1dek?= Date: Wed, 21 Feb 2018 14:52:22 +0100 Subject: [PATCH] recording tweaks & fixes --- src/components/Player.vue | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src/components/Player.vue b/src/components/Player.vue index 7dc7de4..4a8c009 100644 --- a/src/components/Player.vue +++ b/src/components/Player.vue @@ -15,7 +15,8 @@
- +
@@ -48,7 +49,6 @@ data: function () { return { image: null, - buttonLabel: 'PLAY', playing: false, zoom: 1, fullscreen: false, @@ -116,6 +116,17 @@ } else { return sequence } + }, + buttonLabel: function () { + if (!this.playing) { + if (this.record) { + return 'RECORD' + } else { + return 'PLAY' + } + } else { + return 'STOP' + } } }, mounted: function () { @@ -141,9 +152,12 @@ this.$render() }, record: function () { - if (this.record && !bowser.chrome) { - alert('Recording only supported in Chrome :( \n' + - 'https://github.com/spite/ccapture.js/#limitations') + if (this.record) { + this.position = 0 + if (!bowser.chrome) { + alert('Recording only supported in Chrome :( \n' + + 'https://github.com/spite/ccapture.js/#limitations') + } } } }, @@ -154,13 +168,11 @@ } this.playing = !this.playing if (this.playing) { - this.buttonLabel = 'STOP' this.tmp_ctx = this.$refs.canvas.getContext('2d') if (this.record) this.capturer.start() this.$render_advance() } else { cancelAnimationFrame(this.animation_id) - this.buttonLabel = 'PLAY' } }, clear: function (style) { @@ -187,8 +199,8 @@ this.playPause() this.position = 0 if (this.record) { - this.record.stop() - this.record.save() + this.capturer.stop() + this.capturer.save() } } }