tvOS nowPlayingInfo not showing - SOLVED
Posted: 01 Oct 2021 07:53
trying to display played media info on the apple tv "Notification Center" area:
using the nowPlayingInfo dictionary (i am using SwiftUI), but any working code sample would do, this is a sample code i found, but it's not working for me:
(seen on: https://docplayer.net/61615774-Now-play ... -tvos.html)
i tried yo put this code in the "playerTimeChanged" callback and in the player "onAppear" none of it worked
any ideas?
using the nowPlayingInfo dictionary (i am using SwiftUI), but any working code sample would do, this is a sample code i found, but it's not working for me:
Code: Select all
let center = MPNowPlayingInfoCenter.default()
center.nowPlayingInfo = [
MPMediaItemPropertyTitle: "Mastering UIKit on tvOS",
MPMediaItemPropertyArtist: "Apple",
MPMediaItemPropertyAlbumTitle: "WWDC 2016",
MPMediaItemPropertyMediaType: MPNowPlayingInfoMediaType.video.rawValue,
MPNowPlayingPlaybackState: MediaState
MPNowPlayingInfoPropertyElapsedPlaybackTime: 0.0,
MPMediaItemPropertyPlaybackDuration: 3300.0
]
i tried yo put this code in the "playerTimeChanged" callback and in the player "onAppear" none of it worked
any ideas?