pause logic (not yet resume logic)
This commit is contained in:
13
src/components/pause.js
Normal file
13
src/components/pause.js
Normal 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();
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user