positionStream property

Stream<Duration> positionStream

A stream tracking the current position of this player, suitable for animating a seek bar. To ensure a smooth animation, this stream emits values more frequently on short items where the seek bar moves more quickly, and less frequenly on long items where the seek bar moves more slowly. The interval between each update will be no quicker than once every 16ms and no slower than once every 200ms.

See createPositionStream for more control over the stream parameters.

Implementation

Stream<Duration> get positionStream {
  if (_positionSubject == null) {
    _positionSubject = BehaviorSubject<Duration>();
    if (!_disposed) {
      _positionSubject!.addStream(createPositionStream(
          steps: 800,
          minPeriod: const Duration(milliseconds: 16),
          maxPeriod: const Duration(milliseconds: 200)));
    }
  }
  return _positionSubject!.stream;
}