LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows Media Player size

Solved!
Go to solution

I have a Windows Media Player object in a tab control, so even if I manualy resize the video a split second after it starts to play it still expands my tab control well beyond the normal bounds. Looking in the class browser there are a number of height and width properties that are unser other sub classes (Not IWMPPlayer4). The front panel control is only associated with IWMPPlayer4, is there anyway to apply the properties from the parent class. 

 

 

In LabVIEW ref classes I would just use to more generic class, but that does not work for ActiveX. Any ideas on how I can set the size in windows media player and not just in LabVIEW?

0 Kudos
Message 11 of 20
(4,125 Views)

I believe LabVIEW can't control the WMP size. I tried different approaches and could not fix this issue either. This is an internal LabVIEW issue.

0 Kudos
Message 12 of 20
(4,104 Views)

I was looking for the answer to the same question today. I figured out the basic control, and thought I should upload the VI to help the less experienced.

 

Media Player does not seem to behave great in LabVIEW. It appears to reset itself every time you start it, stop it, pause it, or carry out any other action. So you will need a driver VI that handles each possible case, and re-applies the desired properties every time the user carries out an action.

 

At least that's how I imagine it. Any other better ideas or implemented code are very welcome!

Message 13 of 20
(4,083 Views)

I tested your code and it seems that WMP still resets its size. Also the Show Controls button does not do anything - maybe it's a Windows 7 WMP issue?

 

I attached the screenshots below. 

Download All
0 Kudos
Message 14 of 20
(4,066 Views)

 

 

The uiMode property specifies or retrieves a value indicating which controls are shown in the user interface.

 

 

 

mini Windows Media Player is embedded with the status window, play/pause, stop, mute, and volume controls shown in addition to the video or visualization window. "mini" with audio "mini" with video

 

 

 

0 Kudos
Message 15 of 20
(3,825 Views)

Hi all,

 

I am troubled with the same problem.
When IWMPPlayer4 starts play, IWMPPlayer4 seems to change the size of the control. Even a pause was resized.


Is there the method to stop this resize? Or are there other methods to evade?

--

gogomac

0 Kudos
Message 16 of 20
(3,670 Views)

I'm having the same problem. Has anybody found a solution yet?

 

Thanks.

0 Kudos
Message 17 of 20
(3,356 Views)

Hi, I can't change it to write the windows media player properties nodes with height and width....

0 Kudos
Message 18 of 20
(844 Views)

Same problem and no I've never found a solution.  I've tinkered with every property node that looks like it would affect the size.

0 Kudos
Message 19 of 20
(357 Views)

Well, as suggested, the container bounds property for the ActiveX container (apparently combined with the control's StretchToFit property) seems to control this and there is code in this thread from 2011 demonstrating this, but it does seem to require executing after every resize rather than keeping the player size fixed. You could possibly make that example more elegant by registering for the PlayStateChange event or checking to see if there is a resize event and reacting to that.

 

I have no experience with embedding video in LV, but I would guess these are some options:

  1. Build on the example in this thread.
  2. Search the web to see if others ran into this and whether there is something to be done.
  3. Use another way to embed video (such as VLC, or maybe there's a built in .NET control, etc.).
  4. Embed a web browser and write an HTML page which will display the video.

___________________
Try to take over the world!
0 Kudos
Message 20 of 20
(343 Views)