Google is committed to advancing racial equity for Black communities. See how.

Google.XR.ARCoreExtensions.ARPlaybackManager

Provides access to session playback functionality.

Summary

Inheritance

Inherits from: MonoBehaviour

Properties

PlaybackStatus
Gets the current state of the playback.

Public functions

GetUpdatedTrackData(Guid trackId)
List< TrackData >
Gets the set of data recorded to the given track available during playback on this frame.
SetPlaybackDataset(string datasetFilepath)
Sets an MP4 dataset file to playback instead of using the live camera feed and IMU sensor data.

Properties

PlaybackStatus

PlaybackStatus PlaybackStatus

Gets the current state of the playback.

Details
Returns
The current PlaybackStatus.

Public functions

GetUpdatedTrackData

List< TrackData > GetUpdatedTrackData(
  Guid trackId
)

Gets the set of data recorded to the given track available during playback on this frame.

Note, currently playback continues internally while the session is paused. Therefore, on pause/resume, track data discovered internally will be discarded to prevent stale track data from flowing through when the session resumed. Note, if the app's frame rate is higher than ARCore's frame rate, subsequent objects may reference the same underlying ARCore Frame, which would mean the list of TrackData returned could be the same. One can differentiate by examining TrackData.FrameTimestamp.

Details
Parameters
trackId
The ID of the track being queried.
Returns
Returns a list of TrackData. Will be empty if none are available.

SetPlaybackDataset

PlaybackResult SetPlaybackDataset(
  string datasetFilepath
)

Sets an MP4 dataset file to playback instead of using the live camera feed and IMU sensor data.

Restrictions:

  • Can only be called while the session is paused. Playback of the MP4 dataset file will start once the session is resumed.
  • The MP4 dataset file must use the same camera facing direction as is configured in the session.
  • Due to the way session data is processed, ARCore APIs may sometimes produce different results during playback than during recording and produce different results during subsequent playback sessions. For exmaple, the number of detected planes and other trackables, the precise timing of their detection and their pose over time may be different in subsequent playback sessions.
  • Once playback has started pausing the session (by disabling the ARSession) will suspend processing of all camera image frames and any other recorded sensor data in the dataset. Camera image frames and sensor frame data that is discarded in this way will not be reprocessed when the session is again resumed (by re-enabling the ARSession). AR tracking for the session will generally suffer due to the gap in processed data.

Details
Parameters
datasetFilepath
The filepath of the MP4 dataset. Null if stopping the playback and resuming a live feed.
Returns
PlaybackResult.Success if playback filepath was set without issue. Otherwise, the PlaybackResult will indicate the error.