w3c / mediasession

Media Session API
https://w3c.github.io/mediasession/
Other
129 stars 29 forks source link

#320 broke IDL: MediaSessionActionHandler can only use the base MediaSessionActionDetails but not any extensions #322

Closed saschanaz closed 1 month ago

saschanaz commented 8 months ago

The handler is defined in https://w3c.github.io/mediasession/#the-mediasession-interface as:

callback MediaSessionActionHandler = undefined(MediaSessionActionDetails details);

Since MediaSessionActionDetails is a dictionary, it can only expose any members that only MediaSessionActionDetails have, per the dictionary conversion steps. (One might expect that it would allow exposing subdictionaries, but it doesn't work that way.)

I don't think it would be worth (if even possible) complicating the types further with extra handler types, so my recommendation would be to roll it back and add the new member in the existing Details dictionary.

cc @youennf

youennf commented 1 month ago

Fixed in https://github.com/w3c/mediasession/commit/51e3cd5edaadd45b2c6828b484077581997f74ab