To run the example project, clone the repo, and run pod install
from the Example directory first.
#define LWImageBundle(obj) ([NSBundle bundleWithPath:[[NSBundle bundleForClass:[obj class]] pathForResource:@"LWAudioPlayer" ofType:@"bundle"]] ?: ([NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"LWAudioPlayer " ofType:@"bundle"]] ?: [NSBundle mainBundle]))
#define UIImageWithName(name,obj) ([UIImage imageNamed:name inBundle:LWImageBundle(obj) compatibleWithTraitCollection:nil])
self.audioPlayerView = [LWAudioPlayerView new];
self.audioPlayerView.dataSource = self;
[self.view addSubview:self.audioPlayerView];
[self.audioPlayerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.height.mas_equalTo(75);
}];
LWAudioPlayer is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'LWAudioPlayer'
Carthage
github "luowei/LWAudioPlayer"
self.audioPlayerView = [LWAudioPlayerView new];
self.audioPlayerView.dataSource = self;
[self.view addSubview:self.audioPlayerView];
[self.audioPlayerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.bottom.equalTo(self.view);
make.height.mas_equalTo(75);
}];
#pragma mark - LWAudioPlayerDataSource
//获得播放列表,扁平化的ItemList
-(NSArray <ListItem *>*)flatItemList:(NSArray <ListItem *>*)itemList withType:(NSString *)type {
//todo: 列表数据
return nil;
}
luowei, luowei@wodedata.com
LWAudioPlayer is available under the MIT license. See the LICENSE file for more info.