Package buzz.getcoco.media
Class NodeDataSource
- java.lang.Object
-
- com.google.android.exoplayer2.upstream.BaseDataSource
-
- buzz.getcoco.media.NodeDataSource
-
- All Implemented Interfaces:
com.google.android.exoplayer2.upstream.DataReader
,com.google.android.exoplayer2.upstream.DataSource
public class NodeDataSource extends com.google.android.exoplayer2.upstream.BaseDataSource
A datasource which is used for setting up thePlayer
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NodeDataSource.Factory
The factory class of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
android.net.Uri
getUri()
boolean
isAudioStreamUnset()
boolean
isVideoStreamUnset()
long
open(com.google.android.exoplayer2.upstream.DataSpec dataSpec)
int
read(byte[] target, int offset, int length)
void
setAudioStream(buzz.getcoco.media.RxStream audioStream)
set theStream
which will be used to render audio.void
setVideoStream(buzz.getcoco.media.RxStream videoStream)
set theStream
which will be used to render video.void
unsetStream(buzz.getcoco.media.RxStream stream)
unset the stream.-
Methods inherited from class com.google.android.exoplayer2.upstream.BaseDataSource
addTransferListener, bytesTransferred, transferEnded, transferInitializing, transferStarted
-
-
-
-
Method Detail
-
unsetStream
public void unsetStream(@NonNull buzz.getcoco.media.RxStream stream)
unset the stream. Call when the stream is destroyed.- Parameters:
stream
- The stream to unset
-
setVideoStream
public void setVideoStream(@Nullable buzz.getcoco.media.RxStream videoStream)
set theStream
which will be used to render video.- Parameters:
videoStream
- The stream to use
-
setAudioStream
public void setAudioStream(@Nullable buzz.getcoco.media.RxStream audioStream)
set theStream
which will be used to render audio.- Parameters:
audioStream
- The stream to use
-
isVideoStreamUnset
public boolean isVideoStreamUnset()
-
isAudioStreamUnset
public boolean isAudioStreamUnset()
-
open
public long open(@NonNull com.google.android.exoplayer2.upstream.DataSpec dataSpec)
-
getUri
@NonNull public android.net.Uri getUri()
-
close
public void close()
-
read
public int read(@NonNull byte[] target, int offset, int length)
-
-