java - 将 Dropbox 视频添加到 html 网页
问题描述
我正在尝试将来自 Dropbox Api (Java) 的视频文件 (mp4) 与 thymeleaf 集成到我的 spring-made 网站。但是,我无法访问视频文件的链接。我的想法是——>
<html>
<main>
<h2 th:text="${videoName}"></h2>
<video>
<source src="*/some url from the dropbox api to visualize the video\*"/>
</video>
<p th:text="${videoDescription}"></p>
...
</main>
</html>
谢谢!
解决方案
我找到了。我必须嵌入共享文件链接并将 dl=0 替换为 raw=1。
<html>
<main>
<h2 th:text="${videoName}"></h2>
<iframe th:src="${dropboxUrl}"></iframe>
<p th:text="${videoDescription}"></p>
...
</main>
</html>
可以通过 ListSharedLinkResult 接收原始共享链接。
ListSharedLinksResult listSharedLinksResult = dbxClientV2.sharing().listSharedLinksBuilder().withPath(dropboxPath).withDirectOnly(true).start();
String result = listSharedLinksResult.getLinks().get(0).getUrl();
推荐阅读
- typescript - 多对多 TypeOrm NestJs 保存
- c# - 在 .Net 和 Node.js 之间传输大对象图
- python - 扩展根查找 scipy.optimize 的限制(二分法或 brentq)
- c# - 尝试使用 .Net Core 3.1 连接 mySAP WCF 时出现问题
- docusignapi - DocuSign 参数化重定向 URI
- r - 如何计算R中的7天移动平均线?
- reactjs - React NavLink activeClassName 有效,但常规 className 停止在元素上工作
- sql-server - TSQL - 如果手动运行(不在作业中)只执行一行
- python - 获取 KeyError = 0 错误,而我在两个熊猫数据框列上使用 np.nanprod
- javascript - 将类成员对象访问到匿名函数中的最简洁方法