Pythoncom scripting Windows Media Player & visible
eldridge at u-turnmediagroup.com
Tue Aug 2 13:14:56 EDT 2005
I'm trying to make Windows Media Player visible
and control it from Python. It seems when I call it
below, I get only the console version, and there's
no Visible method like with Internet Explorer.
I do catch events, but I need it visible.
Should it be put into a panel instead?
Should a different type dispatch be called
or a different method? it seems that there are
a console and a windows classes in the COM browser,
but I can't seem to access any useful windows classes.
I get "fullScreen" as False, but can't set it.
openPlayer(address) will launch a visible window,
but with no control of the the window after that.
from win32com.client import Dispatch,DispatchWithEvents
print "OnVisible changed:",evt
print "OnBuffering changed:",evt
print "OnOpenStateChange" ,evt
mp = DispatchWithEvents("WMPlayer.OCX.7",WMPEvents)
mp.Visible = True # Does nothing
tune = mp.newMedia("C:/WINDOWS/system32/oobe/images/title.wma")
raw_input("Press enter to stop playing")
More information about the Python-list