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.