我正在使用HTML5视频播放器,使用以下代码
<video id="my-video" class="video-js" controls preload="auto" width="100%" height="600"
data-setup="{}">
<source src="" type='video/mp4'>
<source src="" type='video/webm'>
<p class="vjs-no-js">
To view this video please enable JavaScript, and consider upgrading to a web browser that
<a href="http://videojs.com/html5-video-support/" target="_blank">supports HTML5 video</a>
</p>
</video>
有没有办法添加设置选项的播放器像播放较小版本的hd
,我正在编码的视频到不同的速度。或者有一些免费的播放器提供这样的功能,
发布于 2017-11-10 22:34:30
听起来您使用的是具有多个可用视频比特率的ABR流。
ABR (自适应比特率流)本质上允许客户端设备或播放器以块(例如10秒块)下载视频,并从最适合当前网络条件的比特率中选择下一个块。在这个答案中也可以看到更多信息:https://stackoverflow.com/a/42365034/334402
大多数常见的开源DASH或HLS (ABR格式)播放器都包含选择所需曲目的机制。
例如,在dash.js player中,查看MediaPlayer.js源代码:
和函数'setQualityFor':
/**
* Sets the current quality for media type instead of letting the ABR Heuristics automatically selecting it.
* This value will be overwritten by the ABR rules unless setAutoSwitchQualityFor(type, false) is called.
*
* @param {string} type - 'video' or 'audio'
* @param {number} value - the quality index, 0 corresponding to the lowest bitrate
* @memberof module:MediaPlayer
* @see {@link module:MediaPlayer#setAutoSwitchQualityFor setAutoSwitchQualityFor()}
* @see {@link module:MediaPlayer#getQualityFor getQualityFor()}
* @instance
*/
function setQualityFor(type, value) {
if (!playbackInitialized) {
throw PLAYBACK_NOT_INITIALIZED_ERROR;
}
abrController.setPlaybackQuality(type, streamController.getActiveStreamInfo(), value);
}
https://stackoverflow.com/questions/47177429
复制相似问题