public abstract static class TvInputManager.SessionCallback extends Object
Constructor and Description |
---|
SessionCallback() |
Modifier and Type | Method and Description |
---|---|
void |
onChannelRetuned(TvInputManager.Session session,
Uri channelUri)
This is called when the channel of this session is changed by the underlying TV input
without any
TvInputManager.Session.tune(Uri) request. |
void |
onContentAllowed(TvInputManager.Session session)
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(TvInputManager.Session session,
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 |
onLayoutSurface(TvInputManager.Session session,
int left,
int top,
int right,
int bottom)
This is called when
TvInputService.Session.layoutSurface(int, int, int, int) is called to change the
layout of surface. |
void |
onSessionCreated(TvInputManager.Session session)
This is called after
TvInputManager.createSession(java.lang.String, android.media.tv.TvInputManager.SessionCallback, android.os.Handler) has been processed. |
void |
onSessionEvent(TvInputManager.Session session,
String eventType,
Bundle eventArgs)
This is called when a custom event has been sent from this session.
|
void |
onSessionReleased(TvInputManager.Session session)
This is called when
TvInputManager.Session is released. |
void |
onTimeShiftCurrentPositionChanged(TvInputManager.Session session,
long timeMs)
This is called when the current position for time shifting is changed.
|
void |
onTimeShiftStartPositionChanged(TvInputManager.Session session,
long timeMs)
This is called when the start position for time shifting has changed.
|
void |
onTimeShiftStatusChanged(TvInputManager.Session session,
int status)
This is called when the time shift status is changed.
|
void |
onTracksChanged(TvInputManager.Session session,
List<TvTrackInfo> tracks)
This is called when the track information of the session has been changed.
|
void |
onTrackSelected(TvInputManager.Session session,
int type,
String trackId)
This is called when a track for a given type is selected.
|
void |
onVideoAvailable(TvInputManager.Session session)
This is called when the video is available, so the TV input starts the playback.
|
void |
onVideoSizeChanged(TvInputManager.Session session,
int width,
int height)
This is invoked when the video size has been changed.
|
void |
onVideoUnavailable(TvInputManager.Session session,
int reason)
This is called when the video is not available, so the TV input stops the playback.
|
public void onSessionCreated(TvInputManager.Session session)
TvInputManager.createSession(java.lang.String, android.media.tv.TvInputManager.SessionCallback, android.os.Handler)
has been processed.session
- A TvInputManager.Session
instance created. This can be
null
if the creation request failed.public void onSessionReleased(TvInputManager.Session session)
TvInputManager.Session
is released.
This typically happens when the process hosting the session has crashed or been killed.session
- A TvInputManager.Session
instance released.public void onChannelRetuned(TvInputManager.Session session, Uri channelUri)
TvInputManager.Session.tune(Uri)
request.session
- A TvInputManager.Session
associated with this callback.channelUri
- The URI of a channel.public void onTracksChanged(TvInputManager.Session session, List<TvTrackInfo> tracks)
session
- A TvInputManager.Session
associated with this callback.tracks
- A list which includes track information.public void onTrackSelected(TvInputManager.Session session, int type, String trackId)
session
- A TvInputManager.Session
associated with this callback.type
- The type of the selected track. The type can be
TvTrackInfo.TYPE_AUDIO
, TvTrackInfo.TYPE_VIDEO
or
TvTrackInfo.TYPE_SUBTITLE
.trackId
- The ID of the selected track. When null
the currently selected
track for a given type should be unselected.public void onVideoSizeChanged(TvInputManager.Session session, int width, int height)
session
- A TvInputManager.Session
associated with this callback.width
- The width of the video.height
- The height of the video.public void onVideoAvailable(TvInputManager.Session session)
session
- A TvInputManager.Session
associated with this callback.public void onVideoUnavailable(TvInputManager.Session session, int reason)
session
- A TvInputManager.Session
associated with this callback.reason
- The reason why the TV input stopped the playback:
public void onContentAllowed(TvInputManager.Session session)
session
- A TvInputManager.Session
associated with this callback.public void onContentBlocked(TvInputManager.Session session, TvContentRating rating)
session
- A TvInputManager.Session
associated with this callback.rating
- The content ration of the blocked program.public void onLayoutSurface(TvInputManager.Session session, int left, int top, int right, int bottom)
TvInputService.Session.layoutSurface(int, int, int, int)
is called to change the
layout of surface.session
- A TvInputManager.Session
associated with this callback.left
- Left position.top
- Top position.right
- Right position.bottom
- Bottom position.public void onSessionEvent(TvInputManager.Session session, String eventType, Bundle eventArgs)
session
- A TvInputManager.Session
associated with this callbackeventType
- The type of the event.eventArgs
- Optional arguments of the event.public void onTimeShiftStatusChanged(TvInputManager.Session session, int status)
session
- A TvInputManager.Session
associated with this callback.status
- The current time shift status. Should be one of the followings.
public void onTimeShiftStartPositionChanged(TvInputManager.Session session, long timeMs)
session
- A TvInputManager.Session
associated with this callback.timeMs
- The start position for time shifting, in milliseconds since the epoch.public void onTimeShiftCurrentPositionChanged(TvInputManager.Session session, long timeMs)
session
- A TvInputManager.Session
associated with this callback.timeMs
- The current position for time shifting, in milliseconds since the epoch.