{"action":"created","issue":{"url":"https://api.github.com/repos/WICG/mediasession/issues/145","repository_url":"https://api.github.com/repos/WICG/mediasession","labels_url":"https://api.github.com/repos/WICG/mediasession/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/WICG/mediasession/issues/145/comments","events_url":"https://api.github.com/repos/WICG/mediasession/issues/145/events","html_url":"https://github.com/WICG/mediasession/issues/145","id":190061190,"number":145,"title":"Whether to allow media control actions be default-handled by the UA, and how?","user":{"login":"xxyzzzq","id":4197173,"avatar_url":"https://avatars.githubusercontent.com/u/4197173?v=3","gravatar_id":"","url":"https://api.github.com/users/xxyzzzq","html_url":"https://github.com/xxyzzzq","followers_url":"https://api.github.com/users/xxyzzzq/followers","following_url":"https://api.github.com/users/xxyzzzq/following{/other_user}","gists_url":"https://api.github.com/users/xxyzzzq/gists{/gist_id}","starred_url":"https://api.github.com/users/xxyzzzq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxyzzzq/subscriptions","organizations_url":"https://api.github.com/users/xxyzzzq/orgs","repos_url":"https://api.github.com/users/xxyzzzq/repos","events_url":"https://api.github.com/users/xxyzzzq/events{/privacy}","received_events_url":"https://api.github.com/users/xxyzzzq/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-11-17T14:25:36Z","updated_at":"2016-11-17T15:33:51Z","closed_at":null,"body":"Currently, we allow UA have default handling for media control actions, such as play/pause/seek in the UA internally.\r\n\r\nThe page can do the following:\r\n\r\n1.  Use default-handling by:\r\n    ```\r\n    mediaSession.onfoo = function(e) {};\r\n    ```\r\n2.  Override the default handling by:\r\n    ```\r\n    mediaSession.onfoo = function(e) {\r\n      ...\r\n      e.preventDefault();\r\n    };\r\n    ```\r\n3.  If the page sets `mediaSession.onfoo = null`, the UA will assume it does not support action `foo`, so it will not be default-handled. **This was wrong, it should be equivalent with case 1**\r\n\r\n4.  If the page handles the action in `onfoo` but doesn't call `preventDefault()`, the behavior will get complicated, since the event could be handled by both the page and the UA.\r\n\r\nMy point is that default-handling media control actions may be not very useful. It should be easier to handle actions in the page, while default-handling in the UA will make the API more complex and easier to misuse (especially for case 1 vs. 3 and case 4), and in some situations developers might need to guess what's the default handling behavior (unless we write it in the spec).\r\n\r\nThe idea for default-handling was originally introduced for working around `play`/`pause` actions (issue #69, #139). We need to take care of it when making decisions.\r\n\r\nBringing in folks that involved in the original discussion: @avayvod @jernoble @mounirlamouri "},"comment":{"url":"https://api.github.com/repos/WICG/mediasession/issues/comments/261278765","html_url":"https://github.com/WICG/mediasession/issues/145#issuecomment-261278765","issue_url":"https://api.github.com/repos/WICG/mediasession/issues/145","id":261278765,"user":{"login":"xxyzzzq","id":4197173,"avatar_url":"https://avatars.githubusercontent.com/u/4197173?v=3","gravatar_id":"","url":"https://api.github.com/users/xxyzzzq","html_url":"https://github.com/xxyzzzq","followers_url":"https://api.github.com/users/xxyzzzq/followers","following_url":"https://api.github.com/users/xxyzzzq/following{/other_user}","gists_url":"https://api.github.com/users/xxyzzzq/gists{/gist_id}","starred_url":"https://api.github.com/users/xxyzzzq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xxyzzzq/subscriptions","organizations_url":"https://api.github.com/users/xxyzzzq/orgs","repos_url":"https://api.github.com/users/xxyzzzq/repos","events_url":"https://api.github.com/users/xxyzzzq/events{/privacy}","received_events_url":"https://api.github.com/users/xxyzzzq/received_events","type":"User","site_admin":false},"created_at":"2016-11-17T15:33:51Z","updated_at":"2016-11-17T15:33:51Z","body":"I agree, 3 should be equivalent with 1.\r\n\r\nHowever, there will be no way to declare an action to be unsupported, right?"}}
{"actor":{"display_login":"xxyzzzq"}}