gpt4 book ai didi

java - HTML5视频源不理解文件存储路径

转载 作者:行者123 更新时间:2023-11-28 23:24:57 25 4
gpt4 key购买 nike

HTML5 视频源不理解文件存储路径。例如文件路径是 d:/filestorage 或 c:\tomcat\temp

 <video width="620" height="580" controls="true">
<source src="#{showVideoBean.fileModel.filepath}" type="video/mp4 .mp4"/>
Your browser does not support the video tag.
</video>

据我了解,源仅将路径理解为 URL,例如 http://

如何组织视频文件文件存储并使用 HTML5 video 标签播放。我不想将文件存储在项目文件夹下。

最佳答案

解决方法是:我在\webapps\file-storage 中创建了简单的 Web 应用程序它包括 WEB-INF 和 web.xml在我的后端,我将视频文件存储在\webapps\file-storage并且在网页中

 <video width="620" height="580" controls="true">
<source src="/file-storage/#{showVideoBean.fileModel.filepath}" type="video/mp4 .mp4"/>
Your browser does not support the video tag.
</video>

#{showVideoBean.fileModel.filepath} equals /some/folders/filename.mp4

关于java - HTML5视频源不理解文件存储路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38540064/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com