w3c / mediasession

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

Update MediaPositionState WebIDL #304

Closed youennf closed 10 months ago

youennf commented 1 year ago

Fixes #303 Fixes #252

We make duration a required member of MediaPositionState and add default values for position and playbackRate. duration is now unrestricted to allow Infinity, we add a special check for NaN.

We update MediaSession.setPositionState to accept null since MediaPositionState now has a required member.

This overtakes https://github.com/w3c/mediasession/issues/303 and should fix https://github.com/w3c/mediasession/issues/303 and https://github.com/w3c/mediasession/issues/252.


Preview | Diff

youennf commented 1 year ago

@marcoscaceres, @steimelchrome, PTAL

youennf commented 10 months ago

it might be worth considering adding an explicit method for "clear" or reset.

It is probably worth an issue. Implementations do clear in case of setPositionState() so I am not sure we can break this. We could do like WebKit and change setPositionState to accept setPositionState(null)

marcoscaceres commented 10 months ago

Ok, filed https://github.com/w3c/mediasession/issues/315 ... can follow up on that.