I am using an AVPlayerViewController to play an audio stream, on tvOS, and I am now wanting to have some associated artwork displayed at the same time.
I am not sure whether I should be somehow overlaying it on top or be telling the AVPlayerViewController about the artwork. If it is the latter I can't seem to see the right way to tell the AVPlayerViewController about it? Does anyone have indications as to an appropriate approach?
class StreamPlayerViewController: AVPlayerViewController
var playerItem:AVPlayerItem?
override func viewDidLoad() {
let videoURL = NSURL(string: "http://example.org/aac.m3u")
playerItem = AVPlayerItem(URL: videoURL!)
self.player=AVPlayer(playerItem: playerItem!)
let playerLayer=AVPlayerLayer(player: player)
playerLayer.frame=CGRectMake(0, 0, 300, 50)
self.view.layer.addSublayer(playerLayer)
// TODO add art work or other metadata, not coming from stream
// TODO Tell player stream is of infinite time
self.player?.play()
}
}