Video.js 8 quality selector

sahilkashyap64

Sahil kashyap

Posted on January 15, 2024

Video.js 8 quality selector

Demo:Player in js fiddle

Video tag:

<video id="my-video" class="video-js vjs-default-skin" width="640" height="360" controls>

    <source src="https://cph-p2p-msl.akamaized.net/hls/live/2000341/test/master.m3u8" type="application/x-mpegURL">
    <!-- <source src="https://dash.akamaized.net/akamai/bbb_30fps/bbb_30fps.mpd" type="application/dash+xml"> -->
  </video>
Enter fullscreen mode Exit fullscreen mode

Lib used:

<link href="https://unpkg.com/jb-videojs-hls-quality-selector/dist/css/jb-videojs-hls-quality-selector.css" rel="stylesheet">

 <!-- videojs-contrib-quality-levels plugin -->
  <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-quality-levels/2.0.15/videojs-contrib-quality-levels.min.js"></script>
  <!-- jb-videojs-hls-quality-selector -->
  <script src="https://unpkg.com/jb-videojs-hls-quality-selector"></script>
Enter fullscreen mode Exit fullscreen mode

make sure to add this is

  <script>
    document.addEventListener('DOMContentLoaded', function() {
      const player = videojs('my-video');

      player.ready(function() {
        player.hlsQualitySelector({
       displayCurrentQuality: true,
          });
      });
    });
  </script>
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
sahilkashyap64
Sahil kashyap

Posted on January 15, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Video.js 8 quality selector
videojs Video.js 8 quality selector

January 15, 2024