createStream method

Future<MediaStream> createStream(
  1. String media
)

Implementation

Future<MediaStream> createStream(String media) async {
  _logger.i("Peer :: Creating stream");
  final Map<String, dynamic> mediaConstraints = {
    'audio': true,
    'video': false
  };

  MediaStream stream =
      await navigator.mediaDevices.getUserMedia(mediaConstraints);
  onLocalStream?.call(stream);
  return stream;
}