public class VideoPlayerContainer extends FrameLayout implements AMPFeedLoader.AMPFeedLoaderListener, IPlayerEventsListener
Modifier and Type | Class and Description |
---|---|
static interface |
VideoPlayerContainer.VideoPlayerContainerCallback |
Modifier and Type | Field and Description |
---|---|
static int |
DELIVERY_MODE_HTTP
Normal HTTP delivery mode
|
static int |
DELIVERY_MODE_OCTOSHAPE
Octoshape delivery mode
|
static int |
MODE_AUTOMATIC
Automatic mode:
- For Android 4.1 and above: Exo mode
- For Android 4.0: Hardware Advanced
- For Android 3.x and below:
If device CPU is multicore: Software mode
If device CPU is singlecore: Hardware mode
|
static int |
MODE_EXO
Decoding mode for MPEG-Dash & Smooth Streaming
|
static int |
MODE_HARDWARE
Hardware decoding mode.
|
static int |
MODE_HARDWARE_ADVANCED
Hardware Advanced decoding mode.
|
static int |
MODE_NATIVE_BASIC
Native basic decoding mode.
|
static int |
MODE_NONE
Internal only
|
static int |
MODE_SOFTWARE
Software decoding mode.
|
PLAYER_EVENT_APP_SENT_TO_BACKGROUND, PLAYER_EVENT_APP_SENT_TO_FOREGROUND, PLAYER_EVENT_TYPE_END_REBUFFERING, PLAYER_EVENT_TYPE_ERROR, PLAYER_EVENT_TYPE_FINISHED, PLAYER_EVENT_TYPE_FULLSCREEN_MODE_CHANGE, PLAYER_EVENT_TYPE_LOAD_REQUESTED, PLAYER_EVENT_TYPE_LOADING, PLAYER_EVENT_TYPE_PAUSE_REQUESTED, PLAYER_EVENT_TYPE_POSITION_UPDATE, PLAYER_EVENT_TYPE_RESUME_REQUESTED, PLAYER_EVENT_TYPE_SIZE_CHANGE, PLAYER_EVENT_TYPE_START_PLAYING, PLAYER_EVENT_TYPE_START_REBUFFERING, PLAYER_EVENT_TYPE_SWITCH, PLAYER_EVENT_TYPE_SWITCH_REQUESTED, PLAYER_EXTENDED_EVENT_BANDWIDTH_MEASURE, PLAYER_EXTENDED_EVENT_SEEKING_STARTED, PLAYER_EXTENDED_EVENT_SEEKING_SUCCEDEED
Constructor and Description |
---|
VideoPlayerContainer(Context context)
Constructor of the class
|
VideoPlayerContainer(Context context,
AttributeSet attrs)
Constructor of the class
|
Modifier and Type | Method and Description |
---|---|
void |
addVideoPlayerContainerCallback(VideoPlayerContainer.VideoPlayerContainerCallback obj) |
boolean |
canPause() |
boolean |
canSeekBackward() |
boolean |
canSeekForward() |
void |
feedLoaded(MediaResource resource) |
VideoPlayerView |
getAudioPlayer()
Gets a reference to the VideoPlayerView object used for playing an audio-only stream
|
int |
getAudioSessionId() |
int |
getBufferPercentage() |
int |
getCurrentPosition() |
int |
getDuration() |
int |
getMode()
Returns the current decoding mode.
|
VideoPlayerView |
getVideoPlayer()
Gets a reference to the VideoPlayerView object used for playing the video
|
VideoPlayerController |
getVideoPlayerController() |
boolean |
isPlaying() |
void |
loadPoster(java.lang.String url) |
void |
onFinishInflate() |
boolean |
onPlayerEvent(int iInEventType)
Called to indicate a player event
|
boolean |
onPlayerExtendedEvent(int iInEventType,
int arg1,
int arg2)
Called to indicate a player extended event
|
void |
pause() |
void |
prepareAMPFeed(java.lang.String sInUrl)
Deprecated.
|
void |
prepareAMPFeedFRomJson(java.lang.String rawFeed)
Deprecated.
|
void |
prepareResource(java.lang.String url) |
void |
prepareResource(java.lang.String url,
java.lang.String MIMEType) |
void |
removePoster() |
void |
removeVideoPlayerContainerCallback(VideoPlayerContainer.VideoPlayerContainerCallback obj) |
void |
seekTo(int pos) |
void |
setConfig(AMPConfig ampConfig) |
void |
setConfig(java.lang.String configURL) |
void |
setDefaultMode(int mode)
Sets the default decoding method.
|
void |
setFeedData(java.lang.String rawFeed)
Play a stream given a JSON feed string.
|
void |
setFeedDataFromConfig() |
void |
setFeedURL(java.lang.String feedURL)
Play a stream given a feed url.
|
void |
setFeedURLFromConfig() |
void |
setMedia(Media media)
Play a stream given a media object directly.
|
void |
setMediaFromConfig() |
void |
setOctoSystemBuilder(OctoSystemBuilder osbParam) |
void |
setupPlayback(java.lang.String MIMEType) |
void |
start() |
public static final int MODE_NONE
public static final int MODE_SOFTWARE
public static final int MODE_HARDWARE
public static final int MODE_HARDWARE_ADVANCED
public static final int MODE_NATIVE_BASIC
public static final int MODE_EXO
public static final int MODE_AUTOMATIC
public static final int DELIVERY_MODE_HTTP
public static final int DELIVERY_MODE_OCTOSHAPE
public VideoPlayerContainer(Context context)
context
- Context of the applicationpublic VideoPlayerContainer(Context context, AttributeSet attrs)
context
- Context of the applicationattrs
- Attributespublic void onFinishInflate()
public void setConfig(java.lang.String configURL)
public void setConfig(AMPConfig ampConfig)
public VideoPlayerView getVideoPlayer()
public VideoPlayerView getAudioPlayer()
public VideoPlayerController getVideoPlayerController()
public void setDefaultMode(int mode)
mode
- public int getMode()
public void setOctoSystemBuilder(OctoSystemBuilder osbParam)
public boolean onPlayerEvent(int iInEventType)
IPlayerEventsListener
onPlayerEvent
in interface IPlayerEventsListener
iInEventType
- Even typepublic boolean onPlayerExtendedEvent(int iInEventType, int arg1, int arg2)
IPlayerEventsListener
onPlayerExtendedEvent
in interface IPlayerEventsListener
iInEventType
- Event Typearg1
- Argumentarg2
- Argumentpublic void addVideoPlayerContainerCallback(VideoPlayerContainer.VideoPlayerContainerCallback obj)
public void removeVideoPlayerContainerCallback(VideoPlayerContainer.VideoPlayerContainerCallback obj)
@Deprecated public void prepareAMPFeed(java.lang.String sInUrl)
public void setFeedURL(java.lang.String feedURL)
feedURL
- URL of the feed to play@Deprecated public void prepareAMPFeedFRomJson(java.lang.String rawFeed)
public void setMediaFromConfig()
public void setFeedDataFromConfig()
public void setFeedURLFromConfig()
public void setFeedData(java.lang.String rawFeed)
rawFeed
- the entire Json object as an string of the feed to playpublic void setMedia(Media media)
media
- a Java object reference with all the info to play the videopublic void feedLoaded(MediaResource resource)
feedLoaded
in interface AMPFeedLoader.AMPFeedLoaderListener
public void prepareResource(java.lang.String url)
public void setupPlayback(java.lang.String MIMEType)
public void prepareResource(java.lang.String url, java.lang.String MIMEType)
public void start()
public void pause()
public int getDuration()
public int getCurrentPosition()
public void seekTo(int pos)
public boolean isPlaying()
public int getBufferPercentage()
public boolean canPause()
public boolean canSeekBackward()
public boolean canSeekForward()
public int getAudioSessionId()
public void loadPoster(java.lang.String url)
public void removePoster()