/// <summary> /// Stop capturing video. /// </summary> public void EndCapture() { if (_isCapturing) { MLResult result = MLCamera.StopPreview(); if (result.IsOk) { _isCapturing = false; _captureStartTime = 0; OnVideoCaptureEnded.Invoke(_captureFilePath); } else { if (result.Code == MLResultCode.PrivilegeDenied) { Instantiate(Resources.Load("PrivilegeDeniedError")); } Debug.LogErrorFormat("Error: VideoCaptureExample failed to end video capture. Error Code: {0}", MLCamera.GetErrorCode().ToString()); } } else { Debug.LogError("Error: VideoCaptureExample failed to end video capture because the camera is not recording."); } }
private void disableExternalCamera() { MLog("disableExternalCamera :: External Camera Disabled"); MLCamera.StopPreview(); MLCamera.Disconnect(); MLCamera.Stop(); externalCameraActive = false; }
/// <summary> /// Stops the active camera. /// </summary> public virtual void Stop() { #if !UNITY_EDITOR if (hasInitDone) { MLCamera.StopPreview(); } #else if (hasInitDone) { webCamTexture.Stop(); } #endif }
public void Disable() { MLCamera.StopPreview().ThrowIfFail(); MLCamera.Disconnect().ThrowIfFail(); MLCamera.Stop(); }