lightbulb_outline Help shape the future of the Google Play Console, Android Studio, and Firebase. Start survey

TvView.TvInputCallback

public static abstract class TvView.TvInputCallback
extends Object

java.lang.Object
   ↳ android.media.tv.TvView.TvInputCallback


Callback used to receive various status updates on the TvView.

Summary

Public constructors

TvView.TvInputCallback()

Public methods

void onChannelRetuned(String inputId, Uri channelUri)

This is invoked when the channel of this TvView is changed by the underlying TV input without any TvView.tune(String, Uri) request.

void onConnectionFailed(String inputId)

This is invoked when an error occurred while establishing a connection to the underlying TV input.

void onContentAllowed(String inputId)

This is called when the current program content turns out to be allowed to watch since its content rating is not blocked by parental controls.

void onContentBlocked(String inputId, TvContentRating rating)

This is called when the current program content turns out to be not allowed to watch since its content rating is blocked by parental controls.

void onDisconnected(String inputId)

This is invoked when the existing connection to the underlying TV input is lost.

void onTimeShiftStatusChanged(String inputId, int status)

This is called when the time shift status is changed.

void onTrackSelected(String inputId, int type, String trackId)

This is called when there is a change on the selected tracks.

void onTracksChanged(String inputId, List<TvTrackInfo> tracks)

This is called when the track information has been changed.

void onVideoAvailable(String inputId)

This is called when the video is available, so the TV input starts the playback.

void onVideoSizeChanged(String inputId, int width, int height)

This is invoked when the video size has been changed.

void onVideoUnavailable(String inputId, int reason)

This is called when the video is not available, so the TV input stops the playback.

Inherited methods

Public constructors

TvView.TvInputCallback

added in API level 21
public TvView.TvInputCallback ()

Public methods

onChannelRetuned

added in API level 21
public void onChannelRetuned (String inputId, 
                Uri channelUri)

This is invoked when the channel of this TvView is changed by the underlying TV input without any TvView.tune(String, Uri) request.

Parameters
inputId String: The ID of the TV input bound to this view.

channelUri Uri: The URI of a channel.

onConnectionFailed

added in API level 21
public void onConnectionFailed (String inputId)

This is invoked when an error occurred while establishing a connection to the underlying TV input.

Parameters
inputId String: The ID of the TV input bound to this view.

onContentAllowed

added in API level 21
public void onContentAllowed (String inputId)

This is called when the current program content turns out to be allowed to watch since its content rating is not blocked by parental controls.

Parameters
inputId String: The ID of the TV input bound to this view.

onContentBlocked

added in API level 21
public void onContentBlocked (String inputId, 
                TvContentRating rating)

This is called when the current program content turns out to be not allowed to watch since its content rating is blocked by parental controls.

Parameters
inputId String: The ID of the TV input bound to this view.

rating TvContentRating: The content rating of the blocked program.

onDisconnected

added in API level 21
public void onDisconnected (String inputId)

This is invoked when the existing connection to the underlying TV input is lost.

Parameters
inputId String: The ID of the TV input bound to this view.

onTimeShiftStatusChanged

added in API level 23
public void onTimeShiftStatusChanged (String inputId, 
                int status)

This is called when the time shift status is changed.

Parameters
inputId String: The ID of the TV input bound to this view.

status int: The current time shift status. Should be one of the followings.

onTrackSelected

added in API level 21
public void onTrackSelected (String inputId, 
                int type, 
                String trackId)

This is called when there is a change on the selected tracks.

Parameters
inputId String: The ID of the TV input bound to this view.

type int: The type of the track selected. The type can be TvTrackInfo.TYPE_AUDIO, TvTrackInfo.TYPE_VIDEO or TvTrackInfo.TYPE_SUBTITLE.

trackId String: The ID of the track selected.

onTracksChanged

added in API level 21
public void onTracksChanged (String inputId, 
                List<TvTrackInfo> tracks)

This is called when the track information has been changed.

Parameters
inputId String: The ID of the TV input bound to this view.

tracks List: A list which includes track information.

onVideoAvailable

added in API level 21
public void onVideoAvailable (String inputId)

This is called when the video is available, so the TV input starts the playback.

Parameters
inputId String: The ID of the TV input bound to this view.

onVideoSizeChanged

added in API level 21
public void onVideoSizeChanged (String inputId, 
                int width, 
                int height)

This is invoked when the video size has been changed. It is also called when the first time video size information becomes available after this view is tuned to a specific channel.

Parameters
inputId String: The ID of the TV input bound to this view.

width int: The width of the video.

height int: The height of the video.

onVideoUnavailable

added in API level 21
public void onVideoUnavailable (String inputId, 
                int reason)

This is called when the video is not available, so the TV input stops the playback.

Parameters
inputId String: The ID of the TV input bound to this view.

reason int: The reason why the TV input stopped the playback: