gpt4 book ai didi

ios - 播放(非库)Apple Music 内容 - 请求失败

转载 作者:行者123 更新时间:2023-12-02 02:42:56 26 4
gpt4 key购买 nike

我正在尝试使用以下代码播放专辑...

let predicate = MPMediaPropertyPredicate(value: "1459938538", forProperty: MPMediaItemPropertyAlbumPersistentID)
let iCloudPredicate = MPMediaPropertyPredicate(value: true, forProperty: MPMediaItemPropertyIsCloudItem)
let query = MPMediaQuery.albums()
query.filterPredicates = [predicate, iCloudPredicate]

let mp = MPMusicPlayerController.applicationMusicPlayer
mp.setQueue(with: query)
mp.play()

但是失败了

[SDKPlayback] -[MPMusicPlayerController prepareToPlay] timeout

[MediaRemote] MRC <MPCPlayerPath: route=<MPAVEndpointRoute: 0x280f1a280 name=iPhone uid=LOCAL> origin=iPhoneID bundleID=com.apple.MediaPlayer.RemotePlayerService playerID=MPMusicPlayerApplicationController>: Undo optimistic state [failed] command=Play error=Error Domain=MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0 (MRMediaRemoteCommandHandlerStatus = 1)" UserInfo={NSDebugDescription=Failed to send command 0 (MRMediaRemoteCommandHandlerStatus = 1), MPCPlayerErrorKeyMediaRemoteCommandHandlerStatus=1}

[SDKPlayback] -[MPMusicPlayerController play] completed error: Error Domain=MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0" UserInfo={NSDebugDescription=Failed to send command 0, NSUnderlyingError=0x28344c810 {Error Domain=MPCPlayerRequestErrorDomain Code=1000 "Failed to send command 0 (MRMediaRemoteCommandHandlerStatus = 1)" UserInfo={NSDebugDescription=Failed to send command 0 (MRMediaRemoteCommandHandlerStatus = 1), MPCPlayerErrorKeyMediaRemoteCommandHandlerStatus=1}}}

• 如果我删除谓词,它将正常播放本地相册。

•  SKCloudServiceController.requestAuthorization.authorized

• 设备同时具有 .musicCatalogPlayback.addToCloudMusicLibrary能力。

1459938538似乎是一个有效的 ID(适用于最新的麦当娜专辑 - https://music.apple.com/gb/album/madame-x-deluxe/1459938538)

关于如何播放不在我的音乐库中的专辑有任何提示吗?

最佳答案

MPMediaQuery 仅适用于库项目。您需要使用 Web Apple Music 搜索 API 来获取用于设置队列的商店 ID。

关于ios - 播放(非库)Apple Music 内容 - 请求失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56689237/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com