Documentation
Video
Description
The Video module allows you to upload and embed video files in your content. It supports 3 video formats:
- OGV
- MP4
- WebM
Chrome, Firefox, Edge, and Safari nowadays support MP4, so this format should suffice, but if you are using your own solution, please remember to make sure that it fully supports your selected video format.
If you do not have video conversion software installed, you can convert the files online using e.g. http://video.online-convert.com/.
The module allows providing custom-styled captions for the movie. Using CSS, you can move the captions and change their color and background.
The Video module can be configured with more than one video file. Its API lets you change the movies dynamically with standard buttons. See the commands section for more details.
Properties
The list starts with the common properties. Learn more about them by visiting the Modules description section. The other available properties are described below.
Property name | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Files | A collection of movie files displayed by the module.
This property allows online resources. Find out more ยป |
||||||||||||||||||||||||
Show video (deprecated) | This property is only for the preview in the editor! It allows viewing the specified video (counted from 1 to n, where n is the number of uploaded videos). It works only with the filled 'Show time' property. | ||||||||||||||||||||||||
Show time (deprecated) | This property is only for the preview in the editor! It allows viewing the specified time ('MM:SS'). It works only with the filled 'Show video' property. | ||||||||||||||||||||||||
Narration | Narration for the recorded audio. | ||||||||||||||||||||||||
Hide default controls | If this property is checked, the video controller bar will be hidden. | ||||||||||||||||||||||||
Hide subtitles | If this option is marked, subtitles will be hidden at the start. | ||||||||||||||||||||||||
Show play button | If this property is checked, the play button will be available. | ||||||||||||||||||||||||
Speech Texts | Sets the values of speech texts - predefined phrases providing additional context while using the module in the Text To Speech mode. Speech texts are always read using the content's default language. | ||||||||||||||||||||||||
Offline message | This message will be displayed if the module was configured to display an online video resource, but there is no internet access. | ||||||||||||||||||||||||
Enable video speed controller | If this option is selected, the video speed controller will be available in the video controller bar. | ||||||||||||||||||||||||
Base width | 'Base width' and 'Base height' properties are used for positioning subtitles. Suppose the current dimensions of the module differ from those provided in the 'Base width'/ 'Base height' property (because the module has a different size depending on the selected layout). In that case, the position of the subtitles will be scaled appropriately. If the properties are left empty, the position of the subtitles will be the same regardless of the size of the module. | ||||||||||||||||||||||||
Base height | This property is used for positioning subtitles. See the 'Base width' property described above for more details. |
Supported commands
Command name | Params | Description |
---|---|---|
hide | --- | Hides the module if it is visible. |
show | --- | Shows the module if it is hidden. |
next | --- | Jumps to the next movie. If the last movie is currently displayed, this command will have no effect. |
previous | --- | Jumps to the previous movie. If the first movie is currently displayed, this command will have no effect. |
jumpTo | movieNumber | Jumps to the specified movie number. The movie number should be from 1 to n, where n is the number of configured movie files. Providing a movie number out of this range will have no effect. |
jumpToID | movieID | Jumps to specified movie ID (given in the module's 'Files' property). Providing an undefined movie ID will have no effect. |
seek | seconds | Changes the playback time to the provided seconds in the currently played video. |
play | --- | Plays the video. |
stop | --- | Stops the video. |
pause | --- | Pauses the video. |
showSubtitles | --- | Shows the subtitles. |
hideSubtitles | --- | Hides the subtitles. |
showAudioDescription | --- | Shows the audio description. |
hideAudioDescription | --- | Hides the audio description. |
setVideoURL | videoParams, movieNumber | Sets new parameters for the video under the specified movie ID. videoParams should be a dict object containing one or more of the following keys: oggFormat, mp4Format, webMFormat, poster, subtitles, id, altText, and loop. Movie configuration will be updated with the values corresponding to the provided keys. If the provided value is null, undefined, or an empty string, that parameter will be reset to its original value. |
Advanced Connector integration
Each command supported by the Video module can be used in the Advanced Connector module's scripts. The example below shows how to react to the Text module's gap content changes (i.e., putting in it elements from the Source List module) and change the displayed video accordingly.
EVENTSTART
Source:Text2
Value:1
SCRIPTSTART
var video = presenter.playerController.getModule('video1');
video.jumpTo(1);
SCRIPTEND
EVENTEND
EVENTSTART
Source:Text2
Value:2
SCRIPTSTART
var video = presenter.playerController.getModule('video1');
video.jumpTo(2);
SCRIPTEND
EVENTEND
EVENTSTART
Source:Text2
Value:3
SCRIPTSTART
var video = presenter.playerController.getModule('video1');
video.jumpTo(3);
SCRIPTEND
EVENTEND
Events
The Video module sends the ValueChanged type of events to the Event Bus when the playback is finished.
Field name | Description |
---|---|
Item | Current movie index. |
Value | The 'ended' string. |
Score | N/A |
The playing event occurs when the video is playing.
Field name | Description |
---|---|
Item | N/A |
Value | playing |
Score | N/A |
The time update event is sent every second while the video is playing.
Field name | Description |
---|---|
Item | Current movie index. |
Value | Current time in the MM:SS format. |
Score | N/A |
CSS classes
Class name | Description |
---|---|
video-container | DIV surrounding the video element. The video element is a direct child of this element. |
captions | DIV containing the captions. By default, it has an absolute positioning in reference to the video container and is played in the top left corner. |
playing | This class is added when a video is being played. |
captions-container | Div surrounding the captions. The size of this div will be changed by the module and should not be styled. |
CSS control bar classes
Class name | Description |
---|---|
CustomControlsBar-wrapper | DIV surrounding the controls bar elements. |
CustomControlsBar-wrapper-controls-controlsWrapper | DIV containing all buttons in the lower panel. |
CustomControlsBar-wrapper-controls-play | Play button that is visible when the video is paused. CSS display value should not be changed. |
CustomControlsBar-wrapper-controls-pause | Pause button, which is visible when the video is playing. CSS display value should not be changed. |
CustomControlsBar-wrapper -controls-stop |
Stop button |
CustomControlsBar-wrapper -controls-volume |
Volume button |
CustomControlsBar-wrapper -controls-volumeBarWrapper |
DIV container for the volume bar elements. |
CustomControlsBar -controls-volumeBarWrapper-volumeBackground |
DIV which is background for the volume bar. It is visible if the volume button is clicked. CSS display value should not be changed. |
CustomControlsBar-wrapper-controls -volumeBarWrapper-volumeBackgroundSelected |
DIV which shows the volume level. It is visible if the volume button is clicked. CSS display value should not be changed. |
CustomControlsBar-wrapper -controls-fullscreen |
Fullscreen button. It is visible when the module is not in full-screen mode. CSS display value should not be changed. |
CustomControlsBar-wrapper -controls-closeFullscreen |
Close the fullscreen button. It is visible if the module is in full-screen mode. CSS display value should not be changed. |
CustomControlsBar-wrapper -controls-timer |
DIV which contains the duration time of the video. The module changes the value. |
CustomControlsBar-wrapper -controls-progressBarWrapper |
DIV containing the progress bar elements. |
CustomControlsBar-wrapper -controls-progressBarWrapper-grayProgressBar |
Background for the progress bar. |
CustomControlsBar-wrapper -controls-progressBarWrapper-redProgressBar |
Actual video progress. |
video-poster-play | Play "watermark" button class. |
video-poster-pause | Additional "watermark" button class when the video is paused. |
Default styles
.video-container .CustomControlsBar-wrapper {
bottom: 0px;
left: 0px;
background-color: #EBEFF0;
height: 40px;
width: 100%;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-controlsWrapper {
margin-top: 3px;
position: absolute;
height: 37px;
width: 100%;
}
.video-container-video {
display: block;
pointer-events: none;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-play {
height: 100%;
width: 38px;
background: url("resources/video-play-btn.png") no-repeat center;
box-sizing: border-box;
cursor: pointer;
float: left;
}
.video-container .CustomControlsBar-wrapper-controls-pause {
height: 100%;
width: 38px;
background: url("resources/video-pause-btn.png") no-repeat center;
box-sizing: border-box;
cursor: pointer;
float: left;
}
.video-container .CustomControlsBar-wrapper-controls-stop {
height: 100%;
width: 40px;
background: url("resources/video-stop-btn.png") no-repeat center center;
cursor: pointer;
float: left;
}
.video-container .CustomControlsBar-wrapper-controls-progressBarWrapper {
position: absolute;
width: 100%;
height: 3px;
float: left;
}
.video-container .CustomControlsBar-wrapper-controls-progressBarWrapper:hover {
height: 6px;
}
.video-container .CustomControlsBar-wrapper-controls-progressBarWrapper-redProgressBar {
background-color: red;
height: 100%;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-progressBarWrapper-grayProgressBar {
background-color: dimgrey;
width: 100%;
height: 100%;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-volume {
height: 100%;
width: 40px;
background: url("resources/video-volume-btn.png") no-repeat center center;
cursor: pointer;
float: left;
}
.video-container .CustomControlsBar-wrapper-controls-volumeBarWrapper {
height: 100%;
float: left;
cursor: pointer;
}
.video-container .CustomControlsBar-wrapper-controls-volumeBarWrapper-volumeBackground {
width: 100px;
height: 14px;
border-bottom: solid 9px white;
float: left;
cursor: pointer;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-volumeBarWrapper-volumeBackgroundSelected {
width: 100px;
height: 14px;
border-bottom: solid 9px lightgrey;
float: left;
cursor: pointer;
position: absolute;
}
.video-container .CustomControlsBar-wrapper-controls-fullscreen {
float: right;
width: 40px;
height: 100%;
background: url("resources/video-fullscreen-btn.png") no-repeat center center;
cursor: pointer;
}
.video-container .CustomControlsBar-wrapper-controls-closeFullscreen {
float: right;
width: 40px;
height: 100%;
background: url("resources/video-close-fullscreen-btn.png") no-repeat center center;
cursor: pointer;
}
.video-container .CustomControlsBar-wrapper-controls-timer {
height: 40px;
color: gray;
font-size: 14px;
padding-right: 10px;
display: flex;
align-items: center;
float: right;
}
Managing subtitles
This option in full-screen mode is supported by Chrome, Firefox, and Safari.
Subtitles should be provided in the following format:
0|2|100|200|red|This is a sample text
2.5|4|10|10|green|Another line of text
Subtitles should be entered into the "Subtitles" area(s) of the 'Files' property. Each line represents a separate caption. Values are separated by a vertical bar.
- The first value is a start time.
- The second value is the end time of the caption.
- The third value is the vertical distance from the top edge.
- The fourth value is the horizontal distance from the left edge.
- The fifth value is an additional CSS class that will be used for this specific caption.
- The sixth value is the caption text itself.
If you do not need a specific CSS class for a caption, just omit it ("0|2|0|0||Text").
By editing the CSS, you can alter how each caption is displayed. For example:
.video .green {
color: green;
font-weight: bold;
background-color: #fff;
}
This adds the green class and changes the font color to green, together with font-weight and background color.
Time labels
Each file can contain time labels. After adding the time labels, the user can jump to the given time by selecting the time label from the dropdown menu in the video controls bar.
Time labels should be provided in the following format:
<Hour>:<Minute>:<Second> <Label>
<Minute>:<Second> <Label>
<Second> <Label>
Time must be separated from a label with a space.
Labels will be visible in a dropdown menu. If the label is empty, the time will be displayed in the dropdown menu.
Managing audio description
Audio descriptions should be provided in the following format:
0|100|200|red|en|This is a sample text
2.5|10|10|green|en|Another line of text
Audio descriptions should be entered into the "Audio Description" area(s) of the 'Files' property. Each line represents a separate description. Values are separated with a vertical bar.
- The first value is the start time.
- The second value is the vertical distance from the top edge.
- The third value is the horizontal distance from the left edge.
- The fourth value is the additional CSS class that will be used for this specific caption
- The fifth value defines the language in which the description is read.
- The sixth value is the description text itself.
If you do not need a specific CSS class for a caption, just omit it. The same applies if you want the description to be read in the language defined in the properties of the lesson. ("0|0|0|||Text").
Keyboard navigation
- Space - play/pause.
- Up/Down arrows - volume up/down.
- Left/Right arrows - backward/forward.
- Shift + Left/Right arrows - jump to a previous/next time label.
Demo presentation
Demo presentation contains examples of how to use the Video module.