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

JW Player with HTML5 support


I know this question has been asked many times here, but I could not come to a standard solution from them. So need help.

I simply need to show my .mp4 videos in jwplayer 5.10, such that it will show in flash version where it gets flash otherwise in html5 version.

Here's my code :

jwplayer("video_holder").setup({
'height': '300',
'width': '100%',
modes: [
{ type: "flash",
src: "player.swf",
config: {
file: "http://example.com/path/to/video.mp4",
}
},
{ type: "html5",
config: {
file: "http://example.com/path/to/video.mp4"
}
}
]
});

FYI : I am converting all my videos in .mp4 format, using ffmpeg, libx264 It does not load the video in Chrome and IOS, works with flash in FF.

What am I doing wrong here?

10 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Can you provide a link?

M...

User  
0 rated :

You're making it much more complicated than it really is. Here's a simple demo page that does what you want.

http://misterneutron.com/JW5video/

Ethan Feldman

JW Player Support Agent  
0 rated :

Yeah, you don’t really need to use modes if you are using the same MP4 for both modes.

p...

User  
0 rated :

@MisterNeutron: This configuration does play in all the desktop browsers, but not in IOS safari. It shows me:

"This video could not be loaded, either because the server or network failed or because the format is not supported"

Is there a problem with my .mp4 file? As I said I am converting all other video file formats to .mp4 via ffmpeg service using the
"libx264" codec. Is there any other specification about how to do it?

Thanks for all of your feedbacks though...

p...

User  
0 rated :

Yes, it IS an encoding problem, that's for sure. However, is there some guide about the audio/video codecs that this player can play for an mp4 file?

Ethan Feldman

JW Player Support Agent  
0 rated :

Here is some help – http://www.jwplayer.com/blog/supporting-mobile-video-on-your-site/

Also, we have a reference here – http://support.jwplayer.com/customer/portal/articles/1403635-media-format-support

pratip17.ghosh

User  
0 rated :

Thanks, but Handbrake is not a solution as I need to do the video conversion internally and using ffmpeg.

Ethan Feldman

JW Player Support Agent  
0 rated :

Then there has to be a different setting within ffmpeg that should be used.

pratip17.ghosh

User  
0 rated :

Yep, it plays fine with the jwplayer configuration made by MisterNeutron. It seems the problem was for some reason, the player was not able to access the videos in my local machine (may be some problem with permission, will investigate later). However it played fine in my DEV server.

In case someone stumbles upon this post and want a better explanation:

I am converting all user uploaded videos to mp4 extension to be played by jwplayer in flash version and html5 video on fallback. The ffmpeg video conversion script is like follows:

ffmpeg -y -i 'input_file' -c:v libx264 -crf 23 -profile:v baseline -c:a aac -strict experimental 'output_file'

Hope this helps somebody and thanks a lot for your help.

Ethan Feldman

JW Player Support Agent  
0 rated :

Thanks for sharing, glad you got it.

This question has received the maximum number of answers.