Package com.castlabs.android.player
Class Chapter
java.lang.Object
com.castlabs.android.player.Chapter
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongReturns the end position of the chapter in milliseconds.booleanReturns whether the chapter is highlighted.booleanisShown(long positionMs) Returns whether the chapter is shown at the given position.voidsetEndPositionMs(long endPositionMs) Sets the end position of the chapter in milliseconds.voidsetHighlighted(boolean highlighted) Sets whether the chapter is highlighted.
-
Field Details
-
positionMs
public final long positionMsThe chapter position in milliseconds -
title
(Optional) title -
imageUrl
(Optional) URI to an image
-
-
Constructor Details
-
Chapter
public Chapter(long position) Create a new chapter- Parameters:
position- the chapter position
-
Chapter
Create a new chapter- Parameters:
position- the chapter position in millisecondstitle- the chapter title
-
Chapter
Create a new chapter- Parameters:
positionMs- the position of the chapter start in mstitle- the title (optional)imageUrl- the image url (optional)
-
Chapter
Create a new chapter- Parameters:
positionMs- the position of the chapter start in msendPositionMs- the end position in ms or -1title- the title (optional)imageUrl- the image url (optional)
-
-
Method Details
-
getEndPositionMs
public long getEndPositionMs()Returns the end position of the chapter in milliseconds.- Returns:
- The end position of the chapter in milliseconds.
-
setEndPositionMs
public void setEndPositionMs(long endPositionMs) Sets the end position of the chapter in milliseconds.- Parameters:
endPositionMs- The end position of the chapter in milliseconds.
-
isHighlighted
public boolean isHighlighted()Returns whether the chapter is highlighted.- Returns:
- True if the chapter is highlighted, false otherwise.
-
setHighlighted
public void setHighlighted(boolean highlighted) Sets whether the chapter is highlighted.- Parameters:
highlighted- True if the chapter is highlighted, false otherwise.
-
isShown
public boolean isShown(long positionMs) Returns whether the chapter is shown at the given position.- Parameters:
positionMs- The position in milliseconds.- Returns:
- True if the chapter is shown at the given position, false otherwise.
-