MNAVChapters 0.1.0

MNAVChapters 0.1.0

TestsTested
LangLanguage Obj-CObjective C
License MIT
ReleasedLast Release Dec 2014

Maintained by Michael Nisi.



  • By
  • Michael Nisi

MNAVChapters - read chapter metadata of audiovisual assets

The MNAVChapters iOS library reads chapter metadata of audiovisual assets. It reads chapters from MPEG-4 and specifically MP3 files. Although the id3v2 standard specifies the chapter frame since 2005, I couldn't find a C or Objective-C library that parses this frame correctly.

This modest implementation in Objective-C has been inspired by a post over on the auphonic blog.

Usage

AVAsset *asset = [self assetWithResource:@"auphonic_chapters_demo" ofType:@"mp3"];
NSArray *chapters = [[MNAVChapterReader new] chaptersFromAsset:asset];

Please note that this is blocking and thus should not run in the main loop.

MNAVChapter

@interface MNAVChapter : NSObject
@property (nonatomic) NSString *title;
@property (nonatomic) NSString *url;
@property (nonatomic) CMTime time;
@property (nonatomic) CMTime duration;
@property (nonatomic) UIImage *artwork;
- (BOOL)isEqualToChapter:(MNAVChapter *)aChapter;
- (MNAVChapter *)initWithTime:(CMTime)time duration:(CMTime)duration;
+ (MNAVChapter *)chapterWithTime:(CMTime)time duration:(CMTime)duration;
@end

Installation

License

MIT License