private void RecordVideo()
 {
     NativeCamera.Permission permission = NativeCamera.RecordVideo((path) =>
     {
         if (!string.IsNullOrEmpty(path) && !string.IsNullOrWhiteSpace(path))
         {
             ApplyMediaTreatment(path, false);
         }
     });
 }
示例#2
0
    private void RecordVideo()
    {
        NativeCamera.Permission permission = NativeCamera.RecordVideo((path) =>
        {
            Debug.Log("Video path: " + path);
            if (path != null)
            {
                StartCoroutine(LoadVideo(path));
            }
        });

        Debug.Log("Permission result: " + permission);
    }
示例#3
0
    // Records a video, using https://github.com/yasirkula/UnityNativeCamera
    private void RecordVideo()
    {
        gameObject.transform.Find("Explanation").gameObject.SetActive(false);
        if (NativeCamera.IsCameraBusy())
        {
            output.text = ("Camera Busy");
            return;
        }
        vidTime = DateTime.Now + new TimeSpan(0, 0, 4); // TODO can we do better than just "it'll start in 4 seconds"?

        NativeCamera.Permission permission = NativeCamera.RecordVideo(HandleVideo, NativeCamera.Quality.Low);

        Debug.Log("Permission result: " + permission);
    }
示例#4
0
    private void RecordVideo()
    {
        NativeCamera.Permission permission = NativeCamera.RecordVideo((path) =>
        {
            UnityEngine.Debug.Log("Video path: " + path + " is the path");
            if (path != null)
            {
                // Play the recorded video
                //Handheld.PlayFullScreenMovie("file://" + path);
            }
        });//, NativeCamera.Quality.Medium, 100, 100L, NativeCamera.PreferredCamera.Front);

        UnityEngine.Debug.Log("Permission result: " + permission);
    }
示例#5
0
    private void RecordVideo()
    {
        NativeCamera.Permission permission = NativeCamera.RecordVideo((path) =>
        {
            Debug.Log("Video path: " + path);
            if (path != null)
            {
                // Play the recorded video
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        });

        Debug.Log("Permission result: " + permission);
    }
示例#6
0
    private void VideoKaydet()
    {
        NativeCamera.Permission izin = NativeCamera.RecordVideo((konum) =>
        {
            Debug.Log("Kaydedilen videonun konumu: " + konum);
            if (konum != null)
            {
                // Videoyu oynat
                Handheld.PlayFullScreenMovie("file://" + konum);
            }
        });

        Debug.Log("İzin durumu: " + izin);
    }
示例#7
0
 /// <summary>
 /// 打开相机录像
 /// </summary>
 public static void OpenCameraVideo(Action <string> callBack)
 {
     NativeCamera.Permission permission = NativeCamera.RecordVideo((string path) =>
     {
         if (!string.IsNullOrEmpty(path) && callBack != null)
         {
             callBack(path);
         }
     });
     if (permission != NativeCamera.Permission.Granted)
     {
         ShowToast("当前没有相机访问权限,请在设置中打开");
         //打开应用程序设置
         if (NativeCamera.CanOpenSettings())
         {
             NativeCamera.OpenSettings();
         }
     }
 }