|
@@ -137,7 +137,7 @@ NSURL * MKRUrlWithString(NSString *string){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-- (void)next{
|
|
|
+- (void)nextWhenPlayDidEnd{
|
|
|
if (!self.playList.count) return;
|
|
|
[self resetPlayer];
|
|
|
switch (_playMode) {
|
|
@@ -151,16 +151,25 @@ NSURL * MKRUrlWithString(NSString *string){
|
|
|
break;
|
|
|
case MKRAVPlayerPlayModeOrder:
|
|
|
default:{
|
|
|
- NSInteger index = self.currentIndex + 1;
|
|
|
- if (index > self.playList.count - 1) {
|
|
|
- index = 0;
|
|
|
- }
|
|
|
- [self playAtIndex:index];
|
|
|
+ [self next];
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+- (void)next{
|
|
|
+ if (_playMode == MKRAVPlayerPlayModeRandom) {
|
|
|
+ [self nextWhenPlayDidEnd];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ [self resetPlayer];
|
|
|
+ NSInteger index = self.currentIndex + 1;
|
|
|
+ if (index > self.playList.count - 1) {
|
|
|
+ index = 0;
|
|
|
+ }
|
|
|
+ [self playAtIndex:index];
|
|
|
+}
|
|
|
+
|
|
|
- (void)previous{
|
|
|
if (!self.playList.count) return;
|
|
|
[self resetPlayer];
|
|
@@ -309,6 +318,9 @@ NSURL * MKRUrlWithString(NSString *string){
|
|
|
|
|
|
- (void)playerItemFailedToPlayToEndTime:(NSNotification *)note{
|
|
|
NSLog(@"失败e没结束");
|
|
|
+ if (self.delegate && [self.delegate respondsToSelector:@selector(didFailedToPlayToEndTime)]) {
|
|
|
+ [self.delegate didFailedToPlayToEndTime];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)failedToPlayToEndTimeError:(NSNotification *)note{
|
|
@@ -321,6 +333,10 @@ NSURL * MKRUrlWithString(NSString *string){
|
|
|
self.seekTime = 0.0f;
|
|
|
self.isSeeking = NO;
|
|
|
[self next];
|
|
|
+ [self nextWhenPlayDidEnd];
|
|
|
+ if (self.delegate && [self.delegate respondsToSelector:@selector(didFinishPlay:)]) {
|
|
|
+ [self.delegate didFinishPlay:self.currentIndex];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#pragma mark - setter
|