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

jwplayer 6 multiple source tag


Hello,

I am trying to use playlists with JWPlayer6 in order to set multiple sources to a video. This is how I do:

jwplayer("myElement").setup({
playlist: [{
title: "test",
sources: [
{file: "http://localhost/jwplayer6/videos/test.webm"},
{file: "http://localhost/jwplayer6/videos/test.ogv"}
]
}]
});

However, I always get only one source in the video tag :

<video x-webkit-airplay="allow" src="http://localhost/jwplayer6/videos/test.webm"></video>



Is it the normal behavior ? Shouldn't I get something like:

<video x-webkit-airplay="allow" src="http://localhost/jwplayer6/videos/test.webm">
<source src="http://localhost/jwplayer6/videos/test.webm"></source>
<source src="http://localhost/jwplayer6/videos/test.ogv"></source>
</video>

11 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Yes, it will just pick one or the other, not both, to play.

hakm.madani

User  
0 rated :

Thanks for the answer.

The problem is that it always use the first playlist item for me.

For example, if I set an audio aac and mp3 source, I always get this:

<video x-webkit-airplay="allow" src="http://localhost/jwplayer6/videos/test.aac"></video>

which is not working in chrome.

Ethan Feldman

JW Player Support Agent  
0 rated :

It should pick the first playable item, though. Do you have an example link?

hakm.madani

User  
0 rated :

Yes : http://kalik.fr/jw_test/

Ethan Feldman

JW Player Support Agent  
0 rated :

Wrong mime type.

HTTP “Content-Type” of “audio/x-hx-aac-adts” is not supported. Load of media resource http://kalik.fr/jw_test/0012.aac failed.

hakm.madani

User  
0 rated :

Bonjour,

I think chrome is unable to play aac no matter what mime type is served, however, i set it to audio/mp4 as suggested in the documentation.

Now the error is "Error loading media: File could not be played"

If I set the mp3 source first, it works because chrome can play mp3.

Ethan Feldman

JW Player Support Agent  
0 rated :

I just put the file into – http://www.jwplayer.com/wizard/, and it seems to work. That aac file works fine there – http://kalik.fr/jw_test/0012.aac

hakm.madani

User  
0 rated :

I am using chrome Version 35.0.1916.153 m and it doesn't even work in the wizard for me :(

But, in my example i have 2 files, one of them should work.

I mean, if my browser can't play that aac file, why jwplayer doesn't download the mp3 file ?

Ethan Feldman

JW Player Support Agent  
0 rated :

Ah, then that means if the browser can’t play it, the player won’t be able to either. It won’t try to download that file though. Or you could try flash primary.

hakm.madani

User  
0 rated :

Okay, thanks for the help. I will check if the browser can play a file before to set it.

Ethan Feldman

JW Player Support Agent  
0 rated :

Np

This question has received the maximum number of answers.