Deprecate AnalyticsListener.onSeekStarted.

The new onPositionDiscontinuity callback contains sufficient information, so
that this former workaround to obtain the position before a seek is no longer
needed.

PiperOrigin-RevId: 365993937
This commit is contained in:
tonihei 2021-03-31 10:44:51 +01:00 committed by Oliver Woodman
parent 7aeb476812
commit dc0ee7580e
2 changed files with 5 additions and 3 deletions

View file

@ -170,6 +170,7 @@ public class AnalyticsCollector
* Notify analytics collector that a seek operation will start. Should be called before the player
* adjusts its state and position to the seek.
*/
@SuppressWarnings("deprecation") // Calling deprecated listener method.
public final void notifySeekStarted() {
if (!isSeeking) {
EventTime eventTime = generateCurrentPlayerMediaPeriodEventTime();

View file

@ -553,10 +553,11 @@ public interface AnalyticsListener {
@DiscontinuityReason int reason) {}
/**
* Called when a seek operation started.
*
* @param eventTime The event time.
* @deprecated Use {@link #onPositionDiscontinuity(EventTime, Player.PositionInfo,
* Player.PositionInfo, int)} instead, listening to changes with {@link
* Player#DISCONTINUITY_REASON_SEEK}.
*/
@Deprecated
default void onSeekStarted(EventTime eventTime) {}
/**