Evan
Evan

Reputation: 33

Problems playing MP4 videos on Android from Apache server

I'm having an issue when trying to play an MP4 video (using the HTML5 tag) using an Android web browser.

I've tried both just using the straight HTML5 and the Video.JS plugin (videojs.com) and am having the same issues in both cases. To describe what I'm seeing:

Videos on my site won't play when browsing from Android. I tap to play and get an error dialog box that reads "Cannot play video. Sorry, this video cannot be played."

When using Video.JS, I originally thought this might be a video encoding problem, so in an effort to try to isolate things, I grabbed the code and the video from the home page of videojs.com (which works fine on Android) and put them up on my test server (running apache). Things worked fine on iPhone but not on android.

As a second step, I put the same code and file grabbed from videojs.com and put them on a different dev server running IIS. From there, any Android I test with works great.

This implies to me that it's a server configuration problem, but this is where I'm stumped. I've got both apache and IIS configured correctly for the mime types for mp4 files (video/mp4). I've verified this by looking at the HTTP headers when requesting the file from both servers.

Does anyone have any ideas of what other settings to look at? Clearly the code is correct, and it works great from an IIS server, but for some reason when served from my Apache server it fails to play correctly on Android.

Any help is greatly appreciated.

Thanks,

Evan

Upvotes: 2

Views: 2383

Answers (1)

Kael
Kael

Reputation: 21

I was having the same issue, then I found out that Android doesn't like secure HTTP addresses. Once I removed the "s" from the HTTP link, presto it finally works. So your link should look something like this:

<video width='640' height='360' src='http://domain.net/video/640x360_example.mp4' type='video/mp4' id='player1' autoplay='autoplay' controls='controls' preload='none'></video>

Hopefully this helps you! I spent 10 months looking for this soltuion. :)

Upvotes: 2

Related Questions