Giter Site home page Giter Site logo

joerocca / sclplayer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from eric-robinson/sclplayer

1.0 2.0 0.0 157 KB

A component for embedding a SoundCloud HTML5 widget in an iOS app.

License: MIT License

Ruby 0.81% Objective-C 89.92% C 0.83% Shell 3.57% HTML 4.86%

sclplayer's Introduction

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)

sclplayer's People

Contributors

eric-robinson avatar joerocca avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.