[Baypiggies] How to embed Flash Player Controls within a Pythonapp...

Bob Ippolito bob at redivi.com
Thu Mar 1 03:13:42 CET 2007


On 2/28/07, Dennis O'Brien <DOBrien at leapfrog.com> wrote:
> > From: baypiggies-bounces at python.org
> [mailto:baypiggies-bounces at python.org] On Behalf Of Douglas Kennedy
> > Sent: Thursday, February 22, 2007 6:11 PM
> > To: baypiggies at python.org
> > Subject: [Baypiggies] How to embed Flash Player Controls within a
> Pythonapp...
> >
> >
> > Hi Python users,
> >
> > I am seeking some help or at least direction.
> >
> > I am developing a python application that is a learning center.
> >
> > Part of the requirement is that it not be browser based.
> >
> > Python seems to a practice choice so far.
> >
> > The videos and screencast videos are going to be produced
> > using the Camtasia Studio also requirement in a FLV/SWF format.
> >
> > The learning center application needs to have embedded within
> > its screen the video window. Found wxpython that allows the video
> > to be called from a python.
> >
> > The problem is that have not found any way to control the video?
> > Typical controls play,stop, pause,rewind, fast forward etc...
> >
> > Maybe I am missing it I have not found the controls within python
> > or wxpython to control a flash video.
> >
> > Well, Python users any direction?
> >
> > Your help is and will continue to be appreciated.
> >
> > thanks,
> >
> > Doug
> >
> >
> > P.S... I have been using this list for a couple of years now and it
> has
> > been of benefit in many ways thanks. I hope to in the future enjoy
> your gatherings...
>
> Hi Doug,
>
> This might be more of a Flash ActionScript question than a Python
> question.  ActionScript has a class called ExternalInterface which
> allows two way communication between Flash and the hosting application
> (web browser, wxPython, whatever).  There is a simple how-to with sample
> code in several languages (including Python) over at OSFlash.org (a
> great mailing list about Flash and Open Source)
> http://osflash.org/ext_howto
>
> Googling 'flash python externalinterface' will give you a lot of useful
> ideas as well.
>
> Hope this helps.

A possibly less painful way to do it would be to simply take advantage
of the XMLSocket support that Flash has and write a little TCP socket
server in Python that it connects to on loopback. The protocol is
really simple: null terminated XML documents (or null terminated
strings if you go down to onData). It's likely to be a lot more
straightforward that going through the Flash 8 ExternalInterface
stuff.

Regardless of what you do, you'll probably need to author a container
SWF file that enables the communication. MTASC (maybe in conjunction
with swfmill) is a suitable tool for doing that, if you don't have or
want to use Adobe's authoring product.

There are some minimal things you can do with Flash given just the COM
interface (global stop and play, setting of variables, maybe jumping
to a particular frame) but that's not a worthwhile path to pursue if
you're trying to control a FLV.

-bob


More information about the Baypiggies mailing list