Skip to content

Instantly share code, notes, and snippets.

@zac
Created April 19, 2012 04:03
Show Gist options
  • Save zac/2418465 to your computer and use it in GitHub Desktop.
Save zac/2418465 to your computer and use it in GitHub Desktop.
A very simple interface to playback audio from a URL.
typedef enum {
VLMStreamingPlaybackStatusStopped,
VLMStreamingPlaybackStatusPlaying,
VLMStreamingPlaybackStatusBuffering,
VLMStreamingPlaybackStatusCompleted
} VLMStreamingPlaybackStatus;
typedef void(^VLMStreamingPlaybackStatusCallback)(VLMStreamingPlaybackStatus status);
typedef void(^VLMStreamingPlaybackProgressCallback)(CGFloat fractionComplete);
typedef void(^VLMStreamingDownloadProgressCallback)(CGFloat fractionComplete);
typedef void(^VLMStreamingErrorCallback)(NSError *error);
@interface VLMStreamingAudioPlayer : NSObject
- (void)streamAndPlayAudioAtURL:(NSURL *)url
playbackStatus:(VLMStreamingPlaybackStatusCallback)playbackStatus
playbackProgress:(VLMStreamingPlaybackProgressCallback)playbackProgress
downloadProgress:(VLMStreamingDownloadProgressCallback)downloadProgress
error:(VLMStreamingErrorCallback)error;
- (void)stop;
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment