Jump to content

Windows Media Player Size On Load


Recommended Posts

QUOTE (Eugen Graf @ Oct 9 2008, 04:23 AM)

Hello, I have a problem using WMP ActiveX. After load a file to play the Container autoresizes!!! How to disable autoresize after load?

Thank You, Eugen

This is quite funny that the ActiveX Container's property: Container Bounds has to be placed in the loop to constantly force the size

of the container to what we want INSTEAD of SET it ONCE and the container stays at that size. The autosize jumps in straight awayif we only

set the Bounds even after PLAY the media. Really annoying !?

This is the temporary solution to your problem, not fully efficient but it works.

Regards,

Link to comment

QUOTE (Minh Pham @ Oct 8 2008, 09:30 PM)

This is quite funny that the ActiveX Container's property: Container Bounds has to be placed in the loop to constantly force the size

of the container to what we want INSTEAD of SET it ONCE and the container stays at that size. The autosize jumps in straight awayif we only

set the Bounds even after PLAY the media. Really annoying !?

This is the temporary solution to your problem, not fully efficient but it works.

Regards,

There is a whole other thread on this that I started when I first joined LAVA. The issue has been reported as a CAR (I don't remember the number right now) with the premise being "it will be fixed in a future release" but, of course, no mention of when that release might be (LV 21?).

My workaround was to build a VB6 OCX to contain the WMP Dll. I could then size it as I liked during runtime without any problem. This also meant, however, that access to the properties and methods of WMP had to go through the OCX so not the best solution but it does work.

Link to comment
  • 2 weeks later...

QUOTE (Val Brown @ Oct 9 2008, 12:35 AM)

There is a whole other thread on this that I started when I first joined LAVA. The issue has been reported as a CAR (I don't remember the number right now) with the premise being "it will be fixed in a future release" but, of course, no mention of when that release might be (LV 21?).

My workaround was to build a VB6 OCX to contain the WMP Dll. I could then size it as I liked during runtime without any problem. This also meant, however, that access to the properties and methods of WMP had to go through the OCX so not the best solution but it does work.

I'm not sure there is much that NI could do here. It seems really more like a bug in WMP to me.

Rolf Kalbermatter

Link to comment

QUOTE (Val Brown @ Oct 18 2008, 09:07 PM)

Actually it is a bug in NI's container code, that's how come a "solid" container in a VB6 OCX can perform the same function.

I'm pretty sure that this behaviour is not there for nothing. Most likely it works around some other flaw in ActiveX containers, either a generic ActiveX problem or a more specific issue to certain types of ActiveX controls and the way NI had to implement the container to fit into the way LabVIEW has to hook into Windows events to do its other stuff.

ActiveX containers hadn't been really thought out to well when they were introduced by Microsoft and they had later to find all kinds of bandaids to make it at least work reasonably.

The fact that it is not an issue in other media player ActiveX controls also points to the fact that it is not a generic LabVIEW ActiveX container issue but definitly something in interaction with a certain aspect of the WMP component.

Rolf Kalbermatter

Link to comment

QUOTE (rolfk @ Oct 19 2008, 02:00 AM)

I'm pretty sure that this behaviour is not there for nothing. Most likely it works around some other flaw in ActiveX containers, either a generic ActiveX problem or a more specific issue to certain types of ActiveX controls and the way NI had to implement the container to fit into the way LabVIEW has to hook into Windows events to do its other stuff.

ActiveX containers hadn't been really thought out to well when they were introduced by Microsoft and they had later to find all kinds of bandaids to make it at least work reasonably.

The fact that it is not an issue in other media player ActiveX controls also points to the fact that it is not a generic LabVIEW ActiveX container issue but definitly something in interaction with a certain aspect of the WMP component.

Rolf Kalbermatter

I think you have it backwards here and I'm a bit confused as to why you would defend what NI did in the past, esp when the statements that I have received about this indicate that they will provide a fix in the future. FWIW the fix will be a property specifying whether the container resizes (the current behavior) or doesn't resize (the default behavior in VB and other deployments). There was no reason specifically to NOT implement this functionality except that it hadn't been noticed.

The actual MO of the behavior is that, after every pause operation followed by a subsequent Play operation, WMP reloads the default characteristics of the media being played so that it CAN resize to the default size of the media. The assumption in WMP is that the container will remain sized correctly by the calling program if the desire is to NOT have WMP itself resize back to the loaded media size.

Not implementing the relevant property in a DESIGNATED FOR WMP CONTAINER simply made certain that this behavior was what occurred.

In prior LV versions it made sense that the ActiveX container was NOT specifically crafted to deal with this aspect of WMP. In prior LV versions the only way to utilize WMP within LV was via a generic ActiveX container/operation. The introduction of a specific WMP container (on the pallet) really means -- at least tome -- that this issue should have been researched a little bit more. After all, if it ONLY reproduces the then current behavior of a generic ActiveX container/operation, why develop and deploy a specific to WMP container?

Link to comment

QUOTE (Val Brown @ Oct 19 2008, 05:32 AM)

After all, if it ONLY reproduces the then current behavior of a generic ActiveX container/operation, why develop and deploy a specific to WMP container?

Because it is to difficult for some LabVIEW newbies to actually select the right ActiveX component in a list of many hundreds if not thousends of ActiveX components as available on a typical Windows installation.

There are many other things in LabVIEW that are not really necessary (eg. Express VIs) as you can achieve them with other more generic functionality often just as easy and with more detailed control but are there for the casual LabVIEW programmer that prefers to have a point and click option instead of having to do some programming.

Also the way you describe the problem seems to indicate that LabVIEW is implementing some sort of callback mechanisme that is used by WMP that other containers usually don't implement. So it would seem to me to be overcompliant with MS rather than doing something wrong.

Rolf Kalbermatter

Link to comment

QUOTE (rolfk @ Oct 19 2008, 06:41 AM)

Because it is to difficult for some LabVIEW newbies to actually select the right ActiveX component in a list of many hundreds if not thousends of ActiveX components as available on a typical Windows installation.

There are many other things in LabVIEW that are not really necessary (eg. Express VIs) as you can achieve them with other more generic functionality often just as easy and with more detailed control but are there for the casual LabVIEW programmer that prefers to have a point and click option instead of having to do some programming.

Also the way you describe the problem seems to indicate that LabVIEW is implementing some sort of callback mechanisme that is used by WMP that other containers usually don't implement. So it would seem to me to be overcompliant with MS rather than doing something wrong.

Rolf Kalbermatter

Huh,"to<sic> difficult for some LabVIEW newbies..."? There are a number of examples of just that process in LabVIEW for Everyone, Internet Application in LabVIEW, as well as via internet searches. These can be downloaded and used virtually AS IS for most uses of WMP. The problem is that LV actually ignores its own property (viz Autosizing) and no one in R&D tested this out apparently before it was released.

I have to say that having worked with WMP in deployed apps written in VB, C++ and LV for over 10 years now, it's just a really silly decision to have taken and one that doesn't reflect much understanding of WMP -- IMHO -- on the part of NI. IME, NI generally does a far, far better job of integrating other kinds of functionality once it makes the decision to do so. Here I think they missed a really obvious thing -- esp since it was an issue that I had already reported on, had a CAR etc back when ActiveX containers were first introduced.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.