/// <summary> /// 启动实时取景视频流。调用这个API,会创建一个TCP服务器,端口为890.客户端可以通过SOCKET端口,读取视频流。视频流格式为MJPEG. /// 返回: 成功返回 状态代码 200 OK,否则返回状态代码500. /// </summary> /// <param name="request"></param> /// <param name="response"></param> void onCaptureMovie(HTTPRequest request, HTTPResponse response) { if (RequestIsSuccess(request, response)) { if (response.StatusCode == 200) { Debug.Log("连接实时取景成功 : "); if (_videoReceiver == null) { _videoReceiver = new VideoReceiver(onVideoFramePrepared); } _videoReceiver.Receive(); _connectLiveShowSuccess = true; } else { // 实时取景失败 _connectLiveShowSuccess = false; } } else { Debug.Log("连接实时取景失败 : "); // 连接实时取景失败 _connectLiveShowSuccess = false; } if (!_connectLiveShowSuccess) { _onCameraManagerError.Invoke("_connect Live Show Error"); } }
/// <summary> /// 启动实时取景视频流。调用这个API,会创建一个TCP服务器,端口为890.客户端可以通过SOCKET端口,读取视频流。视频流格式为MJPEG. /// 返回: 成功返回 状态代码 200 OK,否则返回状态代码500. /// </summary> /// <param name="request"></param> /// <param name="response"></param> void onCaptureMovie(HTTPRequest request, HTTPResponse response) { if (RequestIsSuccess(request, response)) { if (response.StatusCode == 200) { VideoReceiver videoReceiver = new VideoReceiver(onVideoFramePrepared); videoReceiver.Receive(); } else { // 实时取景失败 } } else { // 连接实时取景失败 } }