# open Source: https://www.nianticspatial.com/docs/api/swift/NSDK.NSDKPlaybackCacheSession.method-open/ open --- ## Declaration func open(scanId: String, onProgress: ((Double) -> Void)? = nil) async throws -> PlaybackDataset #### Summary Opens a scan's recording, downloading it into the cache unless it is already there. Create and authorize the NSDKSession first. A cached scan needs no network. Only the first chunk of a chunked recording plays. Cancelling the calling Task cancels the download. The dataset does not loop. #### Throws PlaybackOpenError if the open fails, including sessionEnded once the NSDKSession is released; NSDKError.invalidArgument if scanId is malformed; .unknown if the device has no cache directory; .invalidOperation while this session is already opening scanId. ### Parameters | Name | Type | Summary | | --- | --- | --- | | scanId | String | The portal scan ID. | | onProgress | ((Double) -> Void)? | Called from the opening task with download progress in [0, 1]. Called off the main actor; hop to the main actor before updating UI. | ---