如何让MadiaPlayer反复播放同一个AVI?(100分)

W

wgzhang

Unregistered / Unconfirmed
GUEST, unregistred user!
有多个AVI可能被选择播放,画面大小不一样,在播放时一定要以实际画面大小播放
因为都是些连续反复的动作,比如心脏的跳动,所以只取一段重复播放就可以.
由操作者随意关闭此播放画面,按钮要在此画面上.
会者不难,望指教.
 
用<font color=red>ActiveMovie</font>打开AVI(或者用MadiaPlayer选择"ActiveMovie"设备),打开后
不要急着play, 在"play"按钮附近按鼠标右键,然后在菜单里大概是选"属性"
吧,然后会弹出一个窗口,选"重复播放"即可.

也许还有简便方法,不过我是这么做的. :)
 
你是想编程呢,还是只调用 别人的可以了。
 编程的话,可以用mediaplay 的resume吧,
 如果用“媒体。。”的话,可以在界面上打开一个文档后选择
“开始选择”-“结束选择”,然后 ,从“编辑”中选择“自动重复”就可以了。
 
these code is in D5

procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin

MediaPlayer1.Rewind;// if you set the autorewind = True,the line is unused.
MediaPlayer1.Play;
end;


And i think you can use the 'display' property to display the Mediafile!
 
cAkk
没说明白,是做好后给别人用的,一个简单的电子教材.本想用Authware做的,
因为种种原因,想用Delphi试试,于是问题就来了.让操作者这样做不方便吧?

hntangwei
resume用在pause后.要求Stop后Replay.

menxin
无法控制'display' property 的大小,要让一个Panel适合播放的画面,必须要知道
画面的Height and Width.
 
activemovie1.playcount:=0;
会不断重复.
 
menxin
我是用Timer来看Mediaplayer1.Mode=mpStopped然后再Play.你的
procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin

MediaPlayer1.Play;
end;

也实现了重复播放,但是和用Timer一样,无法停止!
有苗头,再帮帮忙吧.
 
About the display question,i test it ,you cando
it with these codes:

with MediaPlayer1do
begin

FileName:='.....';
Open;
Panel1.Width:=DisplayRect.Right;
//-DisplayRect.Left;
because left value is 0;
Panel1.height:=DisplayRect.Bottom;
play;
end;


then
you can see the panel1's bounds is set to the movies's rect! :)

The other question is very easy,you can add code in Panel1's event to
control it.
ie.

procedure TForm1.Panel1Click(Sender: TObject);
begin

mediaplay1.pause;
end;


Good luck!
 
You can modify the Mplayer.pas ,let it return the Video's Width and Height.
You must set the notify=true
and then
you write the program in the notify events as follow:
MediaPlay1.Rewind;
MediaPlay1.Play;
 
procedure TForm1.MediaPlayer1Notify(Sender: TObject);
begin

if ((MediaPlayer1.NotifyValue=nvSuccessful) and
(MediaPlayer1.mode=mpStopped)) then

begin

MediaPlayer1.Rewind;
MediaPlayer1.Play;
end;

end;


至于放在一个个小窗口,直接用TB97的TOOLWIN好了
 
以menxin的回答为基础,参考其他的回答,解决问题了.
谢谢大家!
 

Similar threads

D
回复
0
查看
792
DelphiTeacher的专栏
D
D
回复
0
查看
746
DelphiTeacher的专栏
D
D
回复
0
查看
732
DelphiTeacher的专栏
D
S
回复
0
查看
626
SUNSTONE的Delphi笔记
S
顶部