how to create kendo media player video with ajax call and spring

2 posts, 0 answers
  1. Federico
    Federico avatar
    28 posts
    Member since:
    Sep 2017

    Posted 18 Sep Link to this post

    I would like to create a kendo video player.

    I would like to pass the video data to the player and not link.

    In the back end I use spring.
    The problem is that the call response is empty.

    Html code:

    <div id="video1" style="width:640px; height: 360px;"></div>

    Js code:

    $("#video1").kendoMediaPlayer({

    autoPlay: true,

    messages: { play: "Wiedergabe", pause: "Pausieren"},

    media: { title: "video",

         source: new kendo.data.DataSource({

    transport: {

    read: { url: "/methodSpring/video", contentType: "application/json", dataType: "json"}}

    }),

    }

    });

    Java code:
    @RequestMapping(value="video")

    public void getVideoGst(HttpServletResponse response) throws Exception

    {

    logger.debug("+video");

    File file = new File("/home/user/Desktop/doc.mp4");

    FileInputStream fis = new FileInputStream(file);

    try {

    IOUtils.copy(fis, response.getOutputStream());

    fis.close();

    }

    finally {

    IOUtils.closeQuietly(fis);

    logger.debug("+video");

    }

    }

  2. Stefan
    Admin
    Stefan avatar
    1147 posts

    Posted 20 Sep Link to this post

    Hello Federico,

    The Kendo UI MediaPlayer can use only the URL of the videos. The URL can lead to a hosted video like in YouTube or to a locally available file:

    http://docs.telerik.com/kendo-ui/api/javascript/ui/mediaplayer#configuration-media.source

    If the desired result is to directly pass the file from the server as a stream, I can suggest submitting a feature request and based on its popularity we may implement it in a future release.

    http://kendoui-feedback.telerik.com/forums/127393-telerik-kendo-ui-feedback?filter=new&query=media

    Regards,
    Stefan
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top