DSPack做播放器定时播放问题! ( 积分: 100 )

  • 主题发起人 主题发起人 chrysalis
  • 开始时间 开始时间
C

chrysalis

Unregistered / Unconfirmed
GUEST, unregistred user!
我做的一个播放器,为什么不能定点播放!代码如下!
var
MediaSeeking:IMediaSeeking;
StopPosition,CurrPos,S,Value:Int64;
begin

if OpenDialog.Execute then

begin

if not FilterGraph.Active then
FilterGraph.Active := true;
FilterGraph.ClearGraph;
FilterGraph.RenderFile(OpenDialog.FileName);
VideoWindow.PopupMenu := PopupMenu;
SoundLevel.Position := FilterGraph.Volume;
FilterGraph.QueryInterface(IMediaSeeking,MediaSeeking);
with MediaSeekingdo

begin

Value := Trunc(CurrPos / 10000000);
S := (value mod 3600) mod 60;
MediaSeeking.GetStopPosition(S);
MediaSeeking.SetPositions(S,AM_SEEKING_AbsolutePositioning,
StopPosition,AM_SEEKING_NoPositioning);
FilterGraph.Play;
end;

end;

为什么不能实现在设置的时间段内播放呢?
 
我做的一个播放器,为什么不能定点播放!代码如下!
var
MediaSeeking:IMediaSeeking;
StopPosition,CurrPos,S,Value:Int64;
begin

if OpenDialog.Execute then

begin

if not FilterGraph.Active then
FilterGraph.Active := true;
FilterGraph.ClearGraph;
FilterGraph.RenderFile(OpenDialog.FileName);
VideoWindow.PopupMenu := PopupMenu;
SoundLevel.Position := FilterGraph.Volume;
FilterGraph.QueryInterface(IMediaSeeking,MediaSeeking);
with MediaSeekingdo

begin

Value := Trunc(CurrPos / 10000000);
S := (value mod 3600) mod 60;
MediaSeeking.GetStopPosition(S);
MediaSeeking.SetPositions(S,AM_SEEKING_AbsolutePositioning,
StopPosition,AM_SEEKING_NoPositioning);
FilterGraph.Play;
end;

end;

为什么不能实现在设置的时间段内播放呢?
 
没人告诉吗?
 
先play再seeking
 
后退
顶部