setVolume static method

Future<void> setVolume(
  1. double volume,
  2. MediaStreamTrack track
)

Implementation

static Future<void> setVolume(double volume, MediaStreamTrack track) async {
  if (track.kind == 'audio') {
    if (kIsWeb) {
      final constraints = track.getConstraints();
      constraints['volume'] = volume;
      await track.applyConstraints(constraints);
    } else {
      await WebRTC.invokeMethod(
        'setVolume',
        <String, dynamic>{'trackId': track.id, 'volume': volume},
      );
    }
  }

  return Future.value();
}