在你的程序里加一个Timer控件,定义一个变量 EndPosition;在播放一个文件时,加一句: EndPosition:=MediaPlayer1.Length; Timer的OnTimer事件中用以下代码:var Position:Integer; begin Position:=MediaPlayer1.Position; if Position=EndPosition then begin if Circle then Index:=Index; if Rand then Index:=Random(Num); end;其中,Index为Combox中的序号,也为正在播放的文件在combox中的序号,Num为combox中的文件总数。Circle、Rand为Boolean型,分别为循环播放和随机播放. 还有什么不明白的可继续讨论。
[通过mediaplayer控件的相关属性]
EndPosition:=MediaPlayer1.Length;
Timer的OnTimer事件中用以下代码:var
Position:Integer;
begin
Position:=MediaPlayer1.Position;
if Position=EndPosition then
begin
if Circle then
Index:=Index;
if Rand then
Index:=Random(Num);
end;其中,Index为Combox中的序号,也为正在播放的文件在combox中的序号,Num为combox中的文件总数。Circle、Rand为Boolean型,分别为循环播放和随机播放.
还有什么不明白的可继续讨论。
可以用mediaplayer生成
怎么我用mediaplayer做的只能放AVI文件?