【干货】基于流,自带缓存功能的播放器Labrador

Labrador.

https://github.com/czqasngit/Labrador

timg

A complete audio player with a modular design that can be replaced with different components to suit different needs. A decoder and two data providers have been implemented
一个完整的音频播放器,采用了组件化的设计,可按需要替换不同的组件以适应不同的需求。目前已经实现了一个解码器和两个数据提供器

Labrador3

Extensions

1.The decoder can use FFmpeg to support more formats
2.Data provider can be based on Samba with FTP or more
1.解码器可以使用FFmpeg来支持更多格式
2.Data提供程序可以基于Samba和FTP或更多

Futues

1.Local file play
2.Network stream play and cache
3.Segmentation cache

1.本地文件播放
2.网络文件播放
3.分段缓存

Usage(Objective-C)

- (IBAction)play:(id)sender {
    if(_player) {
        [_player prepare] ;
    return;
    }
    _player = [[LabradorHTTPAudioPlayer alloc] initWithURLString:@""] ;
//    _player = [[LabradorLocalAudioPlayer alloc] init] ;
    _player.delegate = self ;
    [_player prepare] ;
}
- (IBAction)pause:(id)sender {
    [_player pause] ;
}
- (IBAction)resume:(id)sender {
    [_player resume] ;
}

- (IBAction)stop:(id)sender {
    [_player stop] ;
}
- (void)labradorAudioPlayerPrepared:(LabradorAudioPlayer *)player ;
- (void)labradorAudioPlayerWithError:(NSError *)error player:(LabradorAudioPlayer *)player ;
- (void)labradorAudioPlayerDidFinishPlaying:(LabradorAudioPlayer *)player successfully:(BOOL)successfully ;
- (void)labradorAudioPlayerPlaying:(LabradorAudioPlayer *)player playTime:(float)playTime ;
- (void)labradorAudioPlayerCachingPercent:(LabradorAudioPlayer *)player percent:(float)percent ;
- (void)labradorAudioPlayerLoading:(LabradorAudioPlayer *)player ;
- (void)labradorAudioPlayerResumePlayFromLoading:(LabradorAudioPlayer *)player ;

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Installation

Labrador is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'Labrador'

Author

czqasn, czqasn_6@163.com

License

Labrador is available under the MIT license. See the LICENSE file for more info.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 12,181评论 0 10
  • 姥姥说:“心闲着闲着就麻了,麻了就跳得慢了,慢了就上床躺着,躺着就是心脏有病了。” 读这本书,收获很大,也很喜欢倪...
    今天安好阅读 1,481评论 0 0
  • 卵»»»»幼虫 阶段
    钰玥阅读 2,662评论 0 0
  • 暴风雨过后,本来想毁掉所有,想不顾一切,用摧毁告诉所有人:你们辜负了我,我对你们充满了恨! 还好,残存的一点理智告...
    小乐小约阅读 1,504评论 3 0
  • 《司徒》 王中旺 天高云飞扬,地厚草木深。 古筝唱三晋,长袖舞汉唐。 晋豫衣带水,秦赵积怨长。 人生如草木,青史若...
    风雨太行阅读 2,994评论 1 3

友情链接更多精彩内容