onTimebasedPlayerStateChanged property

  1. @override
Stream<ReadiumTimebasedState> get onTimebasedPlayerStateChanged
override

Fires whenever the TimebasedNavigator changes state

Implementation

@override
Stream<ReadiumTimebasedState> get onTimebasedPlayerStateChanged {
  _onTimebasedPlayerStateChanged ??= timebasedStateChannel
      .receiveBroadcastStream()
      .map((dynamic event) {
        final state = ReadiumTimebasedState.fromJsonMap(
          json.decode(event) as Map<String, dynamic>,
        );
        return state;
      });
  return _onTimebasedPlayerStateChanged!;
}