ビデオをそのまま再生する場合KVO
に追加AVPlayer
queuePlayer
AVPlayer
[self.queuePlayer addObserver:self forKeyPath:@"status" options:0 context:NULL];
observer
method
:
-(void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([keyPath isEqualToString:@"status"]) {
if (self.queuePlayer.status == AVPlayerStatusReadyToPlay) {
NSInteger step = (NSInteger)(startTimeForVideo/0.04);
[self.queuePlayer.currentItem stepByCount:step];
//CMTime seekTime = CMTimeMake(startTimeForVideo*timeScale,timeScale);
//if (CMTIME_IS_VALID(seekTime))
// [self.queuePlayer seekToTime:seekTime toleranceBefore:kCMTimePositiveInfinity toleranceAfter:kCMTimePositiveInfinity];
//else
// NSLog(@"In valid time");
[self.queuePlayer play];
} else if (self.queuePlayer.status == AVPlayerStatusFailed) {
/* An error was encountered */
}
}
ここにstartTimeForVideo
イニシャルplayBack time
video
seekToTime
どちらも機能していませんstepByCount
EDIT :Values
でobject
使用されてmethods
いるcorrect
no luck