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

Multiple <source>s in <video> tag using JW Player 5.9


Hi,

I am trying to use HTML Videos using JW Player 5.9.

bc.. <video height="325" width="450" id="1234" poster="testimage.jpg">

<source src="/videos/video_1.mp4" type="video/mp4">

<source src="/videos/video_2.webm" type="video/webm">

<source src="/videos/video_3.flv" type="video/x-flv">

</video>



This works fine in FF, Chrome, IE7 and IE8. However IE9 is causing a problem, the video does not play. I was under the impression that if the browser does not support the mp4 or webm it should fall back to flash?

Can someone please help with this?

Something awkward I have found with this is when I remove the two other source tags for .mp4 and .webm and just keep the .flv it works fine?

Any ideas would be much appreciated.

Regards,
Ibrar

18 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

The best way to do this is using levels.

http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/15995/jw-embedder-reference-guide#levels

JW Player

User  
0 rated :

Thanks Ethan,

I have managed to get it working using your suggestion of levels like so:

[code]
<div id="flash-container">Loading the player...</div>

<script type="text/javascript">
jwplayer("flash-container").setup({
flashplayer: "/Images/Player.swf",
height: 325,
width: 450,
image: "/Images/Image.png",
levels: [

{ file: "/Video.mp4" } ,

{ file: "/Video.webm" } ,

{ file: "/Video.flv" }

]
});
</script>
[/code]

My only issue with this is that it doesn't play as HTML5 by default, I have to disable flash for it to work. I have looked at the link you sent and looked at the use of "modes". When I use modes however the player does not work at all in IE9.

Can you shed any light on this?

Many thanks,
Ibrar

JW Player

User  
0 rated :

If it is definitely modes that will fix this problem, then can you please point me in the right direction of how the markup needs to be setup to play html5 by default with multiple files?

I tried with this and didn't work:

bc.. <div id="flash-container">Loading the player...</div>
<script type="text/javascript">
jwplayer("flash-container").setup({
height: 325,
width: 450,
image: "Image.png",
levels: [

{ file: "Video.mp4" } ,

{ file: "Video.webm" } ,

{ file: "Video.flv" }

],
modes: [
{ type: "html5" },
{ type: "flash", src: "Player.swf" },
{ type: "download" }
]
});
</script>



The above works when I use this in Chrome and FF and defaults to HTML5. IE7 and IE8 fallback to Flash which is perfect. But in IE9 I just get the "Loading the player..." message.

I have no idea why this doesn't work?

Any suggestions would be much appreciated.

Regards,

Ethan Feldman

JW Player Support Agent  
0 rated :

That should work fine, but I would recommend removing FLV from the mix, as Flash handles MP4 just fine. Can you try that? If that doesn’t work, provide a link, thanks.

JW Player

User  
0 rated :

can someone help with a code to switch playlist .Not the admin ... the end user to be able to load a new playlist from the playlists on the right ... thetubemedia.com so .. a default playlist is always on homepage (auto start when entering)but the users can enjoy this playlist ,click and see the others playlists but not being able to play them .. this is what i want to fix .. so each user to be able to load any playlist from playlist categories.
cheers

Ethan Feldman

JW Player Support Agent  
0 rated :

Sorry, can you clarify what you are asking here?

JW Player

User  
0 rated :

Please try to understood what exactly i am asking for ... so go to WEBSITE GIVEN .. , and if you have the flash installed a playlist will auto.start ... RIGHT ...? ok .. so i want the users to be able to start another playlist from the list ... as at the moment if you click another playlist .. you need to click each song individual ... so acting as a list and not a playlist .. i hope you understood what exactly i want.so GO TO SITE AND TRY TO PLAY YOURSELF ANY PLAYLIST FROM CATEGORIES .. TELL ME IF WORKS FOR YOU :).

Ethan Feldman

JW Player Support Agent  
0 rated :

So you mean like this? – http://www.longtailvideo.com/support/jw-player/jw-player-for-flash-v5/24/creating-a-playlist

JW Player

User  
0 rated :

Hey There! I'm also playing around with the HTML5 <video> Tag. Sadly, my content video will only start in Chrome but not in Firefox, even though I provided a WebM File as well, it should work like this or?

bc.. <video
height="380"
width="640"
poster="Content/html5test.jpg"
id="player">
<source src="Content/content2-mp4.mp4" type="video/mp4">
<source src="Content/content1-webm.webm" type="video/webm">
</video>

<script type="text/javascript">
jwplayer("player").setup({
modes: [
{ type: "html5" },
{ type: "flash", src: "player.swf" }
]
});
</script>



Using levels would mean to not use the <video> Tag anymore correct? Is that how its supposed to be? Is it still a HTML5 Player then without using the <video> Tag? Don't get that part yet :)


Thanks and Cheers
Chris

Ethan Feldman

JW Player Support Agent  
0 rated :

If you use levels, the player will generate the <video> tag when HTML5 mode is used ;) the embedder does this automatically.

JW Player

User  
0 rated :

Thanks for getting back to me.

I think that my problem is actually that the server which stores my player, video files etc has a problem with the WebM MIME Type.

Just a general question: Why should I use levels if the <video> tag with multiple sources also checks for the correct file? "Every HTML5 browser will scan through these tags top to bottom, until it finds a video it can play. "

Any particular advantages with levels?


Cheers
Chris

Ethan Feldman

JW Player Support Agent  
0 rated :

Ah, that would be it, MIME-TYPEs are important.

Levels is pretty much doing the same thing as multiple sources for the <video> tag, actually.

Ethan Feldman

JW Player Support Agent  
0 rated :

HTML5 ads with OVA are not yet supported. Soon, though!

JW Player

User  
0 rated :

Oh gosh and I've been trying to get it to work for hours :D

Can you estimate a timeframe maybe?

But my setup looks ok? It should work like that right?


Thanks,
Chris

JW Player

User  
0 rated :

Ah btw I just noticed that I'm not able to edit my message here.. could you please delete the Link from my last post?

And maybe you could also drop a mail (as seen on the player start screen) so we can get in direct contact if thats ok`?


Thanks
Chris

Ethan Feldman

JW Player Support Agent  
0 rated :

Hi Chris,

I deleted it for you.

It is about 8-12 weeks out I’d say (rough ETA)

http://www.longtailvideo.com/support/contact-us

Best,
-Ethan

JW Player

User  
0 rated :

Alright, thanks!

Go ahead and delete the other posts as well as they are out of context now :)

Ill wait then.


Cheers
Chris

Ethan Feldman

JW Player Support Agent  
0 rated :

Cheers, np

This question has received the maximum number of answers.