startStreaming static method

Future<bool> startStreaming(
  1. Bridge bridge,
  2. String entertainmentConfigurationId,
  3. DtlsData dtlsData, {
  4. String decrypter(
    1. String ciphertext
    )?,
})

Start streaming for the givin entertainmentConfiguration.

The bridge parameter is the bridge to establish the handshake with.

decrypter When the old tokens are read from local storage, they are decrypted. This parameter allows you to provide your own decryption method. This will be used in addition to the default decryption method. This will be performed after the default decryption method.

May throw ExpiredAccessTokenException if trying to connect to the bridge remotely and the token is expired. If this happens, refresh the token with TokenRepo.refreshRemoteToken.

Implementation

static Future<bool> startStreaming(
  Bridge bridge,
  String entertainmentConfigurationId,
  DtlsData dtlsData, {
  String Function(String ciphertext)? decrypter,
}) async {
  final bool isStarted = await _startStreaming(
    bridge,
    entertainmentConfigurationId,
    decrypter: decrypter,
  );

  if (!isStarted) return false;

  return await EntertainmentStreamRepo._establishDtlsHandshake(
    bridge: bridge,
    dtlsData: dtlsData,
    decrypter: decrypter,
  );
}