Class Chapter

java.lang.Object
com.castlabs.android.player.Chapter

public class Chapter extends Object
Basic chapter model that consists of the chapter position, a title, and an image URL. Both, the title and the image URL are optional.
Since:
2.0.0
  • Field Details

    • positionMs

      public final long positionMs
      The chapter position in milliseconds
    • title

      @Nullable public final String title
      (Optional) title
    • imageUrl

      @Nullable public final Uri imageUrl
      (Optional) URI to an image
  • Constructor Details

    • Chapter

      public Chapter(long position)
      Create a new chapter
      Parameters:
      position - the chapter position
    • Chapter

      public Chapter(long position, String title)
      Create a new chapter
      Parameters:
      position - the chapter position in milliseconds
      title - the chapter title
    • Chapter

      public Chapter(long positionMs, String title, Uri imageUrl)
      Create a new chapter
      Parameters:
      positionMs - the position of the chapter start in ms
      title - the title (optional)
      imageUrl - the image url (optional)
    • Chapter

      public Chapter(long positionMs, long endPositionMs, String title, Uri imageUrl)
      Create a new chapter
      Parameters:
      positionMs - the position of the chapter start in ms
      endPositionMs - the end position in ms or -1
      title - the title (optional)
      imageUrl - the image url (optional)
  • Method Details

    • getEndPositionMs

      public long getEndPositionMs()
    • setEndPositionMs

      public void setEndPositionMs(long endPositionMs)
    • isHighlighted

      public boolean isHighlighted()
    • setHighlighted

      public void setHighlighted(boolean highlighted)
    • isShown

      public boolean isShown(long positionMs)