Streaming Radio Channel: How To Update Program Title Periodically

plugin-dev

#1

I made a channel for personal use that pulls in a local NPR station's stream. Basically, I consume the program metadadata for the station from NPR and pull the program logos from Google Image Search (and cache them in the resource directory for future use the first time a new program is pulled in). It works fine, but how would I go about triggering an event periodically to continue playing the stream but update the metadata associated with the track, i.e., Artist, Track Name, and Album Art, which are the three fields I utilize. As it functions now, I am setting that info on the initial playback, but when the program changes (same stream), I can't manage to update it.

Thanks, and sorry for such a general question which may already be answered. In summary, is there any way to update an audio track's metadata and on-screen display while it's playing, without stopping the stream and restarting it?


#2

If you are wanting it to update data mid-play, I am not sure you can.

You can set a short cache time on the request to pull your data, but once it starts playing, it is controlled by the player app. Channels just create a media object with all the metadata and puts that in an XML and then each player app reads the media object data in that XML to create the play screen.

The player app would have to be programmed to go back and request the new metadata for the play screen to be updated. And as far as I know, they only pull that XML once, when they first create the play screen.

Or you would have to create a unique part for each program within the media object. But again, once the player app pulls the media object data from the XML, it never goes back to update that data, so you would have to be able to create all those parts ahead of time.


#3

@shopgirl284, so are you saying that I can read say, 24 hours worth of schedule at the beginning of playback and establish the playback time signatures for each program over that period with the appropriate metadata in advance via "parts"?

I'm not familiar with the Plex Channel playback APIs, but if I can in fact divide a single stream into parts relative to the start time, then that will be sufficient and I'll mark this as the answer. Since it's only for personal use, 24 hours of program metadata will be more than sufficient.

Just to be clear about terminology, parts represent essentially arbitrary divisions of the playback timeline, and I can assign them with their own metadata at the beginning of playback?


#4

I may have spoken incorrectly about the parts.

The only attribute I ever add for a part is the duration. I will have to look back at the Framework and see what attributes there are for parts.


#5

@shopgirl284 said:
I may have spoken incorrectly about the parts.

The only attribute I ever add for a part is the duration. I will have to look back at the Framework and see what attributes there are for parts.

That's okay. I think I'm going to roll it as a separate Android TV app instead. I flipped through the Framework documentation without seeing anything promising, and I found some similar attempts to accomplish the same thing without success on the forum. Slightly more work up front, but much better documentation and control in the long run... :/