Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong JWPlayer provider & General player issues #10

Closed
Yokutto opened this issue Nov 7, 2018 · 17 comments
Closed

Wrong JWPlayer provider & General player issues #10

Yokutto opened this issue Nov 7, 2018 · 17 comments

Comments

@Yokutto
Copy link

Yokutto commented Nov 7, 2018

Hi, I tried to create a jwplayer instance in HLS with P2P, but it does not seem to work. In my tests the HLS is always loaded by the "provider.hlsjs.js" (default hls script of jwplayer), in the demo example i see that the segments are loaded by the initiator "p2p-media-loader-hlsjs.min.js". I can not see the difference between the test I did and the demo, could anyone explain what I did wrong?

Demo: https://jsfiddle.net/gkob21fv/1/
Browser: Chrome 70 win10

@mrlika
Copy link
Member

mrlika commented Nov 7, 2018

"@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.

@Yokutto
Copy link
Author

Yokutto commented Nov 8, 2018

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

@mrlika
Copy link
Member

mrlika commented Nov 8, 2018

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

@Yokutto
Copy link
Author

Yokutto commented Nov 8, 2018

Thank you, your help is very appreciated :)

@Yokutto Yokutto closed this as completed Nov 8, 2018
@Yokutto
Copy link
Author

Yokutto commented Nov 8, 2018

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

@Yokutto Yokutto reopened this Nov 8, 2018
@mrlika
Copy link
Member

mrlika commented Nov 9, 2018

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

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

@Yokutto
Copy link
Author

Yokutto commented Nov 9, 2018

Nothing changed :/

@Yokutto
Copy link
Author

Yokutto commented Nov 9, 2018

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

@mrlika
Copy link
Member

mrlika commented Nov 9, 2018

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/

@Yokutto
Copy link
Author

Yokutto commented Nov 9, 2018

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

@Yokutto
Copy link
Author

Yokutto commented Nov 9, 2018

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

@mrlika
Copy link
Member

mrlika commented Nov 9, 2018

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);

@Yokutto
Copy link
Author

Yokutto commented Nov 9, 2018

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/

@Yokutto
Copy link
Author

Yokutto commented Nov 10, 2018

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/

@Yokutto Yokutto changed the title Wrong JWPlayer provider Wrong JWPlayer provider & General player issues Nov 10, 2018
@mrlika
Copy link
Member

mrlika commented Nov 10, 2018

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

@jumpersdevice
Copy link

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

@mrlika
Copy link
Member

mrlika commented May 23, 2019

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

@mrlika mrlika closed this as completed May 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants