Note that there are some explanatory texts on larger screens.

plurals
  1. PORead quicktime movie from servlet in a webpage?
    primarykey
    data
    text
    <p>I have a servlet that construct response to a media file request by reading the file from server: </p> <pre><code> File uploadFile = new File("C:\\TEMP\\movie.mov"); FileInputStream in = new FileInputStream(uploadFile); </code></pre> <p>Then write that stream to the response stream. My question is how do I play the media file in the webpage using embed or object tag to read the media stream from the response?</p> <p>Here is my code in the servlet: </p> <pre><code>public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.getParameter("location"); uploadFile(response); } private void uploadFile(HttpServletResponse response) { File transferFile = new File("C:/TEMP/captured.mov"); FileInputStream in = null; try { in = new FileInputStream(transferFile); } catch (FileNotFoundException e) { System.out.println("File not found"); } try { System.out.println("in byes i s" + in.available()); } catch (IOException e) { } DataOutputStream responseStream = null; try { responseStream = new DataOutputStream(response.getOutputStream()); } catch (IOException e) { System.out.println("Io exception"); } try { Util.copyStream(in, responseStream); } catch (CopyStreamException e) { System.out.println("copy Stream exception"); } try { responseStream.flush(); } catch (IOException e) { } try { responseStream.close(); } catch (IOException e) { } } </code></pre> <p>And here is html page as Ryan suggested: </p> <pre><code>&lt;embed SRC="http://localhost:7101/movies/transferservlet" WIDTH=100 HEIGHT=196 AUTOPLAY=true CONTROLLER=true LOOP=false PLUGINSPAGE="http://www.apple.com/quicktime/"&gt; </code></pre> <p>Any ideas? </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload