如何播放30秒的avplayeritem?

时间:2016-03-27 07:16:27

标签: ios swift avplayer

我可以播放整首歌曲,但我想只播放30秒。我该怎么做?

if let url: String = "hiddingthelink"{

        let urlplayer = NSURL(string: url)
        let playeritem = AVPlayerItem(URL:(urlplayer)!)
        player = AVPlayer(playerItem: playeritem)
        self.player.volume = 1.0
        self.player.rate = 1.0
        self.player.play()
    }

0 个答案:

没有答案