Real-Time Syncronization
Viblast Player supports associating points in a stream with an absolute date and time. This can be useful when you want to synchronise video playback with other timed information related to the stream.
In order to accomplish this feature Viblast Player uses the EXT-X-PROGRAM-DATE-TIME tag that is specified in the HLS playlist.
Accessing the current program date time
Accessing the current absolute date and time is done using the currentProgramDateTime
of the viblast
object associated with a video element:
<video id="player" src="//cdn3.viblast.com/streams/hls/airshow/playlist.m3u8" data-viblast-key="the-key">
</video>
...
<script>
var player = document.getElementById('player');
var currentTime = player.viblast.currentProgramDateTime;
</script>
Or if you are using Video.js:
<video id="player" class="video-js vjs-default-skin">
<source src="//cdn3.viblast.com/streams/hls/airshow/playlist.m3u8" type='application/x-mpegURL' />
</video>
...
<script>
var player = videojs('#player');
var currentTime = player.viblast.currentProgramDateTime;
</script>
Semantics
currentProgramDateTime
returns a Date object that represents
the absolute date and time of the currently displayed frame of the stream. The value of currentProgramDateTime
updates with each update of the player currentTime.
This property is read only.