views:

52

answers:

1

I have this sample code, that works:

<video src="./ellen.ogv" width="320" height="240" type='video/ogg; codecs="theora, vorbis"' controls></video>

And this one that doesn't work:

<video src="./ellen" width="320" height="240" type='video/ogg; codecs="theora, vorbis"' controls></video>

The only change was on the name of the file. First one "point" his extension, second one does not.
This is just a simple view of my problem, where the file I want to stream CAN'T have extension, but is a theora/vorbis (ogv) file.

How can I deal with this problem, i.e., make video tag works even if my filename doesn't have a ".extension" ?

+2  A: 

First, the type attribute is not allowed on the video tag. Place the type attribute in a source tag instead, like this:

<video width="320" height="240" controls>
  <source src="./ellen" type='video/ogg; codecs="theora, vorbis"'>
</video>

Second, video files must be served with the proper MIME type by the web server, even when you have specified a type attribute in the source element. Make sure that your web server serves your video files with Content-Type: video/ogg regardless of whether they have the .ogv extension or not.

Pär Wieslander
@Pär Would you know about zpt (zope page templates), to let me know how can I change the mimetype of the content file "on the fly" on there?
Gabriel L. Oliveira
No, I haven't worked with Zope so I can't help you there, unfortunately. Your best bet is probably to Google around for `zope content-type`, `zope mime-type` or similar, or to ask a separate question here regarding how to specify a content type for your video files.
Pär Wieslander
@Pär Thank you, anyway.
Gabriel L. Oliveira