w3c / mediasession

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

fix: MediaSessionActionHandler cb's type #330

Closed marcoscaceres closed 1 month ago

marcoscaceres commented 6 months ago

Fixes #322

Cc @saschanaz - how's this look?

Also, please see https://github.com/w3c/mediasession/issues/331


Preview | Diff

saschanaz commented 6 months ago

I don't think we can have multiple dictionaries in a union. Consider this:

({ action: "play", seekOffset: 3, seekTime: 4, fastSeek: true, isActivating: true })

This would fit any of the dictionaries in the union. For this specific case we don't do ES-to-IDL conversion so maybe it's theoretically fine?

cc @domenic

youennf commented 5 months ago

@saschanaz, good point. I guess this could work for IDL-to-ES conversion, but would probably need updating WebIDL processors, which UAs might not do. I am tempted to revert the splitting of dictionaries in the spec. @steimelchrome, thoughts?

steimelchrome commented 5 months ago

The fact that we can't just say MediaSessionActionDetails and allow 'subclass' dictionaries to be given feels like a strange limitation, but given that I'd agree with @youennf that reverting the dictionary split change makes the most sense

youennf commented 1 month ago

OK, let's close this PR, I'll work on a PR to revert the dictionary splitting.