JWPlayer HLSJS Provider

See original GitHub issue

I have made a github repository for the jwplayer provider, you can find it here:

github: https://github.com/Teranode/jw-provider

cdn: https://cdn.jsdelivr.net/gh/teranode/jw-provider@v0.0.1/provider.hlsjs.js

This features the full hls.js API support rather than the limited scope of functions directed by the original jwplayer provider. So you can configure all of what hls.js uses.

This also works with the external hls.js file, but can also use the internal one provided by jwplayer

Installation: append the cdn (or your own self-hosted copy) “before” the jwplayer file (might work after too but to be on the safe side load it before).

afterwards you will condifure p2pml (example):

const iid = setInterval(() => {
    if (window.player.hls && window.player.hls.config) {
        clearInterval(iid);
        p2pml.hlsjs.initHlsJsPlayer(window.player.hls)
    }
}, 200)

I’ll be providing updates as the jwplayer release schedule increments. This is currently compatible with JWPlayer 8.18.4

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:4
  • Comments:25

github_iconTop GitHub Comments

1reaction
Teranodecommented, Feb 5, 2021

player.hls.config = { liveSyncDurationCount: 7, loader: engine.createLoaderClass() }

You can add config through hlsjsConfig when setup player. Using hlsjsConfig will keep default hls config without override like using player.hls.config = { liveSyncDurationCount: 7, loader: engine.createLoaderClass() } Ex:

if (p2pml.hlsjs.Engine.isSupported()) {
    var engine = new p2pml.hlsjs.Engine();

    var player = jwplayer("player");

    player.setup({
        preload: "auto",
        file: "http://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.m3u8",
        hlsjsConfig: {
            liveSyncDurationCount: 7
            loader: engine.createLoaderClass(),
        },
    });

    const iid = setInterval(() => {
        console.log(player.hls);
        if (player.hls && player.hls.config) {
            clearInterval(iid);
            p2pml.hlsjs.initHlsJsPlayer(player.hls)
        }
    }, 200);
} else {
    document.write("Not supported :(");
}

doing this fixed the change quality change. not really sure why but thanks. 😃

right sorry about that i forgot to say that you needed to add this to the player setup:

        hlsjsConfig: {
            liveSyncDurationCount: 7
            loader: engine.createLoaderClass(),
        },
1reaction
hoangvietfreelancercommented, Feb 5, 2021

player.hls.config = { liveSyncDurationCount: 7, loader: engine.createLoaderClass() }

You can add config through hlsjsConfig when setup player. Using hlsjsConfig will keep default hls config without override like using player.hls.config = { liveSyncDurationCount: 7, loader: engine.createLoaderClass() } Ex:

if (p2pml.hlsjs.Engine.isSupported()) {
    var engine = new p2pml.hlsjs.Engine();

    var player = jwplayer("player");

    player.setup({
        preload: "auto",
        file: "http://demo.unified-streaming.com/video/tears-of-steel/tears-of-steel.ism/.m3u8",
        hlsjsConfig: {
            liveSyncDurationCount: 7
            loader: engine.createLoaderClass(),
        },
    });

    const iid = setInterval(() => {
        console.log(player.hls);
        if (player.hls && player.hls.config) {
            clearInterval(iid);
            p2pml.hlsjs.initHlsJsPlayer(player.hls)
        }
    }, 200);
} else {
    document.write("Not supported :(");
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

hola/jwplayer-hlsjs: hls.js provider for jwplayer - GitHub
hls.js provider for jwplayer. Contribute to hola/jwplayer-hlsjs development by creating an account on GitHub.
Read more >
getProvider() - JW Player
Returns the provider being utilized by JW Player for a particular media file. ... hlsjs, HLS content rendering with HLS HTML5 provider.
Read more >
@hola.org/jwplayer-hlsjs examples - CodeSandbox
Learn how to use @hola.org/jwplayer-hlsjs by viewing and forking example apps that make use of @hola.org/jwplayer-hlsjs on CodeSandbox. ; Latest version0.0.79.
Read more >
Player Integration | P2P Streaming Engine
JWPlayer Hlsjs Provider --> <script src="//cdn.jsdelivr.net/npm/cdnbye@latest/dist/jwplayer.provider.hls.js"></script> <!-- JW Player Builds --> <script ...
Read more >
Index of /webcasting/jwplayer-8.13.0/
Name Last Modified Size translations 2021‑10‑15 11:21 ‑ provider.airplay.js 2021‑09‑15 19:26 4k polyfills.intersection‑observer.js 2021‑09‑15 19:26 8k
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found