我一直在使用Electron进行GUI界面开发,最近我遇到了Tauri作为Electron的替代品,并意识到相同的代码可以在Electron上运行,但在Tauri上却不能。
<video controls preload src="file:\\C:\Users\User\Desktop\HelloTest\testVideo.mp4" ></video>
我已经尝试过:
<video controls preload src="C:\Users\User\Desktop\HelloTest\testVideo.mp4" ></video>
错误仍然是“Not allowed to load local resource: file:///.....”
在electron中,通过禁用webPreference
中的webSecurity:false
可以解决此问题。是否有任何方法可以在Tauri中禁用Web安全性,以便我可以在Tauri中使用本地资源(来自C://或D://的视频),我的Tauri使用Angular作为前端。