public class MultiDataSource
extends java.lang.Object
implements com.google.android.exoplayer2.upstream.DataSource
Multi data source supports fetching assets from multiple URI schemes. If the data source is
an HTTP/HTTPS source, then it will check the offline store to check if the asset has been
downloaded already and automatically convert to DataSpec
to point to local copy of the
asset.
The supported schemes are:
Modifier and Type | Class and Description |
---|---|
static class |
MultiDataSource.Factory
Implements a factory to support
MultiDataSource |
Modifier and Type | Field and Description |
---|---|
protected com.google.android.exoplayer2.upstream.DataSource |
delegate |
Modifier and Type | Method and Description |
---|---|
void |
addTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener) |
void |
close() |
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getResponseHeaders() |
android.net.Uri |
getUri() |
long |
open(com.google.android.exoplayer2.upstream.DataSpec dataSpec) |
int |
read(byte[] buffer,
int offset,
int readLength) |
@Nullable protected com.google.android.exoplayer2.upstream.DataSource delegate
public void addTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener)
addTransferListener
in interface com.google.android.exoplayer2.upstream.DataSource
public long open(com.google.android.exoplayer2.upstream.DataSpec dataSpec) throws java.io.IOException
open
in interface com.google.android.exoplayer2.upstream.DataSource
java.io.IOException
public int read(byte[] buffer, int offset, int readLength) throws java.io.IOException
read
in interface com.google.android.exoplayer2.upstream.DataSource
java.io.IOException
public android.net.Uri getUri()
getUri
in interface com.google.android.exoplayer2.upstream.DataSource
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getResponseHeaders()
getResponseHeaders
in interface com.google.android.exoplayer2.upstream.DataSource
public void close() throws java.io.IOException
close
in interface com.google.android.exoplayer2.upstream.DataSource
java.io.IOException