コード例 #1
0
        private VideoCaptureState getCurrentVideoCaptureState()
        {
            VideoCaptureState result = null;

            PlayGamesPlatform.Instance.Video.GetCaptureState(
                (status, state) =>
            {
                bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
                if (isSuccess)
                {
                    if (state.IsCapturing)
                    {
                        result = state;
                        Debug.Log("Currently capturing to " + state.CaptureMode.ToString() + " in " +
                                  state.QualityLevel.ToString());
                    }
                    else
                    {
                        Debug.Log("Not currently capturing.");
                    }
                }
                else
                {
                    Debug.Log("Error: " + status.ToString());
                }
            });
            return(result);
        }
コード例 #2
0
        private bool getVideoCaptureCapabilities()
        {
            bool result = false;

#if UNITY_ANDROID
            PlayGamesPlatform.Instance.Video.GetCaptureCapabilities(
                (status, capabilities) =>
            {
                bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
                if (isSuccess)
                {
                    if (capabilities.IsCameraSupported && capabilities.IsMicSupported &&
                        capabilities.IsWriteStorageSupported &&
                        capabilities.SupportsCaptureMode(VideoCaptureMode.File) &&
                        capabilities.SupportsQualityLevel(VideoQualityLevel.SD))
                    {
                        result = true;
                        Debug.Log("All requested capabilities are present.");
                    }
                    else
                    {
                        result = false;
                        Debug.Log("Not all requested capabilities are present!");
                    }
                }
                else
                {
                    result = false;
                    Debug.Log("Error: " + status.ToString());
                }
            });
#endif
            return(result);
        }
コード例 #3
0
        private void launchVideoCaptureOverlay()
        {
#if UNITY_ANDROID
            if (PlayGamesPlatform.Instance.Video.IsCaptureSupported())
            {
                PlayGamesPlatform.Instance.Video.IsCaptureAvailable(VideoCaptureMode.File,
                                                                    (status, isAvailable) =>
                {
                    bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
                    if (isSuccess)
                    {
                        if (isAvailable)
                        {
                            PlayGamesPlatform.Instance.Video.ShowCaptureOverlay();
                        }
                        else
                        {
                            Debug.Log("Video capture is unavailable. Is the overlay already open?");
                        }
                    }
                    else
                    {
                        Debug.Log("Error: " + status.ToString());
                    }
                });
            }
#endif
        }
コード例 #4
0
 internal void DoCaptureCapabilities()
 {
     PlayGamesPlatform.Instance.Video.GetCaptureCapabilities(
         (status, capabilities) =>
     {
         bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
         ShowEffect(isSuccess);
         if (isSuccess)
         {
             mStatus  = "Capture Capabilities:\n";
             mStatus += "Camera: " + capabilities.IsCameraSupported;
             mStatus += ", Mic: " + capabilities.IsMicSupported;
             mStatus += ", Write Storage: " + capabilities.IsWriteStorageSupported + "\n";
             mStatus += "Capture Modes - File: " + capabilities.SupportsCaptureMode(VideoCaptureMode.File);
             mStatus += ", Stream: " + capabilities.SupportsCaptureMode(VideoCaptureMode.Stream) + "\n";
             mStatus += "Quality Levels - SD: " + capabilities.SupportsQualityLevel(VideoQualityLevel.SD);
             mStatus += ", HD: " + capabilities.SupportsQualityLevel(VideoQualityLevel.HD);
             mStatus += ", XHD: " + capabilities.SupportsQualityLevel(VideoQualityLevel.XHD);
             mStatus += ", FullHD: " + capabilities.SupportsQualityLevel(VideoQualityLevel.FullHD);
         }
         else
         {
             mStatus = "Error: " + status.ToString();
         }
     });
 }
コード例 #5
0
 internal void DoCaptureAvailable()
 {
     PlayGamesPlatform.Instance.Video.IsCaptureAvailable(VideoCaptureMode.File,
                                                         (status, isAvailable) =>
     {
         bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
         ShowEffect(isSuccess);
         if (isSuccess)
         {
             mStatus = "Is video capture to file available? " + isAvailable;
         }
         else
         {
             mStatus = "Error: " + status.ToString();
         }
     });
 }
コード例 #6
0
 internal void DoCaptureState()
 {
     PlayGamesPlatform.Instance.Video.GetCaptureState(
         (status, state) =>
     {
         bool isSuccess = CommonTypesUtil.StatusIsSuccess(status);
         ShowEffect(isSuccess);
         if (isSuccess)
         {
             mStatus  = "Capture State:\n";
             mStatus += "Capturing? " + state.IsCapturing + "\n";
             mStatus += "Mode: " + state.CaptureMode.ToString();
             mStatus += ", Quality: " + state.QualityLevel.ToString() + "\n";
             mStatus += "Overlay Visible? " + state.IsOverlayVisible + "\n";
             mStatus += "Paused? " + state.IsPaused + "\n";
         }
         else
         {
             mStatus = "Error: " + status.ToString();
         }
     });
 }