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

v1.4.8

Published

hls.js playback plugin for videojs

Downloads

203

Readme

Videojs hls.js Plugin

An HLS plugin for video.jas based on hls.js

Videojs hls.js offers hls playback using hls.js. For more details on browser compatibility see th hls.js github page.

Getting Started

Download videojs-hlsjs and include it in your page along with video.js:

<video id="video" preload="auto" class="video-js vjs-default-skin" controls>
    <source src="http://www.streambox.fr/playlists/x36xhzz/x36xhzz.m3u8" type="application/vnd.apple.mpegurl">
</video>
<script src="hlsjs.min.js"></script>
<script src="video.min.js"></script>
<script src="videojs-hlsjs.min.js"></script>
<script>
    var player = videojs('video', {
        // hlsjs tech should come before html5, if you want to give precedence to native HLS playback
        // use the favorNativeHLS option.
        techOrder: ["hlsjs", "html5", "flash"]
    });
</script>

There's also a demo of the plugin that you can check out.

Changelog

  • 1.4.5: Added text and audio tracks compatibility.

Documentation

Dependencies

This project depends on:

CORS Considerations

All HLS resources must be delivered with CORS headers allowing GET requests.

Options

You may pass in an options object to the hls playback technology at player initialization.

hlsjs.favorNativeHLS

Type: Boolean

When the favorNativeHLS property is set to true, the plugin will prioritize native hls over MSE. Note that in the case native streaming is available other options won't have any effect.

hlsjs.disableAutoLevel

Type: Boolean

When the disableAutoLevel property is set to true, the plugin will completely disable auto leveling based on bandwidth and remove it from the list of available level options. If no level is specified in hlsjs.startLevelByHeight or hlsjs.setLevelByHeight the plugin will start with the best quality available when this property is set to true. Useful for browsers that have trouble switching between different qualities.

hlsjs.startLevelByHeight

Type: Number

When the startLevelByHeight property is present, the plugin will start the video on the closest quality to the specified height but the auto leveling will still be enabled unless hlsjs.disableAutoLevel was set to true. If height metadata is not present in the HLS playlist this property will be ignored.

hlsjs.setLevelByHeight

Type: Number

When the setLevelByHeight property is present, the plugin will start the video on the closest quality to the specified height. The auto leveling will be disabled but it will still be selectable unless hlsjs.disableAutoLevel was set to true. If height metadata is not present in the HLS playlist this property will be ignored.

This property takes precedence over hlsjs.startLevelByHeight.

hlsjs.hls

Type object

An object containing hls.js configuration parameters, see in detail: Hls.js Fine Tuning.

Exceptions:

  • autoStartLoad the loading is done through the preload attribute of the video tag. This property is always set to false when using this plugin.
  • startLevel if you set any of the level options above this property will be ignored.

Event listeners

This plugin offers the possibility to attach a callback to any hls.js runtime event, see the documetation about the different events here: Hls.js Runtime Events. Simply precede the name of the event in camel case by on, see an example:

var player = videojs('video', {
    hlsjs: {
        /**
         * Will be called on Hls.Events.MEDIA_ATTACHED.
         *
         * @param {Hls} hls      The hls instance from hls.js
         * @param {Object} data  The data from this HLS runtime event
         */
        onMediaAttached: function(hls, data) {
            // do stuff...
        }
    }
});

Original Author

This project was orginally forked from: videojs-hlsjs, credits to the original author.