public final class VideoPlayer extends AndroidViewComponent implements OnDestroyListener, Deleteable, android.media.MediaPlayer.OnCompletionListener, android.media.MediaPlayer.OnErrorListener, android.media.MediaPlayer.OnPreparedListener
VideoView.containerACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF| Constructor and Description |
|---|
VideoPlayer(ComponentContainer container)
Creates a new VideoPlayer component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
Completed()
Indicates that the video has reached the end
|
void |
delayedStart()
Method for starting the VideoPlayer once the media has been loaded.
|
boolean |
FullScreen()
Returns whether the VideoPlayer's video is currently being
shown in fullscreen mode or not.
|
void |
FullScreen(boolean value)
Sets whether the video should be shown in fullscreen or not.
|
void |
fullScreenKilled(android.os.Bundle data)
Notify this VideoPlayer that its video is no longer being shown
in fullscreen.
|
int |
GetDuration() |
int |
getPassedHeight()
Get the value passed in
Height(int) |
int |
getPassedWidth()
Get the value passed in
Width(int) |
android.view.View |
getView()
Returns the
View that is displayed in the UI. |
int |
Height()
Returns the component's vertical height, measured in pixels.
|
void |
Height(int height)
Specifies the component's vertical height, measured in pixels.
|
void |
onCompletion(android.media.MediaPlayer m) |
void |
onDelete() |
void |
onDestroy() |
boolean |
onError(android.media.MediaPlayer m,
int what,
int extra) |
void |
onPrepared(android.media.MediaPlayer newMediaPlayer) |
void |
Pause() |
void |
SeekTo(int ms) |
void |
Source(java.lang.String path)
Sets the video source.
|
void |
Start()
Plays the media specified by the source.
|
void |
VideoPlayerError(java.lang.String message) |
void |
Volume(int vol)
Sets the volume property to a number between 0 and 100.
|
int |
Width()
Returns the component's horizontal width, measured in pixels.
|
void |
Width(int width)
Specifies the component's horizontal width, measured in pixels.
|
Column, Column, CopyHeight, CopyWidth, getDispatchDelegate, Row, Row, Visible, Visiblepublic VideoPlayer(ComponentContainer container)
container - public android.view.View getView()
AndroidViewComponentView that is displayed in the UI.getView in class AndroidViewComponentpublic void Source(java.lang.String path)
MediaUtil.determineMediaSource(com.google.appinventor.components.runtime.Form, java.lang.String) for information about what a
path can be.path - the path to the video sourcepublic void Start()
public void Volume(int vol)
vol - the desired volume levelpublic void delayedStart()
public void Pause()
public void SeekTo(int ms)
public int GetDuration()
public void onCompletion(android.media.MediaPlayer m)
onCompletion in interface android.media.MediaPlayer.OnCompletionListenerpublic void Completed()
public boolean onError(android.media.MediaPlayer m,
int what,
int extra)
onError in interface android.media.MediaPlayer.OnErrorListenerpublic void onPrepared(android.media.MediaPlayer newMediaPlayer)
onPrepared in interface android.media.MediaPlayer.OnPreparedListenerpublic void VideoPlayerError(java.lang.String message)
public void onDestroy()
onDestroy in interface OnDestroyListenerpublic void onDelete()
onDelete in interface Deleteablepublic int Width()
Width in class AndroidViewComponentpublic void Width(int width)
Width in class AndroidViewComponentwidth - in pixelspublic int Height()
Height in class AndroidViewComponentpublic void Height(int height)
Height in class AndroidViewComponentheight - in pixelspublic boolean FullScreen()
public void FullScreen(boolean value)
value - If True, the video will be shown in fullscreen.
If False and FullScreen() returns True, fullscreen
mode will be exited. If False and FullScreen()
returns False, nothing occurs.public void fullScreenKilled(android.os.Bundle data)
data - See FullScreenVideoUtil
for an example of what data should contain.public int getPassedWidth()
Width(int)public int getPassedHeight()
Height(int)