Content Type for mp4 file

822 views
Skip to first unread message

Max Giesbert

unread,
Nov 23, 2012, 1:19:16 PM11/23/12
to Jease - Java with Ease
Hi everyone, hi Mike,

I am serving some MP4-files with Jease. IE9 now has trouble displaying
them. After countless hours of debugging I am thinking the problem might
be related to the content-type being "video/mp4;charset=utf-8" instead
of just "video/mp4".

Does anybody know how/where to change this?

Many thanks


Max

exactt

unread,
Nov 27, 2012, 4:37:35 AM11/27/12
to je...@googlegroups.com
here is some sample code:

<video controls preload="metadata">
  <source src="videos/video.mp4" type="video/mp4"/>
</video>

Anybody?

Maik Jablonski

unread,
Nov 27, 2012, 5:03:10 AM11/27/12
to je...@googlegroups.com
Hi Max,

On Tue, Nov 27, 2012 at 10:37 AM, exactt <gies...@exactt.de> wrote:
> here is some sample code:
>
> <video controls preload="metadata">
> <source src="videos/video.mp4" type="video/mp4"/>
> </video>
>
> Anybody?

I will check your problem with IE this evening, I have currently no IE
to test it. Can you give more some more information? Do you use the
Media-Object or do you create the markup on your own?

Cheers, Maik

Max Giesbert

unread,
Nov 27, 2012, 5:56:14 AM11/27/12
to je...@googlegroups.com
I simply upload the file as "File". Than I call the file using the
provided HTML code...

IIRC I had to add the MIME to the web.xml of the server...

Thx

Max Giesbert

unread,
Nov 27, 2012, 6:05:39 AM11/27/12
to je...@googlegroups.com
some more info:

instead of playing/showing the video IE9 displays a little red cross.

i found this quite helpful for debugging:
http://blogs.msdn.com/b/thebeebs/archive/2011/07/20/html5-video-not-working-in-ie9-some-tips-to-debug.aspx

to see the problem go to http://extend3d.de/de/ and try watching one of
the two videos linked by the images at the bottom left...

cheers


max



Am 27.11.2012 11:03, schrieb Maik Jablonski:

Maik Jablonski

unread,
Nov 27, 2012, 1:11:41 PM11/27/12
to je...@googlegroups.com
Hi Max,

> some more info:
>
> instead of playing/showing the video IE9 displays a little red cross.
>
> i found this quite helpful for debugging:
> http://blogs.msdn.com/b/thebeebs/archive/2011/07/20/html5-video-not-working-in-ie9-some-tips-to-debug.aspx
>
> to see the problem go to http://extend3d.de/de/ and try watching one of
> the two videos linked by the images at the bottom left...

I guess the problem arises from the missing content length in the
response. Can you try the following quick fix? Change your
/site/domain/File.jsp to the code below (just added the content
length). Does it work now? If so, I'll need to fix
Servlets.write(...), but I remember issues with text-content and
content length... I'll have to do more investigation, but maybe this
quick fix will help you get your project going in the meanwhile.

Cheers, Maik

<%@page import="jease.cms.domain.*,jease.site.*"%>
<%
File file = (File) request.getAttribute("Node");
if (session.getAttribute(file.getPath()) != null) {
file = (File) session.getAttribute(file.getPath());
}
response.setContentLength((int)file.getFile().length());
Streams.write(request, response, file.getFile(), file.getContentType());
return;
%>

Max Giesbert

unread,
Nov 28, 2012, 6:45:53 AM11/28/12
to je...@googlegroups.com
Hi Mike,

well spotted. It works now. You made my day!

Thx a lot

Cheers


Max
Reply all
Reply to author
Forward
0 new messages