I am a designer who has previously only worked on non-mobile sites and I am just finishing off my first responsive site which has come out ok. I have just one question.
Does html5 video work on all smartphones and what is the procedure for embedding a youtube html5 video onto my site. I only want it to show below a certain screen width because I have some other media which I show in its place on bigger screen devices - tablet and up.
Do I need some JavaScript to stop it from loading unless on a mobile screen width, or will setting it to display:none in the relevant media queries suffice?
Android devices are notoriously fickle when it come to HTML5. HTML5 features are not accepted across the board. I avoid the whole problem by simply linking my users to the YouTube page that hosts the video.
Thanks for your reply
Will I need to use js to conditionally embed the code if it is supported? I am pretty good with jquery so if you could give me a rough description, I’m sure I can figure it out.
That’s ok thanks anyway Steven, well from what I’ve worked out if you’re doing everything from a responsive design angle, you could use jquery and do something like:
if($.document.width() < minwidth)
{
//add the video to the DOM
}
For the most recent responsive site I did I used HTML 5 video and tested it on Android, iPhone (ver 3/4/4s), Palm Pre, and BlackBerry Bold and It worked really well.
The biggest challenge was finding the correct encoding for all the different video streams. I eventually found people on the Internet that had published optimal setting and then combined these into a Video document that I referred to when compressing the video.
This video resizes with the browser so it will automatically adapt to landscape or portrait on smart phones and on Tablets.
HTML5 is actually pretty consistent on all mobile platforms from iOS to Android to Windows Phone 7. I think when you get to using flash, it is a lot more tricky even on Android. Embedding presents a lot different issue all in itself. I recommend the linking process which allows the phones to use their native media players to play the content.