I finally got video playback to work in chrome with seek feature using the headers Content-Range etc and status 206 returned. It worked well for smaller videos but fails with large videos. Just to note, I am not sending the actual byte ranges explicitly but deliver the entire stream to the webserver. I get the following errors:
org.eclipse.jetty.io.EofException,
this occurs in the backend dataserver that serves the entire inputstream to a servlet and jetty is the server being used. I am not sure how this process actually plays back and corrected the seek feature I needed but now the video fails after playing for a while. The following error also occurs in the browser debugger:
ERR_CONTENT_LENGTH_MISMATCH
I have an audio stream being requested at the same time and playedback as well since I do not know how to mix the two streams.
Any ideas or advice appreciated.
EDIT:
Thanks to the advice to change resourcehandler to defaultservlet; not sure where to do this so found the instances of where this is in the code:
private void addHttpContexts(ConfigNode cnode) throws Exception {
try {
// get all the http context nodes
ConfigNode[] httpContextNodes = cnode.getChildNode("HttpContextList").getChildNodes();
for (int s = 0; s < httpContextNodes.length; s++) {
String urlPath = httpContextNodes[s].getChildNode("ContextPath").getStringValueEx();
String resourceBase = httpContextNodes[s].getChildNode("ResourceBase").getStringValueEx();
ArrayList<String> welcomeFileList = new ArrayList<String>();
if (httpContextNodes[s].hasChildNode("WelcomeFile")) {
String welcomeFile = httpContextNodes[s].getChildNode("WelcomeFile").getStringValueEx();
welcomeFileList.add(welcomeFile);
}
ContextHandler context = new ContextHandler(contexts, urlPath);
ResourceHandler resourceHandler = new ResourceHandler();
resourceHandler.setResourceBase(resourceBase);
resourceHandler.setWelcomeFiles((String[]) welcomeFileList.toArray(new String[welcomeFileList.size()]));
context.setHandler(resourceHandler);
} catch (Exception ex) {
trace.warning("Configuration of http contexts failed", ex);
throw ex;
}
}
What is the appropriate methods for setResourceBase(resourceBase) and setWelcomeFiles((String[]) welcomeFileList.toArray(new String[welcomeFileList.size()]));
This is the other place in the the same class I found DefaultSErvlet
ServletHolder holderDefault = new ServletHolder("default",DefaultServlet.class);
holderDefault.setInitParameter("dirAllowed","false");
and also already defined in web.xml
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.eclipse.jetty.servlet.DefaultServlet</servlet-class>
<init-param>
<param-name>dirAllowed</param-name>
<param-value>false</param-value>
</init-param>
</servlet>