<Video> controls can be used to integrate videos into a Web App.
Instructions for use
A <Video> control is created with the <Video> element.
<Video>
...
</Video>
<Video> controls can be used in all available layout types. For more information, see Layouts.
Attribute
Note:
There are a number of default attributes that can be set for all controls. For more information about the default attributes, see Default attributes.
In addition to the default attributes, you can define the following attributes for <Video> controls.
|
Attribute |
Description |
|---|---|
|
|
Defines the X portion or Y portion of the aspect ratio. Both If By default, YouTube videos have an aspect ratio of 16:9. For videos from the file system, the aspect ratio of the file is taken over. |
|
|
Defines the autoplay behavior of the video. Note: Some browser/settings prevent autoplay. Possible values:
|
|
|
Required Defines the type of video that will be included. Possible values:
Note:
|
|
|
Required Video that is embedded. Possible values:
|
Examples
Example 1: Embedded YouTube video
<DetailComponent displayName="YouTube" path="YouTube" default="true">
<FlowLayout>
<Video type="YouTube" value="feY13KgCMow" />
</FlowLayout>
</DetailComponent>
Example 2: Embedded static resource
<DetailComponent displayName="Resource File" path="File">
<FlowLayout>
<Video type="File" value="video.mp4" />
</FlowLayout>
</DetailComponent>
Example 3: Embedded video from the file system with data binding
<DetailComponent displayName="Resource Binding" path="Binding">
<Properties>
<Property name="VideoPath" type="String" />
</Properties>
<FlowLayout>
<ComboBox value="#VideoPath">
<Option displayName="Video 1" value="video1.mp4" />
<Option displayName="Video 2" value="video2.mp4" />
</ComboBox>
<Video value="#VideoPath" type="File" autoplay="true" aspectRatioX="16" aspectRatioY="9" />
</FlowLayout>
</DetailComponent>
Example 4: Video from an external URL
<DetailComponent displayName="External Video" path="External" process="ExternalVideo.wrf">
<Properties>
<Property name="ExternalVideo" type="Video" />
</Properties>
<FlowLayout>
<Video value="#ExternalVideo" type="File" aspectRatioX="4" aspectRatioY="3" />
</FlowLayout>
</DetailComponent>
Note:
For the data element provided by the Technical Process, the attribute type="external" must be set to use an external URL. Otherwise, an internal URL is expected and an error occurs.
<Ok>
<ExternalVideo type="external">
<!-- Video URL -->
</ExternalVideo>
</Ok>
Data binding for value
The value attribute of the <Video> element can be filled using data binding. For this, the property must have the type String, Base64 or Video.
If a YouTube video (type="YouTube") is embedded, then a valid YouTube video ID must always be provided via data binding.
If video files are embedded (type="File"), the following content is supported:
-
Property type String: The property must contain a file path to a video file. The graphic file must be located in the
Resourcesfolder of the Web App Project. -
Property type Base64: The property must contain a Base64-encoded video file. The media type of the video must be defined in the data element returned by the Technical Process as XML.
XML<MyVideo mediaType="video/mp4"> <!-- Base64 --> </MyVideo> -
Property type Video: The property can contain either a file path to a video file, a Base64-encoded video file, or an external URL. What is provided is defined by the
typeattribute in the data element of the responding Technical Process. Fortype,the valuesresource(default),base64, orexternalcan be specified.
Note:
-
Safari does not support videos that are embedded by file systems. Use external URLs that support buffering instead.
-
File system videos and Base64-encoded videos do not support buffering, but load them at once. Therefore, only use video from file systems and Base64-encoded videos for small videos. For larger videos, use external URLs that support buffering.