Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Nyphur
Visitor

Question about channel developing and meta-data usage

Hello,

I am trying to build up my own Roku channel with HLS links that point to livestreams. I have based my XML files on the videoplayer example in the Roku SDK. First of all, it works, so the videos are playing, but I am not 100% satisfied yet with some minor issues.

The links are all live-streams, but for most of the channels it gives me the option (before I start playing the video) if i want to "resume" or "play from the beginning". But that's of course wrong, the links should just be started.
For some links this is working and it only offers me to play the video, but for most of them it does not. I could not figure out why, because mostly I did a copy&paste-job and all the settings should be the same for each links. I only changed the SD and HD images and the link and description.

Here is an example of the code that I use for the links (please notice the comments inside the code, because i have small questions for a few single options)


<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed>
<!-- resultLength indicates the total number of results for this feed -->
<resultLength>1</resultLength>
<!-- endIndix indicates the number of results for this *paged* section of the feed -->
<endIndex>1</endIndex>
<item sdImg="http://www.blablabla/xyz_SD.png" hdImg="http://www.blablabla/xyz_HD.png">
<title>Title of the channel</title>
<contentId>10201</contentId> <-- Here I just choose any number that is unique for this particular channel, right?
<contentType>Movie</contentType> <-- do I choose "movie" also when it is a livestream? Why is there always "Talk" in the example files?
<contentQuality>HD</contentQuality>
<streamFormat>hls</streamFormat> <-- Is there any way to play RTSP, RTMP or UDP streams?
<media>
<streamQuality>HD</streamQuality>
<streamUrl>http://www.mystream.com/stream</streamUrl>
</media>
</item>
</feed>


I have found this page containing a lot of meta-data options for the channel: http://sdkdocs.roku.com/display/sdkdoc4 ... +Meta-Data
But can I use those options in my XML file for the channel, just by putting the option into brackets <option>...</option> or do I have to use those meta-data within any .brs file inside the ..\source folder?

As you can see, I am so in the beginning in Roku developing as I possible could be, but I unfortunately do not find very good tutorials or examples, that really show me how to do that. I have only the most basic programming skills and try to figure it out by myself - but now i am stuck.

I appreciate any help! Thank you very much!

Nyphur
0 Kudos
10 REPLIES 10
RokuJoel
Binge Watcher

Re: Question about channel developing and meta-data usage

Assuming that you are basing your channel on the videoplayer example, you can remove the "Resume" button in the program, in the refreshDetails function in AppDetailScreen.brs, add a condition to the if / then statement to determine if the content type is live or VOD:

if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 and screen.contentType<>"hls" then


The contentID is a value that needs to be unique for every video and is specific to VOD with pause and resume. If two content items have the same ID then one video will resume from where the viewer left off with the other video.

Another thing to be aware of with the videoplayer example, is that you need to make sure it removes the Resume button after playback is complete, and some versions of this example do not do this (I think the version on our SourceForge site does, but the version you download from the developer site on owner.roku.com does not):

  if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isfullresult()
print "Video Completed Playback Normally"
RegDelete(episode.ContentId)
print "deleted bookmark for playback position"


This is in appVideoScreen.brs

- Joel
0 Kudos
Nyphur
Visitor

Re: Question about channel developing and meta-data usage

Hello Joel,

First of all, thank you very much for the answer! I think that is going to solve my problem.

I have tried to put the suggested codes in the .brs files that you mentioned, but there turnt to be a problem that I could not figure out how to solve.

I have modified the code in the AppDetailScreen.brs and added the "and screen.contentType<>"hls" then" line and this section looked like this in the end:

Function refreshShowDetail(screen As Object, showList As Object, showIndex as Integer) As Integer

if validateParam(screen, "roSpringboardScreen", "refreshShowDetail") = false return -1
if validateParam(showList, "roArray", "refreshShowDetail") = false return -1

show = showList[showIndex]

'Uncomment this statement to dump the details for each show
'PrintAA(show)

screen.ClearButtons()
if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 and screen.contentType<>"hls" then
screen.AddButton(1, "Resume playing")
screen.AddButton(2, "Play from beginning")
else
screen.addbutton(2,"Play")
end if
screen.SetContent(show)
screen.Show()

End Function


Do I have to delete the "screen.addButton" passages concerning "Resume" or "play from the beginning"? or do i just leave it like that. There must be something wrong because after I hadded this contenttype-code the channel would not work anymore. The one installed on the roku would not load some of the channels inside a category and after publishing it on the roku site, the channel would just crash and return to the main screen.
So i guess there are sill some lines to be changed? 🙂

About your other code that removes the resume button after playback is complete...should I implement this code as well or is it not necessary since all my channels are livestreams already?

Is it possible to stream RTSP, RTMP or UDP links with the roku WITHOUT any additional WOWZA, or servers on the pc or anything?

And how do I use the meta-data listed on this site: http://sdkdocs.roku.com/display/sdkdoc4 ... +Meta-Data
Can I use them in my XML files in a pattern like <abc></abc>?

Thank you very much for your help,

Nyphur
0 Kudos
RokuJoel
Binge Watcher

Re: Question about channel developing and meta-data usage

My bad, I think it should should have been show.contentType, not screen.contentType in the if/then statement.

- Joel
0 Kudos
Nyphur
Visitor

Re: Question about channel developing and meta-data usage

Just tried it...it does not make any difference. The "Resume" and "Play from the beginning"-buttons are still there.
But like I asked above, do I have to take any of the rest of the code away or modify it in any way? Do I really just add this short phrase?
0 Kudos
RokuJoel
Binge Watcher

Re: Question about channel developing and meta-data usage

Try show.streamformat

- Joel
0 Kudos
Nyphur
Visitor

Re: Question about channel developing and meta-data usage

Doesn't have an effect either 😐
0 Kudos
Nyphur
Visitor

Re: Question about channel developing and meta-data usage

No ideas? Anyone? :cry:
0 Kudos
RokuJoel
Binge Watcher

Re: Question about channel developing and meta-data usage

I finally had some time to actually test this, this line works for me:

if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 and show.streamformat <> "hls" then


- Joel
0 Kudos
Nyphur
Visitor

Re: Question about channel developing and meta-data usage

"RokuJoel" wrote:
I finally had some time to actually test this, this line works for me:

if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 and show.streamformat <> "hls" then




And it does work for me too! Thank you so much! 🙂


But how about that URL that I posted that contains all those meta-data. How are those used?
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.