Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Changing source/file from hosted video to youtube video results in 'no suitable providers' error.


Good afternoon,

I have been using a local installation of JWPlayer for a site I am working on that requires the ability to swap video sources dynamically.

The project requires the ability to set both the initial video source (inside .setup()) or the new video source (inside .load()) to be either locally hosted videos (e.g. .mp4) or a youtube link.

When the initial source is set as a hosted video, and the .load() method is called with a youtube video as the file/source, the player errors, printing "no suitable provider found" in the JS console.

I have managed to narrow down the issue to the fact that when the player is initiated (.setup()) with a locally hosted video, the list of suitable providers does not include youtube as a provider.

However, when attempting to swap the source for a youtube video, the list of suitable providers is not changed/updated to account for the new source, and thus does not include 'youtube', causing the error and the player to not play the new source.

Is there a way to define a list of suitable providers myself?

Thanks a lot, I can provide more details if needed.

2 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi, Chris.

My name is Alex and I am one of the Support Engineers at JW Player. I will be more than happy to assist you with your questions.

I know your page is hosted locally, but is there any way you can provide me the source code of your page so I may take a look?

Thanks.

c...

User  
0 rated :

Sure, here's what I've written to instantiate the player;

drawJWPlayer: function(video_url, image_url) {

this.player_instance = jwplayer('video-player');
this.player_instance.setup({
file: video_url,
image: image_url,
width: '100%',
height: $('.page-banner').height(), // if set to 100%, bugs occur on iOS safari
stretching: 'fill',
skin: {
name: "my-skin"
},
events: {
***STUFF***
}
}
});

And then here is where I attempt to swap out the video with .load():

showreel.source can be either a url to a locally hosted file (with e.g. .mp4 extension) or a youtube video URL, as with video_url above.

NEWICON_VIDEO.player_instance.load({
file: showreel.source,
image: showreel.poster,
autoplay: true
});

The load event gets called on user interaction with some custom navigation, where you click the thumbnail of a video and the video is loaded into the player. The player_instance is always initiated on page load.

As I mentioned above, if a locally hosted file is passed into .setup() (inside video_url var) and then a youtube video is passed as showreel.source in .load() then the youtube provider is not known in the list of suitable providers.

This is a rather large client site, so providing the source isn't particularly feasible outside of the immediately relevant functions.

This question has received the maximum number of answers.