open
Declaration
func open(scanId: String, onProgress: ((Double) -> Void)? = nil) async throws -> PlaybackDataset
Summary
Throws
PlaybackOpenErrorif the open fails, includingsessionEndedonce theNSDKSessionis released;NSDKError.invalidArgumentifscanIdis malformed;.unknownif the device has no cache directory;.invalidOperationwhile this session is already openingscanId.
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. |
Opens a scan's recording, downloading it into the cache unless it is already there.
Create and authorize the
NSDKSessionfirst. A cached scan needs no network. Only thefirst chunk of a chunked recording plays. Cancelling the calling
Taskcancels thedownload. The dataset does not loop.