Mega Code Archive

 
Categories / Delphi / VCL
 

Endless looping with the tmediaplayer

Question: How can I get an AVI to loop continually with the TMediaPlayer? Answer: The following example demonstrates looping an AVI file by taking advantage of the MediaPlayers Notify event to play the AVI file again... and again... and again! Example: procedure TForm1.MediaPlayer1Notify(Sender: TObject); begin with MediaPlayer1 do if NotifyValue = nvSuccessful then begin Notify := True; Play; end; end;