Package com.brightcove.player.offline
Class MultiDataSource
java.lang.Object
com.brightcove.player.offline.MultiDataSource
- All Implemented Interfaces:
com.google.android.exoplayer2.upstream.DataReader,com.google.android.exoplayer2.upstream.DataSource
public class MultiDataSource
extends 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:
- file: For fetching data from a local file (e.g. file:///path/to/media/media.mp4, or just /path/to/media/media.mp4 because the implementation assumes that a URI without a scheme is a local file URI).
- asset: For fetching data from an asset in the application's apk (e.g. asset:///media.mp4).
- content: For fetching data from a content URI (e.g. content://authority/path/123).
- rtmp: For fetching data over RTMP. Only supported if the project using ExoPlayer has an explicit dependency on ExoPlayer's RTMP extension.
- http(s): For fetching data over HTTP and HTTPS (e.g. https://www.something.com/media.mp4).
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classImplements a factory to supportMultiDataSourcestatic interfaceInterface definition for handlingDataSpecwith an expired manifest URL. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.google.android.exoplayer2.upstream.DataSource -
Method Summary
Modifier and TypeMethodDescriptionvoidaddTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener) voidclose()android.net.UrigetUri()longopen(com.google.android.exoplayer2.upstream.DataSpec dataSpec) intread(byte[] buffer, int offset, int readLength)
-
Field Details
-
delegate
@Nullable protected com.google.android.exoplayer2.upstream.DataSource delegate
-
-
Method Details
-
addTransferListener
public void addTransferListener(com.google.android.exoplayer2.upstream.TransferListener transferListener) - Specified by:
addTransferListenerin interfacecom.google.android.exoplayer2.upstream.DataSource
-
open
- Specified by:
openin interfacecom.google.android.exoplayer2.upstream.DataSource- Throws:
IOException
-
read
- Specified by:
readin interfacecom.google.android.exoplayer2.upstream.DataReader- Throws:
IOException
-
getUri
public android.net.Uri getUri()- Specified by:
getUriin interfacecom.google.android.exoplayer2.upstream.DataSource
-
getResponseHeaders
- Specified by:
getResponseHeadersin interfacecom.google.android.exoplayer2.upstream.DataSource
-
close
- Specified by:
closein interfacecom.google.android.exoplayer2.upstream.DataSource- Throws:
IOException
-