LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

ActiveX: Opening a separate Windows Media Player 9 window and controlling playback

Solved!
Go to solution
Highlighted

Hey all,

 

I am trying to open a video in WMP4 automatically in Labview and control it. There is an existing ActiveX container but it remains on the front panel. I can control its playback, but cannot pause and resume.

I can also open the video on a WMP9 window outside of LabView through Labview, but I have not been able to control it. Merely start it, and then watch it till it finishes. This is the preferred operation I need to figure out.

 

LabView Version: 8.6

ActiveX application: Windows Media Player 4

OS: Windows XP

 

 

My questions are:

a) How do you pause and resume a video file if using the ActiveX container for which LabView provides

b) How could I access the playback controls of an externally opened WMP instance through LabView (because I want to automate the playback based on acquired signals)

Note that the ActiveX refnum is WMP4  whereas the installed version on XP is WMP9.

 

Thanks in advance for your help,

 Hasan

0 Kudos
Message 1 of 6
(2,668 Views)
Highlighted

This is not the answer but a work around:

 

If you have an AVI format video and the Vision Development Module you can watch the video and choose the speed that you watch as well as stop on individual frames. You could also manipulate or inspect the video as well.

 

As far as your actual questions go, do you have a list of activeX commands that WMP support? Do you have the Windows Media Software Development Kit?

Vince M
Applications Engineer
0 Kudos
Message 2 of 6
(2,639 Views)
Highlighted

Hi,

 

Thanks for your reply.

I do not have the Vision Development Module in LabView. I think it would have been under `Vision and Motion', however that menu is empty.

 

I have managed to do what I want in the ActiveX container that shows the video as a part of the front panel. I start the video, I pause it and the screen goes blank (I want this feature. I could also get it to show the frame at pause, but that does not suit my needs). When I resume the play, it seeks to the point at which I paused the video.

 

To do this, I use the invoke property -> controls ->  methodforcontrols-> play / stop functions and the currentposition property as both read and write. I do not have the windows media software development kit.

 

I have attached the VI which describes what I have managed to do. Changing the first property node to an invoke method -> openplayer node will open an external player, but still do the required control of video playback on the wmp container on the front panel, without affecting the video being run on the external window. It seems like I should be able to tweak it and get it to do the same thing on the external instance of WMP, yet I have not been able to figure it out.

 

Thanks for looking at this,

Hasan

 

P.S. - I couldn't upload the video that I was using, hst_1.mpg because it is not a valid extension. Please substitute it with another file before running. Sorry for the inconvenience

0 Kudos
Message 3 of 6
(2,616 Views)
Highlighted
Solution
Accepted by topic author hasanp85

I have had difficulty with your application. I don't know if it is my version of LabVIEW or something else. It will not play for me.

 

I would like to refer you to the following thread:

Windows Media Player ActiveX not playing image, but WMP stand alone application does. Why?

 

Hopefully this will help enough to do what you want. I have not been able to get anything to work but it appears that this is discussed a lot on the forums. Has anyone else tried to do the same thing as you?

Vince M
Applications Engineer
0 Kudos
Message 4 of 6
(2,585 Views)
Highlighted

Hi Vince,

 

Thank you for your help. I followed the advice and tried using quicktime. I managed to do what I needed in terms of video playback control.

 

I also upgraded to WMP10 initially, that ddn't work though some threads said it should.

So, if anyone else is struggling with WMP, I'd suggest switch to QT.

 

Thanks a lot,

Hasan
0 Kudos
Message 5 of 6
(2,575 Views)
Highlighted

Can you show how you've done it in QT? I am struggling with getting this functionality in WMP.. Thanks!

0 Kudos
Message 6 of 6
(1,718 Views)