Log in or register to post comments

AR camera play and pause

September 19, 2017 - 11:34pm #1

Hi,

I have created unity plugin for android and using it in android application. AR detections and 3D rendering everything works fine. But for particular case with ARCamera I am facing following issues :

A. When ARCamera is paused

1. Android application in background and come back in forground then ARCamera background is lost and showing blank screen. 

ARCamera Started==> ARCamera Paused==> Application Background ==> Application foreground ==> ARCamera black screen

Attached screenshots for reference

1. ARCamera Paused

2. Application background

3. Application foreground

 

 

 

AttachmentSize
Image icon arcamera_paused.png1.66 MB
Image icon app_foreground_again.png35.39 KB
Image icon app_background.png1.32 MB

AR camera play and pause

March 11, 2018 - 5:21pm #5

using Vuforia;

VuforiaRenderer.Instance.Pause(true);

AR camera play and pause

October 12, 2017 - 2:40pm #4

In our sample app, the CameraSettings.cs script has the following function that properly stops and restarts Vuforia:

private bool RestartCamera(CameraDevice.CameraDirection direction)
    {
        ObjectTracker tracker = TrackerManager.Instance.GetTracker<ObjectTracker>();
        if (tracker != null)
            tracker.Stop();

        CameraDevice.Instance.Stop();
        CameraDevice.Instance.Deinit();

        if (!CameraDevice.Instance.Init(direction))
        {
            Debug.Log("Failed to init camera for direction: " + direction.ToString());
            return false;
        }
        if (!CameraDevice.Instance.Start())
        {
            Debug.Log("Failed to start camera for direction: " + direction.ToString());
            return false;
        }

        if (tracker != null)
        {
            if (!tracker.Start())
            {
                Debug.Log("Failed to restart the Tracker.");
                return false;
            }
        }
           
        return true;
    }


Could you try something similar to what is being done in this function and let me know if that resolves your issue.

Thanks and sorry for the delayed response,

-Vuforia Support

AR camera play and pause

September 21, 2017 - 11:45pm #3

hi,

Please find the attached script which I am using to pause and resume the camera.

when application restarted means background to foreground the image(texture) has been lost. I want the same image on the camera screen.

 

Thanks

AttachmentSize
Plain text icon Camera PauseResume.txt2.32 KB

AR camera play and pause

September 21, 2017 - 12:11pm #2

Hello satampratham,

What code are you using to pause the ARCamera? Are you doing this to because you need to run some code that requires Vuforia to not be running?

Thanks,

-Vuforia Support

Log in or register to post comments