Controls: VIDEO

What you will learn in this chapter
VIDEO control Attributes, Supported Formats
Reference Tutorial:
Good Read: AUDIO control

VIDEO control can play video files from various sources

  • Remote Server (via streaming)
  • res/raw folder (on the local device - Android only)
  • Assets folder (on the local device - Android only)
  • Absolute path (on the local device)

The player will stop automatically

  • If a phone call is received
  • If the user taps on the screen playing the video
  • If the attribute auto_pause=”true” and another screen pops up above the screen playing video.

Note

Android Only - Add following permission in AndroidManifest.xml file

<uses-permission android:name="android.permission.READ_PHONE_STATE" />

Attributes

Attribute Description Mandatory
name Name identifies this control. If another control wants to include a control as an attribute, then name is used. No
type video Yes
x

Specifies x position (distance from the left edge of the parent control). Parent control could be screen as well. It can be expressed in percentage, or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
y

Specifies y position (distance from the top edge of the parent control). Parent control could be screen as well. It can be expressed in percentage, or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
width

Specifies the width of the control in percentage or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
height

Specifies the height of the control in percentage or pixels (px) or device pixels (dp).

By default width in percentage is relative to its parent control. It can be made relative to screen using attribute dimensions_relative_to=”SCREEN” in screen_deck . Learn more about dimensions

Yes
appearance_name Gives the appearance name for the control as defined in appearance.xml. Yes
default_value video file (local or remote) No
data_type Defines the type of data applicable for this control. URL STRING
auto_start Indicates if the video player should start automatically playing the media upon creation if default_value is set. Default is “true” No
auto_resume Indicates if the video player should resume automatically when the parent screen resumes. Default is “true”. No
auto_pause Indicates if the video player should pause automatically when the parent screen pauses No

Supported Formats

Please refer to the list of

Examples

  1. Example: Remote Source
<control
    name="video" type="VIDEOVIEW" appearance_name="1"
    x="0" y="0" width="100" height="100"
    default_value="http://www.tools4movies.com/dvd_catalyst_profile_samples/Harold%20Kumar%203%20Christmas%20bionic%20hq.mp4">
</control>
Android iOS
../_images/video.png
  1. Example: Raw Folder (Android only)
<control
    name="video" type="VIDEOVIEW" appearance_name="1"
    x="0" y="0" width="100" height="100"
    default_value="raw:harold.mp4">
</control>
  1. Example: Assets Folder (Android only)
<control
    name="video" type="VIDEOVIEW" appearance_name="1"
    x="0" y="0" width="100" height="100"
    default_value="harold.mp4">
</control>
  1. Example: Absolute Path
<control
    name="video" type="VIDEOVIEW" appearance_name="1"
    x="0" y="0" width="100" height="100"
    default_value="/mnt/sdcard/harold.mp4">
</control>