Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Problem with MediaPlayer

rrrrr12345rrrrr12345 Member Posts: 56
How is it possible to change the FileName at run-time, so that the video is changed by clicking a button?

I used this code, but the video in the Panel didn't change to the next videoclip.

procedure TsomeForm.NextClick(Sender: TObject);
var
videofile:string;
begin
{Prepare for video}
Videofile:= X;
If FileExists(Videofile)
then MediaPlayer1.filename:= Videofile;
end;


X is a proper file name e.g. C:xyzxyz.mpeg

Your help will be greatly appreciated.

Comments

  • zibadianzibadian Member Posts: 6,349
    : How is it possible to change the FileName at run-time, so that the video is changed by clicking a button?
    :
    : I used this code, but the video in the Panel didn't change to the next videoclip.
    :
    : procedure TsomeForm.NextClick(Sender: TObject);
    : var
    : videofile:string;
    : begin
    : {Prepare for video}
    : Videofile:= X;
    : If FileExists(Videofile)
    : then MediaPlayer1.filename:= Videofile;
    : end;
    :
    :
    : X is a proper file name e.g. C:xyzxyz.mpeg
    :
    : Your help will be greatly appreciated.
    :
    You need to call Open() after changing the filename to actually open the media-file. See the online help on TMediaplayer.Filename.
  • rrrrr12345rrrrr12345 Member Posts: 56
    Thank you so much.
Sign In or Register to comment.