diff --git a/XYQPlayer/Source.bundle/Root.plist b/XYQPlayer/Source.bundle/Root.plist deleted file mode 100644 index b1b6fea..0000000 --- a/XYQPlayer/Source.bundle/Root.plist +++ /dev/null @@ -1,61 +0,0 @@ - - - - - StringsTable - Root - PreferenceSpecifiers - - - Type - PSGroupSpecifier - Title - Group - - - Type - PSTextFieldSpecifier - Title - Name - Key - name_preference - DefaultValue - - IsSecure - - KeyboardType - Alphabet - AutocapitalizationType - None - AutocorrectionType - No - - - Type - PSToggleSwitchSpecifier - Title - Enabled - Key - enabled_preference - DefaultValue - - - - Type - PSSliderSpecifier - Key - slider_preference - DefaultValue - 0.5 - MinimumValue - 0 - MaximumValue - 1 - MinimumValueImage - - MaximumValueImage - - - - - diff --git a/XYQPlayer/Source.bundle/en.lproj/Root.strings b/XYQPlayer/Source.bundle/en.lproj/Root.strings deleted file mode 100644 index 8cd87b9..0000000 Binary files a/XYQPlayer/Source.bundle/en.lproj/Root.strings and /dev/null differ diff --git a/XYQPlayer/XYQAudioToolView.m b/XYQPlayer/XYQAudioToolView.m index c369eec..f038658 100644 --- a/XYQPlayer/XYQAudioToolView.m +++ b/XYQPlayer/XYQAudioToolView.m @@ -86,7 +86,7 @@ +(instancetype)openAudioPlayerView:(NSArray *)musicArr audioPlayerViewController audioView.musicArr = musicArr; audioView.containViewController = controller; audioView.bgView = [[UIImageView alloc] initWithFrame:controller.view.bounds]; - audioView.bgView.image = [UIImage imageNamed:@"Source.bundle/source/audiobook_bg_icon"]; + audioView.bgView.image = [UIImage imageNamed:@"audiobook_bg_icon"]; [controller.view addSubview:audioView.bgView]; [controller.view addSubview:audioView]; @@ -102,8 +102,8 @@ - (void)setupSubView{ //播放、暂停 self.playOrStopButton = [[UIButton alloc] init]; [self.playOrStopButton addTarget:self action:@selector(playOrPauseButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; - [self.playOrStopButton setImage:[UIImage imageNamed:@"Source.bundle/source/audiobook_start_blue_icon"] forState:UIControlStateNormal]; - [self.playOrStopButton setImage:[UIImage imageNamed:@"Source.bundle/source/audiobook_stop_blue_icon"] forState:UIControlStateSelected]; + [self.playOrStopButton setImage:[UIImage imageNamed:@"audiobook_start_blue_icon"] forState:UIControlStateNormal]; + [self.playOrStopButton setImage:[UIImage imageNamed:@"audiobook_stop_blue_icon"] forState:UIControlStateSelected]; self.playOrStopButton.selected = NO; [self addSubview:self.playOrStopButton]; @@ -111,21 +111,21 @@ - (void)setupSubView{ //上一首 self.preVButton = [[UIButton alloc] init]; [self.preVButton addTarget:self action:@selector(preVButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; - [self.preVButton setImage:[UIImage imageNamed:@"Source.bundle/source/audiobook_last_icon"] forState:UIControlStateNormal]; + [self.preVButton setImage:[UIImage imageNamed:@"audiobook_last_icon"] forState:UIControlStateNormal]; [self addSubview:self.preVButton]; //下一首 self.nextButton = [[UIButton alloc]init]; [self.nextButton addTarget:self action:@selector(nextButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; - [self.nextButton setImage:[UIImage imageNamed:@"Source.bundle/source/audiobook_next_icon"] forState:UIControlStateNormal]; + [self.nextButton setImage:[UIImage imageNamed:@"audiobook_next_icon"] forState:UIControlStateNormal]; [self addSubview:self.nextButton]; //光盘 self.lightDisk = [[UIImageView alloc]init]; self.lightDisk.contentMode = UIViewContentModeScaleAspectFit; - self.lightDisk.image = [UIImage createRoundedRectImage:[UIImage imageNamed:@"Source.bundle/source/audiobook_bg_icon"] size:CGSizeMake(180, 180) radius:90]; + self.lightDisk.image = [UIImage createRoundedRectImage:[UIImage imageNamed:@"audiobook_bg_icon"] size:CGSizeMake(180, 180) radius:90]; [self addSubview:self.lightDisk]; //进度条 @@ -217,6 +217,12 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ #pragma mark - 播放或者暂停播放 - (void)playOrPauseButtonPressed:(UIButton *)sender{ + + //不能为空 + if (self.musicArr.count == 0) { + return; + } + //获取当前播放器 [XYQAudioTool waitPlayingStateCallBack:^(AVAudioPlayer *audioPlayer) { NSLog(@"%@",audioPlayer); @@ -234,6 +240,12 @@ - (void)playOrPauseButtonPressed:(UIButton *)sender{ #pragma mark - 手动切换上一首 - (void)preVButtonPressed:(UIButton *)sender{ + + //不能为空 + if (self.musicArr.count == 0) { + return; + } + if (self.musicArr.count==1 || currentIndex == 0) { [XYQHUDView showHud:@"已经是第一首"]; return; @@ -248,6 +260,12 @@ - (void)preVButtonPressed:(UIButton *)sender{ #pragma mark - 手动切换下一首 - (void)nextButtonPressed:(UIButton *)sender{ + + //不能为空 + if (self.musicArr.count == 0) { + return; + } + if (self.musicArr.count==1 || currentIndex == self.musicArr.count-1) { [XYQHUDView showHud:@"已经是最后一首"]; return; diff --git a/XYQPlayerExample/XYQPlayer/PlayMusicViewController.m b/XYQPlayerExample/XYQPlayer/PlayMusicViewController.m index 2b658fe..14bae78 100644 --- a/XYQPlayerExample/XYQPlayer/PlayMusicViewController.m +++ b/XYQPlayerExample/XYQPlayer/PlayMusicViewController.m @@ -22,10 +22,9 @@ - (void)viewDidLoad { //1、网络音乐 //[self testPlay_Local_URL_Music:@[@"http://120.25.226.186:32812/xxx/minion_02.mp3"]]; - [self testPlay_Local_URL_Music:@[@"http://120.25.226.186:32812/resources/videos/minion_02.mp4"]]; //2、本地音乐 - //[self testPlay_Bundle_Music:[self musicArray]]; + [self testPlay_Bundle_Music:[self musicArray]]; } diff --git a/XYQPlayerExample/XYQPlayer/XYQPlayer/XYQAudioToolView.m b/XYQPlayerExample/XYQPlayer/XYQPlayer/XYQAudioToolView.m index c369eec..4d42b07 100644 --- a/XYQPlayerExample/XYQPlayer/XYQPlayer/XYQAudioToolView.m +++ b/XYQPlayerExample/XYQPlayer/XYQPlayer/XYQAudioToolView.m @@ -217,6 +217,11 @@ -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ #pragma mark - 播放或者暂停播放 - (void)playOrPauseButtonPressed:(UIButton *)sender{ + //不能为空 + if (self.musicArr.count == 0) { + return; + } + //获取当前播放器 [XYQAudioTool waitPlayingStateCallBack:^(AVAudioPlayer *audioPlayer) { NSLog(@"%@",audioPlayer); @@ -234,6 +239,12 @@ - (void)playOrPauseButtonPressed:(UIButton *)sender{ #pragma mark - 手动切换上一首 - (void)preVButtonPressed:(UIButton *)sender{ + + //不能为空 + if (self.musicArr.count == 0) { + return; + } + if (self.musicArr.count==1 || currentIndex == 0) { [XYQHUDView showHud:@"已经是第一首"]; return; @@ -248,6 +259,12 @@ - (void)preVButtonPressed:(UIButton *)sender{ #pragma mark - 手动切换下一首 - (void)nextButtonPressed:(UIButton *)sender{ + + //不能为空 + if (self.musicArr.count == 0) { + return; + } + if (self.musicArr.count==1 || currentIndex == self.musicArr.count-1) { [XYQHUDView showHud:@"已经是最后一首"]; return;