Re: Setiting media type for webm videos
Hi Adam, To simplify your code, you could just do this in your application's constructor: getMetadataService().addExtension(webm, MediaType.valueOf(video/webm)); Then, check the response media type with a raw HTTP client to make sure it is properly set. If it still doesn't work, it might not be Restlet related. Best regards, Jerome -- http://restlet.org http://twitter.com/#!/jlouvel 2013/4/22 Adam Mc a...@cs.miami.edu Hi, I am trying to get HTML5 *.webm videos to play from a restlet server. I am using the latest stable with Jetty standalone with the FILE protocol on a directory. Other types of HTML5 videos play fine, but not webm videos, so I suppose it is a meida type problem. Looking at my old tomcat setup (videos played fine under tomcat), I see the following: mime-mapping extensionwebm/extension mime-typevideo/webm/mime-type /mime-mapping So, I tried to translate this to restlet with the following code, but it is still not working. Any ideas? public synchronized Restlet createInboundRoot() { MetadataService ms = new MetadataService(); ms.addCommonExtensions(); ms.addExtension(webm, new MediaType(video/webm)); ms.setEnabled(true); this.setMetadataService(ms); Router router = new Router(getContext()); // route codes here return router; } Thanks, -Adam -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3053895 -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3053946
Re: Communication Error (1001) - The connector failed to complete the communication with the server
Hi David, Please plugin the org.restlet.ext.net.jar to replace the default connector with a more stable one. It will probably help. Best regards, Jerome -- http://restlet.org http://twitter.com/#!/jlouvel 2013/4/21 David Leangen j...@leangen.net Hello! After a few weeks of absence, I am trying once again to set up restlet in my OSGi environment. Using version 2.2-M1. I am making a call like this: final Client client = new Client( new Context(), Protocol. HTTPS ); final ClientResource clientResource = new ClientResource( url ); clientResource.setNext( client ); final ChallengeResponse authentication = newChallengeResponse( ChallengeScheme. HTTP_BASIC, pwd, ); clientResource.setChallengeResponse( authentication ); final Representation r = clientResource.get(); r.write( System.out ); r.release(); client.stop(); Sometimes I get back a valid reply, but most times I get back this error: Communication Error (1001) - The connector failed to complete the communication with the server What confuses me is why this would work sometimes, but not others. Any hints? Best regards, =David -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3053947
RE: Re: Setiting media type for webm videos
Thanks Jerome for pointing me in the right direction to debug the issue. I was mistaken, it was actually not a problem with webm videos, but in fact m4v videos (I was mistaken as which video was being fallen back to in the IE browser, I thought IE was falling back to webm, but was in fact falling back to m4v videos). Regardless, while it worked in other browsers, IE was not able to load the m4v videos from a restlet standalone because the media type needed a slight change. The following change worked fine and allows m4v HTML5 videos to load fine in IE another other browsers: getMetadataService().addExtension(m4v, new MediaType(video/mp4)); -Adam -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3053962
Re: Communication Error (1001) - The connector failed to complete the communication with the server
Hi Jerome, Thank you very much for this tip. Much appreciated. Please plugin the org.restlet.ext.net.jar to replace the default connector with a more stable one. It will probably help. I interpreted this comment to mean: org.restlet.ext.httpclient is the default to be replaced org.restlet.ext.net is what I should be using Unfortunately, this did not fix the problem. I noticed that since I am making a call over HTTPS, I also needed to add org.restlet.ext.ssl as a dependency*. Since this is a common library between the two connectors, and both connectors result in the same issue, I am wondering if this ssl library is not somehow related to the source of the issue. This theory is further confirmed because I do not experience this issue with calls over HTTP. (* If I do not, I get this error: java.lang.NoClassDefFoundError: org/restlet/ext/ssl/internal/SslUtils) Are there any alternatives to org.restlet.ext.ssl, or perhaps any hints as to how I could work around this issue? Thanks so much! =David -- http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447dsMessageId=3053991