@Test public void getTimePositionMsOnceAndStream_reportsInitialProgress_whenPaused() { new ArrangeBuilder() .withPausedExoPlayer() .withProgress(500L); defaultObservableExoPlayer.getTimePositionMsOnceAndStream(100L, TimeUnit.SECONDS) .test() .assertValue(500L); }
@NonNull @Override public Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod, @NonNull final TimeUnit timeUnit) { return getExoPlayerStateOnceAndStream() .map(DefaultObservableExoPlayer::isTimelineChanging) .switchMap(isTimelineChanging -> timePositionMsOnceAndStream(isTimelineChanging, updatePeriod, timeUnit)); }
DefaultObservableExoPlayer implements ObservableExoPlayer { @NonNull @Override public Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod, @NonNull final TimeUnit timeUnit) { return getExoPlayerStateOnceAndStream() .map(DefaultObservableExoPlayer::isTimelineChanging) .switchMap(isTimelineChanging -> timePositionMsOnceAndStream(isTimelineChanging, updatePeriod, timeUnit)); } }
DefaultObservableExoPlayer implements ObservableExoPlayer { @NonNull @Override public Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod, @NonNull final TimeUnit timeUnit) { return getExoPlayerStateOnceAndStream() .map(DefaultObservableExoPlayer::isTimelineChanging) .switchMap(isTimelineChanging -> timePositionMsOnceAndStream(isTimelineChanging, updatePeriod, timeUnit)); } @Inject  DefaultObservableExoPlayer(@NonNull final Observable<ExoPlayerState> stateOnceAndStream,
                               @NonNull final Observable<Long> progressOnceAndStream,
                               @NonNull final SchedulerProvider schedulerProvider); }
DefaultObservableExoPlayer implements ObservableExoPlayer { @NonNull @Override public Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod, @NonNull final TimeUnit timeUnit) { return getExoPlayerStateOnceAndStream() .map(DefaultObservableExoPlayer::isTimelineChanging) .switchMap(isTimelineChanging -> timePositionMsOnceAndStream(isTimelineChanging, updatePeriod, timeUnit)); } @Inject  DefaultObservableExoPlayer(@NonNull final Observable<ExoPlayerState> stateOnceAndStream,
                               @NonNull final Observable<Long> progressOnceAndStream,
                               @NonNull final SchedulerProvider schedulerProvider); @NonNull @Override Observable<ExoPlayerState> getExoPlayerStateOnceAndStream(); @NonNull @Override Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod,
                                                           @NonNull final TimeUnit timeUnit); }
DefaultObservableExoPlayer implements ObservableExoPlayer { @NonNull @Override public Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod, @NonNull final TimeUnit timeUnit) { return getExoPlayerStateOnceAndStream() .map(DefaultObservableExoPlayer::isTimelineChanging) .switchMap(isTimelineChanging -> timePositionMsOnceAndStream(isTimelineChanging, updatePeriod, timeUnit)); } @Inject  DefaultObservableExoPlayer(@NonNull final Observable<ExoPlayerState> stateOnceAndStream,
                               @NonNull final Observable<Long> progressOnceAndStream,
                               @NonNull final SchedulerProvider schedulerProvider); @NonNull @Override Observable<ExoPlayerState> getExoPlayerStateOnceAndStream(); @NonNull @Override Observable<Long> getTimePositionMsOnceAndStream(long updatePeriod,
                                                           @NonNull final TimeUnit timeUnit);  }