public class

VideoView

extends View
java.lang.Object
   ↳ com.neomades.ui.View
     ↳ com.neomades.ui.VideoView

Class Overview

Plays a video inside the application. The video can come from the internet, or from the file system.

Supported video formats

  • iOS (see iOS documentation (section Supported Formats))
    • Supported formats:
      • H.264 Baseline Profile Level 3.0 video, up to 640 x 480 at 30 fps. (The Baseline profile does not support B frames.)
      • MPEG-4 Simple Profile
    • Supported containers:
      • .mov
      • .mp4
      • .mpv
      • .3gp
  • Android (see Android documentation)
    • H.263, with containers:
      • 3GPP (.3gp)
      • MPEG-4 (.mp4)
    • H.264 Baseline Profile, with containers:
      • 3GPP (.3gp)
      • MPEG-4 (.mp4)
      • MPEG-TS (.ts, AAC audio only, not seekable, Android 3.0+)
    • MPEG-4 Simple Profile, with container:
      • 3GPP (.3gp)
    • VP8, with containers:
      • WebM (.webm)
      • Matroska (.mkv, Android 4.0+)

In NeoMAD, we recommend using formats supported by all platforms that is to say:

  • H.264 Baseline Profile, with 3GPP (.3gp) or MPEG-4 (.mp4) container
  • MPEG-4 Simple Profile, with 3GPP (.3gp) container

Cross Platform Considerations

VideoView is available only for Android and iOS.

Summary

[Expand]
Inherited XML Attributes
From class com.neomades.ui.View
[Expand]
Inherited Constants
From interface com.neomades.ui.Alignment
From interface com.neomades.ui.StretchMode
Public Constructors
VideoView()
Public Methods
boolean canPause()
Returns true if the player can pause the video.
boolean canSeekBackward()
Returns true if the player can go backward.
boolean canSeekForward()
Returns true if the player can go forward.
int getCurrentPosition()
Returns the current playback time of the video, in ms.
int getDuration()
Returns the duration of the video, in ms.
boolean isPlaying()
Returns true if the video is currently playing.
void pause()
Pauses the playback of the video.
void resume()
Resumes the playback of the video.
void setVideoFilePath(String path)
Sets the path of the video, assuming the video is stored in the file system.
void setVideoURLPath(String path)
Sets the path of the video, assuming the path is a valid URL.
void start()
Starts the playback of the video.
void stopPlayback()
Stops the playback of the video.
[Expand]
Inherited Methods
From class com.neomades.ui.View
From class java.lang.Object

Public Constructors

public VideoView ()

Public Methods

public boolean canPause ()

Returns true if the player can pause the video.

Returns
  • true if the player can pause the video

public boolean canSeekBackward ()

Returns true if the player can go backward.

Returns
  • true if the player can go backward

public boolean canSeekForward ()

Returns true if the player can go forward.

Returns
  • true if the player can go forward

public int getCurrentPosition ()

Returns the current playback time of the video, in ms.

Returns
  • the current playback time of the video, in ms

public int getDuration ()

Returns the duration of the video, in ms.

Returns
  • the duration of the video, in ms

public boolean isPlaying ()

Returns true if the video is currently playing.

Returns
  • true if the video is currently playing

public void pause ()

Pauses the playback of the video.

public void resume ()

Resumes the playback of the video.

public void setVideoFilePath (String path)

Sets the path of the video, assuming the video is stored in the file system. Use getAbsolutePath() to get a correct path

Parameters
path the path of the video stored in a file

public void setVideoURLPath (String path)

Sets the path of the video, assuming the path is a valid URL. An HTTP url can be specified here.

Parameters
path the URL path of the video

public void start ()

Starts the playback of the video.

public void stopPlayback ()

Stops the playback of the video.