A component for embedding a SoundCloud HTML5 widget in an iOS app.
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Example
Pod
.gitignore
.travis.yml
LICENSE
README.md
SCLPlayer.podspec

README.md

SCLPlayer

Version License Platform

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

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

pod "SCLPlayer"

Author

Eric Robinson, eric DOT robinson AT me.com

License

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

Backstory / Screenshot

SCLPlayer was developed for the lWlVl Festival app. (It's the bit at the bottom)