Re: Setiting media type for webm videos

2013-04-22 Thread Jerome Louvel
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: Re: Setiting media type for webm videos

2013-04-22 Thread Adam Mc
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