Getting Flowplayer up and running on the site was not quite as smooth as the nice web-site and clean API suggested. I’ll be documenting the whole gory process in the ‘Building a Website (with Python, jquery etc..)’ series, but in the meantime I’ll mention the hideous hackery needed to get over the final hurdle that is Internet Explorer 7.
Somewhere along the line I was looking to pass a web-address, as part of an html overlay, into the flash-player. This has the standard form:
Now if one tries to pass that string into a flashplayer, all hell will break loose. Some of those symbols are going to be interpreted as controls rather than nice, neutral characters. For this reason they need to be ‘escaped’, and Turbogears provides a nice little function “quote_plus”, via Python’s urllib, to do just this. The result is this rather scary looking string:
This string makes it through the flash-player in all the browsers we’re interested in at Showmedo and produces a clickable flash-overlay which, strangely enough, takes one through to the page in question. Er, except (and twas ever thus), IE7 (not 8 <sigh>), where, when all the escape-artistry has taken place, we find ourselves directed to this non-existent page:
which is a very poorly URL indeed.
Now I’m guessing that somewhere at the heart of this is the issue of absolute and relative web-addresses. The second ‘http://…’ should be interpreted as an absolute address, but those unicode escape-characters have confused the system, making it treat the URL as relative, thus adding another root-url.
If I had time to explore this horror I would probably spend it doing something else, but in these time-starved times I just did a little bit of playing around and added a hack-function which undoes the ‘:’ and ‘/’ escapes of “quote_plus”, producing this:
Which makes it through the browser minefield, but, as seems so often the case with this messed up web-development world, at the cost of some serious inelegance.If you enjoyed this post, make sure you subscribe to my RSS feed!