codemonkey
codemonkey

Reputation: 7905

video tag not playing a video/webm file in Safari

I have tried the solutions outlined here: HTML5 videos not working in Safari Video tag not working in Safari now

without any success.

Here is what I have: <video controls class="video" autoplay loop poster="video/Innocence.jpg" data-setup="{}"> <source src="video/main-vid.webm" type="video/webm"> </video>

Plays in Chrome and FF, but not Safari. So my iPhone does not play it. Does anyone have any suggestions?

Upvotes: 5

Views: 17290

Answers (1)

jrrdnx
jrrdnx

Reputation: 1585

WebM video format does not appear to be currently supported by Safari: http://caniuse.com/#feat=webm

To reach the widest audience, you'll want to use MP4, Ogg, and WebM formats:

<video controls class="video" autoplay loop poster="video/Innocence.jpg" data-setup="{}">
    <source src="video/main-vid.mp4" type="video/mp4" />
    <source src="video/main-vid.ogv" type="video/ogg" />
    <source src="video/main-vid.webm" type="video/webm" />
</video>

Note that the MP4 source should be listed first to work in older versions of iOS.

Upvotes: 3

Related Questions