Code Monkey home page Code Monkey logo

Comments (17)

mrlika avatar mrlika commented on June 30, 2024 1

You have to configure P2P Hls.js Engine instance like this:

var engine = new p2pml.hlsjs.Engine({
  loader: {
    trackerAnnounce: [ "wss://tracker1.xyz/", "wss://tracker2.com/" ]
  }
});

Engine configuration documentation:
https://github.com/Novage/p2p-media-loader/tree/master/p2p-media-loader-hlsjs#engine--new-enginesettings

HybridLoader settings documentaion (i.e. loader section of settings object):
https://github.com/Novage/p2p-media-loader/tree/master/p2p-media-loader-core#loader--new-hybridloadersettings

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

"@hola.org/jwplayer-hlsjs" is not initialized. You have to add https://cdn.jsdelivr.net/npm/hls.js@latest script.

Then in a browser's console you will see 'init hola/hls provider v0.0.79 hls v0.11.0' message. It means that the provider is initialized.

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

Thanks, that worked.

Another question, I have some configurations from my old HLS provider and I would like to make some changes to the P2P configuration (like changing the tracker). But I could not change the default settings for HLS and P2P. Can you give me a little help with that? I do not have an intermediate knowledge in javascript
I read the explanation at https://github.com/Novage/p2p-media-loader/tree/master/p2p-media-loader-core#p2p-media-loader-core, but I did not quite understand

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

Thank you, your help is very appreciated :)

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

I reopened this to ask one more info.
How can I get the player to give more buffering (up to 60 seconds of video)? After I implemented the script, I noticed that at the beginning of the video buffering can not get past 1 second, and sometimes this causes a "lag" even without having problems with server-user.

I'm using this:
p2pml.hlsjs.initJwPlayer(player, { maxBufferSize: 100*1000*1000, maxBufferLength: 300, maxMaxBufferLength: 500, loader: engine.createLoaderClass() });

but it does not seem to have any effect

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

You have to use liveSyncDuration parameter of Hls.js playback engine. It is in seconds.

p2pml.hlsjs.initJwPlayer(player, {liveSyncDuration: 60, loader: engine.createLoaderClass() });

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

Nothing changed :/

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

It seems that the script is using the standard HLS settings of jwplayer (with very low buffer). But by the console, who is loading the segments is the "p2p-media-loader-hlsjs.min.js"

image

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

Most likely buffering issues are related to Hls.js engine itself.

You have to test it with raw Hls.js without P2P and player integrations. And if it doesn't work as expected report issues to Hls.js project.

You can use this fiddle as the base for your testing: https://jsfiddle.net/yhLnqu3t/

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

I get this result running only hls.js, without P2P script. I think "p2p-media-loader-hlsjs.min.js" is not interpreting the hls.js settings. The settings of the script itself work (such as changing the tracker), only the hls.js settings have no effect.
image

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

I make this fiddle if you want to view what i'm saying: https://jsfiddle.net/hmyapb2n/1/

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

There is another way of initialization that should be more correct. Please check if it works for you. Also it will output hls.js configuration into console:

var engine = new p2pml.hlsjs.Engine();
var player = jwplayer("player");

player.setup({
  autostart: true,
      sources: [{
        file: "https://wowza.peer5.com/live/smil:bbb_abr.smil/playlist.m3u8",
         type: "mp4"
      }],
});

player.hola_config = {
  	liveSyncDuration: 60,
    loader: engine.createLoaderClass()
};

var provider = require("@hola.org/jwplayer-hlsjs");
provider.attach();

p2pml.hlsjs.initJwPlayer(player);

setTimeout(() => console.log(player.hls.config), 2000);

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

No results. Something is stucking "maxBufferLength" to 30 seconds, like the jwplayer default hls provider. In console, the config is showed as expected. But in player don't work :/
https://jsfiddle.net/hmyapb2n/2/

from p2p-media-loader.

Yokutto avatar Yokutto commented on June 30, 2024

I see other issue here. When the jwplayer is configured to show ads with VAST (not tested with google IMA), the player dies with error "Error in "time" event handler: TypeError: Cannot convert undefined or null to object". The player also does not save the quality and audio settings, and I saw that in later versions the subtitles also do not work as they should. Apparently these problems are from the holajs provider. Is there any way to use another HLS provider?

Advertisement test: https://jsfiddle.net/hmyapb2n/4/

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

Looks like the problems go from hola HLS provider.

P2P Media Loader supports hls.js and Shaka Player playback engines. We can integrate with players that use one of these playback engines built-in or via a plugin.

In the case of JWPlayer we found only this plugin that works via hls.js

from p2p-media-loader.

jumpersdevice avatar jumpersdevice commented on June 30, 2024

Hi Yokutto, how do you check if liveSyncDuration setting is applied? I just tried mrlika's example and it worked. But would like to see what you're getting and how did you solve it if you did?

thanks

from p2p-media-loader.

mrlika avatar mrlika commented on June 30, 2024

Can't reproduce the issue - JWPlayer requires a paid plan to display VAST. Open source JWPlayer has no VAST support.

from p2p-media-loader.

Related Issues (20)

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.