Skip to content

juanjoguevara/MNAVChapters

 
 

Repository files navigation

MNAVChapters - read chapter metadata of audiovisual assets

Build Status

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];

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

MNAVChapters is available through CocoaPods. To install simply add the following line to your Podfile:

pod "MNAVChapters"

License

MIT License

About

Read chapter metadata of AVAssets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 94.4%
  • Ruby 5.6%