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
72b416c6
authored
Jul 13, 2021
by
aquilescanta
Committed by
Oliver Woodman
Jul 14, 2021
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Remove ExoPlaybackException factory method that doesn't take errorCode
PiperOrigin-RevId: 384442821
parent
cdaf3e4e
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
20 deletions
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java
library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
extensions/ima/src/test/java/com/google/android/exoplayer2/ext/ima/ImaAdsLoaderTest.java
View file @
72b416c6
...
@@ -56,6 +56,7 @@ import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer;
...
@@ -56,6 +56,7 @@ import com.google.ads.interactivemedia.v3.api.player.VideoAdPlayer;
import
com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate
;
import
com.google.ads.interactivemedia.v3.api.player.VideoProgressUpdate
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.C
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.ExoPlaybackException
;
import
com.google.android.exoplayer2.PlaybackException
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Player
;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.Timeline
;
import
com.google.android.exoplayer2.Timeline.Period
;
import
com.google.android.exoplayer2.Timeline.Period
;
...
@@ -273,7 +274,9 @@ public final class ImaAdsLoaderTest {
...
@@ -273,7 +274,9 @@ public final class ImaAdsLoaderTest {
adEventListener
.
onAdEvent
(
getAdEvent
(
AdEventType
.
STARTED
,
mockPrerollSingleAd
));
adEventListener
.
onAdEvent
(
getAdEvent
(
AdEventType
.
STARTED
,
mockPrerollSingleAd
));
videoAdPlayer
.
pauseAd
(
TEST_AD_MEDIA_INFO
);
videoAdPlayer
.
pauseAd
(
TEST_AD_MEDIA_INFO
);
videoAdPlayer
.
stopAd
(
TEST_AD_MEDIA_INFO
);
videoAdPlayer
.
stopAd
(
TEST_AD_MEDIA_INFO
);
ExoPlaybackException
anException
=
ExoPlaybackException
.
createForSource
(
new
IOException
());
ExoPlaybackException
anException
=
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
);
imaAdsLoader
.
onPlayerErrorChanged
(
anException
);
imaAdsLoader
.
onPlayerErrorChanged
(
anException
);
imaAdsLoader
.
onPlayerError
(
anException
);
imaAdsLoader
.
onPlayerError
(
anException
);
imaAdsLoader
.
onPositionDiscontinuity
(
imaAdsLoader
.
onPositionDiscontinuity
(
...
...
library/core/src/main/java/com/google/android/exoplayer2/ExoPlaybackException.java
View file @
72b416c6
...
@@ -104,16 +104,6 @@ public final class ExoPlaybackException extends PlaybackException {
...
@@ -104,16 +104,6 @@ public final class ExoPlaybackException extends PlaybackException {
* Creates an instance of type {@link #TYPE_SOURCE}.
* Creates an instance of type {@link #TYPE_SOURCE}.
*
*
* @param cause The cause of the failure.
* @param cause The cause of the failure.
* @return The created instance.
*/
public
static
ExoPlaybackException
createForSource
(
IOException
cause
)
{
return
createForSource
(
cause
,
ERROR_CODE_UNSPECIFIED
);
}
/**
* Creates an instance of type {@link #TYPE_SOURCE}.
*
* @param cause The cause of the failure.
* @param errorCode See {@link #errorCode}.
* @param errorCode See {@link #errorCode}.
* @return The created instance.
* @return The created instance.
*/
*/
...
...
library/core/src/test/java/com/google/android/exoplayer2/ExoPlayerTest.java
View file @
72b416c6
...
@@ -1674,7 +1674,9 @@ public final class ExoPlayerTest {
...
@@ -1674,7 +1674,9 @@ public final class ExoPlayerTest {
ActionSchedule
actionSchedule
=
ActionSchedule
actionSchedule
=
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
prepare
()
.
prepare
()
.
waitForPlaybackState
(
Player
.
STATE_BUFFERING
)
.
waitForPlaybackState
(
Player
.
STATE_BUFFERING
)
...
@@ -1709,7 +1711,8 @@ public final class ExoPlayerTest {
...
@@ -1709,7 +1711,8 @@ public final class ExoPlayerTest {
player
player
.
createMessage
(
.
createMessage
(
(
type
,
payload
)
->
{
(
type
,
payload
)
->
{
throw
ExoPlaybackException
.
createForSource
(
new
IOException
());
throw
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
);
})
})
.
send
();
.
send
();
TestPlayerRunHelper
.
runUntilError
(
player
);
TestPlayerRunHelper
.
runUntilError
(
player
);
...
@@ -1784,7 +1787,9 @@ public final class ExoPlayerTest {
...
@@ -1784,7 +1787,9 @@ public final class ExoPlayerTest {
.
pause
()
.
pause
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
playUntilPosition
(
/* windowIndex= */
1
,
/* positionMs= */
500
)
.
playUntilPosition
(
/* windowIndex= */
1
,
/* positionMs= */
500
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
executeRunnable
(
.
executeRunnable
(
new
PlayerRunnable
()
{
new
PlayerRunnable
()
{
...
@@ -1847,7 +1852,9 @@ public final class ExoPlayerTest {
...
@@ -1847,7 +1852,9 @@ public final class ExoPlayerTest {
.
pause
()
.
pause
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
playUntilPosition
(
/* windowIndex= */
1
,
/* positionMs= */
500
)
.
playUntilPosition
(
/* windowIndex= */
1
,
/* positionMs= */
500
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
executeRunnable
(
.
executeRunnable
(
new
PlayerRunnable
()
{
new
PlayerRunnable
()
{
...
@@ -1909,7 +1916,9 @@ public final class ExoPlayerTest {
...
@@ -1909,7 +1916,9 @@ public final class ExoPlayerTest {
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
pause
()
.
pause
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
seek
(
0
,
C
.
TIME_UNSET
)
.
seek
(
0
,
C
.
TIME_UNSET
)
.
prepare
()
.
prepare
()
...
@@ -1958,12 +1967,16 @@ public final class ExoPlayerTest {
...
@@ -1958,12 +1967,16 @@ public final class ExoPlayerTest {
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
pause
()
.
pause
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
setMediaSources
(
/* resetPosition= */
false
,
mediaSource2
)
.
setMediaSources
(
/* resetPosition= */
false
,
mediaSource2
)
.
prepare
()
.
prepare
()
.
waitForPlaybackState
(
Player
.
STATE_BUFFERING
)
.
waitForPlaybackState
(
Player
.
STATE_BUFFERING
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForTimelineChanged
(
timeline
,
Player
.
TIMELINE_CHANGE_REASON_SOURCE_UPDATE
)
.
waitForTimelineChanged
(
timeline
,
Player
.
TIMELINE_CHANGE_REASON_SOURCE_UPDATE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
build
();
.
build
();
...
...
library/core/src/test/java/com/google/android/exoplayer2/analytics/AnalyticsCollectorTest.java
View file @
72b416c6
...
@@ -731,7 +731,9 @@ public final class AnalyticsCollectorTest {
...
@@ -731,7 +731,9 @@ public final class AnalyticsCollectorTest {
new
ActionSchedule
.
Builder
(
TAG
)
new
ActionSchedule
.
Builder
(
TAG
)
.
pause
()
.
pause
()
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
waitForPlaybackState
(
Player
.
STATE_READY
)
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
()))
.
throwPlaybackException
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
))
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
waitForPlaybackState
(
Player
.
STATE_IDLE
)
.
seek
(
/* positionMs= */
0
)
.
seek
(
/* positionMs= */
0
)
.
prepare
()
.
prepare
()
...
@@ -1958,7 +1960,9 @@ public final class AnalyticsCollectorTest {
...
@@ -1958,7 +1960,9 @@ public final class AnalyticsCollectorTest {
analyticsCollector
.
addListener
(
listener2
);
analyticsCollector
.
addListener
(
listener2
);
analyticsCollector
.
addListener
(
listener3
);
analyticsCollector
.
addListener
(
listener3
);
analyticsCollector
.
onPlayerError
(
ExoPlaybackException
.
createForSource
(
new
IOException
()));
analyticsCollector
.
onPlayerError
(
ExoPlaybackException
.
createForSource
(
new
IOException
(),
PlaybackException
.
ERROR_CODE_IO_UNSPECIFIED
));
InOrder
inOrder
=
Mockito
.
inOrder
(
listener1
,
listener2
,
listener3
);
InOrder
inOrder
=
Mockito
.
inOrder
(
listener1
,
listener2
,
listener3
);
inOrder
.
verify
(
listener1
).
onPlayerError
(
any
(),
any
());
inOrder
.
verify
(
listener1
).
onPlayerError
(
any
(),
any
());
...
...
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