我有一个 zpt(zope 页面模板),我想在其中使用视频标签,例如:
<video src="FILE_LOCATION" width="320" height="240" type='video/ogg; codecs="theora, vorbis"' controls></video>
其中 FILE_LOCATION 将是 plone 的内容类型。我可以使用 3 种方式来访问文件:
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:如果我单击浏览器上第一个或第二个选项返回的链接,它会从浏览器打开下载窗口以下载文件。
在 zpt 上,我可以这样做:
<video src="" id="video_play" width="320" height="240" type='video/ogg; codecs="theora, vorbis"' controls
tal:attributes="src python:file.absolute_url()"></video>
其中“python:file.absolut_url()”可以更改为其他选项。
但这些选项中的任何一个都有效。该页面向我显示了一个应该播放视频的块,但没有播放视频。
我怎样才能使这项工作?