public static class

MediaTrack.Builder

extends Object
java.lang.Object
   ↳ com.google.android.gms.cast.MediaTrack.Builder

Class Overview

A builder for MediaTrack objects.

Summary

Public Constructors
MediaTrack.Builder(long trackId, int trackType)
Constructs a new Builder with the given track ID and type.
Public Methods
MediaTrack build()
Builds and returns the MediaTrack object.
MediaTrack.Builder setContentId(String contentId)
Sets the track content ID.
MediaTrack.Builder setContentType(String contentType)
Sets the track content type.
MediaTrack.Builder setCustomData(JSONObject customData)
Sets the track's custom data object.
MediaTrack.Builder setLanguage(String language)
Sets the RFC-5464 formatted track language.
MediaTrack.Builder setLanguage(Locale locale)
Sets the track language from a Locale in RFC-5464 format.
MediaTrack.Builder setName(String trackName)
Sets the track name.
MediaTrack.Builder setSubtype(int subtype)
Sets the track subtype with one of the SUBTYPE_ constants.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public MediaTrack.Builder (long trackId, int trackType)

Constructs a new Builder with the given track ID and type.

Parameters
trackId long: The unique ID of the media track.
trackType int: The type of the track; one of the TYPE_ constants.
Throws
IllegalArgumentException If the track type is invalid.

Public Methods

public MediaTrack build ()

Builds and returns the MediaTrack object.

Returns
MediaTrack

public MediaTrack.Builder setContentId (String contentId)

Sets the track content ID.

Parameters
contentId String
Returns
MediaTrack.Builder

public MediaTrack.Builder setContentType (String contentType)

Sets the track content type.

Parameters
contentType String
Returns
MediaTrack.Builder

public MediaTrack.Builder setCustomData (JSONObject customData)

Sets the track's custom data object.

Parameters
customData JSONObject
Returns
MediaTrack.Builder

public MediaTrack.Builder setLanguage (String language)

Sets the RFC-5464 formatted track language.

Parameters
language String
Returns
MediaTrack.Builder

public MediaTrack.Builder setLanguage (Locale locale)

Sets the track language from a Locale in RFC-5464 format.

Parameters
locale Locale
Returns
MediaTrack.Builder

public MediaTrack.Builder setName (String trackName)

Sets the track name.

Parameters
trackName String
Returns
MediaTrack.Builder

public MediaTrack.Builder setSubtype (int subtype)

Sets the track subtype with one of the SUBTYPE_ constants.

Parameters
subtype int
Returns
MediaTrack.Builder
Throws
IllegalArgumentException If the subtype is invalid.