我有一個ZPT(Zope頁面模板),在這裏我想使用視頻標籤,這樣的:Plone:如何在內容類型中使用html5視頻標籤?
<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>
其中 「巨蟒:file.absolut_url()」 可以改爲其他選項。
但是,任何選項正在工作。該頁面顯示我應該播放視頻的塊,但不播放視頻。
我該如何做這項工作?
我發現我的服務器需要提供與內容類型的視頻文件:不管他們是否有延長的.ogv與否視頻/ OGG,上請求的MimeType。你有什麼想法,我怎麼能在zpt(zope頁面模板)上做到這一點? – 2010-09-08 06:59:33
我不認爲這裏的頁面模板是相關的,實際的文件對象是什麼需要MIME頭。也許你所需要做的就是在mimetypes_registry中註冊mimetype。 – 2010-09-08 08:55:20