Reputation: 63738
You can set the playback rate for a HTML5 video element:
var player = document.getElementById("video");
player.playbackRate = 100;
The w3 spec does not define a limit. What is the maximum playback rate of the <video>
element in Chrome and Firefox? If the playback rate is not browser dependent, then what determines it?
Research:
MDN HTML Media Element says that some browsers will stop playing audio outside of a playback range between 0.25x - 4x. It does not say whether the video element will continue to play video.
YouTube's player supports speeds between 0.25x - 2x. This is a flash player, not an HTML5 video element, and I'm not interested in it.
Personally, I have created a test page locally on my computer with a <video>
element and a local video file. I can set the playbackrate to anything (e.g. 100), but the video does not seem to play faster than ~5x. I can't actually check the playbackrate speed, since it just returns the value "100" that I set.
Upvotes: 25
Views: 23613
Reputation: 6138
Updated 07/08/2021 to reflect the latest changes in browser behavior
Firefox:
According to the source code, Firefox should clamp effective playback rate to the 0.0625 - 16.0 range. In my tests, it no longer follows that and does not clamp the playback rate at all. However, it still mutes the audio if the playback rate is lower than 0.5, or is higher than 4.0.
Source - Firefox source code at dom/html/HTMLMediaElement.cpp
Chrome:
Chrome clamps playback rate to a range of 0.0625 - 16.0. In my tests, it also mutes the audio if the rate is lower than 0.5, or higher than 4.0.
Source - Chromium source code at third_party/blink/renderer/core/html/media/html_media_element.h
Upvotes: 41
Reputation: 113
Min Speed: 0.0625x
Max Speed: 16x
source: trial and error on Google Chrome with
document.getElementsByTagName("video")[0].playbackRate = 2.5;
Upvotes: 0
Reputation: 10577
Most browsers stop playing audio outside playbackRate bounds of 0.5 and 4, leaving the video playing silently. It's therefore recommended for most applications that you limit the range to between 0.5 and 4.
from Mozilla Developer Network. may be that is the reason why your video playback rate did not go higher than 5 ( may be 4 ).
Edit:
A play back rate demo application can be found here.
It shows playback rate upto 10(but without sound).
Update
The playbackRate property represents a multiplier of the video's intrinsic or normal playback rate, with the default setting of 1. If you set the property to 2, it doubles the playback speed, while .5 will play at half speed. If playbackRate is set to a negative value, in Windows Internet Explorer 9, it rounds it back to zero, essentially pausing playback. In Internet Explorer 10, negative values for playbackRate cause the video to play in reverse. The W3C spec doesn't recommend an upper limit, but Internet Explorer limits playbackRate up to 8x speed.
Source: https://msdn.microsoft.com/library/hh924823(v=vs.85).aspx
It will also depend on the power of your processor. A higher processor speed will give you higher playback limit possible.
Upvotes: 0
Reputation: 1333
Technically there should be no limit.
But where is the reason in playing a 30 seconds long Video in not even one second?
Upvotes: 1