public class FullScreenVideoUtil
extends java.lang.Object
implements android.media.MediaPlayer.OnCompletionListener, android.media.MediaPlayer.OnPreparedListener
Form
class to
display videos in fullscreen.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ACTION_DATA |
static java.lang.String |
ACTION_SUCESS |
static int |
FULLSCREEN_VIDEO_ACTION_DURATION |
static int |
FULLSCREEN_VIDEO_ACTION_FULLSCREEN |
static int |
FULLSCREEN_VIDEO_ACTION_PAUSE |
static int |
FULLSCREEN_VIDEO_ACTION_PLAY |
static int |
FULLSCREEN_VIDEO_ACTION_SEEK |
static int |
FULLSCREEN_VIDEO_ACTION_SOURCE |
static int |
FULLSCREEN_VIDEO_ACTION_STOP |
static int |
FULLSCREEN_VIDEO_DIALOG_FLAG |
static java.lang.String |
VIDEOPLAYER_FULLSCREEN |
static java.lang.String |
VIDEOPLAYER_PLAYING |
static java.lang.String |
VIDEOPLAYER_POSITION |
static java.lang.String |
VIDEOPLAYER_SOURCE |
Constructor and Description |
---|
FullScreenVideoUtil(Form form,
android.os.Handler handler) |
Modifier and Type | Method and Description |
---|---|
android.app.Dialog |
createFullScreenVideoDialog()
Creates the dialog for displaying a fullscreen VideoView.
|
boolean |
dialogInitialized() |
void |
onCompletion(android.media.MediaPlayer arg0)
Called when the video has finished playing.
|
void |
onPrepared(android.media.MediaPlayer arg0)
Called when the video has been loaded.
|
android.os.Bundle |
performAction(int action,
VideoPlayer source,
java.lang.Object data)
Perform some action and get a result.
|
void |
prepareFullScreenVideoDialog(android.app.Dialog dia)
Call just before displaying a fullscreen video Dialog.
|
boolean |
setSource(java.lang.String source,
boolean clearSeek)
Sets the source to be used by the fullscreen video Dialog.
|
boolean |
showing() |
void |
startDialog()
Called when the Dialog is about to be shown.
|
public static final int FULLSCREEN_VIDEO_DIALOG_FLAG
public static final int FULLSCREEN_VIDEO_ACTION_SEEK
public static final int FULLSCREEN_VIDEO_ACTION_PLAY
public static final int FULLSCREEN_VIDEO_ACTION_PAUSE
public static final int FULLSCREEN_VIDEO_ACTION_STOP
public static final int FULLSCREEN_VIDEO_ACTION_SOURCE
public static final int FULLSCREEN_VIDEO_ACTION_FULLSCREEN
public static final int FULLSCREEN_VIDEO_ACTION_DURATION
public static final java.lang.String VIDEOPLAYER_FULLSCREEN
public static final java.lang.String VIDEOPLAYER_PLAYING
public static final java.lang.String VIDEOPLAYER_POSITION
public static final java.lang.String VIDEOPLAYER_SOURCE
public static final java.lang.String ACTION_SUCESS
public static final java.lang.String ACTION_DATA
public android.os.Bundle performAction(int action, VideoPlayer source, java.lang.Object data)
action
- Can be any of the following:
source
- The VideoPlayer to use in some actions.data
- Used by the method. This object varies depending on the action.public android.app.Dialog createFullScreenVideoDialog()
public void prepareFullScreenVideoDialog(android.app.Dialog dia)
dia
- The dialog that will display the video.public boolean dialogInitialized()
public boolean showing()
dialogInitialized()
is true and
the Dialog is showing. False otherwise.public boolean setSource(java.lang.String source, boolean clearSeek)
source
- The source path to use. The MediaUtil
is used to load the
source.clearSeek
- If True, the video will start playing at position zero. If False,
the video will start playing from the
VIDEOPLAYER_POSITION
value of the Bundle passed in the
performAction(int, VideoPlayer, Object)
or createFullScreenVideoDialog()
public void onCompletion(android.media.MediaPlayer arg0)
onCompletion
in interface android.media.MediaPlayer.OnCompletionListener
public void onPrepared(android.media.MediaPlayer arg0)
onPrepared
in interface android.media.MediaPlayer.OnPreparedListener
public void startDialog()