Unlimited playing in MediaPlayer

Posted in Others

Use onNotify event, Notify and NotifyValue properties of MediaPlayer component.

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin
  with MediaPlayer1 do
    if NotifyValue = nvSuccessful then
    begin
      Notify := True;
      Play;
    end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  with MediaPlayer1 do
  begin
    Filename:='test.wav';
    Open;
    Play;
  end;
end;