html5 video - Force .webm instead of .mp4 -


i have video slider .webm,.mp4 & .ogv media formats. webm smaller size, want force use of .webm if browser/device can support format.

you can specify priority of formats way arrange source tags video. if browser supports first format listed use that, if not continue next , on.

example:

this try webm format first, if browser cannot play theora version tried , mp4 if didn't work either (finally fallback if none supported) (borrowed wikipedia) -

<video poster="movie.jpg" controls>     <source src="movie.webm" type='video/webm; codecs="vp8.0, vorbis"'>     <source src="movie.ogv" type='video/ogg; codecs="theora, vorbis"'>     <source src="movie.mp4" type='video/mp4; codecs="avc1.4d401e, mp4a.40.2"'>     <p>this fallback content display user agents not        support video tag.</p> </video> 

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -