Hi! I'm Nathan Hoad


Moredown: Now with SwfObject support

After adding generic Flash movie support to Moredown I received a comment on Twitter from @simultech suggesting that I use SwfObject. At first I wasn't sure how to include SwfObject support because it appeared to mean adding a dependency on external Javascript as well as duplicating a small amount of existing functionality.

I decided that the best way to approach the idea was to replace the existing/duplicated functionality with something that would work with or without SwfObject Javascript. The duplicated concepts mainly dealt with replacing things like Youtube with preview images so I changed them to be handled somewhat automatically. The options :replace_flash_with and :youtube_as_images are no longer available as a result. Now, Flash movies should be visible if Flash is available and a fallback should display if Flash is not available.

If you are using SwfObject then you can tell Moredown about it like this:

Moredown.new('![Some Flash movie](flash:/media/some-movie.swf)', 
             :swfobject => { :src => 'path/to/swfobject.js', 
                             :version => '10',
                             :fallback => 'Flash is not available.' })

Moredown uses SwfObject's static publishing method of embedding Flash content. For more information about it have a look at their documentation.

If I just made your day a little better then thank me with a coffee or maybe a a pizza