Closed DUWENINK closed 8 months ago
If you're expecting a cdvfile://
path, that's not really supported anymore due to CORs. I believe cdvfile://
is still used on file-based hosted app content, but on scheme/http (WebViewAssetLoader) hosted app content, it retains the origin and have the app route to the local path.
Normally the path https://<app-host>/__cdvfile_sdcard__/Movies/PR-DC/DWK_6b62dfc0-83c8-4294-9065-d1080bab8a1d.mp4
is handled by the WebViewAssetLoader, which parses the __cdvfile_sdcard_
part to know where to redirect the rest of the path to the local filesystem.
However you're using a remote web resource as your app, so you're not using the WebViewAssetLoader
, which isn't really a supported configuration. Additionally, your remote web server won't have access to local device files to actually serve that content. The app needs to be hosted through the locally through the WebViewAssetLoader (which means your app web assets like your index.html
and JS, etc needs to be on the local device, not served remotely) for the cdv file work.
But if you're using external storage mediums (e.g. /storage/emulated/0/
, there are a several other issues with using a file-based API due to Android's scoped storage mechanism). So, I'd also consider using a media-store plugin, although I'm not sure if it will solve all of your issues given your current environment.
Closing as won't fix.
Bug Report
Problem
What is expected to happen?
I use my plugin to record the screen can I save it to gallery , and I want to display it on device at the same time,my device load a remote url like 'https://192.168.1.113:7702/MobileServer/dist/index.html',I use this code
and then I get
the filepath I can not set to the src to the video
and also i get list of paths just like 'https://192.168.1.113:7702/__cdvfile_content__/media/external/video/media/366' 'content://media/external/video/media/357' 'file:///storage/emulated/0/Movies/PR-DC/DWK_6b62dfc0-83c8-4294-9065-d1080bab8a1d.mp4'
file:///storage/emulated/com.duwenink.app/Movies/PR-DC/DWK_5b029226-68e9-4441-9082-8499a488cc70.mp4
https://192.168.1.113:7702/__cdvfile_content__/media/external/video/media/357
https://192.168.1.113:7702/__cdvfile_sdcard__/Movies/PR-DC/DWK_6b62dfc0-83c8-4294-9065-d1080bab8a1d.mp4
i try many ways but why i can not the the cdvfile easily????????????????????????????????????