Code Monkey home page Code Monkey logo

videojs-dash-hls-bitrate-switcher's Introduction

videojs-dash-hls-bitrate-switcher

Creates a button in the controlbar that can be used to switch bitrate for DASH and HLS playlists

This plugin requires the Quality Levels plugin

https://github.com/videojs/videojs-contrib-quality-levels

npm install --save videojs-contrib-quality-levels

Table of Contents

Installation

npm install --save @samueleastdev/videojs-dash-hls-bitrate-switcher

How To Run The Code

npm install
npm start

Open your browser to http://localhost:9999

Usage

To include videojs-dash-hls-bitrate-switcher on your website or web application, use any of the following methods.

<script> Tag

This is the simplest case. Get the script in whatever way you prefer and include the plugin after you include video.js, so that the videojs global is available.

<script src="//path/to/video.min.js"></script>
<script src="//path/to/videojs-dash-hls-bitrate-switcher.min.js"></script>
<script>
  var player = videojs("my-video");

  player.dashHlsBitrateSwitcher({
    showInfo: false,
  });
</script>

Browserify/CommonJS

When using with Browserify, install videojs-dash-hls-bitrate-switcher via npm and require the plugin as you would any other module.

var videojs = require("video.js");

// The actual plugin function is exported by this module, but it is also
// attached to the `Player.prototype`; so, there is no need to assign it
// to a variable.
require("videojs-dash-hls-bitrate-switcher");

var player = videojs("my-video");

player.dashHlsBitrateSwitcher({
  showInfo: false,
});

RequireJS/AMD

When using with RequireJS (or another AMD library), get the script in whatever way you prefer and require the plugin as you normally would:

require(["video.js", "videojs-dash-hls-bitrate-switcher"], function (videojs) {
  var player = videojs("my-video");

  player.dashHlsBitrateSwitcher({
    showInfo: false,
  });
});

License

Apache-2.0. Copyright (c) Samuel East

videojs-dash-hls-bitrate-switcher's People

Contributors

s3bubble avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

videojs-dash-hls-bitrate-switcher's Issues

No quality levels being surfaced from MPD file for DASH streams

This plugin is working great for my HLS sources; however, I am not getting anything back when using a DRM'd MPEG-DASH source. My MPD file has several representations (see below) but I'm wondering if maybe the .mp4 format is not supported?

...

 <Representation bandwidth="6500000" codecs="avc1.640028" frameRate="30000/1001" height="1080" id="1" width="1920">
        <SegmentTemplate initialization="xryau3w7_gare0105_r-dash-16x9-1080p-1080p-6500kinit.mp4" media="xryau3w7_gare0105_r-dash-16x9-1080p-1080p-6500k_$Number%09d$.mp4" startNumber="1">
          <SegmentTimeline>
            <S d="540540" r="537" t="0" />
            <S d="144144" t="290810520" />
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>
      <Representation bandwidth="4500000" codecs="avc1.64001f" frameRate="30000/1001" height="720" id="2" width="1280">
        <SegmentTemplate initialization="xryau3w7_gare0105_r-dash-16x9-1080p-720p-4500kinit.mp4" media="xryau3w7_gare0105_r-dash-16x9-1080p-720p-4500k_$Number%09d$.mp4" startNumber="1">
          <SegmentTimeline>
            <S d="540540" r="537" t="0" />
            <S d="144144" t="290810520" />
          </SegmentTimeline>
        </SegmentTemplate>
      </Representation>

...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.