14 lines
308 B
JavaScript
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();
|
|
}
|
|
}
|
|
});
|