MethodChannelXAudioSink constructor

MethodChannelXAudioSink()

Subscribes to the native event stream on platforms that register a handler for it.

Implementation

MethodChannelXAudioSink() {
  if (!supported) return;
  _events.receiveBroadcastStream().listen(
    _onEvent,
    onError: (e, st) {
      FlutterError.reportError(
        FlutterErrorDetails(
          exception: e,
          stack: st,
          library: 'ux',
          context: ErrorDescription('while playing audio'),
        ),
      );
    },
  );
}