Files
junisaber/src/components/toggle-pause-play.js

11 lines
271 B
JavaScript
Raw Normal View History

2018-07-18 20:48:45 +02:00
AFRAME.registerComponent('toggle-pause-play', {
schema: {
2018-10-13 17:19:36 -07:00
isPlaying: { default: false }
2018-07-18 20:48:45 +02:00
},
2018-10-13 17:19:36 -07:00
update: function () {
2018-07-18 20:48:45 +02:00
const action = this.data.isPlaying ? 'pause' : 'play';
parent.postMessage(JSON.stringify({ verify: 'game-action', action }), '*');
2018-10-13 17:19:36 -07:00
}
2018-07-18 20:48:45 +02:00
});