getReplayUri method

Future<String> getReplayUri(
  1. String recordingToken, {
  2. required StreamSetup streamSetup,
})

Requests a URI that can be used to initiate playback of a recorded stream using RTSP as the control protocol. The URI is valid only as it is specified in the response. A device supporting the Replay Service shall support the GetReplayUri command.

ACCESS CLASS: READ_MEDIA

Implementation

Future<String> getReplayUri(
  String recordingToken, {
  required StreamSetup streamSetup,
}) async {
  loggy.debug('getReplayUri');

  final responseEnvelope = await transport.securedRequest(
      uri,
      soap.Body(
        request: ReplayRequest.getReplayUri(
          recordingToken,
          streamSetup: streamSetup,
        ),
      ));

  if (responseEnvelope.body.hasFault) {
    throw Exception(responseEnvelope.body.fault.toString());
  }

  return GetReplayUriResponse.fromJson(responseEnvelope.body.response!).uri;
}