npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

videojs-hlsjs-source-handler

v1.4.0

Published

Hls.js Source Handler for Video.js

Downloads

18

Readme

videojs-hlsjs-source-handler

Hls.js from Dailymotion Source Handler for Video.js

Installation

NPM Package: https://www.npmjs.com/package/videojs-hlsjs-source-handler

npm install videojs-hlsjs-source-handler --save

Dependencies

This source handler assumes you have the following dependencies already loaded:

Api

The source handler will expose two properties on the video.js tech:

  • hls - A reference to the current hls.js instance.
  • isHlsJs - This property will be defined and have the boolean value true when the source handler/hls.js is being used.

Usage

videojs('video', {
    html5: {
        hlsJs: { // Hls.js options
            debug: true
        }
    }
});

Options

  • shouldHandle - Disable this source handler by setting this value to false. Default: true.

For a full list of possible hls.js options, see the hls.js documentation.

Full Example

<!DOCTYPE html>
<html>
    <head>
        <title>videojs-hlsjs-source-handler</title>
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style type="text/css">
            body {
                margin: 0;
                padding: 0;
            }
        </style>
        <link href="//some.domain.com/path/to/video-js.min.css" rel="stylesheet">
        
        <script src="//some.domain.com/path/to/video.min.js" type="text/javascript"></script>
        <script src="//some.domain.com/path/to/videojs-contrib-hls.min.js" type="text/javascript"></script>
        <script src="//some.domain.com/path/to/videojs-contrib-media-sources.min.js" type="text/javascript"></script>
        <script src="//some.domain.com/path/to/hls.min.js" type="text/javascript"></script>
        <script src="//some.domain.com/path/to/videojs-hlsjs-source-handler.min.js" type="text/javascript"></script>
    </head>
    <body>
        <video id="video" class="video-js vjs-default-skin" height="360" width="640" controls>
            <source src="//some.domain.com/path/to/manifest.m3u8" type="application/x-mpegURL"></source>
        </video>
        <script type="text/javascript">
            var player = videojs('video', {
                html5: {
                    hlsJs: {
                        debug: true
                    }
                }
            });
        </script>
    </body>
</html>

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

Release History

  • 2018-10-18 v1.4.0 Improved network error recovery when failing to load the manifest.
  • 2017-12-05 v1.3.0 Fixed bug where Hls.js might not start loading if autoStartLoad is false and _loadStarter is triggered before the lop level manifest is loaded.
  • 2017-11-22 v1.2.0 Added support for Video.Js 6 (Video.Js 5 still supported). && Fixed bug where Hls.js might not start loading if autoStartLoad is false and preroll ad timed out.
  • 2017-02-27 v1.1.0 Fixed publish configuration.
  • 2017-02-27 v1.0.8 Call startLoad() if autoStartLoad is false.
  • 2016-10-24 v1.0.7 Added option to disable source handler.
  • 2016-10-19 v1.0.6 Added license.
  • 2016-10-19 v1.0.5 README formatting.
  • 2016-10-19 v1.0.4 Updated README with npm installation and examples.
  • 2016-10-17 v1.0.3 Better network error handling.
  • 2016-10-14 v1.0.2 Correct seekable start point for DVR controls.
  • 2016-10-14 v1.0.1 Bugfix in recovery mechanism.
  • 2016-10-13 v1.0.0 Initial version.