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: 
matrixebiz
Roku Guru

Re: Roku channel stream has 1 too many clicks

Oh, crap, I see what you are saying now. Post a copy of the xml file to pastbin because currently the pastbin raw file is a playlist of m3u links not an xml.

I'll try that now.
0 Kudos
belltown
Roku Guru

Re: Roku channel stream has 1 too many clicks

... and change any references in the xml file and other files it includes to use either http:// or pkg:// depending on where your resources are located.
0 Kudos
matrixebiz
Roku Guru

Re: Roku channel stream has 1 too many clicks

Ok, now that was easy 🙂
I didn't need to change anything in the xml file either because the resources are the same so when it parses the xml where ever it is, the roku still knows to grab the image from my images location item : sdImg="pkg:/images/C214x144Sd.png"

So I didn't actually need to change anything else except the link to where my xml is in Main.brs

Thx again
0 Kudos
matrixebiz
Roku Guru

Re: Roku channel stream has one two many clicks

"belltown" wrote:

If instead you were to use the NewVideoPlayer (http://forums.roku.com/viewtopic.php?f=34&t=91672&p=516080), which you can get from https://github.com/belltown/Roku-NewVideoPlayer

Hi belltown, is there a reason why you removed the "showFeed.brs" file from your SDK?

I read that if I want to help users who have lower internet speeds to read hls streams properly to help loading issues, I should add the below code to my XML file to adjust the quality of the stream on the fly?;

<switchingStrategy>full-adaptation</switchingStrategy>


but for this to work properly, I also need to add the below to the showFeed.brs file;

if item.StreamFormat = "" then 'set default streamFormat to mp4 if doesn't exist in xml
item.StreamFormat = "HLS"
endif
If item.StreamFormat="hls" then
item.SwitchingStrategy="full-adaptation"
End If

but this file doesn't exist anymore in your updated SDK package. Is this not needed anymore?
0 Kudos
belltown
Roku Guru

Re: Roku channel stream has 1 too many clicks

According to the documentation, the default HLS SwitchingStrategy is "full-adaptation", so it shouldn't be necessary to specify this in the content meta-data. However, I've updated NewVideoPlayer on GitHub to allow you to specify <switchingStrategy>full-adaptation</switchingStrategy> in a Roku Feed (or any other allowable value for switching strategy), if the streamFormat is "hls" (see categories.xml)

The file that handles the change is RokuFeed.brs
0 Kudos
matrixebiz
Roku Guru

Re: Roku channel stream has 1 too many clicks

Ok, thanks I'll check it out.
On the thread I was reading (Can't find it now and I think it was from last year) the 'default HLS SwitchingStrategy' code was broken or something so hence the reason why users had to manually add the code I mentioned above to force it but maybe that is fixed already ??

Will this help with the users Roku's who have slower internet speeds constantly pause and do the Loading ... thing every few minutes?
or is there something else I can code in for this detection? a drop in quality is less annoying than that Loading screen all the time.
(I have no control over the stream source/feed so I can't lower the HD video quality at the source)
0 Kudos
belltown
Roku Guru

Re: Roku channel stream has 1 too many clicks

If the stream is encoded at a bitrate that's higher than the users' internet connections can handle, then there's nothing you can do about that.
0 Kudos
matrixebiz
Roku Guru

Re: Roku channel stream has 1 too many clicks

Hi belltown, as the channel reads my feed XML file and if I wanted to add something to the end of the streamUrl, like an authentication code for streams that contain 'HD' in the title, EG;

<item sdImg="pkg:/images/Tsc214x144Sd.png" hdImg="pkg:/images/Tsc290x218Hd.png">
<title>Stream HD</title>
<description></description>
<streamFormat>hls</streamFormat>
<media>
<streamQuality>HD</streamQuality>
<streamBitrate>0</streamBitrate>
<streamUrl>http://stream.m3u8?id=</streamUrl>
</media>
<synopsis></synopsis>
<genres></genres>
<live>True</live>
</item>


Where and which file can I modify to add this code in? The 'authentication code' is generated elsewhere so I cannot add it directly to the feed XMl file beforehand. Like for example, the XML is read and if the title has HD in it, then streamUrl = streamUrl + authentication code

Thank you
0 Kudos
belltown
Roku Guru

Re: Roku channel stream has 1 too many clicks

"matrixebiz" wrote:
Where and which file can I modify to add this code in? The 'authentication code' is generated elsewhere so I cannot add it directly to the feed XMl file beforehand. Like for example, the XML is read and if the title has HD in it, then streamUrl = streamUrl + authentication code

RokuFeed.brs in parseRokuItem() right after line 345, e.g:


stream.url = _getXmlString (media, "streamUrl")
stream.url = stream.url + authenticationCode
0 Kudos
matrixebiz
Roku Guru

Re: Roku channel stream has 1 too many clicks

Hello, that is great for all the streams but like I mentioned I only want it to add the 'authenticationcode' to only the streams that have 'HD' in the <title>Stream HD</title>. Thx
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.