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
0c0a67bb
authored
Oct 17, 2019
by
bachinger
Committed by
Oliver Woodman
Oct 18, 2019
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Fail at preparation when trying to download live content.
PiperOrigin-RevId: 275293735
parent
36f8bd78
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
1 deletions
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
demos/main/src/main/java/com/google/android/exoplayer2/demo/DownloadTracker.java
View file @
0c0a67bb
...
...
@@ -216,7 +216,12 @@ public class DownloadTracker {
@Override
public
void
onPrepareError
(
DownloadHelper
helper
,
IOException
e
)
{
Toast
.
makeText
(
context
,
R
.
string
.
download_start_error
,
Toast
.
LENGTH_LONG
).
show
();
Log
.
e
(
TAG
,
"Failed to start download"
,
e
);
Log
.
e
(
TAG
,
e
instanceof
DownloadHelper
.
LiveContentUnsupportedException
?
"Downloading live content unsupported"
:
"Failed to start download"
,
e
);
}
// DialogInterface.OnClickListener implementation.
...
...
library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java
View file @
0c0a67bb
...
...
@@ -137,6 +137,9 @@ public final class DownloadHelper {
void
onPrepareError
(
DownloadHelper
helper
,
IOException
e
);
}
/** Thrown at an attempt to download live content. */
public
static
class
LiveContentUnsupportedException
extends
IOException
{}
@Nullable
private
static
final
Constructor
<?
extends
MediaSourceFactory
>
DASH_FACTORY_CONSTRUCTOR
=
getConstructor
(
"com.google.android.exoplayer2.source.dash.DashMediaSource$Factory"
);
...
...
@@ -999,6 +1002,14 @@ public final class DownloadHelper {
// Ignore dynamic updates.
return
;
}
if
(
timeline
.
getWindow
(
/* windowIndex= */
0
,
new
Timeline
.
Window
()).
isLive
)
{
downloadHelperHandler
.
obtainMessage
(
DOWNLOAD_HELPER_CALLBACK_MESSAGE_FAILED
,
/* obj= */
new
LiveContentUnsupportedException
())
.
sendToTarget
();
return
;
}
this
.
timeline
=
timeline
;
mediaPeriods
=
new
MediaPeriod
[
timeline
.
getPeriodCount
()];
for
(
int
i
=
0
;
i
<
mediaPeriods
.
length
;
i
++)
{
...
...
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