My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Featured
Downloads
Links

Following code...

>>> import markdown
>>> url = "http://www.youtube.com/watch?v=ZlpbprBeN5M&hd=1"
>>> markdown.markdown(url, ['video'])

...produces this HTML minus indenting and newlines.

<p>
    <object data="http://www.youtube.com/v/ZlpbprBeN5M&amp;hd=1" height="344" 
        type="application/x-shockwave-flash" width="425">
        <param name="movie"
            value="http://www.youtube.com/v/ZlpbprBeN5M&amp;hd=1" />
        <param name="allowFullScreen" value="true" />
    </object>
</p>

You can also define the size of the object like so:

>>> markdown.markdown(url, ['video(youtube_width=853,youtube_height=505)'])

This extension supports the following services:

  • Blip.tv
  • Dailymotion
  • Gametrailers
  • Metacafe
  • Veoh
  • Vimeo
  • Yahoo! video
  • Youtube

NOTE: Blip.tv works a little differently than the others because there is no way to construct a working object with the player URL. Instead of the URL to the Blip.tv page, you will use the URL to the flv file, like http://blip.tv/file/get/Pycon-DjangoOnJython531.flv for example. This is located in Files and Links section of Blip.tv.

Powered by Google Project Hosting