Playing Windows Media Videos in Adobe AIR

WMV VideoYou may have been led to believe that you can’t play Windows Media files with AIR but that’s only partly true. I gave a session at MAX titled Leveraging PDF in AIR that I’ll be posting the slides for later today, but one of the results of that session is that with the magic of PDF, you can do all kinds of things people told you was impossible. One of those is embedding a Windows Media file into your AIR app.

It’s pretty straight forward because PDF has some video capability built in (Tools->Advanced Editing->Movie Tool in Acrobat Professional). As far as I can tell it uses the underlying player to actually render the video so this example only works if you have at least Acrobat Reader 8.1 and are running Windows (so that you have Windows Media). But if you really need to use your WMV assets in AIR, this might be the way to do it. I’m pretty sure you can programatically hide the chrome of your PDF so that all you see is the video, but I haven’t figured out how to do that yet. You can download the AIR file (do right click and save as) here to try it out and the PDF with WMV embedded. It’s a sweet video of me and James Ward promoing Josh Holmes’ Code to Live. Here’s the really intense code required to do this:

[code]

[/code]

Related posts:

  1. Flash Player and Vista not Playing Nice?
  2. Adobe Media Player Hooks in to the Flash Media Solution Provider Program
  3. Windows Presentation Foundation as Windows Live TV
  4. Windows Presentation Foundation Penetration Numbers May Get a Boost
  5. The Last of the Windows Operating Systems
  • http://www.savvasmalamas.com smalamas

    Hi Ryan.
    The links are broken..

  • http://www.syncrare.com/ Ken Azuma

    Wow, I’m surprised about this way. Thanks !

  • http://blog.xsive.co.nz Campbell

    Can AIR talk to the pdf scripting API (from memory I think its in Javascript)

  • http://blog.digitalbackcountry.com Ryan Stewart

    Whoops! Sorry guys, links are fixed.

    And yeah Campbell, you can talk to the PDF scripting engine. That’ll be part of my slides/session when I post them.

  • Mark

    Oh please, Oh please, post the slides!!!

    BTW, I can’t seem to get the code example to work. I keep getting a PDFError 2044 or something like that.

  • Pingback: rw_test » Blog Archive » Playing Windows Media Videos in Adobe AIR

  • Perry

    Are you really serious? This is how to do it?

    Can you imagine if Microsoft said to play QuickTime MOV files you had to embed a Word document and then access it through VBA macro?

    Come on guys, if you are going to go through the trouble of all that and it only works on Windows, why not use a Windows solution, Winforms, WPF, MFC, heck even VB6 can do it.

    Sorry man this is lame.

  • http://blog.digitalbackcountry.com Ryan Stewart

    Hey Mark, can you send me more info offline? I’m curious what the deal is.

    Perry, WMV isn’t supported in AIR, so don’t think of this as any kind of ‘official’ way to do this. I was just throwing it up as a fun example. No extra work went into this (which is why it doesn’t work on Mac). It’s just a showcase for what you can do inside of AIR when you’re leveraging plain-ol PDF reader.

  • Anonymous

    doesn’t work in Foxit Reader that’s what I use as PDF reader is way too bloated!