Skip to content
Discussion options

You must be logged in to vote

This is a security limitation—an iframe is not allowed to listen to keyboard events from its parent window. The only for it to gain access is if you click on and move focus to the iframe.

The only fix I can think of for this would be to listen to the keyboard events in the parent window and then call postMessage API methods on the YouTube iframe to trigger the corresponding action. Not sure what events that YouTube supports in their postMessage API though.

Replies: 4 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by reagle
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@reagle
Comment options

@hakimel
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants