Interface AnalyticsListener

    • Method Detail

      • onPlaybackStateChanged

        default void onPlaybackStateChanged​(AnalyticsListener.EventTime eventTime,
                                            @State
                                            @com.google.android.exoplayer2.Player.State int state)
        Deprecated.
        Called when the playback state changed.
        Parameters:
        eventTime - The event time.
        state - The new playback state.
      • onPlayWhenReadyChanged

        default void onPlayWhenReadyChanged​(AnalyticsListener.EventTime eventTime,
                                            boolean playWhenReady,
                                            @PlayWhenReadyChangeReason
                                            @com.google.android.exoplayer2.Player.PlayWhenReadyChangeReason int reason)
        Deprecated.
        Called when the value changed that indicates whether playback will proceed when ready.
        Parameters:
        eventTime - The event time.
        playWhenReady - Whether playback will proceed when ready.
        reason - The reason of the change.
      • onIsPlayingChanged

        default void onIsPlayingChanged​(AnalyticsListener.EventTime eventTime,
                                        boolean isPlaying)
        Deprecated.
        Called when the player starts or stops playing.
        Parameters:
        eventTime - The event time.
        isPlaying - Whether the player is playing.
      • onTimelineChanged

        default void onTimelineChanged​(AnalyticsListener.EventTime eventTime,
                                       @TimelineChangeReason
                                       @com.google.android.exoplayer2.Player.TimelineChangeReason int reason)
        Deprecated.
        Called when the timeline changed.
        Parameters:
        eventTime - The event time.
        reason - The reason for the timeline change.
      • onMediaItemTransition

        default void onMediaItemTransition​(AnalyticsListener.EventTime eventTime,
                                           @Nullable
                                           MediaItem mediaItem,
                                           @MediaItemTransitionReason
                                           @com.google.android.exoplayer2.Player.MediaItemTransitionReason int reason)
        Deprecated.
        Called when playback transitions to a different media item.
        Parameters:
        eventTime - The event time.
        mediaItem - The media item.
        reason - The reason for the media item transition.
      • onPositionDiscontinuity

        default void onPositionDiscontinuity​(AnalyticsListener.EventTime eventTime,
                                             Player.PositionInfo oldPosition,
                                             Player.PositionInfo newPosition,
                                             @DiscontinuityReason
                                             @com.google.android.exoplayer2.Player.DiscontinuityReason int reason)
        Deprecated.
        Called when a position discontinuity occurred.
        Parameters:
        eventTime - The event time.
        oldPosition - The position before the discontinuity.
        newPosition - The position after the discontinuity.
        reason - The reason for the position discontinuity.
      • onPlaybackParametersChanged

        default void onPlaybackParametersChanged​(AnalyticsListener.EventTime eventTime,
                                                 PlaybackParameters playbackParameters)
        Deprecated.
        Called when the playback parameters changed.
        Parameters:
        eventTime - The event time.
        playbackParameters - The new playback parameters.
      • onSeekBackIncrementChanged

        default void onSeekBackIncrementChanged​(AnalyticsListener.EventTime eventTime,
                                                long seekBackIncrementMs)
        Deprecated.
        Called when the seek back increment changed.
        Parameters:
        eventTime - The event time.
        seekBackIncrementMs - The seek back increment, in milliseconds.
      • onSeekForwardIncrementChanged

        default void onSeekForwardIncrementChanged​(AnalyticsListener.EventTime eventTime,
                                                   long seekForwardIncrementMs)
        Deprecated.
        Called when the seek forward increment changed.
        Parameters:
        eventTime - The event time.
        seekForwardIncrementMs - The seek forward increment, in milliseconds.
      • onMaxSeekToPreviousPositionChanged

        default void onMaxSeekToPreviousPositionChanged​(AnalyticsListener.EventTime eventTime,
                                                        long maxSeekToPreviousPositionMs)
        Deprecated.
        Called when the maximum position for which Player.seekToPrevious() seeks to the previous window changes.
        Parameters:
        eventTime - The event time.
        maxSeekToPreviousPositionMs - The maximum seek to previous position, in milliseconds.
      • onRepeatModeChanged

        default void onRepeatModeChanged​(AnalyticsListener.EventTime eventTime,
                                         @RepeatMode
                                         @com.google.android.exoplayer2.Player.RepeatMode int repeatMode)
        Deprecated.
        Called when the repeat mode changed.
        Parameters:
        eventTime - The event time.
        repeatMode - The new repeat mode.
      • onShuffleModeChanged

        default void onShuffleModeChanged​(AnalyticsListener.EventTime eventTime,
                                          boolean shuffleModeEnabled)
        Deprecated.
        Called when the shuffle mode changed.
        Parameters:
        eventTime - The event time.
        shuffleModeEnabled - Whether the shuffle mode is enabled.
      • onIsLoadingChanged

        default void onIsLoadingChanged​(AnalyticsListener.EventTime eventTime,
                                        boolean isLoading)
        Deprecated.
        Called when the player starts or stops loading data from a source.
        Parameters:
        eventTime - The event time.
        isLoading - Whether the player is loading.
      • onAvailableCommandsChanged

        default void onAvailableCommandsChanged​(AnalyticsListener.EventTime eventTime,
                                                Player.Commands availableCommands)
        Deprecated.
        Called when the player's available commands changed.
        Parameters:
        eventTime - The event time.
        availableCommands - The available commands.
      • onPlayerError

        default void onPlayerError​(AnalyticsListener.EventTime eventTime,
                                   PlaybackException error)
        Deprecated.
        Called when a fatal player error occurred.

        Implementations of Player may pass an instance of a subclass of PlaybackException to this method in order to include more information about the error.

        Parameters:
        eventTime - The event time.
        error - The error.
      • onTracksChanged

        default void onTracksChanged​(AnalyticsListener.EventTime eventTime,
                                     Tracks tracks)
        Deprecated.
        Called when the tracks change.
        Parameters:
        eventTime - The event time.
        tracks - The tracks. Never null, but may be of length zero.
      • onLoadError

        default void onLoadError​(AnalyticsListener.EventTime eventTime,
                                 LoadEventInfo loadEventInfo,
                                 MediaLoadData mediaLoadData,
                                 IOException error,
                                 boolean wasCanceled)
        Deprecated.
        Called when a media source loading error occurred.

        This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.

        Parameters:
        eventTime - The event time.
        loadEventInfo - The LoadEventInfo defining the load event.
        mediaLoadData - The MediaLoadData defining the data being loaded.
        error - The load error.
        wasCanceled - Whether the load was canceled as a result of the error.
      • onDownstreamFormatChanged

        default void onDownstreamFormatChanged​(AnalyticsListener.EventTime eventTime,
                                               MediaLoadData mediaLoadData)
        Deprecated.
        Called when the downstream format sent to the renderers changed.
        Parameters:
        eventTime - The event time.
        mediaLoadData - The MediaLoadData defining the newly selected media data.
      • onUpstreamDiscarded

        default void onUpstreamDiscarded​(AnalyticsListener.EventTime eventTime,
                                         MediaLoadData mediaLoadData)
        Deprecated.
        Called when data is removed from the back of a media buffer, typically so that it can be re-buffered in a different format.
        Parameters:
        eventTime - The event time.
        mediaLoadData - The MediaLoadData defining the media being discarded.
      • onBandwidthEstimate

        default void onBandwidthEstimate​(AnalyticsListener.EventTime eventTime,
                                         int totalLoadTimeMs,
                                         long totalBytesLoaded,
                                         long bitrateEstimate)
        Deprecated.
        Called when the bandwidth estimate for the current data source has been updated.
        Parameters:
        eventTime - The event time.
        totalLoadTimeMs - The total time spend loading this update is based on, in milliseconds.
        totalBytesLoaded - The total bytes loaded this update is based on.
        bitrateEstimate - The bandwidth estimate, in bits per second.
      • onMetadata

        default void onMetadata​(AnalyticsListener.EventTime eventTime,
                                Metadata metadata)
        Deprecated.
        Called when there is Metadata associated with the current playback time.
        Parameters:
        eventTime - The event time.
        metadata - The metadata.
      • onAudioEnabled

        default void onAudioEnabled​(AnalyticsListener.EventTime eventTime,
                                    DecoderCounters decoderCounters)
        Deprecated.
        Called when an audio renderer is enabled.
        Parameters:
        eventTime - The event time.
        decoderCounters - DecoderCounters that will be updated by the renderer for as long as it remains enabled.
      • onAudioDecoderInitialized

        default void onAudioDecoderInitialized​(AnalyticsListener.EventTime eventTime,
                                               String decoderName,
                                               long initializedTimestampMs,
                                               long initializationDurationMs)
        Deprecated.
        Called when an audio renderer creates a decoder.
        Parameters:
        eventTime - The event time.
        decoderName - The decoder that was created.
        initializedTimestampMs - SystemClock.elapsedRealtime() when initialization finished.
        initializationDurationMs - The time taken to initialize the decoder in milliseconds.
      • onAudioInputFormatChanged

        default void onAudioInputFormatChanged​(AnalyticsListener.EventTime eventTime,
                                               Format format,
                                               @Nullable
                                               DecoderReuseEvaluation decoderReuseEvaluation)
        Deprecated.
        Called when the format of the media being consumed by an audio renderer changes.
        Parameters:
        eventTime - The event time.
        format - The new format.
        decoderReuseEvaluation - The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, or null if the renderer did not have a decoder.
      • onAudioPositionAdvancing

        default void onAudioPositionAdvancing​(AnalyticsListener.EventTime eventTime,
                                              long playoutStartSystemTimeMs)
        Deprecated.
        Called when the audio position has increased for the first time since the last pause or position reset.
        Parameters:
        eventTime - The event time.
        playoutStartSystemTimeMs - The approximate derived System.currentTimeMillis() at which playout started.
      • onAudioUnderrun

        default void onAudioUnderrun​(AnalyticsListener.EventTime eventTime,
                                     int bufferSize,
                                     long bufferSizeMs,
                                     long elapsedSinceLastFeedMs)
        Deprecated.
        Called when an audio underrun occurs.
        Parameters:
        eventTime - The event time.
        bufferSize - The size of the audio output buffer, in bytes.
        bufferSizeMs - The size of the audio output buffer, in milliseconds, if it contains PCM encoded audio. C.TIME_UNSET if the output buffer contains non-PCM encoded audio.
        elapsedSinceLastFeedMs - The time since audio was last written to the output buffer.
      • onAudioDecoderReleased

        default void onAudioDecoderReleased​(AnalyticsListener.EventTime eventTime,
                                            String decoderName)
        Deprecated.
        Called when an audio renderer releases a decoder.
        Parameters:
        eventTime - The event time.
        decoderName - The decoder that was released.
      • onAudioDisabled

        default void onAudioDisabled​(AnalyticsListener.EventTime eventTime,
                                     DecoderCounters decoderCounters)
        Deprecated.
        Called when an audio renderer is disabled.
        Parameters:
        eventTime - The event time.
        decoderCounters - DecoderCounters that were updated by the renderer.
      • onAudioSessionIdChanged

        default void onAudioSessionIdChanged​(AnalyticsListener.EventTime eventTime,
                                             int audioSessionId)
        Deprecated.
        Called when the audio session ID changes.
        Parameters:
        eventTime - The event time.
        audioSessionId - The audio session ID.
      • onAudioAttributesChanged

        default void onAudioAttributesChanged​(AnalyticsListener.EventTime eventTime,
                                              AudioAttributes audioAttributes)
        Deprecated.
        Called when the audio attributes change.
        Parameters:
        eventTime - The event time.
        audioAttributes - The audio attributes.
      • onSkipSilenceEnabledChanged

        default void onSkipSilenceEnabledChanged​(AnalyticsListener.EventTime eventTime,
                                                 boolean skipSilenceEnabled)
        Deprecated.
        Called when skipping silences is enabled or disabled in the audio stream.
        Parameters:
        eventTime - The event time.
        skipSilenceEnabled - Whether skipping silences in the audio stream is enabled.
      • onAudioCodecError

        default void onAudioCodecError​(AnalyticsListener.EventTime eventTime,
                                       Exception audioCodecError)
        Deprecated.
        Called when an audio decoder encounters an error.

        This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.

        Parameters:
        eventTime - The event time.
        audioCodecError - The error. Typically a MediaCodec.CodecException if the renderer uses MediaCodec, or a DecoderException if the renderer uses a software decoder.
      • onVolumeChanged

        default void onVolumeChanged​(AnalyticsListener.EventTime eventTime,
                                     float volume)
        Deprecated.
        Called when the volume changes.
        Parameters:
        eventTime - The event time.
        volume - The new volume, with 0 being silence and 1 being unity gain.
      • onDeviceInfoChanged

        default void onDeviceInfoChanged​(AnalyticsListener.EventTime eventTime,
                                         DeviceInfo deviceInfo)
        Deprecated.
        Called when the device information changes
        Parameters:
        eventTime - The event time.
        deviceInfo - The new DeviceInfo.
      • onDeviceVolumeChanged

        default void onDeviceVolumeChanged​(AnalyticsListener.EventTime eventTime,
                                           int volume,
                                           boolean muted)
        Deprecated.
        Called when the device volume or mute state changes.
        Parameters:
        eventTime - The event time.
        volume - The new device volume, with 0 being silence and 1 being unity gain.
        muted - Whether the device is muted.
      • onVideoEnabled

        default void onVideoEnabled​(AnalyticsListener.EventTime eventTime,
                                    DecoderCounters decoderCounters)
        Deprecated.
        Called when a video renderer is enabled.
        Parameters:
        eventTime - The event time.
        decoderCounters - DecoderCounters that will be updated by the renderer for as long as it remains enabled.
      • onVideoDecoderInitialized

        default void onVideoDecoderInitialized​(AnalyticsListener.EventTime eventTime,
                                               String decoderName,
                                               long initializedTimestampMs,
                                               long initializationDurationMs)
        Deprecated.
        Called when a video renderer creates a decoder.
        Parameters:
        eventTime - The event time.
        decoderName - The decoder that was created.
        initializedTimestampMs - SystemClock.elapsedRealtime() when initialization finished.
        initializationDurationMs - The time taken to initialize the decoder in milliseconds.
      • onVideoInputFormatChanged

        default void onVideoInputFormatChanged​(AnalyticsListener.EventTime eventTime,
                                               Format format,
                                               @Nullable
                                               DecoderReuseEvaluation decoderReuseEvaluation)
        Deprecated.
        Called when the format of the media being consumed by a video renderer changes.
        Parameters:
        eventTime - The event time.
        format - The new format.
        decoderReuseEvaluation - The result of the evaluation to determine whether an existing decoder instance can be reused for the new format, or null if the renderer did not have a decoder.
      • onDroppedVideoFrames

        default void onDroppedVideoFrames​(AnalyticsListener.EventTime eventTime,
                                          int droppedFrames,
                                          long elapsedMs)
        Deprecated.
        Called after video frames have been dropped.
        Parameters:
        eventTime - The event time.
        droppedFrames - The number of dropped frames since the last call to this method.
        elapsedMs - The duration in milliseconds over which the frames were dropped. This duration is timed from when the renderer was started or from when dropped frames were last reported (whichever was more recent), and not from when the first of the reported drops occurred.
      • onVideoDecoderReleased

        default void onVideoDecoderReleased​(AnalyticsListener.EventTime eventTime,
                                            String decoderName)
        Deprecated.
        Called when a video renderer releases a decoder.
        Parameters:
        eventTime - The event time.
        decoderName - The decoder that was released.
      • onVideoDisabled

        default void onVideoDisabled​(AnalyticsListener.EventTime eventTime,
                                     DecoderCounters decoderCounters)
        Deprecated.
        Called when a video renderer is disabled.
        Parameters:
        eventTime - The event time.
        decoderCounters - DecoderCounters that were updated by the renderer.
      • onVideoFrameProcessingOffset

        default void onVideoFrameProcessingOffset​(AnalyticsListener.EventTime eventTime,
                                                  long totalProcessingOffsetUs,
                                                  int frameCount)
        Deprecated.
        Called when there is an update to the video frame processing offset reported by a video renderer.

        The processing offset for a video frame is the difference between the time at which the frame became available to render, and the time at which it was scheduled to be rendered. A positive value indicates the frame became available early enough, whereas a negative value indicates that the frame wasn't available until after the time at which it should have been rendered.

        Parameters:
        eventTime - The event time.
        totalProcessingOffsetUs - The sum of the video frame processing offsets for frames rendered since the last call to this method.
        frameCount - The number to samples included in totalProcessingOffsetUs.
      • onVideoCodecError

        default void onVideoCodecError​(AnalyticsListener.EventTime eventTime,
                                       Exception videoCodecError)
        Deprecated.
        Called when a video decoder encounters an error.

        This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.

        Parameters:
        eventTime - The event time.
        videoCodecError - The error. Typically a MediaCodec.CodecException if the renderer uses MediaCodec, or a DecoderException if the renderer uses a software decoder.
      • onRenderedFirstFrame

        default void onRenderedFirstFrame​(AnalyticsListener.EventTime eventTime,
                                          Object output,
                                          long renderTimeMs)
        Deprecated.
        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.
        Parameters:
        eventTime - The event time.
        output - The output to which a frame has been rendered. Normally a Surface, however may also be other output types (e.g., a VideoDecoderOutputBufferRenderer).
        renderTimeMs - SystemClock.elapsedRealtime() when the first frame was rendered.
      • onVideoSizeChanged

        default void onVideoSizeChanged​(AnalyticsListener.EventTime eventTime,
                                        VideoSize videoSize)
        Deprecated.
        Called before a frame is rendered for the first time since setting the surface, and each time there's a change in the size or pixel aspect ratio of the video being rendered.
        Parameters:
        eventTime - The event time.
        videoSize - The new size of the video.
      • onSurfaceSizeChanged

        default void onSurfaceSizeChanged​(AnalyticsListener.EventTime eventTime,
                                          int width,
                                          int height)
        Deprecated.
        Called when the output surface size changed.
        Parameters:
        eventTime - The event time.
        width - The surface width in pixels. May be C.LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.
        height - The surface height in pixels. May be C.LENGTH_UNSET if unknown, or 0 if the video is not rendered onto a surface.
      • onDrmSessionAcquired

        default void onDrmSessionAcquired​(AnalyticsListener.EventTime eventTime,
                                          @State
                                          @com.google.android.exoplayer2.drm.DrmSession.State int state)
        Deprecated.
        Called each time a drm session is acquired.
        Parameters:
        eventTime - The event time.
        state - The DrmSession.State of the session when the acquisition completed.
      • onDrmKeysLoaded

        default void onDrmKeysLoaded​(AnalyticsListener.EventTime eventTime)
        Deprecated.
        Called each time drm keys are loaded.
        Parameters:
        eventTime - The event time.
      • onDrmSessionManagerError

        default void onDrmSessionManagerError​(AnalyticsListener.EventTime eventTime,
                                              Exception error)
        Deprecated.
        Called when a drm error occurs.

        This method being called does not indicate that playback has failed, or that it will fail. The player may be able to recover from the error. Hence applications should not implement this method to display a user visible error or initiate an application level retry. Player.Listener.onPlayerError(com.google.android.exoplayer2.PlaybackException) is the appropriate place to implement such behavior. This method is called to provide the application with an opportunity to log the error if it wishes to do so.

        Parameters:
        eventTime - The event time.
        error - The error.
      • onDrmKeysRestored

        default void onDrmKeysRestored​(AnalyticsListener.EventTime eventTime)
        Deprecated.
        Called each time offline drm keys are restored.
        Parameters:
        eventTime - The event time.
      • onDrmKeysRemoved

        default void onDrmKeysRemoved​(AnalyticsListener.EventTime eventTime)
        Deprecated.
        Called each time offline drm keys are removed.
        Parameters:
        eventTime - The event time.
      • onDrmSessionReleased

        default void onDrmSessionReleased​(AnalyticsListener.EventTime eventTime)
        Deprecated.
        Called each time a drm session is released.
        Parameters:
        eventTime - The event time.
      • onPlayerReleased

        default void onPlayerReleased​(AnalyticsListener.EventTime eventTime)
        Deprecated.
        Called when the Player is released.
        Parameters:
        eventTime - The event time.