{"action":"closed","issue":{"url":"https://api.github.com/repos/johndyer/mediaelement/issues/1662","repository_url":"https://api.github.com/repos/johndyer/mediaelement","labels_url":"https://api.github.com/repos/johndyer/mediaelement/issues/1662/labels{/name}","comments_url":"https://api.github.com/repos/johndyer/mediaelement/issues/1662/comments","events_url":"https://api.github.com/repos/johndyer/mediaelement/issues/1662/events","html_url":"https://github.com/johndyer/mediaelement/issues/1662","id":122042894,"number":1662,"title":"Player still responds to keydown after focus change done with js","user":{"login":"feulix","id":4669995,"avatar_url":"https://avatars.githubusercontent.com/u/4669995?v=3","gravatar_id":"","url":"https://api.github.com/users/feulix","html_url":"https://github.com/feulix","followers_url":"https://api.github.com/users/feulix/followers","following_url":"https://api.github.com/users/feulix/following{/other_user}","gists_url":"https://api.github.com/users/feulix/gists{/gist_id}","starred_url":"https://api.github.com/users/feulix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feulix/subscriptions","organizations_url":"https://api.github.com/users/feulix/orgs","repos_url":"https://api.github.com/users/feulix/repos","events_url":"https://api.github.com/users/feulix/events{/privacy}","received_events_url":"https://api.github.com/users/feulix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-12-14T13:31:50Z","updated_at":"2016-08-17T03:07:27Z","closed_at":"2016-08-17T03:07:26Z","body":"When you change the focus with js to a DOM element other than the player, for instance an html input element, the player still responds to the keydown event.\r\nThis is because player.hasfocus isn't changed on a keydown event.\r\nSuggested change: change player.hasFocus on keydown event.\r\n\r\nFrom line 3213 in mediaelement-and-player.js:\r\n```\r\n// listen for key presses\r\nt.globalBind('keydown', function(e) {\r\n\tplayer.hasFocus = $(event.target).closest('.mejs-container').length !== 0; //Change hasFocus\r\n\treturn t.onkeydown(player, media, e);\r\n});\r\n```"}}
{"actor":{"display_login":"ron666"}}