Inherits from NSObject
Declared in FSAudioController.h

Overview

FSAudioController is functionally equivalent to FSAudioStream with one addition: it can be directly fed with a playlist (PLS, M3U) URL or an RSS podcast feed. It determines the content type and forms a playlist for playback. Notice that this generates more traffic and is generally more slower than using an FSAudioStream directly.

It is also possible to construct a playlist by yourself by providing the playlist items. In this case see the methods for managing the playlist.

If you have a playlist with multiple items, FSAudioController attemps automatically preload the next item in the playlist. This helps to start the next item playback immediately without the need for the user to wait for buffering.

Notice that do not attempt to set your own blocks to the audio stream owned by the controller. FSAudioController uses the blocks internally and any user set blocks will be overwritten. Instead use the blocks offered by FSAudioController.

Properties

activeStream

The the active playing stream, which may change from time to time during the playback. In this way, do not set your own blocks to the stream but use the blocks provides by FSAudioController.

@property (readonly) FSAudioStream *activeStream

Discussion

The the active playing stream, which may change from time to time during the playback. In this way, do not set your own blocks to the stream but use the blocks provides by FSAudioController.

Declared In

FSAudioController.h

automaticAudioSessionHandlingEnabled

This property determines if automatic audio session handling is enabled. This is YES by default.

@property (nonatomic, assign) BOOL automaticAudioSessionHandlingEnabled

Discussion

This property determines if automatic audio session handling is enabled. This is YES by default.

Declared In

FSAudioController.h

configuration

This property holds the configuration used for the streaming.

@property (nonatomic, strong) FSStreamConfiguration *configuration

Discussion

This property holds the configuration used for the streaming.

Declared In

FSAudioController.h

currentPlaylistItem

The playlist item the controller is currently using.

@property (nonatomic, readonly) FSPlaylistItem *currentPlaylistItem

Discussion

The playlist item the controller is currently using.

Declared In

FSAudioController.h

delegate

Delegate.

@property (nonatomic, unsafe_unretained) IBOutlet id<FSAudioControllerDelegate> delegate

Discussion

Delegate.

Declared In

FSAudioController.h

enableDebugOutput

This property determines if the debug output is enabled. Disabled by default

@property (nonatomic, assign) BOOL enableDebugOutput

Discussion

This property determines if the debug output is enabled. Disabled by default

Declared In

FSAudioController.h

onFailure

Called upon a failure.

@property (copy) void ( ^ ) ( FSAudioStreamError error , NSString *errorDescription ) onFailure

Discussion

Called upon a failure.

Declared In

FSAudioController.h

onMetaDataAvailable

Called upon a meta data is available.

@property (copy) void ( ^ ) ( NSDictionary *metadata ) onMetaDataAvailable

Discussion

Called upon a meta data is available.

Declared In

FSAudioController.h

onStateChange

Called upon a state change.

@property (copy) void ( ^ ) ( FSAudioStreamState state ) onStateChange

Discussion

Called upon a state change.

Declared In

FSAudioController.h

preloadNextPlaylistItemAutomatically

This property determines if the next playlist item should be loaded automatically. This is YES by default.

@property (nonatomic, assign) BOOL preloadNextPlaylistItemAutomatically

Discussion

This property determines if the next playlist item should be loaded automatically. This is YES by default.

Declared In

FSAudioController.h

url

The controller URL.

@property (nonatomic, assign) NSURL *url

Discussion

The controller URL.

Declared In

FSAudioController.h

volume

This property holds the current playback volume of the stream, from 0.0 to 1.0.

@property (nonatomic, assign) float volume

Discussion

This property holds the current playback volume of the stream, from 0.0 to 1.0.

Note that the overall volume is still constrained by the volume set by the user! So the actual volume cannot be higher than the volume currently set by the user. For example, if requesting a volume of 0.5, then the volume will be 50% lower than the current playback volume set by the user.

Declared In

FSAudioController.h

Instance Methods

addItem:

Adds an item to the playlist.

- (void)addItem:(FSPlaylistItem *)item

Parameters

item

The playlist item to be added.

Discussion

Adds an item to the playlist.

Declared In

FSAudioController.h

countOfItems

Returns the count of playlist items.

- (NSUInteger)countOfItems

Discussion

Returns the count of playlist items.

Declared In

FSAudioController.h

hasNextItem

Returns if the current multiple-item playlist has next item

- (BOOL)hasNextItem

Discussion

Returns if the current multiple-item playlist has next item

Declared In

FSAudioController.h

hasPreviousItem

Returns if the current multiple-item playlist has Previous item

- (BOOL)hasPreviousItem

Discussion

Returns if the current multiple-item playlist has Previous item

Declared In

FSAudioController.h

initWithUrl:

Initializes the audio stream with an URL.

- (id)initWithUrl:(NSURL *)url

Parameters

url

The URL from which the stream data is retrieved.

Discussion

Initializes the audio stream with an URL.

Declared In

FSAudioController.h

insertItem:atIndex:

Adds an item to the playlist at a specific position.

- (void)insertItem:(FSPlaylistItem *)item atIndex:(NSInteger)index

Parameters

item

The playlist item to be added.

index

The location in the playlist to place the new item

Discussion

Adds an item to the playlist at a specific position.

Declared In

FSAudioController.h

isPlaying

Returns the playback status: YES if the stream is playing, NO otherwise.

- (BOOL)isPlaying

Discussion

Returns the playback status: YES if the stream is playing, NO otherwise.

Declared In

FSAudioController.h

moveItemAtIndex:toIndex:

Moves an item already in the playlist to a different position in the playlist

- (void)moveItemAtIndex:(NSUInteger)from toIndex:(NSUInteger)to

Parameters

from

The original index of the track to move

to

The destination of the the track at the index specified in from

Discussion

Moves an item already in the playlist to a different position in the playlist

Declared In

FSAudioController.h

pause

If the stream is playing, the stream playback is paused upon calling pause. Otherwise (the stream is paused), calling pause will continue the playback.

- (void)pause

Discussion

If the stream is playing, the stream playback is paused upon calling pause. Otherwise (the stream is paused), calling pause will continue the playback.

Declared In

FSAudioController.h

play

Starts playing the stream. Before the playback starts, the URL content type is checked and playlists resolved.

- (void)play

Discussion

Starts playing the stream. Before the playback starts, the URL content type is checked and playlists resolved.

Declared In

FSAudioController.h

playFromPlaylist:

Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem.

- (void)playFromPlaylist:(NSArray *)playlist

Parameters

playlist

The playlist items.

Discussion

Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem.

Declared In

FSAudioController.h

playFromPlaylist:itemIndex:

Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem. The playback starts from the given index in the playlist.

- (void)playFromPlaylist:(NSArray *)playlist itemIndex:(NSUInteger)index

Parameters

playlist

The playlist items.

index

The playlist index where to start playback from.

Discussion

Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem. The playback starts from the given index in the playlist.

Declared In

FSAudioController.h

playFromURL:

Starts playing the stream from an URL. Before the playback starts, the URL content type is checked and playlists resolved.

- (void)playFromURL:(NSURL *)url

Parameters

url

The URL from which the stream data is retrieved.

Discussion

Starts playing the stream from an URL. Before the playback starts, the URL content type is checked and playlists resolved.

Declared In

FSAudioController.h

playItemAtIndex:

Plays a playlist item at the specified index.

- (void)playItemAtIndex:(NSUInteger)index

Parameters

index

The playlist index where to start playback from.

Discussion

Plays a playlist item at the specified index.

Declared In

FSAudioController.h

playNextItem

Play the next item of multiple-item playlist

- (void)playNextItem

Discussion

Play the next item of multiple-item playlist

Declared In

FSAudioController.h

playPreviousItem

Play the previous item of multiple-item playlist

- (void)playPreviousItem

Discussion

Play the previous item of multiple-item playlist

Declared In

FSAudioController.h

removeItemAtIndex:

Removes a playlist item.

- (void)removeItemAtIndex:(NSUInteger)index

Parameters

index

The index of the playlist item to be removed.

Discussion

Removes a playlist item.

Declared In

FSAudioController.h

replaceItemAtIndex:withItem:

Replaces a playlist item.

- (void)replaceItemAtIndex:(NSUInteger)index withItem:(FSPlaylistItem *)item

Parameters

index

The index of the playlist item to be replaced.

item

The playlist item used the replace the existing one.

Discussion

Replaces a playlist item.

Declared In

FSAudioController.h

stop

Stops the stream playback.

- (void)stop

Discussion

Stops the stream playback.

Declared In

FSAudioController.h