With tvOS 10 setting the nowPlayingInfo worked without error and it showed the new infos on the top right corner above the screen saver of tvOS.
With tvOS 11 i see this error in Xcode and no playing info is displayed on top of the screen saver:
2017-07-12 16:41:45.454945+0200 radio.net[277:19185] [Default] No LanguageDataSource for item <TVPMPNowPlayingContentItem: 0x1c44b4be0 id=8BAFBBD6-9A4E-466E-9D8D-4D93C02434A9 title="Born in the U.S.A. / Bruce Springsteen">
2017-07-12 16:41:45.457201+0200 radio.net[277:19185] [MediaRemote] Error Operation requires a client data source to have been registered. requesting item 8BAFBBD6-9A4E-466E-9D8D-4D93C02434A9 "Born in the U.S.A. / Bruce Springsteen" with <_MRPlaybackQueueRequestProtobuf: 0x1c4291490> {
includeLanguageOptions = 1;
length = 1;
location = 0;
requestID = "718E8BAC-0317-43B8-A93C-BB29601DDB29";
returnContentItemAssetsInUserCompletion = 1;
} at indexPath (
0
)
I guess i have to set the LanguageDataSource? I did not find out how to do this yet. Also, what does client data source mean?
What do i have to do to let the nowPlayingInfo appear for my app on tvOS 11?
The code is this:
func updateNowPlaying(title:String, artworkImageURL:String) {
var currentlyPlayingTrackInfo: [String : Any]?
var image:UIImage = UIImage(named: "radio.png")!
let url = URL(string: artworkImageURL)
let data = try? Data(contentsOf: url!)
if (data != nil) {
image = UIImage(data: data!)!
}
let artwork = MPMediaItemArtwork.init(boundsSize: image.size, requestHandler: { (size) -> UIImage in
return image
})
currentlyPlayingTrackInfo = [MPMediaItemPropertyTitle: title,
MPMediaItemPropertyMediaType: MPNowPlayingInfoMediaType.audio.rawValue,
MPMediaItemPropertyArtwork: artwork]
MPNowPlayingInfoCenter.default().nowPlayingInfo = currentlyPlayingTrackInfo
}
In Xcode debug output i can see this:
[MediaRemote] [NowPlayingInfo] Ignoring nowPlayingInfo update because playback queue callbacks are set