Martin Martin - 1 year ago 188
Javascript Question

Audio Player for AppleTV - TVML

does someone know a nice way to display a player with a picture, title and artist name for AppleTV?

I've tried with:

videoURL = ele.getAttribute("videoURL")
if(videoURL) {
var player = new Player();
var playlist = new Playlist();
var mediaItem = new MediaItem("video", videoURL);
player.playlist = playlist;

But nothing appear. Anyone to help?

Baa Baa
Answer Source

Headline asking for audio, though you are setting up a video mediaItem. Try using the audio item, filling the metadata to your liking.

// set up new mediaItem
var mediaItem = new MediaItem("audio");

// player data
mediaItem.url = ...
mediaItem.title = ...
mediaItem.subtitle = ...
mediaItem.artworkImageURL = ...
mediaItem.description = ...

See as well.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download