Closed milesscherrer closed 1 year ago
@milesscherrer It is supposed to return a Media
struct, not a jpg, and Media
has getData()
, is it not the case? Could you please attach your code if you not getting an actual Media
? Have a nice day
This makes it return a thumbnail if it is video:
func getUrl() async -> URL? {
switch source {
case .media(let assetMediaModel):
if assetMediaModel.mediaType == .image {
return await assetMediaModel.source.getURL()
} else {
return await assetMediaModel.source.getThumbnailURL()
}
case .url(let url):
return url
}
}
But now something seems broken and I now get nil when using let url = await medias[0].getUrl()
Using getData() instead I can turn the data into a UIImage but still no video available. Also in the picker camera roll preview state, the video never loads.
Same here, the video is not playable, not sure why.
Hey @milesscherrer @slimwangyue, thanks for bringing this to my attention, sorry for the late response, but I'm glad to say it's fixed now! Media now has url, thumbnailUrl, data and thumbnailData. Please check out version 1.0.0, and do let me know if you are still facing issues with the library. And be sure to have a marvellous day!
When selecting a video from camera roll, it returns a .jpg url for the first frame only. How do I get the video?