Black playback screen tvOS 14.0.1 and 14.2

Since tvOS 14.0.1+ i see a black screen (with a time bar at the bottom) when playing an audio stream. From tvOS 10 to tvOS 14.0 it was showing the image i provided with code like this

Code Block
player = new Player();
player.playlist = new Playlist();
audio = new MediaItem('audio', stream);
audio.title = title;
audio.artworkImageURL = artwork;
audio.subtitle = subtitle;
audio.description = description;
player.playlist.push(audio);
player.play();


How can i make the image and subtitle appear again with tvOS 14.0.1 and 14.2?

The same thing happens when playing audio with this sample project:
https://developer.apple.com/documentation/tvmljs/playing_media_in_a_client-server_app
Answered by macmark.de in 645039022
I learned from code level support how to fix it:

… When tvOS 14 added Picture-in-Picture Support (PIP), we made the default value for this value is ‘true'. This has broken the existing behavior for audio.

To get around your issue, you need to explicitly set the property ‘supportsPictureInPicturePlayback’ (linked below), to false, on your app’s TVApplicationControllerContext.

<https://developer.apple.com/documentation/tvmlkit/tvapplicationcontrollercontext/3192087-supportspictureinpictureplayback>

let appControllerContext = TVApplicationControllerContext()

appControllerContext.supportsPictureInPicturePlayback = false

Setting this will make the Now Playing UI appear again. …

It looks like tvOS 14.0.1+ changed the default value for supportsPictureInPicturePlayback from false to true. The docs say default is false until now https://developer.apple.com/documentation/tvmlkit/tvapplicationcontrollercontext/3192087-supportspictureinpictureplayback
Here's what i did for testing with Apple's demo project:

Code Block
function playMedia(extension, mediaType) {
    var mediaURL = baseURL + extension;
    mediaURL = "https://swr-swr3-live.cast.addradio.de/swr/swr3/live/aac/96/stream.aac";
    var singleMediaItem = new MediaItem(mediaType, mediaURL);
    singleMediaItem.artworkImageURL = "https://d3kle7qwymxpcy.cloudfront.net/images/broadcasts/cd/0c/2275/3/c300.png";
    singleMediaItem.description = "description";
    singleMediaItem.subtitle = "subtitle";
    singleMediaItem.title = "title";
    var mediaList = new Playlist();
    mediaList.push(singleMediaItem);
    var myPlayer = new Player();
    myPlayer.playlist = mediaList;
    myPlayer.play();
}


It does not show any of the texts an no image. But it used to with tvOS <= 14.0.
Accepted Answer
I learned from code level support how to fix it:

… When tvOS 14 added Picture-in-Picture Support (PIP), we made the default value for this value is ‘true'. This has broken the existing behavior for audio.

To get around your issue, you need to explicitly set the property ‘supportsPictureInPicturePlayback’ (linked below), to false, on your app’s TVApplicationControllerContext.

<https://developer.apple.com/documentation/tvmlkit/tvapplicationcontrollercontext/3192087-supportspictureinpictureplayback>

let appControllerContext = TVApplicationControllerContext()

appControllerContext.supportsPictureInPicturePlayback = false

Setting this will make the Now Playing UI appear again. …

It looks like tvOS 14.0.1+ changed the default value for supportsPictureInPicturePlayback from false to true. The docs say default is false until now https://developer.apple.com/documentation/tvmlkit/tvapplicationcontrollercontext/3192087-supportspictureinpictureplayback
Black playback screen tvOS 14.0.1 and 14.2
 
 
Q