Code:
AVQueuePlayer+initWithAppAudioFiles.m
AVQueuePlayer+initWithAppAudioFiles.m
Code:
#import "AVQueuePlayer+initWithAppAudioFiles.h"
@implementation AVQueuePlayer (initWithAppAudioFiles)
+(AVQueuePlayer *)initWithAppFiles:(NSArray *)fileNames extension:(NSString *)extension
{
NSMutableArray *fileURLs;
for (NSString *fileName in fileNames)
{
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:fileName withExtension:extension];
[fileURLs addObject:fileURL];
}
AVQueuePlayer *queuePlayer = [[AVQueuePlayer alloc] initWithItems:fileURLs];
return queuePlayer;
}
@end
Last edited: