setRepeatMode static method

Future setRepeatMode({
  1. required RepeatMode repeatMode,
})

Sets the repeat mode

Set repeatMode to a value of RepeatMode either off, track, context. Throws a PlatformException if adding failed Throws a MissingPluginException if the method is not implemented on the native platforms.

Implementation

static Future setRepeatMode({required RepeatMode repeatMode}) async {
  try {
    return _channel.invokeMethod(
        MethodNames.setRepeatMode, {ParamNames.repeatMode: repeatMode.index});
  } on Exception catch (e) {
    _logException(MethodNames.setRepeatMode, e);
    rethrow;
  }
}