Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Interface ISyncMediaManagedReaderViewSynchronizationOptions

    Options specifying the behavior for managed synchronization between a SyncMediaPlayer and a ReaderView.

    interface ISyncMediaManagedReaderViewSynchronizationOptions {
        alwaysSeekToSegmentStart?: boolean;
        enabled?: boolean;
        minimumTimeToDisplayPagesWithSyncMedia?: number;
        navigateOnVisibleRangeEndReached?: boolean;
        skipPagesWithoutSyncMedia?: boolean;
        timeToDisplayPagesWithoutSyncMedia?: number;
    }

    Properties

    alwaysSeekToSegmentStart?: boolean

    If set to true, the sync media player will always seek to the start of the segment that best matches the ReaderView's current readingPosition.

    If set to false, it seeks to the segment and an offset within that segment, that most closely matches the readingPosition. (For example a word within a sentence).

    Note that this behaviour only applies when the SyncMediaPlayer applies synchronization actions. It does not alter the behaviour when manually calling SyncMediaPlayer.seek().

    It is recommended to set this option to true when using a scrolling renderer, and false for paginated renderers.

    When setting this to true, it is also recommended to set SyncMediaPlayer.setReaderViewSynchronizationWaitBehavior() to SyncMediaReaderViewSynchronizationWaitBehavior.DONT_WAIT, otherwise sync media playback may be halted if it happens to seek to a position that is before the visible range.

    false
    
    enabled?: boolean

    If managed synchronization should be enabled. This will enable automatic page turning when media playback reaches the end of the visible range, and seeking of sync media to match visible content when the ReaderView is navigated.

    It also controls whether the ReaderView reading position and the SyncMediaPlayer position are kept in sync. While this is false, neither one updates the other on its own, and no initialSyncMethod passed to ReaderView.setSyncMediaPlayer() has any effect. The application performs synchronization itself by calling SyncMediaPlayer.attemptReaderViewSynchronization(), which always runs.

    Because nothing synchronizes the two while this is false, a SyncMediaPlayer can keep waiting for a synchronization that never comes, which leaves it not ready and not playing. Either set the wait behavior to SyncMediaReaderViewSynchronizationWaitBehavior.DONT_WAIT, or synchronize the two from the application with SyncMediaPlayer.attemptReaderViewSynchronization().

    Setting this back to true while a SyncMediaPlayer is attached does not synchronize the two by itself. Call SyncMediaPlayer.attemptReaderViewSynchronization() for a deterministic outcome. Otherwise the two stay as they are until the next ReaderView navigation or scroll, or the next change of the player position.

    Visual styles that a SyncMediaObjectRenderer applies, such as highlighting the segment or word being played, are not affected by this option.

    true
    
    minimumTimeToDisplayPagesWithSyncMedia?: number

    The minimum amount of time in milliseconds to display pages with sync media. This can be useful if for example a page only contains one SyncMediaSegment with a very short duration. This allows the user to see the page content properly before the ReaderView navigates to the next page.

    You MUST set SyncMediaPlayer.setReaderViewSynchronizationWaitBehavior() with WAIT_OUTSIDE_VISIBLE when setting this option to a non-zero value. Otherwise, synchronization will not work properly. For example, the SyncMediaPlayer will immediately start to play media present in the next ReaderView content range, while still waiting to perform the ReaderView navigation.

    0
    
    navigateOnVisibleRangeEndReached?: boolean

    Automatically navigate the ReaderView when media playback reaches the end of the visible range. Note that if there is only a small amount of media to be played on the visible pages, it will navigate after that media has been played.

    true
    
    skipPagesWithoutSyncMedia?: boolean

    This option controls if pages without sync media should be skipped if navigateOnVisibleRangeEndReached is set to true.

    If set to false, pages without sync media will still be shown for the duration specified by timeToDisplayPagesWithoutSyncMedia. If set to true, the ReaderView will skip pages that do not contain sync media.

    false
    
    timeToDisplayPagesWithoutSyncMedia?: number

    The amount of time in milliseconds to wait before navigating to next page, when the current visible range contains no sync media.

    2000