• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

video playing/streaming

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I want to add video playing support from database to my website using jsp. Can some body help me?
Thank You.....
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ShowSomeEffort. What have you tried so far? What problems are you having?
 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:ShowSomeEffort. What have you tried so far? What problems are you having?



Hi Bibeaul! thanks for your reply.
Actually I upload a video on server and kept the reference in database by name. Now i want to play this video on client(browser ) with out downloading.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Impossible. To play the video, the data must be sent to the client.
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Singh Kuldeep wrote:
Actually I upload a video on server and kept the reference in database by name. Now i want to play this video on client(browser ) with out downloading.



You have to explain what exactly you mean by "without downloading"? Do you mean, when the video is requested by the client, you don't want a "save as" window to pop-up and instead it should just start playing in the client browser?
 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jaikiran Pai wrote:

Singh Kuldeep wrote:
Actually I upload a video on server and kept the reference in database by name. Now i want to play this video on client(browser ) with out downloading.



You have to explain what exactly you mean by "without downloading"? Do you mean, when the video is requested by the client, you don't want a "save as" window to pop-up and instead it should just start playing in the client browser?



yes.... exactly. I don't want client to save as option. it should start playing in browser....
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You still haven't shown us the code.
 
Singh Kuldeep
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:You still haven't shown us the code.



<%

String filename = "C:\\uploaded-download\\anjane.mov"; //my own filename
//you can write http://localhost
//String filepath = "C:/"; //located on Local C harddisk

BufferedInputStream buf = null;

try {


File myfile = new File( filename);

//set response headers
response.setContentType("application"); //I want to play a video file

response.addHeader(
"Content-Disposition", "attachment; filename=" + filename);

response.setContentLength((int) myfile.length());

FileInputStream input = new FileInputStream(myfile);
buf = new BufferedInputStream(input);
int readBytes = 0;

//read from the file; write to the ServletOutputStream
while ((readBytes = buf.read()) != -1) {
out.write(readBytes);
}

} catch (IOException ioe) {
} finally {


}

%>


Hi Bear Bibeault, Please check this.
 
Bear Bibeault
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're trying to stream it from a JSP?

Step 1: Move the code out of a JSP and into a servlet. JSP is a completely unsuitable technology for this.
 
reply
    Bookmark Topic Watch Topic
  • New Topic