Bug 259642
| Summary: | MediaSession.setPositionState() does not allow duration Infinity | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Jakob Wierzba <webkit-bugzilla> |
| Component: | Media | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ahmad.saleem792, jer.noble, webkit-bug-importer, youennf |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari 16 | ||
| Hardware: | Mac (Apple Silicon) | ||
| OS: | macOS 13 | ||
Jakob Wierzba
Per spec https://w3c.github.io/mediasession/#the-mediapositionstate-dictionary
> positive infinity can be used to indicate media without a defined end such as live playback
but when I do
navigator.mediaSession.setPositionState({ duration: Infinity })
I get a
> TypeError: The provided value is non-finite
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/113493417>
Jer Noble
This is (currently) intentional (and the spec text is confusing). The MediaSession specification defines `duration` to be a `double`, whereas the HTMLMediaElement.duration is defined as a `unrestricted double` (thus allowing +Infinity).
This issue was raised recently in the Media WG: <https://github.com/w3c/mediasession/issues/252>
We'll update the definition (to allow +Infinity) when the spec changes.
Ahmad Saleem
Web-Spec thread just got closed last week: https://github.com/w3c/mediasession/pull/304
with one follow-up: https://github.com/w3c/mediasession/issues/315