ios playback: introduce macro to enable photos/ library

Until now the photo library integration is broken (that API was
deprecated by Apple) and the iTunes integration is better to have
optional to put our test files in the forefront (and have better way to
browse large iTunes libs).
This commit is contained in:
Stephan Hesse 2018-05-04 13:35:48 +02:00 committed by Sebastian Dröge
parent a9a8e36475
commit 4a62c09504

View file

@ -2,6 +2,8 @@
#import "VideoViewController.h"
#import <AssetsLibrary/AssetsLibrary.h>
#define ENABLE_IOS_LIBRARY false
@interface LibraryViewController ()
@end
@ -95,10 +97,14 @@ static NSString *CellIdentifier = @"CellIdentifier";
- (void)refreshMediaItems {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSAllDomainsMask, YES);
#if ENABLE_IOS_LIBRARY
NSString *docsPath = [paths objectAtIndex:0];
NSMutableArray *entries;
/* Entries from the Photo Library */
NSMutableArray *entries = [[NSMutableArray alloc] init];
entries = [[NSMutableArray alloc] init];
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupsWithTypes:ALAssetsGroupAll
usingBlock:^(ALAssetsGroup *group, BOOL *stop)
@ -130,6 +136,8 @@ static NSString *CellIdentifier = @"CellIdentifier";
[entries addObject:[NSString stringWithFormat:@"file://%@/%@", docsPath, e]];
}
self->mediaEntries = entries;
#endif
self->onlineEntries = [NSArray arrayWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"OnlineMedia" withExtension:@"plist"]];
}