S
siyan
Unregistered / Unconfirmed
GUEST, unregistred user!
程序代码如下
var
Graph: IGraphBuilder;
evCode: Integer;
MediaControl: IMediaControl;
MediaEvent: IMediaEventEx;
pivw : IVideoWindow
procedure TForm_Main.MenuItem_PlayClick(Sender: TObject);
begin
if Graph.RenderFile('mms://10.45.0.75:1234', nil)<> S_OK then
begin
Application.MessageBox('所选服务器没有进行广播!','提示',MB_OK+MB_IconInformation);
Exit;
end;
pivw.put_WindowStyle(WS_CHILD + WS_CLIPCHILDREN + WS_CLIPSIBLINGS);
pivw.put_Owner(Panel_Show.handle)
pivw.SetWindowPosition(1, 1, Panel_Show.Width-2,Panel_SHow.Height-2);
MediaEvent.SetNotifyWindow(Self.Handle,WM_GRAPHNOTIFY,0);
MediaControl.Run
MediaEvent.WaitForCompletion(0, evCode);
end;
procedure TForm_Main.MenuItem_StopClick(Sender: TObject);
begin
MediaControl.Stop;
end;
我点击播放、然后关闭,然后再播放就会死机,不知道是什么原因!
如果是播放文件则没有这个问题,请诸位高手指教,感激涕零!
var
Graph: IGraphBuilder;
evCode: Integer;
MediaControl: IMediaControl;
MediaEvent: IMediaEventEx;
pivw : IVideoWindow
procedure TForm_Main.MenuItem_PlayClick(Sender: TObject);
begin
if Graph.RenderFile('mms://10.45.0.75:1234', nil)<> S_OK then
begin
Application.MessageBox('所选服务器没有进行广播!','提示',MB_OK+MB_IconInformation);
Exit;
end;
pivw.put_WindowStyle(WS_CHILD + WS_CLIPCHILDREN + WS_CLIPSIBLINGS);
pivw.put_Owner(Panel_Show.handle)
pivw.SetWindowPosition(1, 1, Panel_Show.Width-2,Panel_SHow.Height-2);
MediaEvent.SetNotifyWindow(Self.Handle,WM_GRAPHNOTIFY,0);
MediaControl.Run
MediaEvent.WaitForCompletion(0, evCode);
end;
procedure TForm_Main.MenuItem_StopClick(Sender: TObject);
begin
MediaControl.Stop;
end;
我点击播放、然后关闭,然后再播放就会死机,不知道是什么原因!
如果是播放文件则没有这个问题,请诸位高手指教,感激涕零!