首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"nw_endpoint_flow_copy_multipath_subflow_counts在非多路径连接上调用,导致搜索栏出现问题

"nw_endpoint_flow_copy_multipath_subflow_counts在非多路径连接上调用,导致搜索栏出现问题
EN

Stack Overflow用户
提问于 2019-11-18 15:35:49
回答 2查看 2K关注 0票数 3

我正在构建一个广播/播客流媒体应用程序,并且在输出终端中得到了以下注释。我一直忽略它,因为它似乎没有影响任何事情,但现在它似乎影响了我使用UISlider作为搜索栏,以便在曲目中跳过更远或更早。我知道多路径是为了帮助数据流从wifi无缝传输到4G,但我不知道如何在我的播放器中实现它。

我的播放器如下所示,它接受音频的URL作为参数

代码语言:javascript
复制
func loadRadio(radioURL: String) {


        guard let url = URL.init(string: radioURL) else { return }


        if let playerItem = self.playerItem {
            playerItem.removeObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), context: &playerItemContext)
        }

        let playerItem = AVPlayerItem.init(url: url)
        self.playerItem = playerItem
        playerItem.addObserver(self, forKeyPath: #keyPath(AVPlayerItem.status), options: [NSKeyValueObservingOptions.old, .new], context: &playerItemContext)
        AudioService.shared.player = AVPlayer.init(playerItem: playerItem)
        AudioService.shared.player?.automaticallyWaitsToMinimizeStalling = false;
        AudioService.shared.player?.play()


    }

它的文档在这里:https://developer.apple.com/documentation/foundation/urlsessionconfiguration/improving_network_reliability_using_multipath_tcp

但它的实现超出了我的能力范围。

要启用multipath service typehandover类型,我需要在代码中添加什么

EN

回答 2

Stack Overflow用户

发布于 2020-02-07 05:16:13

请参阅:Using an AVPlayer returns a "non-Multipath connection" error

这是iOS 13模拟器中的一个错误,苹果需要修复它

票数 4
EN

Stack Overflow用户

发布于 2019-11-21 01:27:08

通过查看文档,您似乎应该: 1)确保在您的项目设置中启用了多路径授权。2)将您的URLSessionConfiguration的multipathServiceType更改为.handover (他们说了一些其他的东西,而不是什么也没有)。

代码语言:javascript
复制
URLSessionConfiguration.default.multipathServiceType = .handover

MultipathServiceType.handover的定义:

https://developer.apple.com/documentation/foundation/urlsessionconfiguration/multipathservicetype

代码语言:javascript
复制
A Multipath TCP service that provides seamless handover between Wi-Fi and cellular in order to preserve the connection.

警告:我还没有测试它,只是按照文档的说明。

票数 -2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/58909866

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档