我有使用AVPlayervewcontroller播放視頻,但我面臨着暫停視頻的問題。 它有一種方法來停止視頻比從beging開始,但我想暫停視頻。如何在AVPlayervewcontroller中暫停視頻?
請給我一些想法,我該如何做到這一點? Thanx
我有使用AVPlayervewcontroller播放視頻,但我面臨着暫停視頻的問題。 它有一種方法來停止視頻比從beging開始,但我想暫停視頻。如何在AVPlayervewcontroller中暫停視頻?
請給我一些想法,我該如何做到這一點? Thanx
AVPlayerViewController有一個AVPlayer(它的player
)。告訴玩家pause
,或將玩家的rate
設置爲0
。這會暫停視頻而不重置其播放頭位置。
AVplayerviewcontroller has audioPlayer
property which which access the Player Object。要管理播放,請使用pause
方法。閱讀完整的文檔: - https://developer.apple.com/reference/avfoundation/avplayer/1387895-pause
代碼例子以供參考: -
audioPlayer.pause()
你能否解釋一下你說什麼我沒得到什麼? –
不,我說過的一切都有說。 – matt