Latest 0.5
Homepage https://github.com/cromulentlabs/CLMediaPicker
License Apache License, Version 2.0
Platforms ios 8.0, requires ARC
Frameworks Foundation

CLMediaPicker is an open source (nearly drop-in) replacement for
MPMediaPickerController from the MediaPlayer framework in iOS. It can
be used to choose audio files (music, podcasts, audiobooks) from a
user’s media library.

Comparison to MPMediaPickerController

Advantages over MPMediaPickerController

1. Displays podcasts and audiobooks (unlike MPMediaPickerController in iOS 8.4+).
2. Can be used as a modal view controller or within a UINavigationController.
3. Colors can optionally be customized to match the rest of your app.
4. Images can optionally be provided as replacements for Back, Done and Cancel buttons.
5. Displays number of items chosen in title when choosing multiple items.
6. Supports landscape and portrait.
7. Supports subclassing for easier customization.

Similar features as MPMediaPickerController

1. Displays top-level audio choices for easy browsing (Artists, Albums, Songs, Playlists, etc.)
2. Can be configured to choose only one or multiple items at once.
3. Can filter out only audio types requested.
4. Can filter out cloud items.
5. Provides a + button to include all items below the current level.
6. Provides a search bar for searching in addition to browsing.

Other features

1. Provides localization in 12 different languages.

Installation

CocoaPods

CLMediaPicker is available on CocoaPods and can be install by adding

pod 'CLMediaPicker'

to your pod file.

Manually

Alternatively, you can just copy the CLMediaPicker sub-directory into
your project and make sure to include the MediaPlayer framework.

Example

Step 1: Include header

if using cocoapods:

#import <CLMediaPicker/CLMediaPicker.h>

or if installed manually:

#import "CLMediaPicker.h"

Step 2: Mark your class as implementing CLMediaPickerDelegate protocol

@interface ViewController : UIViewController<CLMediaPickerDelegate>

Step 3: Set up delegate

#pragma mark - CLMediaPickerDelegate

- (void)clMediaPicker:(CLMediaPicker *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection
{
    if (mediaItemCollection)
    {
    // Do what you want with the collection
    }
}

- (void)clMediaPickerDidCancel:(CLMediaPicker *)mediaPicker
{
    [self dismissViewControllerAnimated:NO completion:nil];
}

Step 4: Instantiate and show view controller

CLMediaPicker *picker = [[CLMediaPicker alloc] init];
picker.mediaTypes = CLMediaPickerAll;
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
picker.showsCloudItems = NO;
[self.navigationController pushViewController:picker animated:YES];

or if you want to display it modally:

CLMediaPicker *picker = [[CLMediaPicker alloc] init];
picker.mediaTypes = CLMediaPickerAll;
picker.delegate = self;
picker.allowsPickingMultipleItems = YES;
picker.showsCloudItems = NO;
picker.isModal = YES;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:picker];
[self presentViewController:navController animated:YES completion:nil];

Latest podspec

{
    "name": "CLMediaPicker",
    "version": "0.5",
    "summary": "Drop-in replacement for MPMediaPickerController for iOS that provides much more flexibility",
    "description": "CLMediaPicker is an open source (nearly drop-in) replacement fornMPMediaPickerController from the MediaPlayer framework in iOS. It cannbe used to choose audio files (music, podcasts, audiobooks) from anuser's media library.nnAdvantages over MPMediaPickerController:nn    1. Displays podcasts and audiobooks (unlike MPMediaPickerController in iOS 8.4+).n    2. Can be used as a modal view controller or within a UINavigationController.n    3. Colors can optionally be customized to match the rest of your app.n    4. Images can optionally be provided as replacements for Back, Done and Cancel buttons.n    5. Displays number of items chosen in title when choosing multiple items.n    6. Supports landscape and portrait.n    7. Supports subclassing for easier customization.nnSimilar features as MPMediaPickerController:nn    1. Displays top-level audio choices for easy browsing (Artists, Albums, Songs, Playlists, etc.)n    2. Can be configured to choose only one or multiple items at once.n    3. Can filter out only audio types requested.n    4. Can filter out cloud items.n    5. Provides a + button to include all items below the current level.n    6. Provides a search bar for searching in addition to browsing.nnOther features:nn    1. Provides localization in 12 different languages.",
    "homepage": "https://github.com/cromulentlabs/CLMediaPicker",
    "license": "Apache License, Version 2.0",
    "authors": "Greg Gardner",
    "platforms": {
        "ios": "8.0"
    },
    "source": {
        "git": "https://github.com/cromulentlabs/CLMediaPicker.git",
        "tag": "0.5"
    },
    "frameworks": "Foundation",
    "source_files": [
        "CLMediaPicker/**/*.{h,m}",
        "Foundation",
        "UIKit",
        "MediaPlayer"
    ],
    "requires_arc": true,
    "resource_bundles": {
        "CLMediaPickerLocalization": [
            "CLMediaPicker/CLMediaPickerLocalization.bundle/**"
        ]
    },
    "resources": [
        "CLMediaPicker/CLMediaPickerImages.xcassets"
    ]
}

Pin It on Pinterest

Share This