Пример #1
0
        public override bool VideoPlay()
        {
            VideoEnvironment_ZHSR.ZHSR_Main_Callback_Event -= VideoEnvironment_ZHSR_ZHSR_Main_Callback_Event;
            VideoEnvironment_ZHSR.ZHSR_Main_Callback_Event += VideoEnvironment_ZHSR_ZHSR_Main_Callback_Event;
            int intChannel = CurrentCameraInfo.Channel - 1;
            int md_tp      = 1;
            int iRet       = -1;

            if (CurrentVideoPlaySet.VideoTalkEnable)
            {
                md_tp = 3;
                iRet  = SDK_ZHSRSDK.win_sta_usr_call_req(VideoEnvironment_ZHSR.Session, CurrentVideoInfo.DVSAddress, intChannel, 0, md_tp, 1, (int)intptrPlayMain);
            }
            else if (CurrentVideoPlaySet.VideoMonitorEnable)
            {
                iRet = SDK_ZHSRSDK.win_sta_start_monitor(VideoEnvironment_ZHSR.Session, CurrentVideoInfo.DVSAddress, intChannel, 0, 3, 1, (int)intptrPlayMain);
            }
            else
            {
                iRet = SDK_ZHSRSDK.win_sta_start_monitor(VideoEnvironment_ZHSR.Session, CurrentVideoInfo.DVSAddress, intChannel, 0, 1, 1, (int)intptrPlayMain);
            }
            VideoPlayCallback(new VideoPlayCallbackValue {
                evType = Enum_VideoPlayEventType.RequestConn
            });
            if (iRet < 0)
            {
                VideoPlayCallback(new VideoPlayCallbackValue {
                    evType = Enum_VideoPlayEventType.ConnFailed
                });
                return(false);
            }
            return(true);
        }