Android APIs
public static final class

TvTrackInfo.Builder

extends Object
java.lang.Object
   ↳ android.media.tv.TvTrackInfo.Builder

Class Overview

A builder class for creating TvTrackInfo objects.

Summary

Public Constructors
TvTrackInfo.Builder(int type, String id)
Public Methods
TvTrackInfo build()
Creates a TvTrackInfo instance with the specified fields.
final TvTrackInfo.Builder setAudioChannelCount(int audioChannelCount)
Sets the audio channel count.
final TvTrackInfo.Builder setAudioSampleRate(int audioSampleRate)
Sets the audio sample rate, in the unit of Hz.
final TvTrackInfo.Builder setExtra(Bundle extra)
Sets the extra information about the current track.
final TvTrackInfo.Builder setLanguage(String language)
Sets the language information of the current track.
final TvTrackInfo.Builder setVideoFrameRate(float videoFrameRate)
Sets the frame rate of the video, in the unit fps (frames per rate).
final TvTrackInfo.Builder setVideoHeight(int videoHeight)
Sets the height of the video, in the unit of pixels.
final TvTrackInfo.Builder setVideoWidth(int videoWidth)
Sets the width of the video, in the unit of pixels.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public TvTrackInfo.Builder (int type, String id)

Added in API level 21

Create a TvTrackInfo.Builder. Any field that should be included in the TvTrackInfo must be added.

Parameters
type The type of the track.
id The ID of the track that uniquely identifies the current track among all the other tracks in the same TV program.

Public Methods

public TvTrackInfo build ()

Added in API level 21

Creates a TvTrackInfo instance with the specified fields.

Returns

public final TvTrackInfo.Builder setAudioChannelCount (int audioChannelCount)

Added in API level 21

Sets the audio channel count. Valid only for TYPE_AUDIO tracks.

Parameters
audioChannelCount The audio channel count.

public final TvTrackInfo.Builder setAudioSampleRate (int audioSampleRate)

Added in API level 21

Sets the audio sample rate, in the unit of Hz. Valid only for TYPE_AUDIO tracks.

Parameters
audioSampleRate The audio sample rate.

public final TvTrackInfo.Builder setExtra (Bundle extra)

Added in API level 21

Sets the extra information about the current track.

Parameters
extra The extra information.

public final TvTrackInfo.Builder setLanguage (String language)

Added in API level 21

Sets the language information of the current track.

Parameters
language The language string encoded by either ISO 639-1 or ISO 639-2/T.

public final TvTrackInfo.Builder setVideoFrameRate (float videoFrameRate)

Added in API level 21

Sets the frame rate of the video, in the unit fps (frames per rate). Valid only for TYPE_VIDEO tracks.

Parameters
videoFrameRate The frame rate of the video.

public final TvTrackInfo.Builder setVideoHeight (int videoHeight)

Added in API level 21

Sets the height of the video, in the unit of pixels. Valid only for TYPE_VIDEO tracks.

Parameters
videoHeight The height of the video.

public final TvTrackInfo.Builder setVideoWidth (int videoWidth)

Added in API level 21

Sets the width of the video, in the unit of pixels. Valid only for TYPE_VIDEO tracks.

Parameters
videoWidth The width of the video.