Setting Up Playback
To see the SD Card the user will have to create a SDCardPlaybackClient object. Which will initialize the SD Card playback and start the streaming to a player that can be fetched from the newly created object.
Initiating a SD Card Playback Connection
To create a SDCardPlaybackClient you will need
startTime(required): Epoch seconds at which playback begins.endTime(required): Epoch seconds; rounded up to the end of that day.device(required): TheDeviceobject of the camera you want to connect to.streamType(optional): Whether to request theMAINSTREAMorSUBSTREAMresolution. Defaults toStreamType.MAINSTREAM.playbackLens(optional): The sensor id to play back on cameras with multiple lenses.null(default) selects the first sensor.autoDisconnectAfter(optional): Milliseconds of inactivity after which the stream auto-disconnects. Defaults to0L(disabled).
You can create an object likewise:
val client = SDCardPlaybackClient(
device = device,
startTime = 123123123L,
endTime = 123123123L,
)
Handing audio over to a call
An SDCardPlaybackClient shares its streaming behaviour with the live view client. If your app manages calls through its own ConnectionService or Telecom integration, tell the client to stop managing the audio mode so the two do not fight over the audio route:
client.setTelecomOwnsAudio(true)
Set it back to false once the call ends and the SDK should manage the audio route again.
Failures during playback
If a failure occurs while playback is running, the status moves to FAILED rather than bringing down the app, so treat FAILED as a state to recover from.