/// <summary>
        /// Raises the save to camera roll button click event.
        /// </summary>
        public async void OnSaveToCameraRollButtonClick()
        {
            Debug.Log("OnSaveToCameraRollButtonClick ()");

            if (isVideoPlaying || isVideoRecording || isFinishWriting || string.IsNullOrEmpty(videoPath))
            {
                return;
            }

            var mes = "";

#if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
            try
            {
                SavePayload payload = new SavePayload("NatCorderWithOpenCVForUnityExample");
                payload.AddMedia(videoPath);
                var success = await payload.Commit();

                mes = $"Successfully saved items: {success}";
            }
            catch (ApplicationException e)
            {
                mes = e.Message;
            }
#else
            mes = "NatShare Error: SavePayload is not supported on this platform.";
            await Task.Delay(100);
#endif

            Debug.Log(mes);
            if (fpsMonitor != null)
            {
                fpsMonitor.Toast(mes);
            }
        }
Beispiel #2
0
    private void SaveScreen()
    {
        var screenShot = ScreenCapture.CaptureScreenshotAsTexture();

        using (var payload = new SavePayload())
        {
            payload.AddImage(screenShot);
        }
    }
Beispiel #3
0
 public void OnSaveToCameraRollButtonClick()
 {
     using (var payload = new SavePayload("NatCamWithOpenCVForUnityExample",
                                          completionHandler: () =>
     {
         Debug.Log("User saved image to camera roll!");
     }
                                          ))
     {
         payload.AddImage(texture);
     }
 }
 public async Task GetSave(IHttpContext context)
 {
     Authenticator.VerifyAuth(context);
     await context.SendResponse(HttpStatusCode.OK, SavePayload.FromServer());
 }