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.
  • Justin BibJustin Bib USAMember Posts: 0

    __ [ http://forcoder.org ] free ebooks and video tutorials about < MATLAB, Ruby, Java, Go, Assembly, Visual Basic .NET, C++, Visual Basic, C#, R, PHP, Perl, JavaScript, C, Objective-C, Swift, PL/SQL, Scratch, Delphi, Python SAS, FoxPro, COBOL, Fortran, Lua, Erlang, F#, D, Hack, Prolog, Awk, Apex, Rust, Julia, Clojure, ML, Dart, Scheme, VBScript, Bash, Kotlin, Logo, Crystal, Transact-SQL, LabVIEW, Lisp, Alice, Ada, Scala, ABAP /> ___________

Sign In or Register to comment.