Search Unity

Tricky bug with IsReadyForRecording(), heads up!

Discussion in 'Unity Everyplay' started by hidingspot, Sep 10, 2016.

  1. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    The private bool that is returned by the IsReadyForRecording() method in Everyplay.cs will not be set correctly if the ReadyForRecording event does not have a delegate appended to it at the time that Everyplay becomes ready. See more here:
    https://github.com/Everyplay/everyplay-unity-sdk/issues/14

    I spent a good part of the day looking at my code until I realized it's a bug with the Unity Everyplay package. Hopefully this post will prevent others from doing the same. My temporary fix was just to create my own EveryplayInitializer that appends an empty delegate method to ReadyForRecording before Everyplay is initialized. Ideally the bug will be fixed so that such a workaround won't be necessary.
     
  2. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    We are sorry for the inconvenience. The best practise is to use ReadyForRecording event since the state might also change during recording if the device gets out of disk space. The issue is however now fixed in Everyplay SDK 2121-1540 - Sep 13th 2016, available from the Asset Store.
     
  3. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    I was using the ReadyForRecord event exactly as I would have thought appropriate: calling IsReadyForRecording first to check if it's already good to go, otherwise subscribing to ReadyForRecord event. Given the bug, this can either work as expected or fail depending on the timing of initialization, hence the trickiness to figure out what was wrong.

    Regardless, thanks for the speedy update!
     
  4. pmjo

    pmjo

    Unity Technologies

    Joined:
    Sep 17, 2013
    Posts:
    245
    Yes, that is exactly the best way to handle it and IsReadyForRecording now hopefully works like expected.