pause logic (not yet resume logic)

This commit is contained in:
Kevin Ngo
2018-10-03 18:58:26 -07:00
parent 9392e57133
commit e9c6c4a9f0
7 changed files with 58 additions and 23 deletions

13
src/components/pause.js Normal file
View File

@@ -0,0 +1,13 @@
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();
}
}
});