cyprich.com

Occasionally Relevant Insights from a Software Builder

By

Dynamic Video Player Selection with iframe Embeds

Its a real challenge providing a video on your web site that can be viewed on any device accessing it, i.e. desktop computer, smart phone, PDA, or tablet. HTML5 is gaining ground against Flash, but not all devices will support this format and may only have one type of video player installed. A computer that does not have the correct version of Flash will not be able to play certain Flash videos.

The solution to make videos cross platform is iframe embedding. This will allow a device to choose the right player for a video embedded on a web site.

iframe Embed on YouTube

A video can be embedded in YouTube with the following code:

<iframe class="youtube-player" type="text/html" width="640" height="385"
        src="http://www.youtube.com/watch?v=bu06YnJlmiQ?fs=1&amp;h1=en_US" frameborder="0>
</iframe>http://www.youtube.com/v/bu06YnJlmiQ?fs=1&amp;hl=en_US

The URL in red is the URL of the video on YouTube. You need to include ?fs=1&amp;hl=en_US after the video URL otherwise the HTML page will be embedded in the page as opposed to just the video.

The following is an example of iframe embedding.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>