Skip to main content
←API Reference ←com.nianticspatial.nsdk.playback ←PlaybackCacheSession

open


Declaration​

suspend fun open(scanId: String, onProgress: (Double) -> Unit): PlaybackDataset

Summary​

Opens a scan's recording, downloading it into the cache unless it is already there.


Create and authorize the NSDK session first. A cached scan needs no network. Only the first
chunk of a chunked recording plays. Cancelling the calling coroutine cancels the download.
The dataset does not loop.

Throws​

  • PlaybackOpenException — if the open fails.
  • com.nianticspatial.nsdk.NsdkInvalidArgumentStatusException — if scanId is malformed.
  • com.nianticspatial.nsdk.NsdkInvalidOperationStatusException — if this session is already opening scanId.

Parameters​

NameTypeSummary
scanIdString
The portal scan ID.
onProgress(Double) -> Unit
Called on the calling coroutine with download progress in [0, 1].