setLoop method

Future<void> setLoop(
  1. int loopCount
)

Set player loop count

loopCount must not null and greater than or equal to 0. Default loopCount of player is 1, which also means no loop. A positive value of loopCount means special repeat times. If loopCount is 0, is means infinite repeat.

Implementation

Future<void> setLoop(int loopCount) async {
  await _nativeSetup.future;
  if (loopCount < 0) {
    FijkLog.e("$this invoke setLoop invalid loopCount:$loopCount");
    return Future.error(ArgumentError.value(
        loopCount, "loopCount must not be null and >= 0"));
  } else {
    FijkLog.i("$this invoke setLoop $loopCount");
    return _channel
        .invokeMethod("setLoop", <String, dynamic>{"loop": loopCount});
  }
}