如何在VLCMediaPlayer swift 4中循环播放视频?

时间:2018-09-11 11:37:31

标签: ios iphone swift ipad

func playURL(){
    mediaPlayer.drawable = self.mediaView
    let url = URL(string: "http://-------/media/conversation/animated_images/c720d4ad8a92bcfc505ac7f8ea50fd4e.webm")
    let media = VLCMedia(url: url!)
    mediaPlayer.media = media
    mediaPlayer.delegate = self
    mediaPlayer.play()

}

这是我的代码。视频在这里可以正常播放,但我想循环播放视频。

我该如何实现?

1 个答案:

答案 0 :(得分:0)

设置repeatMode属性:

mediaPlayer.repeatMode = VLCRepeatMode.VLCRepeatCurrentItem