SeekRequestData
Stay organized with collections
Save and categorize content based on your preferences.
Data structure for seek command requests.
Nested Class Summary
@interface
The state enum for the action to take after the
seek operation has finished.
Inherited Constant Summary
From interface android.os.Parcelable
int |
CONTENTS_FILE_DESCRIPTOR |
|
int |
PARCELABLE_WRITE_RETURN_VALUE |
|
Inherited Method Summary
From class java.lang.Object
From interface android.os.Parcelable
abstract int |
describeContents
()
|
abstract void |
writeToParcel
( Parcel
arg0,
int arg1)
|
From interface com.google.android.gms.cast.RequestData
Constants
public static final long
SEEK_POSITION_INFINITE_MS
The constant standing for infinite position (in milliseconds) in seek requests.
Constant Value:
4294967296000
Public Methods
public Long
getCurrentTime
()
Returns the absolute time to seek to, in milliseconds.
If the returned value is SEEK_POSITION_INFINITE_MS
, then request indicates to seek to the end of
stream or live position.
This may return null
if the absolute time is not provided.
public Long
getRelativeTime
()
Returns the time to seek to, relative to the current position, in milliseconds.
This may return null
if the relative time is not provided.
If not null
, the getCurrentTime()
field should be ignored.
public int
getResumeState
()
Returns the resume state. If it is SeekResumeState#PLAYBACK_UNCHANGED
,
the playback state should be unchanged.
public void
writeToParcel
( Parcel
out, int
flags)
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\u003eSeekRequestData\u003c/code\u003e is a Parcelable data structure used for creating seek command requests in the Cast framework.\u003c/p\u003e\n"],["\u003cp\u003eIt allows seeking to a specific time, either absolute or relative to the current position, within a media stream.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eSeekResumeState\u003c/code\u003e nested class defines the playback state after the seek operation, such as playing, pausing, or remaining unchanged.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eSEEK_POSITION_INFINITE_MS\u003c/code\u003e constant represents seeking to the end of the stream or live position.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003egetCurrentTime()\u003c/code\u003e, \u003ccode\u003egetRelativeTime()\u003c/code\u003e, \u003ccode\u003egetResumeState()\u003c/code\u003e, and \u003ccode\u003egetCustomData()\u003c/code\u003e to access seek parameters and custom data.\u003c/p\u003e\n"]]],["`SeekRequestData` is a data structure for seek command requests, implementing `Parcelable`. Key actions include retrieving seek times: `getCurrentTime()` for absolute time and `getRelativeTime()` for time relative to the current position. `getCustomData()` retrieves custom data, and `getResumeState()` returns the desired playback state post-seek. `writeToParcel()` is used for parceling the data. A constant, `SEEK_POSITION_INFINITE_MS`, represents an infinite or end-of-stream position.\n"],null,["# SeekRequestData\n\npublic class **SeekRequestData** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nimplements [Parcelable](//developer.android.com/reference/android/os/Parcelable.html) [RequestData](/android/reference/com/google/android/gms/cast/RequestData) \nData structure for seek command requests. \n\n### Nested Class Summary\n\n|------------|---|---|------------------------------------------------------------------------------|\n| @interface | [SeekRequestData.SeekResumeState](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData.SeekResumeState) || The state enum for the action to take after the seek operation has finished. |\n\n### Constant Summary\n\n|------|--------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| long | [SEEK_POSITION_INFINITE_MS](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#SEEK_POSITION_INFINITE_MS) | The constant standing for infinite position (in milliseconds) in seek requests. |\n\n### Inherited Constant Summary\n\nFrom interface android.os.Parcelable \n\n|-----|-------------------------------|---|\n| int | CONTENTS_FILE_DESCRIPTOR | |\n| int | PARCELABLE_WRITE_RETURN_VALUE | |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Long](//developer.android.com/reference/java/lang/Long.html) | [getCurrentTime](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#getCurrentTime())() Returns the absolute time to seek to, in milliseconds. |\n| [JSONObject](//developer.android.com/reference/org/json/JSONObject.html) | [getCustomData](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#getCustomData())() Returns the custom data. |\n| [Long](//developer.android.com/reference/java/lang/Long.html) | [getRelativeTime](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#getRelativeTime())() Returns the time to seek to, relative to the current position, in milliseconds. |\n| int | [getResumeState](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#getResumeState())() Returns the resume state. |\n| void | [writeToParcel](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#writeToParcel(android.os.Parcel,%20int))([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags) |\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\nFrom interface android.os.Parcelable \n\n|---------------|--------------------------------------------------------------------------------------------------|\n| abstract int | describeContents() |\n| abstract void | writeToParcel([Parcel](//developer.android.com/reference/android/os/Parcel.html) arg0, int arg1) |\n\nFrom interface com.google.android.gms.cast.RequestData \n\n|-----------------------------------------------------------------------------------|-----------------|\n| abstract [JSONObject](//developer.android.com/reference/org/json/JSONObject.html) | getCustomData() |\n\nConstants\n---------\n\n#### public static final long\n**SEEK_POSITION_INFINITE_MS**\n\nThe constant standing for infinite position (in milliseconds) in seek requests. \nConstant Value: 4294967296000\n\nPublic Methods\n--------------\n\n#### public [Long](//developer.android.com/reference/java/lang/Long.html) **getCurrentTime** ()\n\nReturns the absolute time to seek to, in milliseconds.\n\nIf the returned value is [SEEK_POSITION_INFINITE_MS](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#SEEK_POSITION_INFINITE_MS), then request indicates to seek to the end of\nstream or live position.\n\nThis may return `null` if the absolute time is not provided. \n\n#### public [JSONObject](//developer.android.com/reference/org/json/JSONObject.html)\n**getCustomData** ()\n\nReturns the custom data. \n\n#### public [Long](//developer.android.com/reference/java/lang/Long.html) **getRelativeTime** ()\n\nReturns the time to seek to, relative to the current position, in milliseconds.\n\nThis may return `null` if the relative time is not provided.\n\nIf not `null`, the [getCurrentTime()](/android/reference/com/google/android/gms/cast/tv/media/SeekRequestData#getCurrentTime()) field should be ignored. \n\n#### public int **getResumeState** ()\n\nReturns the resume state. If it is `SeekResumeState#PLAYBACK_UNCHANGED`,\nthe playback state should be unchanged. \n\n#### public void **writeToParcel** ([Parcel](//developer.android.com/reference/android/os/Parcel.html) out, int flags)"]]