Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

FaceCam Live Preview freezes after about 1 Second

Discussion in 'Unity Everyplay' started by philstubbs, Apr 20, 2015.

  1. philstubbs

    philstubbs

    Joined:
    Apr 16, 2015
    Posts:
    6
    I got the live preview working, but after a short time the picture of the preview freezes. Below are the relevant parts of code.

    Code (CSharp):
    1. void Start() {
    2.         Everyplay.SharedInstance.FaceCamRecordingPermission += CheckForRecordingPermission;
    3.         RequestPermission ();
    4.         _recordingStarted = false;
    5.     }
    6.  
    7. private void CheckForRecordingPermission(bool granted) {
    8.         if(granted) {
    9.             Everyplay.FaceCamStartSession();
    10.             Everyplay.FaceCamSetPreviewVisible(true);
    11.         }
    12.     }
    13.  
    14. void Update () {
    15.         if (Everyplay.FaceCamIsSessionRunning () && !_recordingStarted) {
    16.             Everyplay.StartRecording ();
    17.             _recordingStarted = true;
    18.         }
    19.     }
    Is anything wrong with this? The test device is an iPad 4 Move with iOS 8.1.3
     
  2. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    240
    The code looks about right. However changing Everyplay.FaceCamSetPreviewVisible(true); should be called before FaceCamStartSession. In your code that does not really matter since preview is enabled by default. I will try to replicate this if I find a matching device. What Everyplay SDK and Unity version were you using?
     
  3. philstubbs

    philstubbs

    Joined:
    Apr 16, 2015
    Posts:
    6
    I fixed the order just to make sure, but the problem persists.
    EP SDK: 1950-1310
    Unity: 5.0.1f1

    I will try to replicate the problem on another iOS device tomorrow.