views:

60

answers:

1

I have a zpt (zope page template), where I want to use a video tag, something like:

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

where FILE_LOCATION would be a content type of plone. I can use either 3 ways to acces the file:

1) file.download_url #gives me: http://localhost:8000/a/acervo/testeflv2/at_download/file
2) file.absolute_url #gives me: http://localhost:8000/a/acervo/testeflv2
3) file.getFile() #gives me the file (like if I open the video file on a text editor)

obs: If I click the link returned from the first or the second choice on a browser, it opens the download window from the browser to download the file.

On the zpt, I can do something like this:

<video src="" id="video_play" width="320" height="240" type='video/ogg; codecs="theora, vorbis"' controls
       tal:attributes="src python:file.absolute_url()"></video>

where "python: file.absolut_url()" can be changed to that other options.

But any of that options are working. The page shows me a block where the video should be played, but no video is played.
How can I make this work?

A: 

You will probably need the download link - you want pure data, not a Plone default view.

i.e.

<video src="" id="video_play"    width="320" height="240"    type='video/ogg; codecs="theora,    vorbis"' controls tal:attributes="src    file/download_url"></video>

If that doesn't work:

  • Does your browser support .ogg? (Try with both firefox and chrome)
  • is it really ogg?
  • what happens if you open the download url directly? Does the browser play anything?
  • what does src point to after rendering the template (view-source or inspect element). Does the url look correct?
Ivo van der Wijk
@Ivo I found that my server needs to serves the video files with Content-Type: video/ogg regardless of whether they have the .ogv extension or not, on the MimeType of the REQUEST. Do you have any idea in how can I do this on the zpt (zope page template) ?
Gabriel L. Oliveira
I don't think the page template is relevant here, the actual file object is what needs the mime header. Perhaps all you need to do is register the mimetype in mimetypes_registry.
Ivo van der Wijk