多くのトピックがあることは知っていますが、私の問題の解決策を見つけることはできません。NSDateとAVPlayerItem.currentTime
私はAVPlayerItemを持っています。私はcurrentTimeプロパティ(CMTime)を私の音楽プレーヤーのための読みやすいフォーマットに変換します。
これは私のコードです:
NSDate *seconds = [[NSDate alloc] initWithTimeIntervalSinceNow:CMTimeGetSeconds(self.playerItem.currentTime)];
NSDateFormatter *timeFormatter = [[NSDateFormatter alloc] init];
[timeFormatter setDateFormat:@"HH:mm:ss"];
self.currentTimeLabel.text = [NSString stringWithFormat:@"%@", [timeFormatter stringFromDate:seconds]];
それは動作しますが、それは演奏時間に1時間を追加します。どのように私はその時間を引くことができますか?
thx!