WMPlayer.OCX COM object: player window is not opened

Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

WMPlayer.OCX COM object: player window is not opened

This post has NOT been accepted by the mailing list yet.
I'm trying to instantiate and use a Windows Media Player COM object. I can do that and all seems fine, but the player window is not opened.

Here's my code:
import win32com.client

wmp = win32com.client.Dispatch("WMPlayer.OCX")
wmp.currentMedia = wmp.newMedia("C:\Users\Public\Videos\Sample Videos\Wildlife.wmv")
I get the sound from this video, but no video window is shown. And in the process list I don't find a wmplayer.exe process, just a wmpnetwk.exe process (whereby I'm not sure if this process is related to my COM object).

I played around a bit and found that
wmp.openPlayer("C:\Users\Public\Videos\Sample Videos\Wildlife.wmv")
actually opens a WMPlayer window; but that player can't be controlled by COM commands;
 and similar are ineffective.

Maybe I'm just overlooking a silly detail, but I'm stuck on this - any help is appreciated!