3
我正在製作一個iPhone應用程序,並且想爲AVPlayer製作一個搜索欄。我想用UISlider來製作。我怎樣才能做到這一點?如何爲AVPlayer製作搜索欄
我正在製作一個iPhone應用程序,並且想爲AVPlayer製作一個搜索欄。我想用UISlider來製作。我怎樣才能做到這一點?如何爲AVPlayer製作搜索欄
您可以映射文件的持續時間由AVPlayer被髮揮到了UISlider的範圍內使用AVPlayer的duration
財產,並在滑塊位置設置AVPlayer的currentTime
變化(最大值和最小值)。
更改由滑塊值歌曲的電流持續時間
- (IBAction)currentTimeSliderTouchUpInside:(id)sender
{
[self.player stop];
self.player.currentTime = self.currentTimeSlider.value;
[self.player prepareToPlay];
[self play:self];
}
我將如何讓他們更改時間 –
「......變化的滑塊位置設置AVPlayer的'currentTime'。」 - 只是引用自己。 – MiguelB
對不起,以爲你的意思是從currentTime獲得當前時間 –