Package 

Interface MediaNavigator

  • All Implemented Interfaces:
    org.readium.r2.navigator.Navigator

    @Deprecated(message = Use the new readium-navigator-media modules.) 
    public interface MediaNavigator
     implements Navigator
                        

    A navigator rendering an audio or video publication.

    • Method Summary

      Modifier and Type Method Description
      abstract Unit setPlaybackRate(Double rate) Sets the speed of the media playback.
      abstract Unit play() Resumes or start the playback at the current location.
      abstract Unit pause() Pauses the playback.
      abstract Unit playPause() Toggles the playback.
      abstract Unit stop() Stops the playback.
      abstract Unit seekTo(Duration position) Seeks to the given time in the current resource.
      abstract Unit seekRelative(Duration offset) Seeks relatively from the current position in the current resource.
      abstract Flow<MediaPlayback> getPlayback() Current playback information.
      abstract Boolean getIsPlaying() Indicates whether the navigator is currently playing.
      abstract StateFlow<Locator> getCurrentLocator() Current position in the publication.
      Locator getCurrentLocation()
      • Methods inherited from class org.readium.r2.navigator.MediaNavigator

        go, go
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setPlaybackRate

         abstract Unit setPlaybackRate(Double rate)

        Sets the speed of the media playback.

        Normal speed is 1.0 and 0.0 is incorrect.

      • play

         abstract Unit play()

        Resumes or start the playback at the current location.

      • pause

         abstract Unit pause()

        Pauses the playback.

      • playPause

         abstract Unit playPause()

        Toggles the playback. Can be useful as a handler for play/pause button.

      • stop

         abstract Unit stop()

        Stops the playback.

        Compared to pause, the navigator may clear its state in whatever way is appropriate. For example, recovering a player's resources.

      • seekTo

         abstract Unit seekTo(Duration position)

        Seeks to the given time in the current resource.

      • seekRelative

         abstract Unit seekRelative(Duration offset)

        Seeks relatively from the current position in the current resource.

      • getIsPlaying

         abstract Boolean getIsPlaying()

        Indicates whether the navigator is currently playing.

      • getCurrentLocator

         abstract StateFlow<Locator> getCurrentLocator()

        Current position in the publication. Can be used to save a bookmark to the current position.