Search Unity

Stable everyplay initialization

Discussion in 'Unity Everyplay' started by icebear007, Jul 23, 2016.

  1. icebear007

    icebear007

    Joined:
    Jun 8, 2016
    Posts:
    67
    Hi,

    I have problems with a reliable everyplay initialization and recording. The ReadyForRecording event is only triggered if I start and stop a recording once (knowing that it can't record anything). Afterwards, the recording is working.

    Code (CSharp):
    1. void Start ()
    2. {
    3.     Everyplay.ReadyForRecording += OnReadyForRecording;
    4. }
    5.  
    6. public void OnReadyForRecording(bool enabled)
    7. {
    8.     // Won't be called until I call StartRecordingGame() once.
    9.     if (enabled)
    10.     {
    11.         // The recording is supported
    12.         recordButton.SetActive(true);
    13.     }
    14. }
    15.  
    16. public void StartRecordingGame()
    17. {
    18.     Debug.Log("IsReadyForRecording: " + Everyplay.IsReadyForRecording());   // The first time this will be false, the seoncd time this is true.
    19.     Everyplay.StartRecording();
    20. }
    Furthermore, the failsafe is messing up my game because the recording just stops working after a some game starts.

    Do you have an idea how to improve this? Is there a better way to initialize and start recordings?

    Thanks,
    Alex
     
  2. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
  3. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    The issue mentioned is fixed in latest Unity Everyplay 2120-1540 - Sep 12th 2016 release.
     
  4. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    When the app starts for the first time Everyplay (Android) requires a server side check to see if device is supported. The check will take some time. Later the Internet is no longer required and the app will know if it can record with this device or not. After the first time OnReadyForRecording might happen in so early stage that you might miss it. To get around it you might want to change your Start method like this:

    Code (CSharp):
    1. void Start ()
    2. {
    3.     Everyplay.ReadyForRecording += OnReadyForRecording;
    4.  
    5.     if(Everyplay.IsReadyForRecording()) {
    6.         recordButton.SetActive(true);
    7.     }
    8. }