VideoPlayer
Definition
A multimedia component capable of playing videos. When the application is run, the VideoPlayer
will be displayed as a rectangle on-screen. If the user touches the rectangle, controls will appear to play/pause, skip ahead, and skip backward within the video. The application can also control behavior by calling the Start
, Pause
, and SeekTo
methods.
Video files should be in 3GPP (.3gp) or MPEG-4 (.mp4) formats. For more details about legal formats, see Android Supported Media Formats.
App Inventor only permits video files under 1 MB and limits the total size of an application to 5 MB, not all of which is available for media (video, audio, and sound) files. If your media files are too large, you may get errors when packaging or installing your application, in which case you should reduce the number of media files or their sizes. Most video editing software, such as Windows Movie Maker and Apple iMovie, can help you decrease the size of videos by shortening them or re-encoding the video into a more compact format.
You can also set the media source to a URL that points to a streaming video, but the URL must point to the video file itself, not to a program that plays the video.
Properties
- FullScreen
- Sets whether the video should be shown in fullscreen or not.
- Height
- Specifies the component’s vertical height, measured in pixels.
- HeightPercent
- Specifies the
VideoPlayer
’s vertical height as a percentage of theScreen
’sHeight
. - Source
- Sets the “path” to the video. Usually, this will be the name of the video file, which should be added in the Designer.
- Visible
- Specifies whether the
VideoPlayer
should be visible on the screen. Value istrue
if theVideoPlayer
is showing andfalse
if hidden. - Volume
- Sets the volume property to a number between 0 and 100. Values less than 0 will be treated as 0, and values greater than 100 will be treated as 100.
- Width
- Specifies the component’s horizontal width, measured in pixels.
- WidthPercent
- Specifies the horizontal width of the
VideoPlayer
as a percentage of theScreen
’sWidth
.