getStreamUri static method

XmlDocumentFragment getStreamUri(
  1. String profileToken, {
  2. required StreamSetup streamSetup,
})

XML for the getStreamUri, requires a profileToken

Implementation

static XmlDocumentFragment getStreamUri(String profileToken,
    {required StreamSetup streamSetup}) {
  Transport.builder.element('GetStreamUri', nest: () {
    Transport.builder.namespace(Xmlns.trt);

    Transport.builder.element('StreamSetup', nest: () {
      Transport.builder.namespace(Xmlns.trt);
      Transport.builder.element('Stream', nest: () {
        Transport.builder.namespace(Xmlns.tt);
        Transport.builder.text(streamSetup.stream);
      });
      Transport.builder.element('Transport', nest: () {
        Transport.builder.namespace(Xmlns.tt);
        Transport.builder.element('Protocol', nest: () {
          Transport.builder.namespace(Xmlns.tt);
          Transport.builder.text(streamSetup.transport.protocol);
        });
      });
    });

    Transport.builder.element('ProfileToken', nest: () {
      Transport.builder.text(profileToken);
    });
  });

  return Transport.builder.buildFragment();
}