• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1614
  • Last Modified:

WindowsMediaPlayer1 Repeat Track

Hi, I've been using the Windows Media Player imported from the library and what I'm having problems with is Repeating the Track.

now I've figured out the loop which is

form1.WindowsMediaPlayer1.settings.setMode('loop',true);

and I have tried this

form1.WindowsMediaPlayer1.settings.playCount:=0;

and

form1.WindowsMediaPlayer1.settings.playCount:=999;


though still it doesn't stay on the same track or repeat the track :( just goes to the next track..

any way of doing thing so it repeats the track active?

0
eNarc
Asked:
eNarc
  • 3
1 Solution
 
wd123Commented:
setMode('loop',true); only form playlist, create your playlist with 1 files and you git it.
0
 
eNarcAuthor Commented:
lol create it with 1 file in the playlist, and loop that one ;) alright hehe I'll see what I can do :)
0
 
Eddie ShipmanAll-around developerCommented:
Write an OnNotify handle that when you are notified of a Stop, you reset and Play again.
0
 
Eddie ShipmanAll-around developerCommented:
oops, TMEdiaPlayer has the OnNotify.
WindowsMediaPlayer has OnPlayStateChange. Check for wmppsStopped.


procedure TForm1.WMP1PlayStateChange(Sender: TObject;
  NewState: Integer);
begin
  if NewState = wmppsStopped then
  begin
    WMP1.controls.currentPosition := 0;
    WMP1.controls.play
  end;
end;

Open in new window

0
 
Eddie ShipmanAll-around developerCommented:
Oh, BTW, I'm not sure how to keep it from playing if you stop in the middle. I suppose there's a way to capture which button was pressed and don't restart if the stop button was pressed.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now