Start at a Specific Place on the Seek-Bar
Environment
Product | Progress® Kendo UI® MediaPlayer for jQuery | Product Version | 2019.1.115 |
Description
How can I programmatically start my video at a specific place the first time it is played?
Solution
To have a different start time when a video loads in a Kendo UI MediaPlayer:
- Use the
seek
method the first time theplay
event is fired. - Utilize the
one
method of the Kendo UI observable to attach a handler for one-time execution.
<div id="mediaplayer" style="height:360px"></div>
<script type="text/javascript">
$(document).ready(function(){
$("#mediaplayer").kendoMediaPlayer({
autoPlay: true,
navigatable: true,
media: {
title: "ProgressNEXT 2018 Highlights",
source: "https://www.youtube.com/watch?v=Gp7tcOcSKAU"
}
});
var mediaPlayer = $("#mediaplayer").data("kendoMediaPlayer");
mediaPlayer.one("play", function(){
mediaPlayer.seek(50000);
});
});
</script>