MediaPlayer OCX control

How do I control the MediaPlayer OCX? (load movie, play movie, etc..)
I mannaged to put it on screen but I cannot show the movie...
Any ideeas, suggestions, web pages, hints?

attached is my silly try.

WMP is the module generated by makepy.py (win32com)

main.py (942 Bytes)

···

--
Peter Damoc
Hacker Wannabe
http://www.sigmacore.net/

Peter,

You can find an example of how to control Media Player on Windows (and Quicktime on Mac) by looking at the source code for Transana, which is open-source Python/wxPython software for the transcription and qualitative analysis of video and audio data for researchers.

Start at the Transana web site, http://www.transana.org, and go to the Open Source Development page. At the bottom of the page, you will find links to a page describing all the modules you need to compile and run Transana's source code, as well as a link to CVS for the program.

You will want to look at WindowsMediaPlayer.py, video_msw.py, and VideoWindow.py in particular. The first of those is the lowest level code, the second level abstracts the functionality into an interface which is shared by the video_mac.py module, and the third file does OS detection and I forget what all else.

Okay, so sending you to Transana's source code to answer your question is a bit like using a front end loader to swat a house fly, but, like a house fly, your question can be difficult to get a hand on and can be a bit of a nuisance. Plus, I didn't do the development of that part of the program myself, so I can't be much help to you.

Good luck,
David Woods
Lead Transana Developer
Wisconsin Center for Education Research
University of Wisconsin, Madison

···

-----Original Message-----
From: Peter Damoc [mailto:pdamoc@gmx.net]
Sent: Saturday, May 22, 2004 4:54 AM
To: wxPython-users@lists.wxwidgets.org
Subject: [wxPython-users] MediaPlayer OCX control

How do I control the MediaPlayer OCX? (load movie, play movie, etc..)
I mannaged to put it on screen but I cannot show the movie...
Any ideeas, suggestions, web pages, hints?

attached is my silly try.

WMP is the module generated by makepy.py (win32com)

--
Peter Damoc
Hacker Wannabe
http://www.sigmacore.net/

Okay, so sending you to Transana's source code to answer your question is a bit like using a front end loader to swat a house fly, but, like a house fly, your question can be difficult to get a hand on and can be a bit of a nuisance. Plus, I didn't do the development of that part of the program myself, so I can't be much help to you.

Thanks, :smiley: will look at the code next week. :smiley:
Fot the time being I dodged the task via IEHtmlWin+emmbeded WMP OCX in the page.

···

On Sat, 22 May 2004 14:00:24 -0500, David Woods <dwoods@wcer.wisc.edu> wrote:

Good luck,
David Woods
Lead Transana Developer
Wisconsin Center for Education Research
University of Wisconsin, Madison

--
Peter Damoc
Hacker Wannabe

Peter Damoc wrote:

> How do I control the MediaPlayer OCX? (load movie, play movie, etc..)
> I mannaged to put it on screen but I cannot show the movie...
> Any ideeas, suggestions, web pages, hints?

It is all documented on the MSDN web site

Here is some of my code that does the trick. I didn't want any UI. This
also plays a file.

        # self.video is the control

        self.video.uiMode="none"
        self.video.stretchToFit=1
        self.video.URL=sys.argv[1]

You can manipulate the controls:

        self.video.controls.play()
        self.video.controls.pause()

You can also direct where callback methods from WMP are sent:

        theClass=MakeActiveXClass(videomodule.WindowsMediaPlayer, eventObj=self)
        self.video=theClass(self, wx.NewId())

Whatever you specified as the eventObj then has various methods called.
Here are two I use:

    def OnClick(self, *args):
        print "onclick", `args`
        ....

    def OnStatusChange(self, *args):
        print "statuschange", args
        print self.video.status
        if self.video.status=="Stopped":
             ....

(I wasn't able to tell how this was localised but I only cared about some
US Windows XP Embedded Devices I setup so it isn't a big deal).

Roger