Add completed state

This commit is contained in:
Ryan Heise 2019-12-27 16:43:09 +11:00
parent ff20386e96
commit dfd1a193ed
4 changed files with 59 additions and 18 deletions

View file

@ -12,5 +12,6 @@ enum PlaybackState {
paused,
playing,
buffering,
connecting
connecting,
completed
};

View file

@ -164,7 +164,7 @@
queue:nil
usingBlock:^(NSNotification* note) {
NSLog(@"Reached play end time");
[self stop];
[self complete];
}
];
if (_player) {
@ -258,6 +258,14 @@
}];
}
- (void)complete {
[_player pause];
[_player seekToTime:CMTimeMake(0, 1000)
completionHandler:^(BOOL finished) {
[self setPlaybackState:completed];
}];
}
- (void)setVolume:(float)volume {
[_player setVolume:volume];
}