Sending focus to html dom, but remaining in control of canvas items

I’ve been tasked with an HTML overlay where a user may select some options. however the user must also be able to press play/pause while on this html overlay. Is there a way to route these key presses to the place in the app “video-control-overlay” where its _handlePlayPause() functions etc are?

Yes! You can use either global variables or some Pub/sub system. In your overlay, you’ll need to handle the key press for “play / pause” (usually enter via addEventListener(‘keypress’) ) - Then when you get those events call VIDEO.play() where VIDEO is the global var you created for your video player.

Alternatively, you could have your overlay send all the keypresses it doesn’t understand to the canvas tag… If you have your App reference you can forward the event to _receiveKeydown

Okay awesome thank you so much!

I’ll have a go at it and see.

Cheers.