アプリケーションで次のコードを使用して、UISliderでの現在の再生時間と合計時間を取得したいのですが、このリンクからコードを取得します。
-(IBAction)sliding:(id)sender{
CMTime newTime = CMTimeMakeWithSeconds(seeker.value, 1);
[self.player seekToTime:newTime];
}
-(void)setSlider{
sliderTimer = [[NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateSlider) userInfo:nil repeats:YES]retain];
self.seeker.maximumValue = [self durationInSeconds];
[seeker addTarget:self action:@selector(sliding:) forControlEvents:UIControlEventValueChanged];
seeker.minimumValue = 0.0;
seeker.continuous = YES;
}
- (void)updateSlider {
self.seeker.maximumValue = [self durationInSeconds];
self.seeker.value = [self currentTimeInSeconds];
}
- (Float64)durationInSeconds {
Float64 dur = CMTimeGetSeconds(duration);
return dur;
}
- (Float64)currentTimeInSeconds {
Float64 dur = CMTimeGetSeconds([self.player currentTime]);
return dur;
}
しかし、私はシーカーが何であるかわかりません。私はiOSを初めて使用するので、この問題のチュートリアルに関する提案が必要です。