【发布时间】:2013-02-12 05:57:23
【问题描述】:
这是我在 viewDidLoad 中的代码:
AVPlayerItem* playerItem = [AVPlayerItem playerItemWithURL:[NSURL URLWithString:@"http://groove.wavestreamer.com:7321/listen.pls?sid=1"]];
[playerItem addObserver:self forKeyPath:@"timedMetadata" options:NSKeyValueObservingOptionNew context:nil];
music = [[AVPlayer playerWithPlayerItem:playerItem] retain];
[music play];
我的问题:
如何创建一个按钮,当它被按下时快进/快退 5 秒?
感谢您的回答... :)
编辑:如何添加到当前时间...
CMTime currentTime = music.currentTime;
...5 秒?
【问题讨论】:
-
这是正确的方法吗? CMTime currentTime = music.currentTime; float audioCurrentSeconds = CMTimeGetSeconds(currentTime);音频电流秒 += 5.0; [音乐 seekToTime:audioCurrentSeconds toleranceBefore:kCMTimeZero toleranceAfter:kCMTimeZero];
标签: iphone ios xcode avplayer forward