google-ar / arcore-unity-sdk

ARCore SDK for Unity
https://developers.google.com/ar
Other
1.4k stars 403 forks source link

Unable to play recorded session #785

Closed Zumbalamambo closed 3 years ago

Zumbalamambo commented 3 years ago

I'm using the following code to play the recorded session,

public IEnumerator restart()
  {
      ARCoreSession session = arcoreObj.GetComponent<ARCoreSession>();
      ARCoreSessionConfig myConfig = session.SessionConfig;
      arcoreSession.enabled = false;
      DestroyImmediate(session);
      yield return new WaitForSeconds(2);

      playbackResult =  Session.SetPlaybackDataset(_filenameToSave);

      if (playbackResult == PlaybackResult.OK)
      {
          ShowAndroidToastMessage("Done");
      }else if (playbackResult == PlaybackResult.ErrorPlaybackFailed)
      {
          ShowAndroidToastMessage("ErrorPlaybackFailed");

      }else if (playbackResult == PlaybackResult.ErrorSessionUnsupported)
      {
          ShowAndroidToastMessage("ErrorSessionUnsupported");

      }
      else if (playbackResult == PlaybackResult.ErrorSessionNotPaused)
      {
          ShowAndroidToastMessage("ErrorSessionNotPaused");
      }

      session = arcoreObj.AddComponent<ARCoreSession>();
      session.SessionConfig = myConfig;
      session.enabled = true;
  }

Unfortunately, it throws ErrorPlaybackFailed error. How can I sort this out?