KEMBAR78
Throw exception when HTMLMediaElement’s defaultPlaybackRate or playbackRate are set to negative values if unsupported by the user agent. · Issue #2754 · whatwg/html · GitHub
Skip to content

Throw exception when HTMLMediaElement’s defaultPlaybackRate or playbackRate are set to negative values if unsupported by the user agent. #2754

@japacible

Description

@japacible

cc @jernoble @foolip @mounirlamouri @cpearce

Setting a video's defaultPlaybackRate or playbackRate to a negative value does not have uniform behavior across the major browsers:

Browser defaultPlaybackRate = -1 playbackRate = -1
Chrome defaultPlaybackRate set to -1, plays at 1 playbackRate set to -1, plays at 1
Edge defaultPlaybackRate set to 1 playbackRate set to 1
Firefox NS_ERROR_NOT_IMPLEMENTED NS_ERROR_NOT_IMPLEMENTED
Safari implements if set before load time implements

The spec does not currently specify the desired behavior in the case when the value set is negative.

While some non-negative values are unsupported by some implementations, they are usually approximated or capped, making the problem different (e.g. 10x as 5x, 0.001x as 0.1x). Negative values are uncommon, can’t be approximated, and unlikely to be used.

We propose to throw a RangeError when the value of playbackRate or defaultPlaybackRate is
negative.

edit: updated safari behavior per jernoble's comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    interopImplementations are not interoperable with each othertopic: media

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions