mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-09-22 20:10:13 +00:00
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:
parent
a9a8e36475
commit
4a62c09504
1 changed files with 9 additions and 1 deletions
|
@ -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"]];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue