New to Kendo UI for jQuery? Download free 30-day trial

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:

  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