Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1021
  • Last Modified:

media player in delphi

I want to play some .wmv files in my program using the mediaplayer component.
now as you know mediaplayer displays the video in the component linked in the DISPLAY property.
in my program i have linked it to a panel.
the problem is that the video's original  dimension are 800 x 600 while my panel is half that size.
this causes the video to be displayed only half. is there any way to resize\zoom the video so that it fits on the panel ?
0
data-nova
Asked:
data-nova
2 Solutions
 
jexd99Commented:
Some videos dont play in that, I have been looking at the activex control for WMP but that has really limited information avaiable.  I'm having a tough time finding info on that as I think thats actually the better component.  I wonder if D2006 has improved their media player so that all files will play on it (on D5 there are alot of videos that have problems).
0
 
ZhaawZSoftware DeveloperCommented:
I believe you have to set MediaPlayer1.DisplayRect
MediaPlayer1.DisplayRect := Panel1.ClientRect;
0
 
ZhaawZSoftware DeveloperCommented:
There's a problem with DisplayRect - if you make it 1000x100, it will show 1000x100 :) even if real video size is 800x600 (so it should show 133x100 instead of 1000x100), so some calculations will be needed to stretch it proportionally. Say if you need some help with this
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
data-novaAuthor Commented:

 Hi Zhaawz ,

  thanks a lot :)
0
 
ZhaawZSoftware DeveloperCommented:
Glad to help ;]
0
 
data-novaAuthor Commented:
but it cuts the movie , is there anyway to zoom it ?
0
 
ZhaawZSoftware DeveloperCommented:
Does it cut? It should stretch (zoom) a movie to specified rectangle (at least it did so when I tried it).
0
 
geobulCommented:
Hi,

Zhaawz is right. Just place that line after Open and before play:

  MediaPlayer1.Open;
  MediaPlayer1.DisplayRect := Panel1.ClientRect;
  MediaPlayer1.Play;

Regards, Geo
0
 
data-novaAuthor Commented:

 oh now it works :)  Geo was right the code has to be between Open and PLay.

 thanks a lot Zhaawz and Geo
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now