Open waakobrian opened 5 years ago
Hi, I am also facing similar issue when try with DASH (.mpd) videos. Does anyone has solution to switch between multi bitrate / qualities DASH stream?
I think these developer hasn't paid attention to documentation nor on examples videojs has wasted my whole week.
It works for me. By default the bitrate options is empty because it was taken from videojs-contrib-quality-levels. I think videojs-contrib-quality-levels still not support to fetch the bitrate options from mpd file, so we should add the options manually with this tutorial. However, that is not the best practice. I want to fetch the options from the mpd file metadata, luckily DashJS provide the ability for that.
This is the example how I fetch quality data from dashjs and add the options to videojs-contrib-quality-levels. (Notes: you should install dashjs first)
const levels = player.qualityLevels()
const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video');
const availableQualities = bitrates.map(({ height, bitrate, width }) => {
return {
id: height.toString(),
height,
width,
bandwidth: bitrate,
bitrate,
isEnabled_: true,
enabled: toggleQuality
}
})
availableQualities.forEach(quality => {
levels.addQualityLevel(quality)
})
It works for me. By default the bitrate options is empty because it was taken from videojs-contrib-quality-levels. I think videojs-contrib-quality-levels still not support to fetch the bitrate options from mpd file, so we should add the options manually with this tutorial. However, that is not the best practice. I want to fetch the options from the mpd file metadata, luckily DashJS provide the ability for that.
This is the example how I fetch quality data from dashjs and add the options to videojs-contrib-quality-levels. (Notes: you should install dashjs first)
const levels = player.qualityLevels() const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video'); const availableQualities = bitrates.map(({ height, bitrate, width }) => { return { id: height.toString(), height, width, bandwidth: bitrate, bitrate, isEnabled_: true, enabled: toggleQuality } }) availableQualities.forEach(quality => { levels.addQualityLevel(quality) })
Thanks @suryakun . Can you please include the example of toggleQuality function as well? Thanks!
It works for me. By default the bitrate options is empty because it was taken from videojs-contrib-quality-levels. I think videojs-contrib-quality-levels still not support to fetch the bitrate options from mpd file, so we should add the options manually with this tutorial. However, that is not the best practice. I want to fetch the options from the mpd file metadata, luckily DashJS provide the ability for that. This is the example how I fetch quality data from dashjs and add the options to videojs-contrib-quality-levels. (Notes: you should install dashjs first)
const levels = player.qualityLevels() const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video'); const availableQualities = bitrates.map(({ height, bitrate, width }) => { return { id: height.toString(), height, width, bandwidth: bitrate, bitrate, isEnabled_: true, enabled: toggleQuality } }) availableQualities.forEach(quality => { levels.addQualityLevel(quality) })
Thanks @suryakun . Can you please include the example of toggleQuality function as well? Thanks!
here's here's dynamic player m3u8/mpd/mp4/youtube https://sahilkashyap64.github.io/hls/index5.html
here's video.js dash player with quality selector https://sahilkashyap64.github.io/dash-player-buydrm/index.html
It works for me. By default the bitrate options is empty because it was taken from videojs-contrib-quality-levels. I think videojs-contrib-quality-levels still not support to fetch the bitrate options from mpd file, so we should add the options manually with this tutorial. However, that is not the best practice. I want to fetch the options from the mpd file metadata, luckily DashJS provide the ability for that. This is the example how I fetch quality data from dashjs and add the options to videojs-contrib-quality-levels. (Notes: you should install dashjs first)
const levels = player.qualityLevels() const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video'); const availableQualities = bitrates.map(({ height, bitrate, width }) => { return { id: height.toString(), height, width, bandwidth: bitrate, bitrate, isEnabled_: true, enabled: toggleQuality } }) availableQualities.forEach(quality => { levels.addQualityLevel(quality) })
Thanks @suryakun . Can you please include the example of toggleQuality function as well? Thanks!
did you get toggleQuality function? or fix the issue
It works for me. By default the bitrate options is empty because it was taken from videojs-contrib-quality-levels. I think videojs-contrib-quality-levels still not support to fetch the bitrate options from mpd file, so we should add the options manually with this tutorial. However, that is not the best practice. I want to fetch the options from the mpd file metadata, luckily DashJS provide the ability for that. This is the example how I fetch quality data from dashjs and add the options to videojs-contrib-quality-levels. (Notes: you should install dashjs first)
const levels = player.qualityLevels() const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video'); const availableQualities = bitrates.map(({ height, bitrate, width }) => { return { id: height.toString(), height, width, bandwidth: bitrate, bitrate, isEnabled_: true, enabled: toggleQuality } }) availableQualities.forEach(quality => { levels.addQualityLevel(quality) })
Thanks @suryakun . Can you please include the example of toggleQuality function as well? Thanks!
here's here's dynamic player m3u8/mpd/mp4/youtube https://sahilkashyap64.github.io/hls/index5.html
here's video.js dash player with quality selector https://sahilkashyap64.github.io/dash-player-buydrm/index.html
There isn't the toggleQuality function here, could you provide it to us ? Thanks.
这个对我有用。默认情况下,比特率选项为空,因为它取自videojs-contrib-quality-levels。 我认为 videojs-contrib-quality-levels 仍然不支持从 mpd 文件中获取比特率选项,所以我们应该在本教程中手动添加选项。 但是,这不是最佳做法。我想从 mpd 文件元数据中获取选项,幸运的是DashJS提供了这个功能。 这是我如何从 dashjs 获取质量数据并将选项添加到 videojs-contrib-quality-levels 的示例。(注意:你应该先安装dashjs)
const levels = player.qualityLevels() const bitrates = player.dash.mediaPlayer.getBitrateInfoListFor('video'); const availableQualities = bitrates.map(({ height, bitrate, width }) => { return { id: height.toString(), height, width, bandwidth: bitrate, bitrate, isEnabled_: true, enabled: toggleQuality } }) availableQualities.forEach(quality => { levels.addQualityLevel(quality) })
谢谢@suryakun. 您能否也包括 toggleQuality 函数的示例?谢谢!
这里是动态播放器 m3u8/mpd/mp4/youtube https://sahilkashyap64.github.io/hls/index5.html 这是带有质量选择器的 video.js 破折号播放器https://sahilkashyap64.github.io/dash-player-buydrm/index.html
这里没有 toggleQuality 功能,你能提供给我们吗?谢谢。
i found this demo https://sahilkashyap64.github.io/hls/index5.html , could chose mpd qualities,but it's js not in git and need script cooperate
Plugin failing to work with DASH videos. I checked out the DEMO at https://vod.dev/ but it uses m3u.....
Am i missing something??? I cant seem to make this plugin to show qualities with DASH streams.