johndyer/mediaelement — Issue #360: Unable to Play Video on iPhone IOS 3.1.3 (from master branch)
Author: andrewringler
Created: 2012-01-14 18:37:59+00:00
State: open

I have an original iPhone running IOS 3.1.3 and I am having difficulty getting videos to play with mediaelementjs.

Taking a look at Apple's example here: http://www.apple.com/html5/showcase/video/ they have a simple video tag that looks like this (added ... for brevity):

Now this video actually plays fine on IOS 3.1.3 and despite the IOS 3.X poster bug, the poster actually shows up 100% of the time.

When I try to add mediaelementjs however this video no longer plays on IOS 3.1.3. What seems to be happening is that mediaelementjs is adding the URL of the first element to the video tag src attribute so inspecting the DOM with medialelementjs running we have something like:

Some experimentation seems to reveal that when a src attribute is present in the video tag, even if my iPhone fails to be able to play that video it will not inspect the additional elements, so the video will fail to play. Now, looking back at Apple's example above, what is interesting is that all of the attributes have type with codec defined. It seems that my iPhone will ignore tags if the codecs is defined on them and happily skip down to the .mov and play it. Notably the .mov element has no type at all defined on it.

Anyways, IOS 3.1.3 seems extremely finicky playing s, so I am not sure what the best approach should be, if a robust solution exists at all. Let me know if you want me to test anything.

Thanks,

Andrew