String videoUrl = "../videos/"+"abhishek"+"/"+"videos"+"/"+batchName+"/"+videoName+"/200";
HTML video = new HTML("<video id=\"my_video_1\" class=\"video-js vjs-default-skin\" controls preload=\"auto\" width=\"640\" height=\"264\" data-setup=\"{}\">"+
"<source src="+videoUrl+" type='video/mp4'></video>");
here videos is my servlet
String videoPath= "C:/mnt/bigvol/WebImages/videos/2011/clips/";
String videoName= "L_00010.mp4";
ServletContext application= getServletConfig().getServletContext();
File file = new File(videoPath,videoName);
String contentType = getServletContext().getMimeType(file.getName());
response.setBufferSize(DEFAULT_BUFFER_SIZE);
response.setHeader("Content-Type", "video/mp4");
response.setHeader("Content-Length", Long.toString(file.length()));
response.setHeader("Content-Disposition", "inline; filename=\"" + file.getName() + "\"");
// Prepare streams.
BufferedInputStream input = null;
ServletOutputStream outputStream = response.getOutputStream();
BufferedOutputStream output = null;
try {
// Open streams.
byte[] buffer = new byte[DEFAULT_BUFFER_SIZE];
input = new BufferedInputStream(new FileInputStream(file), DEFAULT_BUFFER_SIZE);
output = new BufferedOutputStream(response.getOutputStream(), DEFAULT_BUFFER_SIZE);
// Write file contents to response.
int length;
while ((length = input.read(buffer,0,4096)) != -1) {
outputStream.write(buffer, 0, length);
}
} finally {
// Gently close streams.
// close(output);
// close(input);
try{
if(input != null)
input.close();
}catch (Exception e) {
// TODO: handle exception
}
if(outputStream != null)
outputStream.flush();
}
I cannot seek forward or backward and once played I cant play again .
I can setup a new server to serve video I read something like HTTP pusedstreaming etc.
Is I am in right direction ??