Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for accessing files from local filesystem with in html #2103

Closed
shareejvk opened this issue Jun 26, 2021 · 3 comments · Fixed by #2104
Closed

Support for accessing files from local filesystem with in html #2103

shareejvk opened this issue Jun 26, 2021 · 3 comments · Fixed by #2104

Comments

@shareejvk
Copy link

As of now, I am not able to access files from the local file system within HTML.
Reading files as binary then converting to base64 cant be considered as a solution to this issue as this is super slow especially for video files.
I believe local file system access within the renderer is a very basic requirement.

@nothingismagick
Copy link
Sponsor Member

One should be able to do something like:

<video controls src="file:///User/dave/film.mp4" />

@wusyong
Copy link
Member

wusyong commented Jun 28, 2021

I updated the custom protocol example in tauri-apps/wry#315 which should make it more like a real life sample to load local assets.
@lucasfernog @lemarier Does tauri support this feature yet?

@wusyong
Copy link
Member

wusyong commented Jun 28, 2021

Btw, I tested file:// protocol last weekemd.
It can be used to load the webview by with_url.
But it is extreme restricted in the HTML files on all platforms.
And even there are some hacks and workarounds. It still has some wierd behaviors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants