Skip to content

Commit

Permalink
Use loading period event time for fatal load errors.
Browse files Browse the repository at this point in the history
ExoPlaybackExceptions of type SOURCE are always associated with the loading
period and thus we can use the event time for the loading period in
onPlayerError. Renderer and unexpected exceptions are still associated with the
currently playing period.

Issue:#5407
PiperOrigin-RevId: 230216253
  • Loading branch information
tonihei authored and ojw28 committed Jan 21, 2019
1 parent e671dac commit 923aa42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions RELEASENOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@
fit service requirements. Remove ability to set a custom stop action.
* Add workaround for video quality problems with Amlogic decoders
([#5003](https://github.com/google/ExoPlayer/issues/5003)).
* Associate fatal player errors of type SOURCE with the loading source in
`AnalyticsListener.EventTime`
([#5407](https://github.com/google/ExoPlayer/issues/5407)).

### 2.9.4 ###

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,10 @@ public final void onShuffleModeEnabledChanged(boolean shuffleModeEnabled) {

@Override
public final void onPlayerError(ExoPlaybackException error) {
EventTime eventTime = generatePlayingMediaPeriodEventTime();
EventTime eventTime =
error.type == ExoPlaybackException.TYPE_SOURCE
? generateLoadingMediaPeriodEventTime()
: generatePlayingMediaPeriodEventTime();
for (AnalyticsListener listener : listeners) {
listener.onPlayerError(eventTime, error);
}
Expand Down

0 comments on commit 923aa42

Please sign in to comment.