2
votes

I am trying to write an IOS app that can, amongst many other things, fetch videos synced from iTunes to the IOS device (where the app is running). I have tried using AssetsLibrary and Photos Framework. I am only able to get hold of those assets that are accessible by the Photos app (The framework documentation also confirms this) But, the Videos app is able to fetch those videos synced from iTunes. Is there some public API that I could use to get access to the synced videos? Or is this by design? One workaround I came across was to go to "Photos" section in iTunes and turn ON "include videos" and sync (another copy of) the video as a "photo" which is now accessible by Photos app as well as by my app. Is this the only way out?

1
Seems there is no way to get contents that is inaccessible by UIImagePickerViewController, e.g. videos from iTunes.Raptor

1 Answers

1
votes

You can try by fetching all the collections of type SmartAlbum:

PHFetchResult *albums = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum subtype:PHAssetCollectionSubtypeAny options:nil]

And then iterating over each album to get the PHAssets:

for (PHAssetCollection *sub in albums) {
    PHFetchResult *fetchResult = [PHAsset fetchAssetsInAssetCollection:sub options:nil];
}

Notice that the album fetch results will include the Synced Albums.