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.
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.
SCLPlayer is built for iOS 7 and above.
SCLPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "SCLPlayer"
Eric Robinson, eric DOT robinson AT me.com
SCLPlayer is available under the MIT license. See the LICENSE file for more info.
SCLPlayer was developed for the lWlVl Festival app. (It's the bit at the bottom)