{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/mediasession/issues/76","labels_url":"https://api.github.com/repos/whatwg/mediasession/issues/76/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/mediasession/issues/76/comments","events_url":"https://api.github.com/repos/whatwg/mediasession/issues/76/events","html_url":"https://github.com/whatwg/mediasession/issues/76","id":91833637,"number":76,"title":"Replace setMetadata() by a metadata attribute","user":{"login":"mounirlamouri","id":573590,"avatar_url":"https://avatars.githubusercontent.com/u/573590?v=3","gravatar_id":"","url":"https://api.github.com/users/mounirlamouri","html_url":"https://github.com/mounirlamouri","followers_url":"https://api.github.com/users/mounirlamouri/followers","following_url":"https://api.github.com/users/mounirlamouri/following{/other_user}","gists_url":"https://api.github.com/users/mounirlamouri/gists{/gist_id}","starred_url":"https://api.github.com/users/mounirlamouri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mounirlamouri/subscriptions","organizations_url":"https://api.github.com/users/mounirlamouri/orgs","repos_url":"https://api.github.com/users/mounirlamouri/repos","events_url":"https://api.github.com/users/mounirlamouri/events{/privacy}","received_events_url":"https://api.github.com/users/mounirlamouri/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/whatwg/mediasession/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-29T15:14:10Z","updated_at":"2015-06-30T10:13:13Z","closed_at":null,"body":"This is mostly for developer convenience. A developer who wants to change the session's title would have to do:\r\n```js\r\nvar metadata = { title: 'foo', author: 'bar' };\r\nmedia.session.setMetadata(metadata);\r\n/// ... later\r\nmetadata.title = 'something else';\r\nmedia.session.setMetadata(metadata);\r\n```\r\nIt can be tedious.\r\n\r\nIt would be simpler to do:\r\n```js\r\nmedia.session.metadata = new MediaSessionMetadata({title: 'foo', author: 'bar'});\r\n// ... later\r\nmedia.session.metadata.title = 'something else';\r\n```\r\n\r\nIt seems to me that the main reason why ```.setMetadata()``` is here is so the UA is aware of metadata changes. I think this can be solved by having metadata represented by an interface instead of a dictionary. That would also solve issue #71 and if the interface is constructable like the example above, using an interface shouldn't be a problem."},"comment":{"url":"https://api.github.com/repos/whatwg/mediasession/issues/comments/117111746","html_url":"https://github.com/whatwg/mediasession/issues/76#issuecomment-117111746","issue_url":"https://api.github.com/repos/whatwg/mediasession/issues/76","id":117111746,"user":{"login":"annevk","id":1544111,"avatar_url":"https://avatars.githubusercontent.com/u/1544111?v=3","gravatar_id":"","url":"https://api.github.com/users/annevk","html_url":"https://github.com/annevk","followers_url":"https://api.github.com/users/annevk/followers","following_url":"https://api.github.com/users/annevk/following{/other_user}","gists_url":"https://api.github.com/users/annevk/gists{/gist_id}","starred_url":"https://api.github.com/users/annevk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/annevk/subscriptions","organizations_url":"https://api.github.com/users/annevk/orgs","repos_url":"https://api.github.com/users/annevk/repos","events_url":"https://api.github.com/users/annevk/events{/privacy}","received_events_url":"https://api.github.com/users/annevk/received_events","type":"User","site_admin":false},"created_at":"2015-06-30T10:13:13Z","updated_at":"2015-06-30T10:13:13Z","body":"This design doesn't solve the problem with loading artwork."}}