advance method

void advance(
  1. Duration by
)

Moves the playhead, as a device that consumes frames does. The playhead stops at the end.

Implementation

void advance(Duration by) {
  final next = _position + by;
  _position = next > duration ? duration : next;
}