Stay organized with collections
Save and categorize content based on your preferences.
ARPlaybackManager
Provides access to session playback functionality.
Summary
Inheritance
Inherits from:
UnityEngine::MonoBehaviour
Properties
PlaybackStatus
PlaybackStatus PlaybackStatus
Gets the current state of the playback.
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 example, 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.
Deprecated.
Please use SetPlaybackDatasetUri(Uri) instead.
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.
|
SetPlaybackDatasetUri
PlaybackResult SetPlaybackDatasetUri(
Uri datasetUri
)
Sets the uri for a dataset to be played back.
The ARCore Session must be paused when using this method. Resume the Session for the change to take effect. The AbsoluteUri property of the Uri will be passed to ARCore to create an android.net.Uri.
The uri must point to a seekable resource.
See SetPlaybackDataset(string)
for more restrictions.
Details |
Parameters |
datasetUri
|
The uri of the MP4 dataset. Null if stopping the playback and resuming a live feed.
|
|
Returns
|
PlaybackResult.Success if playback uri was set without issue. Otherwise, the PlaybackResult will indicate the error.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-14 UTC.
[null,null,["Last updated 2025-07-14 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eARPlaybackManager\u003c/code\u003e provides access to AR session playback functionality, allowing developers to replay recorded AR sessions.\u003c/p\u003e\n"],["\u003cp\u003eIt offers methods to set the playback dataset from a file path or URI, enabling control over the data source for playback.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can retrieve updated track data during playback, which includes information about detected features and their properties.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ePlaybackStatus\u003c/code\u003e property reflects the current state of the playback, such as whether it's playing, paused, or completed.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSetPlaybackDataset\u003c/code\u003e function is deprecated and should be replaced with \u003ccode\u003eSetPlaybackDatasetUri\u003c/code\u003e for setting the playback dataset.\u003c/p\u003e\n"]]],[],null,["# ARPlaybackManager Class Reference\n\nARPlaybackManager\n=================\n\nProvides access to session playback functionality.\n\nSummary\n-------\n\n### Inheritance\n\nInherits from: [`UnityEngine::MonoBehaviour`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.html)\n\n| ### Properties ||\n|-----------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|\n| [PlaybackStatus](#playbackstatus) | [PlaybackStatus](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackstatus) Gets the current state of the playback. |\n\n| ### Public functions ||\n|-------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [GetUpdatedTrackData](#getupdatedtrackdata)`(`[Guid](https://docs.microsoft.com/en-us/dotnet/api/System.Guid)` trackId)` | `List\u003c `[TrackData](/ar/reference/unity-arf/struct/Google/XR/ARCoreExtensions/TrackData#structGoogle_1_1XR_1_1ARCoreExtensions_1_1TrackData)` \u003e` Gets the set of data recorded to the given track available during playback on this frame. |\n| [SetPlaybackDataset](#setplaybackdataset)`(string datasetFilepath)` | [PlaybackResult](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackresult) **[Deprecated.](/ar/reference/unity-arf/deprecated/deprecated)** Please use [SetPlaybackDatasetUri(Uri)](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARPlaybackManager#setplaybackdataseturi) instead. Sets an MP4 dataset file to playback instead of using the live camera feed and IMU sensor data. |\n| [SetPlaybackDatasetUri](#setplaybackdataseturi)`(`[Uri](https://docs.microsoft.com/en-us/dotnet/api/System.Uri)` datasetUri)` | [PlaybackResult](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackresult) Sets the uri for a dataset to be played back. |\n\nProperties\n----------\n\n### PlaybackStatus\n\n```c#\nPlaybackStatus PlaybackStatus\n``` \nGets the current state of the playback.\n\n\n| Details ||\n|-------------|------------------------------------------------------------------------------------------------------------|\n| **Returns** | The current [PlaybackStatus](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackstatus). |\n\nPublic functions\n----------------\n\n### GetUpdatedTrackData\n\n```c#\nList\u003c TrackData \u003e GetUpdatedTrackData(\n Guid trackId\n)\n``` \nGets the set of data recorded to the given track available during playback on this frame.\n\nNote, 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](/ar/reference/unity-arf/struct/Google/XR/ARCoreExtensions/TrackData#structGoogle_1_1XR_1_1ARCoreExtensions_1_1TrackData) returned could be the same. One can differentiate by examining [TrackData.FrameTimestamp](/ar/reference/unity-arf/struct/Google/XR/ARCoreExtensions/TrackData#frametimestamp).\n\n\n| Details ||\n|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-----------|------------------------------------| | `trackId` | The ID of the track being queried. | |\n| **Returns** | Returns a list of [TrackData](/ar/reference/unity-arf/struct/Google/XR/ARCoreExtensions/TrackData#structGoogle_1_1XR_1_1ARCoreExtensions_1_1TrackData). Will be empty if none are available. |\n\n### SetPlaybackDataset\n\n```c#\nPlaybackResult SetPlaybackDataset(\n string datasetFilepath\n)\n``` \nSets an MP4 dataset file to playback instead of using the live camera feed and IMU sensor data.\n\nRestrictions:\n\n- Can only be called while the session is paused. Playback of the MP4 dataset file will start once the session is resumed.\n- The MP4 dataset file must use the same camera facing direction as is configured in the session.\n- 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 example, 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.\n- 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.\n\n\u003cbr /\u003e\n\n**[Deprecated.](/ar/reference/unity-arf/deprecated/deprecated)** Please use [SetPlaybackDatasetUri(Uri)](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARPlaybackManager#setplaybackdataseturi) instead.\n\n| Details ||\n|-------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |-------------------|------------------------------------------------------------------------------------------| | `datasetFilepath` | The filepath of the MP4 dataset. Null if stopping the playback and resuming a live feed. | |\n| **Returns** | `PlaybackResult.Success` if playback filepath was set without issue. Otherwise, the [PlaybackResult](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackresult) will indicate the error. |\n\n### SetPlaybackDatasetUri\n\n```c#\nPlaybackResult SetPlaybackDatasetUri(\n Uri datasetUri\n)\n``` \nSets the uri for a dataset to be played back.\n\nThe ARCore Session must be paused when using this method. Resume the Session for the change to take effect. The AbsoluteUri property of the Uri will be passed to ARCore to create an android.net.Uri.\n\nThe uri must point to a seekable resource.\n\nSee [SetPlaybackDataset(string)](/ar/reference/unity-arf/class/Google/XR/ARCoreExtensions/ARPlaybackManager#setplaybackdataset) for more restrictions.\n\n\n| Details ||\n|-------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Parameters | |--------------|-------------------------------------------------------------------------------------| | `datasetUri` | The uri of the MP4 dataset. Null if stopping the playback and resuming a live feed. | |\n| **Returns** | `PlaybackResult.Success` if playback uri was set without issue. Otherwise, the [PlaybackResult](/ar/reference/unity-arf/namespace/Google/XR/ARCoreExtensions#playbackresult) will indicate the error. |"]]