Video

Definition

<cst-video>
<sub-theme/>
<sub-font/>
<sub-style/>
<sub-access/>
<sub-options />
<sub-help-icon/>
<sub-feature-flag/>
</cst-video>

OR

<cst-element name="video" schema="" schema-prop=""/>

Example

<cst-video id="" src="" autoplay="" controls="" loop="" muted="" poster="" preload="">
<sub-theme name="" clr-var1="" clr-var2=""/>
<sub-font name="" font-var1="" font-var2=""/>
<sub-style name="" width="" height=""/>
<sub-access can-view="" can-modify=""/>
<sub-options />
<sub-help-icon name="" position="" title="" link="">
<sub-feature-flag >
</cst-video>

Attributes

AttributeValueDescription
idstring typeIdentifier for component.
srcstring typeSpecifies the URL of the video file
autoplayboolean typeSpecifies that the video will start playing as soon as it is ready
controlsboolean typeSpecifies that video controls should be displayed (such as a play/pause button etc).
loopnumber typeSpecifies that the video will start over again, every time it is finished
mutedboolean typeSpecifies that the audio output of the video should be muted
posterstring typeSpecifies an image to be shown while the video is downloading, or until the user hits the play button
preloadstring type(auto/metadata/none)Specifies if and how the author thinks the video should be loaded when the page loads
disabledboolean typeSpecifies if component should be disabled.(aurelia ext attribute)
classcst-video
Specifies class to be applied(Multiple classes can be given with space).

sub-theme

object typeSpecifies theme to be used for component.

sub-font

object typeSpecifies fonts to be used for component.

sub-style

object typeSpecifies style to be applied to component.

sub-options

object typeSpecifies the options of the component.

sub-help-icon

object typeSpecifies help icon to be displayed.

sub-feature-flag

objectSpecifies what features to enable/disable.
otherany typeAny other info.
schemaobject type Specifies JSON schema.
schema-propstring typeSpecifies property to be used to pick schema.

Sub element attributes

sub-theme

PropertyValueDescription
nameprimary(default)/secondary/customName of the theme.
clr-labelstring typeIf custom then specific/ named color variables

sub-font

PropertyValueDescription
nameroboto (default)/customName of the font
font-textstring typeIf custom then specific/ named font variables.
font-labelstring type
font-errorstring type

sub-style

PropertyValueDescription
nameDesign nameName of design to be used.
widthpercentage/pixels/string(x-small,small,medium,large,x-large)Gives width/any other prop value

sub-help-icon

PropertyValueDescription
namestring typeIcon name.
positionleft/rightPosition of the icon.
titlestring typeIcon tooltip
linkstring typeLink to be opened on click.

sub-feature-flag

PropertyValueDescription

Schema Examples

Full schema

Fetch appropriate based on schemaProp

let schema = {
type: "object",
required: ["video"], //= required
properties: {
video: {
type: "string",
title:"Video",//= label
cstAttr: {
raw:{ //loop & add to element
autoplay: true,
controls: true,
loop: 3,
muted: true,
poster: '<poster-url>',
preload: 'auto',
src: '<video-path>',
disabled : true,
class:'outline cst-class1'
},
subStyle:{ //loop & add to element style
name: '', // Default star
width:'',
height:'',
fontSize:''
},
subHelpIcon: {
name: '',
position: '',
title:'',
link:''
},
subFeatureFlag: {
},
subTheme:{
name:'',
clrLabel:''
},
subFont:{
name:'',
fontText:'',
fontLabel:'',
fontError:''
},
itemsSource: '', //to check in page object
itemsSourceAPI: '',
}
}
}
}
let schemaProp = 'video';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Exact schema

let schema = {
type: "string",
title: "Video", //= label
cstAttr: {
}
}
let schemaProp = '';
let finalSchema = schemaProp ? schema.properties[schemaProp] : schema;

Nested object

Nested object schemaProp

let schema = {};
let schemaProp = 'EMDDetails.video';
var finalSchema = schema;
let schemaPropSplits = schemaProp.split('.');
for(let prop of schemaPropSplits){
finalSchema = finalSchema.properties[schemaProp];
}

Material Measurement Guidelines

Events

AttributeDescription
onplayclickFires when the play button click.
onpauseclickFires when the pause button click.
onnextclickFires when the next button click.
onpreviousclickFires when the previous button click.
onreverseclickFires when the reverse button click.
onforwardclickFires when the forward button click.
onprogressclickFires when click on progress bar.
onprogresshoverFires when hover on progress bar.
onprogresshoverleaveFires when hover leave on progress bar.
onhoverFires when the element's value hover.
onhoverleaveFires when the element's value hover leave.
oninvalidScript to be run when an element is invalid.

Event Method signature

method(parentRefObj, evtObj, elm, others)

Parameters description

ParameterValueDescription
parentRefObj
parentRefObj = {
parentContext,
loopParentContext,
doubleLoopParentContext
}
Parent Context references
evtObjobjectEvent object
elmobjectElement value
othersanyOther value

OverRidable Classes

  • cst-ovr-video
  • cst-ovr-video-txt

Unit Test Screenshots

Responsiveness Test Screenshots

Design Images

Demo link

Features

  • Display video in video section
  • Play, pause, next, previous, reverse, forward button click functionality is there