java - 带有 thymleaf 视频播放任务的 Spring Boot
问题描述
在具有视频相关路径(如“H:/testing/1.mp4”)的数据库中,这些是用户上传的视频,然后我想在用户登录他的帐户时使用 spring boot 在 thymleaf 上播放这些视频我写了所有内容,直到获取用户相关数据“问题是如何播放 thymleaf 视频标签上的视频”请
控制器代码:
List<Postings> findByUserVideos = postingService.findByUserVideos(Id);
model.addAttribute("data", findByUserVideos);
百里香代码:
<video th:each="file : ${data}" width="100%" controls poster="https://cdn.plyr.io/static/demo/View_From_A_Blue_Moon_Trailer-HD.jpg">
<source th:src="${file.preview}" type="video/mp4">
</video>
错误:
不允许加载本地资源:file:///H:/testing/1.mp4
解决方案
推荐阅读
- python - 我的 while 循环不会随机化我的列表,而是开始重复列表中的相同单词
- macos - 带有 -f 选项的 grep 根据模式文件的顺序返回不同的结果
- html - Mat-Dialog 在页面底部打开而不是弹出窗口?
- laravel - 为什么数据没有保存在 laravel 的 cookie 中?
- c++ - 使用变量在类中存储自定义函数
- android - Android Studio,缺少 Gradle 设置
- c# - 为什么我的 azure 函数有时无法读取静态配置变量?
- android - 意外行为改造 + 协程
- angular - 传单 GeoJSON 类型不与 GeoJSON 对象关联
- r - 按数据框中的因子列着色行 - R