做一个音乐播放器应用程序!上一首和下一首曲目
如何在不使用 iPod 库的情况下制作 iphone 的应用程序,并执行下一首歌曲和上一首歌曲?
我认为最好的方法是用歌曲做一个数组,但我不知道该怎么做。有人可以帮助我吗?
我的应用程序正在运行,具有暂停、播放、当前时间和音量滑块...但是下一首歌曲的这一部分我真的不知道!
- (void)viewDidLoad {
//initialize string to the path of the song in the resource folder
NSString *myMusic = [[NSBundle mainBundle]pathForResource:@"gastando" ofType:@"mp3"];
player = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:myMusic] error:NULL];
player.numberOfLoops = 0;
player.volume = slider.value;
timeSlider.maximumValue = player.duration;
timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(timeLoader) userInfo:nil repeats:YES];
[super viewDidLoad];
}
How can I make a app to iphone without using ipod library, and doing the next song and the previous song??
I think the best way is doing an array with the songs, but I don't know how to do. Someone can helps me??
My app is working, with pause, play, current time and volume slider... but this part of next song I really don't know!
- (void)viewDidLoad {
//initialize string to the path of the song in the resource folder
NSString *myMusic = [[NSBundle mainBundle]pathForResource:@"gastando" ofType:@"mp3"];
player = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:myMusic] error:NULL];
player.numberOfLoops = 0;
player.volume = slider.value;
timeSlider.maximumValue = player.duration;
timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(timeLoader) userInfo:nil repeats:YES];
[super viewDidLoad];
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)