php - html5 embed mp4 video | how to know if the device is an iphone 3/3gs or 4 | mp4 dimension are too big -


i have mp4 video embedded in html5. works on every browser , on iphone4 , ipad, not on iphone 3 , 3gs, cause dimension 900px*508px.

how can know in php (or replace entire video tag in javascript) on device (iphone4 or 3g/3gs) im gonna show page?

thanks lot in advance!

you can serve different video (with reduced size) using media attribute, e.g.

<video controls>    <source src="myfile.ogg" type="video/ogg">    <source src="myfile.ogg" type="video/ogg" media="(max-device-width: 300px)"> </video> 

you can read more here, scroll down "sending differently-compressed videos handheld devices".


Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -