Files
junisaber/src/components/pause.js

14 lines
308 B
JavaScript
Raw Normal View History

2018-10-03 18:58:26 -07:00
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();
}
}
});