Example Programs

cancel
Showing results for 
Search instead for 
Did you mean: 

Play Files in Windows Media Player using ActiveX in LabVIEW

Overview
This example VI opens Windows Media Player on your computer and plays a selected file.

 


Description
You can use any video file that is supported by Windows Media Player (.mpa, .mp2, .mp3, .avi, .wma, etc..). The Strip Path VI finds the location of the current VI. This is particularly useful if the example file is saved to this folder as well. If not, then the video file path can be referenced directly into the constant. The Build Path VI adds the current folder filepath to the video name so that the full filepath can be used to play the video. There are many Windows Media Player (WMP) ActiveX classes that can manipulate it in a number of ways. 

 


Requirements

  • LabVIEW 2012 (or compatible)
  • Windows Media Player

 


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the VI "Windows Media Player.vi"
  3. Run the program

 

 

Additional Information or References
VI Block Diagram

BD.PNG

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Grant H.
National Instruments
LabVIEW Product Marketing Manager
Comments
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast

Not all of us have moved on to 8.6

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



Member wprice
Member

Good example! I tried it on LV2009 and it works, however the stretchToFit method does not work so it does not resize the player when the main window is resized.

- WinXP, WMP 10.0

Member nymoon
Member

It can meet basic needs,so good.

by the first ,LabView is so strong!
Member Marinica
Member

How can you build this from scratch? I placed "Automation Open" and "property node", but I was not able to place the reference to "WindowsMediaPlayer". I tried using "create control", but I was not able to generate similar controls. Downloading it from your site, I was able to run it very well, I'm working with LabVIEW13.

Thank you.

Member 0Forest0
Member

Thank you very mutch. I think it's very  hard to find the ActiveX reference in that long list whithout search button.