0

我使用ijkplayer在我的 ios 应用程序中播放实时视频。

这是播放器初始化的代码

    let options = IJKFFOptions.byDefault()
    let streamUrl:String = "http://xxxxxxxxx.com/test/7777.flv"
    let player = IJKFFMoviePlayerController(contentURLString: streamUrl, with: options)
    let autoresize = UIViewAutoresizing.flexibleWidth.rawValue | UIViewAutoresizing.flexibleHeight.rawValue
    player?.view.autoresizingMask = UIViewAutoresizing(rawValue: autoresize)
    player?.view.frame = CGRect(x: 0, y: 0, width: 1, height: 1)
    let gesture = UITapGestureRecognizer(target: self, action: #selector(self.compressExpand(_:)))
    player?.view.addGestureRecognizer(gesture)
    player?.view.backgroundColor = UIColor.black
    player?.scalingMode = .aspectFit
    player?.shouldAutoplay = false
    self.player = player
    self.player.shouldShowHudView = true
    self.player.setPlayerOptionIntValue(1000, forKey: "max_cached_duration")

问题是我player.pause()用来恢复播放器一段时间。然后我player.play()用来恢复播放。然后从暂停的帧播放实时视频,我想要的是从最新或最新的帧恢复视频。

4

1 回答 1

0

您可以释放播放器,然后重新启动它。这应该从最新的帧播放演示。这可能不是最好的解决方案。

于 2017-07-14T06:35:48.413 回答