mirror of
https://github.com/samsonjs/media.git
synced 2026-03-25 09:25:53 +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.Nullable;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.MediaMetadata;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
import com.google.android.exoplayer2.PlaybackParameters;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.Player.DiscontinuityReason;
|
||||
|
|
@ -617,7 +617,7 @@ public interface AnalyticsListener {
|
|||
* @param eventTime The event time.
|
||||
* @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.
|
||||
|
|
|
|||
|
|
@ -21,7 +21,6 @@ import android.os.SystemClock;
|
|||
import android.text.TextUtils;
|
||||
import androidx.annotation.Nullable;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.Format;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
|
|
@ -245,7 +244,7 @@ public class EventLogger implements AnalyticsListener {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException e) {
|
||||
public void onPlayerError(EventTime eventTime, PlaybackException e) {
|
||||
loge(eventTime, "playerFailed", e);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7161,8 +7161,7 @@ public final class ExoPlayerTest {
|
|||
player.addAnalyticsListener(
|
||||
new AnalyticsListener() {
|
||||
@Override
|
||||
public void onPlayerError(
|
||||
EventTime eventTime, ExoPlaybackException error) {
|
||||
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||
timelineAfterError.set(player.getCurrentTimeline());
|
||||
trackGroupsAfterError.set(player.getCurrentTrackGroups());
|
||||
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.Format;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
import com.google.android.exoplayer2.PlaybackParameters;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.Renderer;
|
||||
|
|
@ -1942,7 +1943,7 @@ public final class AnalyticsCollectorTest {
|
|||
spy(
|
||||
new AnalyticsListener() {
|
||||
@Override
|
||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
||||
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||
analyticsCollector.onSurfaceSizeChanged(/* width= */ 0, /* height= */ 0);
|
||||
}
|
||||
});
|
||||
|
|
@ -2141,7 +2142,7 @@ public final class AnalyticsCollectorTest {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
||||
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||
reportedEvents.add(new ReportedEvent(EVENT_PLAYER_ERROR, eventTime));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ import androidx.annotation.RequiresApi;
|
|||
import androidx.annotation.VisibleForTesting;
|
||||
import com.google.android.exoplayer2.C;
|
||||
import com.google.android.exoplayer2.DefaultLoadControl;
|
||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||
import com.google.android.exoplayer2.MediaItem;
|
||||
import com.google.android.exoplayer2.PlaybackException;
|
||||
import com.google.android.exoplayer2.Player;
|
||||
import com.google.android.exoplayer2.Renderer;
|
||||
import com.google.android.exoplayer2.RenderersFactory;
|
||||
|
|
@ -639,7 +639,7 @@ public final class Transformer {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void onPlayerError(EventTime eventTime, ExoPlaybackException error) {
|
||||
public void onPlayerError(EventTime eventTime, PlaybackException error) {
|
||||
handleTransformationEnded(error);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue