private bool Iv_VideoPlayStateChangedEvent(object sender, object VideoPlayStateChangedValue) { bool bolResult = false; IVideoPlay iv = (IVideoPlay)sender; this.VideoPlayState = iv.VideoPlayState; return(bolResult); }
private void InterfaceInit() { if (iv != null && iv.VideoPlayState == Enum_VideoPlayState.InPlayState) { iv.VideoClose(); } Enum_VideoType Temp_videoType = CurrentVideoInfo.VideoType; if (ProgParameter.TransitionEnable && Temp_videoType == Enum_VideoType.Unrecognized) { Temp_videoType = Transition.Transition_VideoTypeConvert.GetVideoType(CurrentVideoInfo); } if (iv == null) { IVideoPlayInit(Temp_videoType, CurrentVideoInfo, CurrentCameraInfo); } else { iv.VideoPlayCallbackEvent -= VideoPlayCallbackEvent; iv.VideoRecordStausChangedEvent -= videoRecordStausChangedEvent; iv.VideoStreamChangedEvent -= videoStreamChangedEvent; if (iv.CurrentVideoInfo.VideoType != Temp_videoType) { iv = null; IVideoPlayInit(Temp_videoType, CurrentVideoInfo, CurrentCameraInfo); } } if (iv != null) { iv.PicPlayMain = this.picPlayMain; iv.CurrentVideoInfo = CurrentVideoInfo; iv.CurrentCameraInfo = CurrentCameraInfo; iv.CurrentVideoPlaySet = currentVideoPlaySet; iv.VideoplayWindowWidth = picPlayMain.Width; iv.VideoplayWindowHeight = picPlayMain.Height; iv.VideoPlayCallbackEvent -= VideoPlayCallbackEvent; iv.VideoPlayCallbackEvent += VideoPlayCallbackEvent; iv.VideoPlayCallbackEvent += Iv_VideoPlayCallbackEvent; iv.VideoPlayStateChangedEvent -= Iv_VideoPlayStateChangedEvent; iv.VideoPlayStateChangedEvent += Iv_VideoPlayStateChangedEvent; iv.SoundStateChangedEvent += Iv_SoundStateChangedEvent; iv.VideoRecordStausChangedEvent += videoRecordStausChangedEvent; iv.VideoStreamChangedEvent += videoStreamChangedEvent; } }
/// <summary> /// 音频状态改变相关 /// </summary> /// <param name="sender"></param> /// <param name="SoundStateChangedValue"></param> /// <returns></returns> private bool Iv_SoundStateChangedEvent(object sender, object SoundStateChangedValue) { IVideoPlay iv = (IVideoPlay)sender; if (this.IsDisposed) { iv.SoundStateChangedEvent -= Iv_SoundStateChangedEvent; return(false); } if (iv.SoundState == Enum_VideoPlaySoundState.SoundOpen) { picSound.Image = lstimgSoundState.Images[c_strSoundOn]; } else { picSound.Image = lstimgSoundState.Images[c_strSoundOff]; } return(true); }
/// <summary> /// 视频播放事件回调 /// </summary> /// <param name="sender"></param> /// <param name="evType"></param> /// <param name="strTag"></param> private bool VideoPlayEventCallBackEvent(object sender, VideoPlayCallbackValue eventValue) { bool bolResult = false; IVideoPlay v = (IVideoPlay)sender; if (bolDisplayVideoEvent) { StringBuilder sbDisplayInfo = new StringBuilder(); sbDisplayInfo.Append("["); if (dicCurrentVideoInfos != null && dicCurrentVideoInfos.ContainsKey(strCurrentVideoID)) { sbDisplayInfo.Append(dicCurrentVideoInfos[strCurrentVideoID].DVSNumber + "_"); sbDisplayInfo.Append(dicCurrentVideoInfos[strCurrentVideoID].DVSName); } if (CurrentCameraInfo != null) { sbDisplayInfo.Append("_"); sbDisplayInfo.Append(CurrentCameraInfo.Channel + "_"); sbDisplayInfo.Append(CurrentCameraInfo.CameraName); } sbDisplayInfo.Append("]"); switch (eventValue.evType) { case Enum_VideoPlayEventType.InitEnd: sbDisplayInfo.Append("控件初始化完成"); break; case Enum_VideoPlayEventType.LoadEnd: sbDisplayInfo.Append("控件加载完成"); break; case Enum_VideoPlayEventType.SetVideoInfo: sbDisplayInfo.Append("设置视频播放信息"); break; case Enum_VideoPlayEventType.VideoTypeNotExists: sbDisplayInfo.Append("视频类型不存在"); break; case Enum_VideoPlayEventType.VideoClose: sbDisplayInfo.Append("关闭视频"); break; case Enum_VideoPlayEventType.RequestConn: sbDisplayInfo.Append("请求视频连接"); break; case Enum_VideoPlayEventType.ConnSuccess: sbDisplayInfo.Append("连接成功,请求视频信息"); break; case Enum_VideoPlayEventType.ConnFailed: sbDisplayInfo.Append("连接失败"); break; case Enum_VideoPlayEventType.VideoPlay: sbDisplayInfo.Append("正在播放视频"); break; case Enum_VideoPlayEventType.RequestVideoTimeout: sbDisplayInfo.Append("请求视频信息超时"); break; case Enum_VideoPlayEventType.VideoDeviceNotOnline: sbDisplayInfo.Append("当前设备不在线"); break; case Enum_VideoPlayEventType.UserAccessError: sbDisplayInfo.Append("用户信息验证失败"); break; case Enum_VideoPlayEventType.VideoPlayException: sbDisplayInfo.Append("视频播放异常"); break; case Enum_VideoPlayEventType.DevLoginException: sbDisplayInfo.Append("设备登录异常" + v.CurrentVideoInfo.LoginPrompt); break; case Enum_VideoPlayEventType.DeviceNotExist: sbDisplayInfo.Append("设备不存在"); break; case Enum_VideoPlayEventType.ConnNumMax: sbDisplayInfo.Append("超出设备最大连接数"); break; case Enum_VideoPlayEventType.StartVideoRecord: sbDisplayInfo.Append("开始视频视频录像"); break; case Enum_VideoPlayEventType.StartVideoRecordException: sbDisplayInfo.Append("开始视频视频录像异常"); break; case Enum_VideoPlayEventType.StopVideoRecord: sbDisplayInfo.Append("停止视频录像"); break; case Enum_VideoPlayEventType.StopVideoRecordException: sbDisplayInfo.Append("停止视频录像异常"); break; case Enum_VideoPlayEventType.LoginStart: sbDisplayInfo.Append("设备开始登陆"); break; case Enum_VideoPlayEventType.LogonIn: sbDisplayInfo.Append("设备登陆中"); break; case Enum_VideoPlayEventType.LoginSuccess: sbDisplayInfo.Append("设备登陆成功"); break; case Enum_VideoPlayEventType.DeviceStreamTypeException: sbDisplayInfo.Append("设备码流类型异常"); break; case Enum_VideoPlayEventType.NoDeviceAuthority: sbDisplayInfo.Append("无设备权限"); break; default: sbDisplayInfo.AppendFormat("[{0}]{1}", eventValue.evType.ToString(), eventValue.EventContent); break; } sbDisplayInfo.Append("[" + videoPlayWindow.intConnCount + "]"); DisplayRecord(sbDisplayInfo.ToString()); } return(bolResult); }
public void IVideoPlayInit(Enum_VideoType videoType, VideoInfo vInfo, CameraInfo cInfo) { switch (videoType) { case Enum_VideoType.HikDVR: if (vInfo.VideoConnectType == 3) //流媒体模式 { iv = new VideoPlay_HikStream(vInfo, cInfo); } else { iv = new VideoPlay_HikDVR(vInfo, cInfo); } break; case Enum_VideoType.HikDVRStream: if (vInfo.VideoConnectType == 2) //直连模式 { iv = new VideoPlay_HikDVR(vInfo, cInfo); } else { iv = new VideoPlay_HikStream(vInfo, cInfo); } break; case Enum_VideoType.BlueSky: iv = new VideoPlay_BuleSky(this.Handle, vInfo, cInfo); break; case Enum_VideoType.Axis: iv = new VideoPlay_AXIS(vInfo, cInfo); break; case Enum_VideoType.XMaiVideo: iv = new VideoPlay_XMai(vInfo, cInfo); break; case Enum_VideoType.Ezviz: iv = new VideoPlay_Ezviz(vInfo, cInfo); break; case Enum_VideoType.SKNVideo: iv = new VideoPlay_SKNVideo(vInfo, cInfo); break; case Enum_VideoType.ZLVideo: iv = new VideoPlay_ZLVideo(vInfo, cInfo); break; case Enum_VideoType.SKVideo: iv = new VideoPlay_Shike(vInfo, cInfo); break; case Enum_VideoType.DaHuaVideo: iv = new VideoPlay_DaHua(vInfo, cInfo); break; case Enum_VideoType.CloundSee: iv = new VideoPlay_CloundSee(vInfo, cInfo); break; case Enum_VideoType.HuaMaiVideo: iv = new VideoPlay_HuaMai(vInfo, cInfo); break; case Enum_VideoType.TLiVideo: iv = new VideoPlay_TLi(vInfo, cInfo); break; default: iv = null; break; } }