This is a migrated thread and some comments may be shown as answers.
how to create kendo media player video with ajax call and spring
1 Answer 26 Views
This is a migrated thread and some comments may be shown as answers.
Federico
Top achievements
Rank 1
Federico asked on 18 Sep 2017, 10:20 AM

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");

}

}

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 20 Sep 2017, 06:05 AM
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.
Asked by
Federico
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or