Start at a Specific Place on the Seek-Bar

Environment

Product MediaPlayer for ProgressĀ® Kendo UIĀ®
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:

  1. Use the seek method the first time the play event is fired.
  2. 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>

See Also

In this article
Not finding the help you need? Improve this article