Kind: global class
- UITimeDisplay
- new UITimeDisplay()
- .showDuration :
boolean
Import from Github repo
// importing into an ES6 class import { UITimeDisplay } from 'ad-video'
This is a display object class, extending [UITextField](UITextField) with direct control to a [VideoPlayer](#VideoPlayer) instance. It displays the time of [VideoPlayer](#VideoPlayer).
While it can be instantiated by itself, it is typically created from the VideoControls class which is called from the constructor of a [VideoPlayer](#VideoPlayer) instance.
See [UITextField](UITextField) for more info.<br><br>
<b>Sample 1</b><br>
Add the time display to the controlBar<br>
<pre class="sunlight-highlight-javascript">
var myVideoPlayer = new VideoPlayer({
source: adParams.videosPath + 'RED_Html5_Showcase_300x250.mp4',
target: View.main,
id: 'my-video-player',
css: {
width: 400,
height: 250
},
controls : {
timeDisplay : {
css : {
height : 'inherit',
color : '#ffffff'
},
fontSize : 18,
fontFamily : 'Arial',
alignText : Align.CENTER,
bufferText : {
left : 5,
right : 5
},
showDuration : true
}
}
});
<b>Sample 2</b><br>
Add the time display on the screen, NOT on the controlBar<br>
<pre class="sunlight-highlight-javascript">
var myVideoPlayer = new VideoPlayer({ source: adParams.videosPath + 'RED_Html5_Showcase_300x250.mp4', target: View.main, id: 'my-video-player', css: { width: 400, height: 250 }, controls : { onScreen : { timeDisplay : { css : { height : 50, color : '#ffffff' }, fontSize : 18, fontFamily : 'Arial', alignText : Align.CENTER,
showDuration : true
}
},
}
});
Getter | Setter : Toggles if the time will have the duration appended to the display.
Will output either #:## or #:##/#:##
Kind: static property of UITimeDisplay