MediaSeekOptions
Stay organized with collections
Save and categorize content based on your preferences.
The class for specifying options for seek requests.
Nested Class Summary
@interface
The resume state.
Constant Summary
int |
RESUME_STATE_PAUSE
|
A resume state indicating that the player should
be paused, regardless of its current state. |
int |
RESUME_STATE_PLAY
|
A resume state indicating that the player should
be playing, regardless of its current state. |
int |
RESUME_STATE_UNCHANGED
|
A resume state indicating that the player state
should be left unchanged. |
Public Method Summary
boolean |
|
JSONObject
|
getCustomData
() Returns the custom application-specific data to pass along with the seek
request.
|
long |
getPosition
() Returns the position to seek to, in milliseconds.
|
int |
getResumeState
() Returns the action to take after the seek operation has finished.
|
int |
|
boolean |
isSeekToInfinite
() Returns whether to seek to the end of stream or live position.
|
Inherited Method Summary
From class java.lang.Object
Constants
public static final int
RESUME_STATE_PAUSE
A resume state indicating that the player should be paused, regardless of its
current state.
Constant Value:
2
public static final int
RESUME_STATE_PLAY
A resume state indicating that the player should be playing, regardless of its
current state.
Constant Value:
1
public static final int
RESUME_STATE_UNCHANGED
A resume state indicating that the player state should be left unchanged.
Constant Value:
0
Public Methods
public boolean
equals
( Object
other)
public JSONObject
getCustomData
()
Returns the custom application-specific data to pass along with the seek
request.
public long
getPosition
()
Returns the position to seek to, in milliseconds. The default value is 0
.
The position will be ignored if isSeekToInfinite()
is true
.
public int
getResumeState
()
public boolean
isSeekToInfinite
()
Returns whether to seek to the end of stream or live position. The default value is false
.
If true
, the seek position as specified by getPosition()
will be ignored.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eMediaSeekOptions\u003c/code\u003e allows developers to define how media playback should behave during seek operations.\u003c/p\u003e\n"],["\u003cp\u003eIt provides options to specify the desired position (in milliseconds), resume state (play, pause, or unchanged), and custom data.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can seek to a specific point in the media or to the live position/end of the stream using the \u003ccode\u003eisSeekToInfinite\u003c/code\u003e option.\u003c/p\u003e\n"],["\u003cp\u003eThree resume states are available: \u003ccode\u003eRESUME_STATE_UNCHANGED\u003c/code\u003e, \u003ccode\u003eRESUME_STATE_PLAY\u003c/code\u003e, and \u003ccode\u003eRESUME_STATE_PAUSE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eMediaSeekOptions.Builder\u003c/code\u003e can be used to construct instances of \u003ccode\u003eMediaSeekOptions\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# MediaSeekOptions\n\npublic class **MediaSeekOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nThe class for specifying options for seek requests. \n\n### Nested Class Summary\n\n|------------|---|---|--------------------------------------------------------------------------------------------------|\n| class | [MediaSeekOptions.Builder](/android/reference/com/google/android/gms/cast/MediaSeekOptions.Builder) || Builder for [MediaSeekOptions](/android/reference/com/google/android/gms/cast/MediaSeekOptions). |\n| @interface | [MediaSeekOptions.ResumeState](/android/reference/com/google/android/gms/cast/MediaSeekOptions.ResumeState) || The resume state. |\n\n### Constant Summary\n\n|-----|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------|\n| int | [RESUME_STATE_PAUSE](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_PAUSE) | A resume state indicating that the player should be paused, regardless of its current state. |\n| int | [RESUME_STATE_PLAY](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_PLAY) | A resume state indicating that the player should be playing, regardless of its current state. |\n| int | [RESUME_STATE_UNCHANGED](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_UNCHANGED) | A resume state indicating that the player state should be left unchanged. |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| boolean | [equals](/android/reference/com/google/android/gms/cast/MediaSeekOptions#equals(java.lang.Object))([Object](//developer.android.com/reference/java/lang/Object.html) other) |\n| [JSONObject](//developer.android.com/reference/org/json/JSONObject.html) | [getCustomData](/android/reference/com/google/android/gms/cast/MediaSeekOptions#getCustomData())() Returns the custom application-specific data to pass along with the seek request. |\n| long | [getPosition](/android/reference/com/google/android/gms/cast/MediaSeekOptions#getPosition())() Returns the position to seek to, in milliseconds. |\n| int | [getResumeState](/android/reference/com/google/android/gms/cast/MediaSeekOptions#getResumeState())() Returns the action to take after the seek operation has finished. |\n| int | [hashCode](/android/reference/com/google/android/gms/cast/MediaSeekOptions#hashCode())() |\n| boolean | [isSeekToInfinite](/android/reference/com/google/android/gms/cast/MediaSeekOptions#isSeekToInfinite())() Returns whether to seek to the end of stream or live position. |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final int\n**RESUME_STATE_PAUSE**\n\nA resume state indicating that the player should be paused, regardless of its\ncurrent state. \nConstant Value: 2 \n\n#### public static final int\n**RESUME_STATE_PLAY**\n\nA resume state indicating that the player should be playing, regardless of its\ncurrent state. \nConstant Value: 1 \n\n#### public static final int\n**RESUME_STATE_UNCHANGED**\n\nA resume state indicating that the player state should be left unchanged. \nConstant Value: 0\n\nPublic Methods\n--------------\n\n#### public boolean **equals** ([Object](//developer.android.com/reference/java/lang/Object.html) other)\n\n#### public [JSONObject](//developer.android.com/reference/org/json/JSONObject.html)\n**getCustomData** ()\n\nReturns the custom application-specific data to pass along with the seek\nrequest. \n\n#### public long **getPosition** ()\n\nReturns the position to seek to, in milliseconds. The default value is\n`0`.\n\nThe position will be ignored if [isSeekToInfinite()](/android/reference/com/google/android/gms/cast/MediaSeekOptions#isSeekToInfinite()) is `true`. \n\n#### public int **getResumeState** ()\n\nReturns the action to take after the seek operation has finished. The default value\nis [RESUME_STATE_UNCHANGED](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_UNCHANGED).\n\nValid values are [RESUME_STATE_UNCHANGED](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_UNCHANGED), [RESUME_STATE_PLAY](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_PLAY), and [RESUME_STATE_PAUSE](/android/reference/com/google/android/gms/cast/MediaSeekOptions#RESUME_STATE_PAUSE). \n\n#### public int **hashCode** ()\n\n#### public boolean **isSeekToInfinite** ()\n\nReturns whether to seek to the end of stream or live position. The default value is\n`false`.\n\nIf `true`, the seek position as specified by [getPosition()](/android/reference/com/google/android/gms/cast/MediaSeekOptions#getPosition())\nwill be ignored."]]