Christian Heilmann

Posts Tagged ‘fix’

Fixing the embed code for my needs

Monday, June 13th, 2011

As you may have guessed from my talks and all I am a big fan of, a service that automatically converts uploaded videos to all kind of HTML5 compatible formats on the fly. I met with the owner for a coffee and they are overall good guys! Yesterday I realized though that they broke all my blog posts from the past where I embedded their videos as they changed their embed code!

OK, was beta when I used it and I should have read my email but it was annoying nonetheless. I contacted them and we are sorting things out. To recap: converts a video you upload to 13 different formats supporting all browsers, mobile devices and consoles. It creates a single URL that redirects you to the correct format of the video in accordance of the device or the browser used to request it. Awesome!

In the beta program all you had to do to embed a video in HTML5 compliant browsers was this:

<video src="" controls width="500">
<a href="">
Download &#8220;Multimedia on the web&#8221;

For some reason though this now sends my Firefox Aurora to the MP4 version which doesn’t work any more. I guess there is just a detection issue of Firefox Aurora. The official embed endorsed by is the following:

<iframe frameborder="0" width="640" height="360" name="vidly-frame"
<a target='_blank' href=''>
<img src='' />

The embeded.html file always loads a player to play the video that falls back to Flash in Firefox Aurora and Chrome. On Safari and Opera it uses the HTML5 native controls. I want that for all – why load an extra player and Flash when the browser is capable? So instead of using the official player I checked what URLs it generates and put in the URLs by hand:

<video width="500" height="375" controls style="display:block">
<source src="" type="video/mp4">         
<source src="" type="video/webm">         
<source src="" type="video/ogg">
<a target='_blank' href=''>
<img src='' width="500">

This is unfortunate, and it seems to be an issue with Aurora detection. The following works fine in Opera and Chrome and Safari.

<video width="640" height="360" controls 

I could also use this redirect URL to get formats, f.e. gets you the WEBM version.

Detecting the video capabilities of a browser seems to be still quite an annoying thing as you need to do it in JS and not by just reading the user agent on the server. To me, players should never fall back to Flash when the browser is capable of playing it natively – for the sake of accessibility.

Problems with the YouTube Chromeless player being unavailable? – Change the URL

Thursday, June 12th, 2008

I am almost ready to release v2 of the easy youtube player but out of a sudden everything stopped working. I thought at first my own developer key got banned for incessant re-loading locally, but even Google’s own example is broken.

The solution to it seems to be to change the URL of the embed code:

// broken
swfobject.embedSWF(‘ ... ‘)
// working
swfobject.embedSWF(‘ ... ‘)

Thanks do d.kunchev who pointed this out on the mailing list