我用panel.handle获取视频回放不显示的问题(100)

  • 主题发起人 kunwyf12345
  • 开始时间
K

kunwyf12345

Unregistered / Unconfirmed
GUEST, unregistred user!
我用panel.handle获取视频回放,如果第一次就播放这个文件,没问题,如果先播放别的,再播放它就有问题,显示不出来。等点停止,panel.repaint时就会闪一下就没有了,为什么啊?
 
不会吧?没人回答吗?我根据海康的例子做的,人家的就没问题啊
 
我是要panel.repaint什么的吗?我试了不好用啊
 
人家的例子没问题,我在前面加了一句showmessage就可以显示了,可是真正运行的时候不能有这句啊,还有两段视频,只不过服务器不一样,为什么一个怎么都能播放的了,一个在别的播放完它就不能播放了啊,要是不加showmessage,它会在最后一秒的时候闪出来显示一下
 
showmessage改成application.processmessages再看看
 
不好用啊,别人还有什么建议吗
 
stlont还有别的建议吗
 
我把代码贴一下,哪位帮我看看吧?这个F_Play是开始按钮procedure TFrmplayback.F_Play;var fileselpos :integer;
csFileName :pchar; csIP,csTemp, sTemp1 :String; nPos :integer; boolreturn:boolean;
begin
if(m_locFileList.Selected = nil) then
begin
showMessage('请选择要播放的文件!'); exit; end;
//PlayM4_SetFileRefCallBack(USED_PORT,FileRefDone,(DWORD)this); csFileName := pchar(m_locFileList.Selected.caption); if(Length(csFileName)=0) then
exit; csTemp:=csFileName; while(Pos('/',csTemp)>0)do
begin
csIP:=Rightstr(csTemp,Length(csTemp)-nPos);
//showmessage(csIP); csTemp:=csIP; nPos:=pos('/',csTemp); end;
nPos:=pos('_',csTemp); csIP:=Leftstr(csTemp,nPos-1); m_csIP:=csIP; if(PlayM4_OpenFile(USED_PORT,csFileName)=false) then
//调用PlayM4_OpenFile begin
showmessage('open file failed!'); exit; end;
sTemp1 := m_locFileList.Selected.Caption; iSelChannel := midstr(sTemp1,pos('_',sTemp1)+1,2);
m_iTotalSeconds:=0; m_iTotalSeconds:=PlayM4_GetFileTime(USED_PORT);
//调用PlayM4_GetFileTime if(m_iTotalSeconds<=0) then
begin
boolreturn:=PlayM4_CloseFile(USED_PORT); showmessage('文件大小为0!'); exit; end;
boolreturn:=PlayM4_SetDisplayCallBack(USED_PORT,DisplayCBFun);//调用PlayM4_SetDisplayCallBack if((PlayM4_Play(USED_PORT,Frmplayback.Panel1.Handle))=FALSE) then
//调用PlayM4_Play begin
err:=PlayM4_GetLastError(USED_PORT);
if err=NET_DVR_PASSWORD_ERROR then
showmessage('用户名密码错误') else
showmessage(inttostr(err));
boolreturn:=PlayM4_CloseFile(USED_PORT); end;

F_Sound(TRUE);
//调用F_Soundend;
procedure TFrmplayback.F_Sound(bSound: boolean);var boolreturn:boolean;
begin
if(bSound) then
begin
m_bSound:=PlayM4_PlaySound(USED_PORT); boolreturn:=PlayM4_SetVolume(USED_PORT,32767); end else
begin
boolreturn:=PlayM4_StopSound(); m_bSound:=FALSE; end;

end;
以下为停止按钮 f_pause; boolreturn:=PlayM4_Stop(USED_PORT); boolreturn:=PlayM4_CloseFile(USED_PORT);
F_Sound(false);
procedure TFrmplayback.F_Pause;
begin
if(PlayM4_Pause(USED_PORT, not m_bPause)) then
begin
m_bPause:=not m_bPause; end else
begin
//TRACE("PAUSE ERROR!");
showmessage('PAUSE ERROR!'); end;

end;
 
是播放不同回路时要用不同的port
 
顶部