SCLPlayer 0.2.2

SCLPlayer 0.2.2

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

Maintained by Eric Robinson.



SCLPlayer 0.2.2

SCLPlayer is a UIWebView based wrapper for the SoundCloud HTML5 widget. It allows you to easily embed a SoundCloud player and message it from your Cocoa code.

Usage

To create a player...

[[SCLPlayerViewController alloc] initWithURL:<<SoundCloud URL>> configuration:nil]

To control the player...

- (void)play;
- (void)playTrackWithID:(NSString*)soundcloudTrackID;
- (void)pause;
- (void)next;
- (void)prev;
- (void)seekTo:(NSUInteger)milliseconds;
- (void)setVolume:(NSUInteger)volume;
- (void)toggle;

To query the player...

- (void)getSounds:(SCLPlayerResponseHandler)responseBlock;
- (void)getCurrentSound:(SCLPlayerResponseHandler)responseBlock;
- (void)getCurrentSoundIndex:(SCLPlayerResponseHandler)responseBlock;
- (void)getVolume:(SCLPlayerResponseHandler)responseBlock;
- (void)getDuration:(SCLPlayerResponseHandler)responseBlock;
- (void)getPosition:(SCLPlayerResponseHandler)responseBlock;

You can subscribe to events to update your UI based on user interaction with the player. The available notifications are...

SCLPlayerDidLoadNotification
SCLPlayerDidPlayNotification
SCLPlayerDidPauseNotification
SCLPlayerDidFinishNotification
SCLPlayerDidSeekNotification
SCLPlayerPlayProgressNotification
SCLPlayerLoadProgressNotification

You can also message the HTML5 player directly through SCLPlayer's UIWebView. The widget object is accessible through SCLPlayer.scPlayer()...

[sclPlayerInstance.webview stringByEvaluatingJavaScriptFromString:@"SCLPlayer.scPlayer().play()"];

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

Requirements

SCLPlayer is built for iOS 7 and above.

Installation

Author

Eric Robinson, eric DOT robinson AT me.com

License

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