本文介绍了使用 AVPlayer 返回一个“非多路径连接"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 AVKit 播放 youtube 网址.

I'm using AVKit to play a youtube URL.

我在按钮操作中有此代码:

I have this code inside a button action:

 @IBAction func trailerButtonAction(_ sender: Any) {
    guard let youtubeUrl = youtubeURL else { return }
    let player = AVPlayer(url: youtubeUrl)
    let playerViewController = AVPlayerViewController()
    playerViewController.player = player

    present(playerViewController, animated: true) {
        player.play()
    }
}

URL 有效,但当我按下按钮时,视频不会停止加载,我在调试区域收到此消息:

The URL is valid, but when I press the button, the video doesn't stop loading and I'm getting this message on Debug area:

nw_endpoint_flow_copy_multipath_subflow_counts 在非多路径连接上调用

我发现 AVPlayer 不支持 YouTube 网址

I found that AVPlayer doesn't support youtube URL

推荐答案

我想说这个日志不一定相关.尝试在模拟器上播放时出现此错误,但在真实设备上没有发生.

I would say this log isn't necessarily relevant. I was getting this error when trying to playback on the simulator but it wasn't happening on a real device.

这篇关于使用 AVPlayer 返回一个“非多路径连接"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 15:07