jfujita / videojs-http-source-selector

VideoJS plugin that leverages videojs-contrib-quality-levels plugin to offer manual user-select able level selection options for adaptive http streams.
MIT License
62 stars 49 forks source link

Does not work with DASH #23

Open waakobrian opened 5 years ago

waakobrian commented 5 years ago

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.

bishnupradhan commented 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?

khizarbajwa007 commented 4 years ago

I think these developer hasn't paid attention to documentation nor on examples videojs has wasted my whole week.

suryakun commented 4 years ago

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)
    })
mikehatfield commented 3 years ago

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!

sahilkashyap64 commented 3 years ago

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

alpkahveci commented 3 years ago

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

chetrit commented 3 years ago

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.

R8KwEwN2hvrhY commented 2 years ago

这个对我有用。默认情况下,比特率选项为空,因为它取自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