October 30th, 2008
An addendum to the problems I was having with Plone and Flash Player 10. Looks like another problem occurs with Opera if you change the content disposition header to “inline”. Basically, screeds of nonsense displaying instead of the Flash movie or the fall-back image. I’m not sure how widespread this problem is and I’m not prepared to do lots of testing but for the record this was happening with Plone 2.5.3 / SWFObject to embed the Flash file. Various versions of Opera were tested — for instance I’m running version 9.10 on Windows.
I got round it with a bit of old-fashioned browser detection. Basically, Opera’s quite happy to have the content-disposition header left alone, so I needed a direct path to the Flash file for Opera and a path that took in my header setting script for everyone else:
if (navigator.userAgent.indexOf('Opera')>-1) {
swfurl = '&dtml-portal_url;/path/to/flash/myflash.swf' } else {
swfurl = '&dtml-portal_url;/path/to/flash/showflash?flashvid=myflash.swf'
}
swfobject.embedSWF(swfurl, "my-dom-id", "435", "290", "9.0.115");
Not sure why Opera should behave differently to other browsers here.
Tags: flash, plone
October 19th, 2008
Just been looking at the download statistics for my Plone themes via PyPi. I’m not sure how they should be read or if they’ve been skewed by me doing various tests, but they’re quite interesting:
I recently updated the source download for Hamnavoe which explains the discrepancy between Egg and source downloads for that theme, but in general it seems that the Eggs are the clear winners, which is due, I assume, to the themes being installed via buildout rather than direct download and installation via setup.py. Simplicity doesn’t even include a source download. I think this was to due to the fact that this was the first product I’d uploaded to PyPi and was having problems uploading it via setup.py from my Windows laptop, so I did the upload manually via the PyPi website.
I’m glad to see they’re being downloaded at all, and particularly pleased to see Hamnavoe on top as it’s my own design
As far as I know I can’t get these kind of stats for downloads via plone.org.
Tags: plone, plone-themes, plone3
October 17th, 2008
Another pyrrhic victory maybe, but something that has made me exceptionally happy this afternoon. Basically, yesterday I upgraded my version of Flash Player to version 10 only to find that the Flash files on our Plone-powered site no longer worked.
The lovely folks at SWFObject helped to identify why this was happening — nothing to do with SWFObject at all but the fact that Flash Player 10 implements some new security “features”. I managed to isolate it to the fact that Plone serves up ATFiles with the header, “Content-Disposition: attachment”. Flash Player 10 ignores files served up with this header, so you need to override this and set it to “Content-Disposition: inline;”.
I came up with this solution which may not be overly elegant but at least it works. I created a skin-level Python script that sets response headers before returning the file:
showflash.py
request = container.REQUEST
RESPONSE = request.RESPONSE
flashvid = request['flashvid']
cd = ‘inline; filename=%s’ %(context.id)
RESPONSE.setHeader(’Content-Disposition’, cd)
return context[flashvid]
Then, when I embed the video with SWFObject I call it thus,
<script type="text/javascript">
swfobject.embedSWF("&dtml-portal_url;/path/to/flash/showflash?flashvid=myflash.swf", "my-dom-id", "435", "290", "9.0.115");
</script>
This may be better handled by a product like Plone4Artists Video but it certainly works as a fix for us.
Tags: UI, flash, plone, web design, web development, zope