Files
junisaber/src/components/pause.js
2018-10-03 18:58:26 -07:00

14 lines
308 B
JavaScript

AFRAME.registerComponent('pause', {
schema: {
isPaused: {default: false}
},
update: function () {
if (this.data.isPaused && this.el.isPlaying) {
this.el.pause();
} else if (!this.data.isPaused && !this.el.isPlaying && this.el.sceneEl.isPlaying) {
this.el.play();
}
}
});