serverwentdown / Youpp

A (beta) design-oriented, simple YouTube client
http://serverwentdown.github.io/Youpp
MIT License
31 stars 4 forks source link

Keyevents not triggering after clicking on video #6

Closed serverwentdown closed 10 years ago

serverwentdown commented 10 years ago

Keyboard events not passing through video after focusing on video (i.e. clicking on video to pause/play), requires exit from player. Probably due to Flash and/or YouTube.

Includes Mousetrap keyboard events and OS X events (i.e. Cmd-Q and Cmd-W).

serverwentdown commented 10 years ago

Possible fixes:

  1. Bind Mousetrap listener to YouTube's player.addEventListener (But no Mousetrap APIs to do this (Here is a fork that has that API) ).
  2. Write own listener (But don't want to write Mousetrap myself).
  3. Use an in-between, e.which and then trigger the event (Messy).

EDIT: None of this will work because I realised YouTube's player.addEventListener is for YouTube player events. Grrrrr...

Related Stackoverflow

serverwentdown commented 10 years ago

Found possible bug fix, implemented it, based on this stackoverlow question.

Basically what has been done is to setInterval while the player is open, and use that to keep docs on a hidden <input> element. Yes and Miusetrap has need set to global including textareas.