FSAudioController Class Reference
| 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.
Tasks
-
– initWithUrl: -
– play -
– playFromURL: -
– playFromPlaylist: -
– playFromPlaylist:itemIndex: -
– playItemAtIndex: -
– countOfItems -
– addItem: -
– insertItem:atIndex: -
– moveItemAtIndex:toIndex: -
– replaceItemAtIndex:withItem: -
– removeItemAtIndex: -
– stop -
– pause -
– isPlaying -
– hasNextItem -
– hasPreviousItem -
– playNextItem -
– playPreviousItem -
volumeproperty -
urlproperty -
activeStreamproperty -
currentPlaylistItemproperty -
preloadNextPlaylistItemAutomaticallyproperty -
enableDebugOutputproperty -
automaticAudioSessionHandlingEnabledproperty -
configurationproperty -
onStateChangeproperty -
onMetaDataAvailableproperty -
onFailureproperty -
delegateproperty
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 *activeStreamDiscussion
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.hautomaticAudioSessionHandlingEnabled
This property determines if automatic audio session handling is enabled. This is YES by default.
@property (nonatomic, assign) BOOL automaticAudioSessionHandlingEnabledDiscussion
This property determines if automatic audio session handling is enabled. This is YES by default.
Declared In
FSAudioController.hconfiguration
This property holds the configuration used for the streaming.
@property (nonatomic, strong) FSStreamConfiguration *configurationDiscussion
This property holds the configuration used for the streaming.
Declared In
FSAudioController.hcurrentPlaylistItem
The playlist item the controller is currently using.
@property (nonatomic, readonly) FSPlaylistItem *currentPlaylistItemDiscussion
The playlist item the controller is currently using.
Declared In
FSAudioController.hdelegate
Delegate.
@property (nonatomic, unsafe_unretained) IBOutlet id<FSAudioControllerDelegate> delegateDiscussion
Delegate.
Declared In
FSAudioController.henableDebugOutput
This property determines if the debug output is enabled. Disabled by default
@property (nonatomic, assign) BOOL enableDebugOutputDiscussion
This property determines if the debug output is enabled. Disabled by default
Declared In
FSAudioController.honFailure
Called upon a failure.
@property (copy) void ( ^ ) ( FSAudioStreamError error , NSString *errorDescription ) onFailureDiscussion
Called upon a failure.
Declared In
FSAudioController.honMetaDataAvailable
Called upon a meta data is available.
@property (copy) void ( ^ ) ( NSDictionary *metadata ) onMetaDataAvailableDiscussion
Called upon a meta data is available.
Declared In
FSAudioController.honStateChange
Called upon a state change.
@property (copy) void ( ^ ) ( FSAudioStreamState state ) onStateChangeDiscussion
Called upon a state change.
Declared In
FSAudioController.hpreloadNextPlaylistItemAutomatically
This property determines if the next playlist item should be loaded automatically. This is YES by default.
@property (nonatomic, assign) BOOL preloadNextPlaylistItemAutomaticallyDiscussion
This property determines if the next playlist item should be loaded automatically. This is YES by default.
Declared In
FSAudioController.hurl
The controller URL.
@property (nonatomic, assign) NSURL *urlDiscussion
The controller URL.
Declared In
FSAudioController.hvolume
This property holds the current playback volume of the stream, from 0.0 to 1.0.
@property (nonatomic, assign) float volumeDiscussion
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.hInstance Methods
addItem:
Adds an item to the playlist.
- (void)addItem:(FSPlaylistItem *)itemParameters
- item
The playlist item to be added.
Discussion
Adds an item to the playlist.
Declared In
FSAudioController.hcountOfItems
Returns the count of playlist items.
- (NSUInteger)countOfItemsDiscussion
Returns the count of playlist items.
Declared In
FSAudioController.hhasNextItem
Returns if the current multiple-item playlist has next item
- (BOOL)hasNextItemDiscussion
Returns if the current multiple-item playlist has next item
Declared In
FSAudioController.hhasPreviousItem
Returns if the current multiple-item playlist has Previous item
- (BOOL)hasPreviousItemDiscussion
Returns if the current multiple-item playlist has Previous item
Declared In
FSAudioController.hinitWithUrl:
Initializes the audio stream with an URL.
- (id)initWithUrl:(NSURL *)urlParameters
- url
The URL from which the stream data is retrieved.
Discussion
Initializes the audio stream with an URL.
Declared In
FSAudioController.hinsertItem:atIndex:
Adds an item to the playlist at a specific position.
- (void)insertItem:(FSPlaylistItem *)item atIndex:(NSInteger)indexParameters
- 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.hisPlaying
Returns the playback status: YES if the stream is playing, NO otherwise.
- (BOOL)isPlayingDiscussion
Returns the playback status: YES if the stream is playing, NO otherwise.
Declared In
FSAudioController.hmoveItemAtIndex:toIndex:
Moves an item already in the playlist to a different position in the playlist
- (void)moveItemAtIndex:(NSUInteger)from toIndex:(NSUInteger)toParameters
- 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.hpause
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)pauseDiscussion
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.hplay
Starts playing the stream. Before the playback starts, the URL content type is checked and playlists resolved.
- (void)playDiscussion
Starts playing the stream. Before the playback starts, the URL content type is checked and playlists resolved.
Declared In
FSAudioController.hplayFromPlaylist:
Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem.
- (void)playFromPlaylist:(NSArray *)playlistParameters
- playlist
The playlist items.
Discussion
Starts playing the stream from the given playlist. Each item in the array must an FSPlaylistItem.
Declared In
FSAudioController.hplayFromPlaylist: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)indexParameters
- 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.hplayFromURL:
Starts playing the stream from an URL. Before the playback starts, the URL content type is checked and playlists resolved.
- (void)playFromURL:(NSURL *)urlParameters
- 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.hplayItemAtIndex:
Plays a playlist item at the specified index.
- (void)playItemAtIndex:(NSUInteger)indexParameters
- index
The playlist index where to start playback from.
Discussion
Plays a playlist item at the specified index.
Declared In
FSAudioController.hplayNextItem
Play the next item of multiple-item playlist
- (void)playNextItemDiscussion
Play the next item of multiple-item playlist
Declared In
FSAudioController.hplayPreviousItem
Play the previous item of multiple-item playlist
- (void)playPreviousItemDiscussion
Play the previous item of multiple-item playlist
Declared In
FSAudioController.hremoveItemAtIndex:
Removes a playlist item.
- (void)removeItemAtIndex:(NSUInteger)indexParameters
- index
The index of the playlist item to be removed.
Discussion
Removes a playlist item.
Declared In
FSAudioController.hreplaceItemAtIndex:withItem:
Replaces a playlist item.
- (void)replaceItemAtIndex:(NSUInteger)index withItem:(FSPlaylistItem *)itemParameters
- 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