stop method

  1. @override
Future<bool> stop()
override

Stop this Track if not stopped. Returns true if stopped, false if already stopped

Implementation

@override
Future<bool> stop() async {
  final didStop = await super.stop();
  if (didStop) {
    logger.fine('Stopping mediaStreamTrack...');
    try {
      await mediaStreamTrack.stop();
    } catch (error) {
      logger.severe('MediaStreamTrack.stop() did throw $error');
    }
    try {
      await mediaStream.dispose();
    } catch (error) {
      logger.severe('MediaStreamTrack.dispose() did throw $error');
    }
  }
  return didStop;
}