CocoaPods trunk is moving to be read-only. Read more on the blog, there are 18 months to go.
TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2015 |
Maintained by Lukasz Kasperek.
To run the example project, clone the repo, and run pod install
from the Example directory first.
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.
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;
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;
AUMediaPlayers requires ARC. Deployment target: iOS7. Requires AFNetworking dependency.
Thanks to AppUnite and @piotrbernad, who has authored the library class in major part.
lukasz.kasperek, [email protected]
AUMediaPlayer is available under the MIT license. See the LICENSE file for more info.