-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Are http/localhost urls blocked in Android? Can I unblock them? #10506
Comments
Hi, |
I tried adding that item to capabilities/main.json, but I got this error: long list of permissions, but no http
|
I am using the plugin |
I saw that plugin and thought it just gave you some extra JS apis, but wouldn't expect it to affect the webview http. Why would it work on desktop without a plugin but require it for android? But hey at this point I'll try anything lol. |
I try to use convertFileSrc method to play local video, but it not work, is there anyway to play local video resource on android platform? |
I still haven't gotten a chance to try the tauri-plugin-http. Will report back here with the result. |
I meet the same issue. I can get the http resource using |
@lucasfernog Hi! Do you have any idea about this? |
Hi! I just solved this issue. <?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config> and then add the below contetn to android:networkSecurityConfig="@xml/network_security_config" It works for me. |
I gave that a try, but kept getting errors that the file could not be found! I put it here:
And tried a number of other locations to no avail. But the good news is I instead found, and changed this line in AndroidManifest.xml:
to this:
And now I'm able to see locally-served videos and audio files in the browser. At long last! I wonder if `usesCleartextTraffic' is something that is set someplace else, that's under source control, rather than in generated code? |
Discussed in #10428
I'm looking to get audio/video working on my page in an android app.
According to #3725 it appears I need to use a web server to host the files, because of a bug in webkit. I added a web server to my app, and it does work - on linux.
On android the files don't load. I enabled logging on my web server and it seems its never getting the requests. I can adb shell and use curl to access the files just fine, and then I see those accesses in my logs.
From my android app, I can embed links to media files over https. But it doesn't work with an http url.
So my question is, is there some kind of policy on android that blocks an url like this?
http://localhost:8000/file/75d69666-b189-475e-9d8d-827d45ed3838
If so, how can I deactivate that policy?
reproduction:
See the readme
Then make a markdown document that points to an http media file, like
Observe that the https one works while the http one does not.
expected behavior:
Expected that access to urls should be the same on linux and on android, with the same tauri.conf.json
Full
tauri info
outputThe text was updated successfully, but these errors were encountered: