Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
155e27ec
authored
Jun 28, 2021
by
aquilescanta
Committed by
Oliver Woodman
Jun 30, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Move ExoPlaybackException back into core
PiperOrigin-RevId: 381941053
parent
02db70bd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
library/common/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java → library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java
extensions/cast/src/main/java/com/google/android/exoplayer2/ext/cast/CastPlayer.java
View file @
155e27ec
...
...
@@ -28,10 +28,10 @@ import androidx.annotation.Nullable;
import
androidx.annotation.VisibleForTesting
;
import
com.google.android.exoplayer2.BasePlayer
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
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.Timeline
;
...
...
@@ -338,7 +338,7 @@ public final class CastPlayer extends BasePlayer {
@Override
@Nullable
public
Exo
PlaybackException
getPlayerError
()
{
public
PlaybackException
getPlayerError
()
{
return
null
;
}
...
...
extensions/leanback/src/main/java/com/google/android/exoplayer2/ext/leanback/LeanbackPlayerAdapter.java
View file @
155e27ec
...
...
@@ -28,7 +28,6 @@ import androidx.leanback.media.SurfaceHolderGlueHost;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ControlDispatcher
;
import
com.google.android.exoplayer2.DefaultControlDispatcher
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlayerLibraryInfo
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
...
...
@@ -262,14 +261,14 @@ public final class LeanbackPlayerAdapter extends PlayerAdapter implements Runnab
Pair
<
Integer
,
String
>
errorMessage
=
errorMessageProvider
.
getErrorMessage
(
exception
);
callback
.
onError
(
LeanbackPlayerAdapter
.
this
,
errorMessage
.
first
,
errorMessage
.
second
);
}
else
{
int
rendererIndex
=
C
.
INDEX_UNSET
;
if
(
exception
instanceof
ExoPlaybackException
)
{
rendererIndex
=
((
ExoPlaybackException
)
exception
).
rendererIndex
;
}
callback
.
onError
(
LeanbackPlayerAdapter
.
this
,
exception
.
errorCode
,
context
.
getString
(
R
.
string
.
lb_media_player_error
,
exception
.
errorCode
,
rendererIndex
));
// This string was probably tailored for MediaPlayer, whose callback takes 2 ints as
// error code. Since ExoPlayer provides a single error code, we just pass 0 as the
// extra.
context
.
getString
(
R
.
string
.
lb_media_player_error
,
/* formatArgs...= */
exception
.
errorCode
,
0
));
}
}
...
...
library/co
mmon
/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java
→
library/co
re
/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java
View file @
155e27ec
...
...
@@ -23,6 +23,7 @@ import androidx.annotation.IntDef;
import
androidx.annotation.Nullable
;
import
com.google.android.exoplayer2.C.FormatSupport
;
import
com.google.android.exoplayer2.source.MediaPeriodId
;
import
com.google.android.exoplayer2.source.MediaSource
;
import
com.google.android.exoplayer2.util.Assertions
;
import
com.google.android.exoplayer2.util.Util
;
import
java.io.IOException
;
...
...
@@ -43,18 +44,16 @@ public final class ExoPlaybackException extends PlaybackException {
@IntDef
({
TYPE_SOURCE
,
TYPE_RENDERER
,
TYPE_UNEXPECTED
,
TYPE_REMOTE
})
public
@interface
Type
{}
/**
* The error occurred loading data from a {@
code
MediaSource}.
* The error occurred loading data from a {@
link
MediaSource}.
*
* <p>Call {@link #getSourceException()} to retrieve the underlying cause.
*/
// TODO(b/172315872) MediaSource was a link. Link to equivalent concept or remove @code.
public
static
final
int
TYPE_SOURCE
=
0
;
/**
* The error occurred in a {@
code
Renderer}.
* The error occurred in a {@
link
Renderer}.
*
* <p>Call {@link #getRendererException()} to retrieve the underlying cause.
*/
// TODO(b/172315872) Renderer was a link. Link to equivalent concept or remove @code.
public
static
final
int
TYPE_RENDERER
=
1
;
/**
* The error was an unexpected {@link RuntimeException}.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment