AUMediaPlayer

AUMediaPlayer is a nice high level API for audio and video playback, both from network stream and local files.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

70

Maintenance

Last Commit

5yrs ago

Contributors

3

Package

Dependencies

1

License

MIT

Categories

Readme

AUMediaPlayer

CI Status Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Features

  • Audio playback (local file and network stream)
  • Video playback (local file and network stream)
  • Chromecast stream
  • Downloading and storing media files (playback occurs automatically from local file, if one is available)
  • Convenient, KVO based mechanism for desplayinf playback info to user
  • Shuffle
  • Repeat queue (or repeat one track endlessly...)
  • Background playback with built in interruptions (i.e. phone calls) management
  • Displaying media info on lock screen
  • Lock screen controls

AUMediaPlayer is a library allowing audio and video playback, both from network stream and local files. It features all the common stuff you may expect, like queues, shuffle, repeat. It has convenient progress observation mechanism based on KVO. It automatically sets media info for lock screen displaying and works with lock screen controls. It also manages interruptions. Library object is included as well. It allows to download and store media. Since then they are automatically played from local files.

From version 3.0 it also enables you to stream tracks from AUMediaLibrary to Chromecast.

AUMediaPlayer header files contain commented out code snippets, which allow you to setup whole playback mechanism quickly. Example project is also included.

alt tag

Some basic methods

AUMediaPlayer class

Play item:

- (void)playItem:(id<AUMediaItem>)item error:(NSError * __autoreleasing *)error;

Play queue:

- (void)playItemQueue:(id<AUMediaItemCollection>)collection error:(NSError * __autoreleasing *)error;

Play another item from current queue:

- (void)playItemFromCurrentQueueAtIndex:(NSUInteger)index;
- (BOOL)tryPlayingItemFromCurrentQueue:(id<AUMediaItem>)item;

Control playback:

- (void)play;
- (void)pause;
- (void)stop;
- (void)playNext;
- (void)playPrevious;

Seek to specific moment (value from 0 to 1):

- (void)seekToMoment:(double)moment;

Set shuffle and repeat options:

- (void)setShuffleOn:(BOOL)shuffle;
- (void)setRepeatMode:(AUMediaRepeatMode)repeat;
- (void)toggleRepeatMode;

AUMediaLibrary class

Download:

- (void *)downloadItem:(id<AUMediaItem>)item;
- (void)cancelDownloadForItem:(id<AUMediaItem>)item;
- (NSProgress *)progressObjectForItem:(id<AUMediaItem>)item;
- (void)downloadItemCollection:(id<AUMediaItemCollection>)collection;

Check status:

- (BOOL)itemIsDownloaded:(id<AUMediaItem>)item;
- (BOOL)itemCollectionIsDownloaded:(id<AUMediaItemCollection>)collection;

Get all items ot items from specific category (audio or video):

- (NSArray *)downloadingItems;
- (NSDictionary *)allExistingItems;
- (NSDictionary *)existingItemsForType:(AUMediaType)type;

Remove items:

- (void)removeItemFromLibrary:(id<AUMediaItem>)item error:(NSError * __autoreleasing*)error;
- (void)removeCollectionFromLibrary:(id<AUMediaItemCollection>)collecion error:(NSError * __autoreleasing*)error;
- (void)cleanLibraryError:(NSError * __autoreleasing*)error;

Requirements

AUMediaPlayers requires ARC. Deployment target: iOS7. Requires AFNetworking dependency.

Installation

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

pod "AUMediaPlayer"

Credits

Thanks to AppUnite and @piotrbernad, who has authored the library class in major part.

Author

lukasz.kasperek, lukasz.kasperek@appunite.com

License

AUMediaPlayer is available under the MIT license. See the LICENSE file for more info.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100