mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Make AnalyticsListener.onPlayerError take a PlaybackException
NO_EXTERNAL PiperOrigin-RevId: 377090819
This commit is contained in:
parent
a8e96da1a2
commit
89fe0d0cf9
5 changed files with 9 additions and 10 deletions
|
|
@ -26,10 +26,10 @@ import android.view.Surface;
|
||||||
import androidx.annotation.IntDef;
|
import androidx.annotation.IntDef;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.MediaMetadata;
|
import com.google.android.exoplayer2.MediaMetadata;
|
||||||
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.PlaybackParameters;
|
import com.google.android.exoplayer2.PlaybackParameters;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.Player.DiscontinuityReason;
|
import com.google.android.exoplayer2.Player.DiscontinuityReason;
|
||||||
|
|
@ -617,7 +617,7 @@ public interface AnalyticsListener {
|
||||||
* @param eventTime The event time.
|
* @param eventTime The event time.
|
||||||
* @param error The error.
|
* @param error The error.
|
||||||
*/
|
*/
|
||||||
default void onPlayerError(EventTime eventTime, ExoPlaybackException error) {}
|
default void onPlayerError(EventTime eventTime, PlaybackException error) {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the available or selected tracks for the renderers changed.
|
* Called when the available or selected tracks for the renderers changed.
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,6 @@ import android.os.SystemClock;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
import com.google.android.exoplayer2.PlaybackException;
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
|
|
@ -245,7 +244,7 @@ public class EventLogger implements AnalyticsListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException e) {
|
public void onPlayerError(EventTime eventTime, PlaybackException e) {
|
||||||
loge(eventTime, "playerFailed", e);
|
loge(eventTime, "playerFailed", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7161,8 +7161,7 @@ public final class ExoPlayerTest {
|
||||||
player.addAnalyticsListener(
|
player.addAnalyticsListener(
|
||||||
new AnalyticsListener() {
|
new AnalyticsListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(
|
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||||
EventTime eventTime, ExoPlaybackException error) {
|
|
||||||
timelineAfterError.set(player.getCurrentTimeline());
|
timelineAfterError.set(player.getCurrentTimeline());
|
||||||
trackGroupsAfterError.set(player.getCurrentTrackGroups());
|
trackGroupsAfterError.set(player.getCurrentTrackGroups());
|
||||||
trackSelectionsAfterError.set(player.getCurrentTrackSelections());
|
trackSelectionsAfterError.set(player.getCurrentTrackSelections());
|
||||||
|
|
|
||||||
|
|
@ -71,6 +71,7 @@ import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.PlaybackParameters;
|
import com.google.android.exoplayer2.PlaybackParameters;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.Renderer;
|
import com.google.android.exoplayer2.Renderer;
|
||||||
|
|
@ -1942,7 +1943,7 @@ public final class AnalyticsCollectorTest {
|
||||||
spy(
|
spy(
|
||||||
new AnalyticsListener() {
|
new AnalyticsListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||||
analyticsCollector.onSurfaceSizeChanged(/* width= */ 0, /* height= */ 0);
|
analyticsCollector.onSurfaceSizeChanged(/* width= */ 0, /* height= */ 0);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
@ -2141,7 +2142,7 @@ public final class AnalyticsCollectorTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||||
reportedEvents.add(new ReportedEvent(EVENT_PLAYER_ERROR, eventTime));
|
reportedEvents.add(new ReportedEvent(EVENT_PLAYER_ERROR, eventTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,8 @@ import androidx.annotation.RequiresApi;
|
||||||
import androidx.annotation.VisibleForTesting;
|
import androidx.annotation.VisibleForTesting;
|
||||||
import com.google.android.exoplayer2.C;
|
import com.google.android.exoplayer2.C;
|
||||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
|
||||||
import com.google.android.exoplayer2.MediaItem;
|
import com.google.android.exoplayer2.MediaItem;
|
||||||
|
import com.google.android.exoplayer2.PlaybackException;
|
||||||
import com.google.android.exoplayer2.Player;
|
import com.google.android.exoplayer2.Player;
|
||||||
import com.google.android.exoplayer2.Renderer;
|
import com.google.android.exoplayer2.Renderer;
|
||||||
import com.google.android.exoplayer2.RenderersFactory;
|
import com.google.android.exoplayer2.RenderersFactory;
|
||||||
|
|
@ -639,7 +639,7 @@ public final class Transformer {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||||
handleTransformationEnded(error);
|
handleTransformationEnded(error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue