LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How would I get information from Windows Media Player to determine when a file is finished playing?

Solved!
Go to solution

I am creating a program to for Windows Media Player. This program will use external buttons connected to a PCI card to read when a user presses a particular button. I need the program to wait until the video is complete before doing anything else. Is there any way to read this information with a property node?

 

Help will be much appreciated.

0 Kudos
Message 1 of 5
(2,524 Views)

You could register for the player's PlayStateChange event, using a callback VI. There are shipping examples on using ActiveX callbacks. Open the Example Finder and search for "ActiveX". There is one example for Excel and one example for Internet Explorer. Windows Media Player would work the same way.

0 Kudos
Message 2 of 5
(2,513 Views)

I already have an ActiveX automation in my program that opens the player file and maximizes it while it is playing. It's based on the "IWMPPLAYER4" method or property. I can insert a callback VI into the program, but if I use this automation, it greys out and returns an error message. The "PlayStateChange" is under a completely different category. I'm missing something here and I'm sure it's a minor detail. Is there a tutorial on this subject somewhere? I can't find anything more than generic information about property nodes.

 

Thanks for your help earlier.

0 Kudos
Message 3 of 5
(2,500 Views)
Solution
Accepted by topic author James12

Attached is a very simply example (LV 8.2) of using that event.

 

You need to head over to Microsoft to get the details on the Windows Media Player properties and methods: http://msdn.microsoft.com/en-us/library/windows/desktop/dd564680%28v=vs.85%29.aspx

Download All
Message 4 of 5
(2,496 Views)

This was just the sort of information I needed.

 

Thanks for your help.

0 Kudos
Message 5 of 5
(2,492 Views)