onChapterChanged

open fun onChapterChanged(chapter: Chapter?)

Called when the current chapter changes. This can occur due to several reasons:

  • Automatic playback: the player's position progresses naturally during playback and enters a new chapter.

  • Seeking: the user manually seeks to a new position within the content, landing within a different chapter.

  • Playlist change: the current playlist is changed, potentially resulting in a different set of chapters and a new active chapter.

Parameters

chapter

The currently active Chapter. This will be null if the current playback position is not within any defined chapter.