• 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

Streaming Video Through a Servlet (.wmp)

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I'm basically just connecting to the movie and I would like to play it through the servlet. I've gotten this far so far. I've got the movie actually opening up but it is corrupted. The movies fine with a normal browser link but I need to connect this way. Can anyone point me in the right direction please??



thanks
 
B Wiley Snyder
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is a better question. I've modified the code also. If I am just connecting to an URL through a servlet. What could be corrupting the file if it opens on its own without httpconnect . What is that adding to this situation? It connects, opens the player and I get a file corruption error. but If I go straight to the URL http://www.foo.com/MovementDemo.wmv ... it opens up just fine. I thought If I set the response object to the mime type it would open it just like it would if the url was in the address bar?

[code]
package TESTLINK;

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.util.*;
import java.net.*;

public class WindowsMediaServer extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)throws ServletException, IOException {

response.setHeader("Cache-Control","no-cache");
response.setHeader("Pragma","no-cache");
response.setDateHeader ("Expires", 0);

response.setContentType("video/x-ms-wmv");
try{
URL theUrl = new URL("http://www.foo.com/MovementDemo.wmv");
URLConnection connection = theUrl.openConnection();
HttpURLConnection http = (HttpURLConnection)connection;
http.connect();

}catch(ConnectException ce){

}

}
}

anything please, thanks
 
reply
    Bookmark Topic Watch Topic
  • New Topic