All Projects → NoonPacific → NPAudioStream

NoonPacific / NPAudioStream

Licence: MIT license
Continuously stream a playlist of audio through a lightweight Objective-C library.

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to NPAudioStream

Player
▶️ video player in Swift, simple way to play and stream media on iOS/tvOS
Stars: ✭ 1,849 (+7939.13%)
Mutual labels:  stream, tvos
Pbjvideoplayer
▶️ video player, simple way to play and stream media on iOS/tvOS
Stars: ✭ 620 (+2595.65%)
Mutual labels:  stream, tvos
xbvr
Tool to organize and stream your VR porn library
Stars: ✭ 186 (+708.7%)
Mutual labels:  stream
mst-effect
💫 Designed to be used with MobX-State-Tree to create asynchronous actions using RxJS.
Stars: ✭ 19 (-17.39%)
Mutual labels:  stream
aws-kinesis-consumer
Consume an AWS Kinesis Data Stream to look over the records from a terminal.
Stars: ✭ 23 (+0%)
Mutual labels:  stream
SDWebImageSVGKitPlugin
A SDWebImage plugin to support SVG with SVGKit and category
Stars: ✭ 15 (-34.78%)
Mutual labels:  tvos
SensorNode
SensorNode-client application for IOTA.
Stars: ✭ 35 (+52.17%)
Mutual labels:  stream
dot
distributed data sync with operational transformation/transforms
Stars: ✭ 73 (+217.39%)
Mutual labels:  stream
elasticbulk
Add data in bulk to elasticsearch. It supports data streaming from PostgreSQL or Filesystem
Stars: ✭ 27 (+17.39%)
Mutual labels:  stream
YOLO-Streaming
Push-pull streaming and Web display of YOLO series
Stars: ✭ 56 (+143.48%)
Mutual labels:  stream
android-chat-tutorial
Sample apps for the Stream Chat Android SDK's official tutorial
Stars: ✭ 44 (+91.3%)
Mutual labels:  stream
ngx-stream-request-module
基于ngx-stream-module 实现长连接的处理,把长连接数据按照使用的协议转切分为请求(request),与后端服务器使用短连接通讯,完全兼容后端http协议。后端服务器使用推送协议可以很方便的把数据推送到客户端。
Stars: ✭ 15 (-34.78%)
Mutual labels:  stream
SwiftCurrent
A library for managing complex workflows in Swift
Stars: ✭ 286 (+1143.48%)
Mutual labels:  tvos
GoogleMapsTileOverlay
GoogleMapsTileOverlay lets you customize Apple Maps MKMapView with the Google Maps StylingWizard
Stars: ✭ 68 (+195.65%)
Mutual labels:  tvos
papilo
DEPRECATED: Stream data processing micro-framework
Stars: ✭ 24 (+4.35%)
Mutual labels:  stream
KeyboardKitPro
KeyboardKit Pro extends KeyboardKit with pro features.
Stars: ✭ 42 (+82.61%)
Mutual labels:  tvos
AnimeDLR
AnimeDLR
Stars: ✭ 47 (+104.35%)
Mutual labels:  stream
http-emitter
📡 Emitting psr-7 responses.
Stars: ✭ 31 (+34.78%)
Mutual labels:  stream
lwt-pipe
[beta] A multi-consumer, multi-producers blocking queue and stream for Lwt
Stars: ✭ 30 (+30.43%)
Mutual labels:  stream
plugin.video.sendtokodi
📺 plays various stream sites on kodi using youtube-dl
Stars: ✭ 86 (+273.91%)
Mutual labels:  stream

NPAudioStream

Carthage Compatible Version License Platform Twitter

NPAudioStream is a lightweight Objective-C library to continuously stream a playlist of audio on iOS, tvOS, and macOS. NPAudioStream excels at maintaining audio playback over a poor network connection.

Features

  • Audio controls represent the most common music interface behaviors (e.g. play, pause, skip, seek, shuffle).
  • Array/index style of url management elegantly binds to table view selection.
  • Optionally prebuffer the next track, even when shuffling.
  • Detect when a source is not streamable and automatically skip to the next song in the stream.
  • Repeat functionality supports one track or the whole stream.
  • Shuffle functionality mimics iPod behavior.

iOS only

  • Manages background tasks to ensure your app remains active during network interruptions
  • Pauses and resumes playback in response to a phone call interruption

Installation

CocoaPods

The recommended method of installation is through CocoaPods. Add the following line to your Podfile, then run pod install.

Podfile

pod 'NPAudioStream', '~> 1.0'

For iOS, be sure to add support for background audio as well.

Carthage

Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.

You can install Carthage with Homebrew using the following command:

$ brew update
$ brew install carthage

To integrate NPAudioStream into your Xcode project using Carthage, specify it in your Cartfile:

github "NoonPacific/NPAudioStream" ~> 1.1

Run carthage update to build the framework and drag the built NPAudioStream.framework into your Xcode project.

Manual Installation

  1. Download NPAudioStream
  2. Drag the NPAudioStream directory into your Xcode project, and ensure the files are copied into your project's directory.
  3. In your Xcode project, navigate to Target > Build Phases > Link Binary with Libraries and add the AVFoundation framework.
  4. For iOS, be sure to add support for background audio.

Basic Example

The simplest usage of NPAudioStream involves creating an instance, populating the urls property, then selecting an index for playback. NPAudioStream was built with the intention of streaming SoundCloud audio, so the following example demonstrates how to stream an array of SoundCloud URLs on iOS.

Note: Be sure to replace YOUR_CLIENT_ID with your own SoundCloud Client ID.

AppDelegate.m

#import "NPAudioStream.h"

@implementation AppDelegate {
    NPAudioStream *audioStream;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    audioStream = [NPAudioStream new];

    NSArray *urlStrings = @[@"https://api.soundcloud.com/tracks/216878983/stream",
                            @"https://api.soundcloud.com/tracks/215647717/stream",
                            @"https://api.soundcloud.com/tracks/218064667/stream",
                            @"https://api.soundcloud.com/tracks/206986247/stream"
                            ];

    NSMutableArray *urls = [NSMutableArray arrayWithCapacity:urlStrings.count];

    // append SoundCloud Client ID and create NSURL objects
    for (NSString *urlString in urlStrings) {
        NSString *streamURLString = [NSString stringWithFormat:@"%@?client_id=YOUR_CLIENT_ID", urlString];
        NSURL *url = [NSURL URLWithString:streamURLString];
        [urls addObject:url];
    }

    [audioStream setUrls:urls];
    [audioStream selectIndexForPlayback:0];

    return YES;
}

@end

Example Projects

NPAudioStream includes a workspace with two example projects - one for macOS and one for iOS (tvOS coming later). These projects showcase the most common patterns to build a music interface.

Add your SoundCloud Client ID

These examples use SoundCloud URLs, thus a SoundCloud Client ID is required. In the root directory, duplicate the file named keys-example.json, rename the new file to keys.json, then add your SC Client ID to keys.json.

Device support

NPAudioStream supports iOS 8.0+, tvOS 9.0+, and macOS 10.8+.

About

NPAudioStream is created and maintained by Alex Givens for Noon Pacific – the chillest way to discover new music every Monday 🌴

NPAudioStream is released under the MIT license. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].