MediaLoadOptions
Stay organized with collections
Save and categorize content based on your preferences.
An object that holds options that affect how a receiver application should load a media
item.
Public Method Summary
long[] |
|
boolean |
getAutoplay
() Returns the value of whether playback should start immediately.
|
String
|
|
String
|
|
JSONObject
|
getCustomData
() Returns the custom application-specific data to pass along with the load
request.
|
long |
getPlayPosition
() Returns the initial playback position, in milliseconds from the beginning of
the stream.
|
double |
getPlaybackRate
() Returns the playback rate, as the multiplier of the normal playback rate.
|
Inherited Method Summary
From class java.lang.Object
Constants
public static final double
PLAYBACK_RATE_MAX
public static final double
PLAYBACK_RATE_MIN
Public Methods
public long[]
getActiveTrackIds
()
Returns the array of the active tracks. If the default value is null
.
public boolean
getAutoplay
()
Returns the value of whether playback should start immediately. The default value is true
.
public String
getCredentials
()
public String
getCredentialsType
()
public JSONObject
getCustomData
()
Returns the custom application-specific data to pass along with the load
request.
public long
getPlayPosition
()
Returns the initial playback position, in milliseconds from the beginning of the
stream. The default value is 0.
public double
getPlaybackRate
()
Returns the playback rate, as the multiplier of the normal playback rate. The
default value is 1.
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\u003eMediaLoadOptions\u003c/code\u003e is an object containing options that influence how a receiver application loads media items.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can control playback behavior, such as autoplay and initial playback position, using this object.\u003c/p\u003e\n"],["\u003cp\u003eCredentials and custom data can be included for authentication and application-specific needs.\u003c/p\u003e\n"],["\u003cp\u003eOptions for active tracks and playback rate adjustments are also available.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMediaLoadOptions.Builder\u003c/code\u003e class is used to construct and configure these options.\u003c/p\u003e\n"]]],["`MediaLoadOptions` configures how a receiver application loads media. Key properties include: active track IDs, autoplay status (default: true), credentials and their type, custom application data, initial playback position (default: 0 ms), and playback rate (default: 1.0, range: 0.5-2.0). The `MediaLoadOptions.Builder` facilitates building these options. The class offers methods to retrieve these settings like `getActiveTrackIds`, `getAutoplay`, `getCredentials`, `getCustomData`, `getPlayPosition`, and `getPlaybackRate`.\n"],null,["# MediaLoadOptions\n\npublic class **MediaLoadOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nAn object that holds options that affect how a receiver application should load a media\nitem. \n\n### Nested Class Summary\n\n|-------|---|---|--------------------------------------------------------------------------------------------------------|\n| class | [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) || Builder class for [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions). |\n\n### Constant Summary\n\n|--------|--------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| double | [PLAYBACK_RATE_MAX](/android/reference/com/google/android/gms/cast/MediaLoadOptions#PLAYBACK_RATE_MAX) | The maximum value that can be used in [MediaLoadOptions.Builder.setPlaybackRate(double)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlaybackRate(double)). |\n| double | [PLAYBACK_RATE_MIN](/android/reference/com/google/android/gms/cast/MediaLoadOptions#PLAYBACK_RATE_MIN) | The minimum value that can be used in [MediaLoadOptions.Builder.setPlaybackRate(double)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlaybackRate(double)). |\n\n### Public Method Summary\n\n|--------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| long\\[\\] | [getActiveTrackIds](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getActiveTrackIds())() Returns the array of the active tracks. |\n| boolean | [getAutoplay](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getAutoplay())() Returns the value of whether playback should start immediately. |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getCredentials](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getCredentials())() Returns the credentials string, as passed in with [MediaLoadOptions.Builder.setCredentials(String)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentials(java.lang.String)). |\n| [String](//developer.android.com/reference/java/lang/String.html) | [getCredentialsType](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getCredentialsType())() Returns the credentials type string, as passed in with [MediaLoadOptions.Builder.setCredentialsType(String)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentialsType(java.lang.String)). |\n| [JSONObject](//developer.android.com/reference/org/json/JSONObject.html) | [getCustomData](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getCustomData())() Returns the custom application-specific data to pass along with the load request. |\n| long | [getPlayPosition](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getPlayPosition())() Returns the initial playback position, in milliseconds from the beginning of the stream. |\n| double | [getPlaybackRate](/android/reference/com/google/android/gms/cast/MediaLoadOptions#getPlaybackRate())() Returns the playback rate, as the multiplier of the normal playback rate. |\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 double\n**PLAYBACK_RATE_MAX**\n\nThe maximum value that can be used in [MediaLoadOptions.Builder.setPlaybackRate(double)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlaybackRate(double)). \nConstant Value: 2.0 \n\n#### public static final double\n**PLAYBACK_RATE_MIN**\n\nThe minimum value that can be used in [MediaLoadOptions.Builder.setPlaybackRate(double)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlaybackRate(double)). \nConstant Value: 0.5\n\nPublic Methods\n--------------\n\n#### public long\\[\\] **getActiveTrackIds** ()\n\nReturns the array of the active tracks. If the default value is\n`null`. \n\n#### public boolean **getAutoplay** ()\n\nReturns the value of whether playback should start immediately. The default value is\n`true`. \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getCredentials** ()\n\nReturns the credentials string, as passed in with [MediaLoadOptions.Builder.setCredentials(String)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentials(java.lang.String)). \n\n#### public [String](//developer.android.com/reference/java/lang/String.html) **getCredentialsType** ()\n\nReturns the credentials type string, as passed in with [MediaLoadOptions.Builder.setCredentialsType(String)](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentialsType(java.lang.String)). \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 load\nrequest. \n\n#### public long **getPlayPosition** ()\n\nReturns the initial playback position, in milliseconds from the beginning of the\nstream. The default value is 0. \n\n#### public double **getPlaybackRate** ()\n\nReturns the playback rate, as the multiplier of the normal playback rate. The\ndefault value is 1."]]