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() } } }