I’m trying to select a video using media.selectVideo. On the listener of the selectVideo call I try to load a native.newVideo with the returned event.url.
Something like:
local function selectFinished(event) local video = native.newVideo(0, 0, 640, 360) video:load(event.url, media.RemoteSource) end local options = { listener = selectFinished } media.selectVideo(options)
I tried setting the mediaSource to media.PhotoLibrary and media.savedPhotosAlbum and both didn’t work.
I noticed, that the returned event.url was a content url (content://com.android.providers.media.documents/document/video%3A253953) instead of a more familiar file:/// url returned from media.captureVideo or media.selectVideo on older devices.
Is there a way to get the file path from the content uri.
Or is it possible to copy the content uri to any of the system directories (i.e. Resource/Temporary/DocumentsDirectory)?
I’m using Corona build 2015.2644 with Android 5.1.1.