MediaLoadOptions.Builder
Stay organized with collections
Save and categorize content based on your preferences.
Public Constructor Summary
Inherited Method Summary
From class java.lang.Object
Public Methods
Sets the array of the active tracks.
Sets the value of whether playback should start immediately.
Sets the user credentials to pass along with the load request to the receiver. The
credentials are completely application-specific and can be any arbitrary String
.
Sets the user credentials type to pass along with the load request to the receiver.
The credentials type is completely application-specific and can be any arbitrary String
.
Sets the custom application-specific data to pass along with the load request.
Sets the initial playback position, in milliseconds from the beginning of the
stream.
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.Builder\u003c/code\u003e is used to construct \u003ccode\u003eMediaLoadOptions\u003c/code\u003e objects, which define parameters for loading media on a Cast receiver.\u003c/p\u003e\n"],["\u003cp\u003eIt allows customization of playback settings like autoplay, initial position, and playback rate.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can specify active tracks, user credentials, and custom application data.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild()\u003c/code\u003e method creates the final \u003ccode\u003eMediaLoadOptions\u003c/code\u003e instance based on the builder's configurations.\u003c/p\u003e\n"]]],[],null,["# MediaLoadOptions.Builder\n\npublic static class **MediaLoadOptions.Builder** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nBuilder class for [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions). \n\n### Public Constructor Summary\n\n|---|------------------------------------------------------------------------------------------------|\n| | [Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#Builder())() |\n\n### Public Method Summary\n\n|-----------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions) | [build](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#build())() Builds a [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions) object. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setActiveTrackIds](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setActiveTrackIds(long[]))(long\\[\\] activeTrackIds) Sets the array of the active tracks. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setAutoplay](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setAutoplay(boolean))(boolean autoplay) Sets the value of whether playback should start immediately. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setCredentials](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentials(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) credentials) Sets the user credentials to pass along with the load request to the receiver. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setCredentialsType](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCredentialsType(java.lang.String))([String](//developer.android.com/reference/java/lang/String.html) credentialsType) Sets the user credentials type to pass along with the load request to the receiver. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setCustomData](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setCustomData(org.json.JSONObject))([JSONObject](//developer.android.com/reference/org/json/JSONObject.html) customData) Sets the custom application-specific data to pass along with the load request. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setPlayPosition](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlayPosition(long))(long playPosition) Sets the initial playback position, in milliseconds from the beginning of the stream. |\n| [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder) | [setPlaybackRate](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder#setPlaybackRate(double))(double playbackRate) Sets 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\nPublic Constructors\n-------------------\n\n#### public **Builder** ()\n\nPublic Methods\n--------------\n\n#### public [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions)\n**build** ()\n\nBuilds a [MediaLoadOptions](/android/reference/com/google/android/gms/cast/MediaLoadOptions)\nobject. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setActiveTrackIds** (long\\[\\] activeTrackIds)\n\nSets the array of the active tracks. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setAutoplay** (boolean autoplay)\n\nSets the value of whether playback should start immediately. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setCredentials** ([String](//developer.android.com/reference/java/lang/String.html) credentials)\n\nSets the user credentials to pass along with the load request to the receiver. The\ncredentials are completely application-specific and can be any arbitrary\n`String`. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setCredentialsType** ([String](//developer.android.com/reference/java/lang/String.html) credentialsType)\n\nSets the user credentials type to pass along with the load request to the receiver.\nThe credentials type is completely application-specific and can be any arbitrary\n`String`. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setCustomData** ([JSONObject](//developer.android.com/reference/org/json/JSONObject.html) customData)\n\nSets the custom application-specific data to pass along with the load request. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setPlayPosition** (long playPosition)\n\nSets the initial playback position, in milliseconds from the beginning of the\nstream. \n\n#### public [MediaLoadOptions.Builder](/android/reference/com/google/android/gms/cast/MediaLoadOptions.Builder)\n**setPlaybackRate** (double playbackRate)\n\nSets the playback rate, as the multiplier of the normal playback rate. The accepted\nvalue is between [MediaLoadOptions.PLAYBACK_RATE_MIN](/android/reference/com/google/android/gms/cast/MediaLoadOptions#PLAYBACK_RATE_MIN) and [MediaLoadOptions.PLAYBACK_RATE_MAX](/android/reference/com/google/android/gms/cast/MediaLoadOptions#PLAYBACK_RATE_MAX). The normal playback rate is 1.0."]]