Stay organized with collections Save and categorize content based on your preferences.

ExoHostedTest

@UnstableApi
abstract class ExoHostedTest : AnalyticsListener, HostActivity.HostedTest


A HostedTest for ExoPlayer playback tests.

Summary

Public constructors

ExoHostedTest(tag: @Size(max = 23) String!, fullPlaybackNoSeeking: Boolean)
ExoHostedTest(
    tag: @Size(max = 23) String!,
    expectedPlayingTimeMs: Long,
    failOnPlayerError: Boolean
)

Public functions

Boolean
blockUntilStopped(timeoutMs: Long)

Called on the main thread to block until the test has stopped or forceStop is called.

Boolean

Called on the main thread to force stop the test (if it is not stopped already).

Unit
onAudioDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when an audio renderer is disabled.

Unit

Called after one or more events occurred.

Unit

Called on the test thread after the test has finished and been stopped.

Unit
onStart(
    host: HostActivity!,
    surface: Surface!,
    overlayFrameLayout: FrameLayout!
)

Called on the main thread when the test is started.

Unit
onVideoDisabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when a video renderer is disabled.

Unit

Sets a schedule to be applied during the test.

Protected functions

Unit
assertPassed(
    audioCounters: DecoderCounters!,
    videoCounters: DecoderCounters!
)
DrmSessionManager!
ExoPlayer!
buildExoPlayer(
    host: HostActivity!,
    surface: Surface!,
    trackSelector: MappingTrackSelector!
)
abstract MediaSource!
buildSource(
    host: HostActivity!,
    drmSessionManager: DrmSessionManager!,
    overlayFrameLayout: FrameLayout!
)
DefaultTrackSelector!
Unit
logMetrics(
    audioCounters: DecoderCounters!,
    videoCounters: DecoderCounters!
)
Unit

Protected properties

String!

Inherited Constants

From androidx.media3.exoplayer.analytics.AnalyticsListener
const Int

Audio attributes changed.

const Int

The audio codec encountered an error.

const Int

An audio renderer created a decoder.

const Int

An audio renderer released a decoder.

const Int

An audio renderer was disabled.

const Int

An audio renderer was enabled.

const Int

The format consumed by an audio renderer changed.

const Int

The audio position has increased for the first time since the last pause or position reset.

const Int

An audio session id was set.

const Int

The audio sink encountered a non-fatal error.

const Int

An audio underrun occurred.

const Int

getAvailableCommands changed.

const Int

The bandwidth estimate has been updated.

const Int

getCurrentCues changed.

const Int

getDeviceInfo changed.

const Int

getDeviceVolume changed.

const Int

The downstream format sent to renderers changed.

const Int

DRM keys were loaded.

const Int

DRM keys were removed.

const Int

DRM keys were restored.

const Int

A DRM session has been acquired.

const Int

A non-fatal DRM session manager error occurred.

const Int

A DRM session has been released.

const Int

Video frames have been dropped.

const Int

isLoading ()} changed.

const Int

isPlaying changed.

const Int

A source canceled loading data.

const Int

A source started completed loading data.

const Int

A source had a non-fatal error loading data.

const Int

A source started loading data.

const Int

getMaxSeekToPreviousPosition changed.

const Int

getCurrentMediaItem changed or the player started repeating the current item.

const Int

getMediaMetadata changed.

const Int

Metadata associated with the current playback time was reported.

const Int

getPlaybackParameters changed.

const Int

getPlaybackState changed.

const Int

getPlaybackSuppressionReason changed.

const Int

getPlayerError changed.

const Int

The player was released.

const Int

getPlaylistMetadata changed.

const Int

getPlayWhenReady changed.

const Int

A position discontinuity occurred.

const Int

The first frame has been rendered since setting the surface, since the renderer was reset or since the stream changed.

const Int

getRepeatMode changed.

const Int

getSeekBackIncrement changed.

const Int

getSeekForwardIncrement changed.

const Int

getShuffleModeEnabled changed.

const Int

Skipping silences was enabled or disabled in the audio stream.

const Int

The surface size changed.

const Int

getCurrentTimeline changed.

const Int

getCurrentTracks changed.

const Int

getTrackSelectionParameters changed.

const Int

Data was removed from the end of the media buffer.

const Int

The video codec encountered an error.

const Int

A video renderer created a decoder.

const Int

A video renderer released a decoder.

const Int

A video renderer was disabled.

const Int

A video renderer was enabled.

const Int

Video frame processing offset data has been reported.

const Int

The format consumed by a video renderer changed.

const Int

The video size changed.

const Int

The volume changed.

Inherited functions

From androidx.media3.exoplayer.analytics.AnalyticsListener
Unit
@UnstableApi
onAudioAttributesChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioAttributes: AudioAttributes!
)

Called when the audio attributes change.

Unit
@UnstableApi
onAudioCodecError(
    eventTime: AnalyticsListener.EventTime!,
    audioCodecError: Exception!
)

Called when an audio decoder encounters an error.

Unit
@UnstableApi
onAudioDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializationDurationMs: Long
)

This function is deprecated.

Use onAudioDecoderInitialized.

Unit
@UnstableApi
onAudioDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!,
    initializedTimestampMs: Long,
    initializationDurationMs: Long
)

Called when an audio renderer creates a decoder.

Unit
@UnstableApi
onAudioDecoderReleased(
    eventTime: AnalyticsListener.EventTime!,
    decoderName: String!
)

Called when an audio renderer releases a decoder.

Unit
@UnstableApi
onAudioEnabled(
    eventTime: AnalyticsListener.EventTime!,
    decoderCounters: DecoderCounters!
)

Called when an audio renderer is enabled.

Unit

This function is deprecated.

Use onAudioInputFormatChanged.

Unit
@UnstableApi
onAudioInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    format: Format!,
    decoderReuseEvaluation: DecoderReuseEvaluation?
)

Called when the format of the media being consumed by an audio renderer changes.

Unit
@UnstableApi
onAudioPositionAdvancing(
    eventTime: AnalyticsListener.EventTime!,
    playoutStartSystemTimeMs: Long
)

Called when the audio position has increased for the first time since the last pause or position reset.

Unit
@UnstableApi
onAudioSessionIdChanged(
    eventTime: AnalyticsListener.EventTime!,
    audioSessionId: Int
)

Called when the audio session ID changes.

Unit
@UnstableApi
onAudioSinkError(
    eventTime: AnalyticsListener.EventTime!,
    audioSinkError: Exception!
)

Called when AudioSink has encountered an error.

Unit
@UnstableApi
onAudioUnderrun(
    eventTime: AnalyticsListener.EventTime!,
    bufferSize: Int,
    bufferSizeMs: Long,
    elapsedSinceLastFeedMs: Long
)

Called when an audio underrun occurs.

Unit
@UnstableApi
onAvailableCommandsChanged(
    eventTime: AnalyticsListener.EventTime!,
    availableCommands: Player.Commands!
)

Called when the player's available commands changed.

Unit
@UnstableApi
onBandwidthEstimate(
    eventTime: AnalyticsListener.EventTime!,
    totalLoadTimeMs: Int,
    totalBytesLoaded: Long,
    bitrateEstimate: Long
)

Called when the bandwidth estimate for the current data source has been updated.

Unit

Called when there is a change in the CueGroup.

Unit

This function is deprecated.

Use onCues instead.

Unit
@UnstableApi
onDecoderDisabled(
    eventTime: AnalyticsListener.EventTime!,
    trackType: Int,
    decoderCounters: DecoderCounters!
)

This function is deprecated.

Use onAudioDisabled and onVideoDisabled instead.

Unit
@UnstableApi
onDecoderEnabled(
    eventTime: AnalyticsListener.EventTime!,
    trackType: Int,
    decoderCounters: DecoderCounters!
)

This function is deprecated.

Use onAudioEnabled and onVideoEnabled instead.

Unit
@UnstableApi
onDecoderInitialized(
    eventTime: AnalyticsListener.EventTime!,
    trackType: Int,
    decoderName: String!,
    initializationDurationMs: Long
)

This function is deprecated.

Use onAudioDecoderInitialized and onVideoDecoderInitialized instead.

Unit
@UnstableApi
onDecoderInputFormatChanged(
    eventTime: AnalyticsListener.EventTime!,
    trackType: Int,
    format: Format!
)

This function is deprecated.

Use onAudioInputFormatChanged and onVideoInputFormatChanged. instead.

Unit
@UnstableApi
onDeviceInfoChanged(
    eventTime: AnalyticsListener.EventTime!,
    deviceInfo: DeviceInfo!
)

Called when the device information changes

Unit
@UnstableApi
onDeviceVolumeChanged(
    eventTime: AnalyticsListener.EventTime!,
    volume: Int,
    muted: Boolean
)

Called when the device volume or mute state changes.

Unit

Called when the downstream format sent to the renderers changed.

Unit

Called each time drm keys are loaded.

Unit

Called each time offline drm keys are removed.

Unit

Called each time offline drm keys are restored.

Unit

This function is deprecated.

Implement onDrmSessionAcquired instead.

Unit

Called each time a drm session is acquired.

Unit

Called when a drm error occurs.

Unit

Called each time a drm session is released.

Unit
@UnstableApi
onDroppedVideoFrames(
    eventTime: AnalyticsListener.EventTime!,
    droppedFrames: Int,
    elapsedMs: Long
)

Called after video frames have been dropped.

Unit
@UnstableApi
onIsLoadingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isLoading: Boolean
)

Called when the player starts or stops loading data from a source.

Unit
@UnstableApi
onIsPlayingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isPlaying: Boolean
)

Called when the player starts or stops playing.

Unit
@UnstableApi
onLoadCanceled(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source canceled loading data.

Unit
@UnstableApi
onLoadCompleted(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source completed loading data.

Unit
@UnstableApi
onLoadError(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!,
    error: IOException!,
    wasCanceled: Boolean
)

Called when a media source loading error occurred.

Unit
@UnstableApi
onLoadStarted(
    eventTime: AnalyticsListener.EventTime!,
    loadEventInfo: LoadEventInfo!,
    mediaLoadData: MediaLoadData!
)

Called when a media source started loading data.

Unit
@UnstableApi
onLoadingChanged(
    eventTime: AnalyticsListener.EventTime!,
    isLoading: Boolean
)

This function is deprecated.

Use onIsLoadingChanged instead.

Unit
@UnstableApi
onMaxSeekToPreviousPositionChanged(
    eventTime: AnalyticsListener.EventTime!,
    maxSeekToPreviousPositionMs: Long
)

Called when the maximum position for which seekToPrevious seeks to the previous window changes.

Unit

Called when playback transitions to a different media item.

Unit
@UnstableApi
onMediaMetadataChanged(
    eventTime: AnalyticsListener.EventTime!,
    mediaMetadata: MediaMetadata!
)

Called when the combined MediaMetadata changes.

Unit

Called when there is Metadata associated with the current playback time.

Unit
@UnstableApi
onPlayWhenReadyChanged(
    eventTime: AnalyticsListener.EventTime!,
    playWhenReady: Boolean,
    @Player.PlayWhenReadyChangeReason reason: Int
)

Called when the value changed that indicates whether playback will proceed when ready.

Unit

Called when the playback parameters changed.

Unit

Called when the playback state changed.

Unit

Called when playback suppression reason changed.

Unit

Called when a fatal player error occurred.

Unit

Called when the PlaybackException returned by getPlayerError changes.

Unit

Called when the Player is released.

Unit
@UnstableApi
onPlayerStateChanged(
    eventTime: AnalyticsListener.EventTime!,
    playWhenReady: Boolean,
    @Player.State playbackState: Int
)

This function is deprecated.

Use onPlaybackStateChanged and onPlayWhenReadyChanged instead.

Unit
@UnstableApi
onPlaylistMetadataChanged(
    eventTime: AnalyticsListener.EventTime!,
    playlistMetadata: MediaMetadata!
)

Called when the playlist MediaMetadata changes.

Unit

This function is deprecated.

Use onPositionDiscontinuity instead.

Unit
@UnstableApi
onPositionDiscontinuity(
    eventTime: AnalyticsListener.EventTime!,
    oldPosition: Player.PositionInfo!,
    newPosition: Player.PositionInfo!,
    @Player.DiscontinuityReason reason: Int
)

Called when a position discontinuity occurred.

Unit
@UnstableApi
onRenderedFirstFrame(
    eventTime: AnalyticsListener.EventTime!,
    output: Any!,
    renderTimeMs: Long
)

Called when a frame is rendered for the first time since setting the surface, or since the renderer was reset, or since the stream being rendered was changed.

Unit

Called when the repeat mode changed.

Unit
@UnstableApi
onSeekBackIncrementChanged(
    eventTime: AnalyticsListener.EventTime!,
    seekBackIncrementMs: Long
)

Called when the seek back increment changed.

Unit
@UnstableApi
onSeekForwardIncrementChanged(
    eventTime: AnalyticsListener.EventTime!,
    seekForwardIncrementMs: Long
)

Called when the seek forward increment changed.

Unit