Skip to content

Commit

Permalink
feat(sound): Add clientEvents: soundplay, soundpause, soundstop (#433)
Browse files Browse the repository at this point in the history
* WIP: sound-control

* WIP: sound-control

* handle sound events

* change slightly
  • Loading branch information
mwfarb authored Apr 6, 2022
1 parent 2f1aeaf commit d313202
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/message-actions/client-event.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,21 @@ export class ClientEvent {
},
}, false);
break;
case 'soundplay':
if (entityEl.components.sound) {
entityEl.components.sound.playSound();
}
break;
case 'soundpause':
if (entityEl.components.sound) {
entityEl.components.sound.pauseSound();
}
break;
case 'soundstop':
if (entityEl.components.sound) {
entityEl.components.sound.stopSound();
}
break;
default: // handle others here like mouseenter / mouseleave
break;
}
Expand Down

0 comments on commit d313202

Please sign in to comment.