Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bbonet-entercom
Level 8

Looking for HLS Audio Metadata Help

This is a cross post from a post in the RokuDev subreddit on Friday. There was no response but a few upvotes.

We are streaming hls audio with custom metadata on EXT-X-DATERANGE. Items like title, artist, albumArtUrl. For the life of me I can't figure out how to access that data. I've tried monitoring timedMetaData and setting timedMetaDataSelectionKeys to ["*"] with no luck. I've also monitored streams on the content metadata. I haven't been able to find an examples. The stream works on the stream tester but shows no metadata. Does anyone have any tips on handling this?

Thanks - Brent

3 REPLIES 3\
codeMonkeyMike
Level 8

Re: Looking for HLS Audio Metadata Help

This was working in version 9 of the Roku OS. Couple things to note here:
- timedMetaDataSelectionKeys dosn't have a * in it.
-I could only return timedMetaData2

sub audioInit()
   m.audio = createObject("roSGNode""Video")
   m.audio.observeField("state""audioStatus")
   m.audio.timedMetaDataSelectionKeys = [""]
   m.audio.observeField("timedMetaData2""timedMetaDataChanged")
   m.audio.control = "stop"
end sub

sub timedMetaDataChanged()    
   print m.audio.timedMetaData2.data[""]
end sub

This took me a long time to figure out. I don't think you will find any documentation on this any where (except here). I really just got lucky. You must put the meta data in the right place in the stream to read it in Roku. In the steam put all the data you need in the timedMetaData2 field and use commas between song title, artist, album etc. 
codeMonkeyMike
0 Kudos
bbonet-entercom
Level 8

Re: Looking for HLS Audio Metadata Help

Hi Mike - Thanks for the suggestion, unfortunately that does not work for me. m.audio.timedMetaData2 does not exist so it breaks the app when I hit is. I'll keep searching and post a solution here if I figure it out. Until then, any additional help would be appreciated. I feel like I'm missing something fundamental here.

0 Kudos
codeMonkeyMike
Level 8

Re: Looking for HLS Audio Metadata Help

Also make sure you use video not audio. 

m.audio = createObject("roSGNode""Video")

codeMonkeyMike
0 Kudos