Not sure if anyone can help but I'm struggling wit...
# ios
s
Not sure if anyone can help but I'm struggling with creating or getting a thumbnail for a video file in my iOS app. I'm using a
PHPickerView
to show my gallery, I select a video and get a
PHPickerResult
, which has the
itemProvider
that i use to get a
nsUrl
. however if I try to do something like
AVAsset.assetWithURL(videoUrl)
then the asset doesn't seem to be recognized as a video, or readable. I have permissions enabled so I don't think it's that, and I'm able to get photos with the picker. looking for other ideas. Slack Conversation
f
did you check in the console output if there is an error?
sometimes the error is tricky on iOS
s
yeah, no errors. I ended up figuring it out...I guess I had to write the bytes to a temp url. I'm calling
videoNsData.writeToURL(tempUrl)
function before calling
AVAsset.assetWithURL(tempUrl)