HTML5视频 - 最高回放速度是多少? [英] HTML5 Video - what is the maximum playback rate?

查看:1728
本文介绍了HTML5视频 - 最高回放速度是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您可以设置HTML5视频元素的播放速率:

  var player = document.getElementById(video) ; 
player.playbackRate = 100;

w3规范没有定义限制。 Chrome和Firefox中< video> 元素的最大播放速率是多少?如果回放速度不依赖于浏览器,那么是什么原因决定的?

研究:

MDN HTML媒体元素表示,某些浏览器将停止播放音频以外的音频播放范围在0.25x - 4x之间。它没有说明视频元素是否会继续播放视频。



YouTube的播放器支持的速度在0.25x - 2x之间。这是一个Flash播放器,而不是一个HTML5的视频元素,我不感兴趣。

我个人在我的电脑上创建了一个测试页,内数信息范范范读预范亦能范范信息中预读内能数当读读的数范读的内读范范秘范亦预范预的信息的预读信息信息信息的预读信息信息我实际上无法检查播放速度,因为它只是返回我设置的值100。 解决方案

> Firefox:


$ b Firefox将有效播放速率限制在 0.25 - 5.0 范围内(可为负值,但绝对值为一样)。
此外,如果回放速度低于 0.5 或高于 4.0 ,音频将被静音。


- Firefox源代码位于 dom\ html \HTMLMediaElement.cpp



Chrome浏览器 b
$ b

将播放速率限制在 0.0625 - 16.0 的较宽范围内。然而,更宽的允许范围并不能保证特定的个人电脑能够按照要求的速率跟上视频渲染和音频处理。所以,指定范围只能在更快的个人电脑和现代操作系统上完全体验。
$ b

- Chromium source code at media/blink/webmediaplayer_impl.cc


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.

解决方案

Firefox:

Firefox clamps effective playback rate to the 0.25 - 5.0 range (can be negative, but the absolute values are the same). Furthermore, if the playback rate is lower than 0.5, or is higher than 4.0, audio is muted.

Source - Firefox source code at dom\html\HTMLMediaElement.cpp

Chrome:

Chrome clamps playback rate to a wider range of 0.0625 - 16.0. However, the wider allowed range does not guarantee that a particular PC will be able to keep up with video rendering and audio processing at the requested rates. So, the specified range can only be fully experienced on faster PCs and modern operating systems.

Source - Chromium source code at media/blink/webmediaplayer_impl.cc

这篇关于HTML5视频 - 最高回放速度是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆