Hi everyone. How can I get an MP3 song to repeat once it's finished in my game made with Delphi and unDelphiX?
I have the following in the formCreate:
Code:
MediaPlayer.Notify := True;
MediaPlayer.OnNotify := NotifyProc;
fAutorepeat := True;
and the procedure to repeat:
Code:
procedure TFormGame.NotifyProc(Sender: TObject);
begin
with Sender as TMediaPlayer do
begin
case Mode of
mpStopped: if fAutoRepeat then
(Sender as tMediaplayer).play;
end;
Notify := True;
end;
end;
The above works perfectly on a normal Delphi app but not with unDelphiX, it stops and doesn't repeat...any ideas?
Bookmarks