我在控制台中看到以下错误。
WARNING: Unexpected type for now playing key kMRMediaRemoteNowPlayingInfoDuration (is CFType, should be CFNumber). Removing from now playing info dictionary.
有人知道我做错了什么吗?
if let duration = player.currentItem?.asset.duration {
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration
}
最佳答案
我遇到了同样的问题并解决了它找到以下解决方案:你忘记提及“.seconds”
if let currentItem = player.currentItem {
let duration = currentItem.asset.duration
nowPlayingInfo[MPMediaItemPropertyPlaybackDuration] = duration.seconds
}
关于ios - 警告 : Unexpected type for now playing key kMRMediaRemoteNowPlayingInfoDuration,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64307378/