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: 

Trick mode and Live streaming

I have a HLS live stream that shows trick mode when triggered during playback. It appears that you can FF and REW, and it shows 00m at the beginning and end, even though it's a live stream. What's the best way to fix this? Thanks.
0 Kudos
12 REPLIES 12
RokuChris
Roku Employee
Roku Employee

Re: Trick mode and Live streaming

If you set the live attribute on your content-meta-data to true, it won't display the time remaining on the right of the scrubber. http://sdkdocs.roku.com/display/sdkdoc/ ... +Meta-Data

If you don't want any trickplay at all, you can use roVideoPlayer instead of roVideoScreen
0 Kudos

Re: Trick mode and Live streaming

I read in the developer material that putting Live here http://sdkdocs.roku.com/display/sdkdoc/roVideoScreen in the notes section, number 7, that 'live' will change the trick mode for Live streaming. I don't know where to put the 'live' to do this though... Any ideas?
0 Kudos

Re: Trick mode and Live streaming

Sorry our posts crossed... Our channel parses xml files on our server to load the streams. Some are LIVE, some are VOD. I'm not sure how to add that 'live' metadata in the xml file. Here's an example of our one of our live streams as in the xml.

<item sdImg="http://server/ROKU/images/icon-live.png" hdImg="http://server/ROKU/images/icon-live.png">
<title>High Bandwidth</title>
<contentType>TV</contentType>
<contentId>9000</contentId>
<contentQuality>SD</contentQuality>
<streamFormat>hls</streamFormat>

<media>
<streamFormat>hls</streamFormat>
<streamQuality>SD</streamQuality>
<streamBitrate>1600</streamBitrate>
<streamUrl>http://server-stream/playlist.m3u8</streamUrl>
</media>
<synopsis>MissionTV takes you to the front lines of a world in need.</synopsis>
<genres></genres>
<runtime>0</runtime>
</item>


Can I insert the 'live' attribute in here somewhere?
0 Kudos

Re: Trick mode and Live streaming

I tried to insert some code like this below the <contentID> in the xml, but it doesn't work...

<live>true</live>


What am I doing wrong?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Trick mode and Live streaming

"recordlikedaniel" wrote:
I tried to insert some code like this below the <contentID> in the xml, but it doesn't work...

<live>true</live>


What am I doing wrong?


You'll probably need to add some BrightScript to your parsing logic to look for that new element and use it to set the appropriate value on your content-meta-data structure.
0 Kudos

Re: Trick mode and Live streaming

Thanks Chris. I'm not sure if I'm doing this right, but hopefully it's close? I've inserted this code in Function parse_show_feed, but somehow it's not working yet...

item.Live             = validstr(curShow.Live.GetText())


Is this the correct code?
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Trick mode and Live streaming

"recordlikedaniel" wrote:
Thanks Chris. I'm not sure if I'm doing this right, but hopefully it's close? I've inserted this code in Function parse_show_feed, but somehow it's not working yet...

item.Live             = validstr(curShow.Live.GetText())


Is this the correct code?


The live attribute must have a boolean value for it to work (http://sdkdocs.roku.com/display/sdkdoc/ ... +Meta-Data). You're assigning it a string.
0 Kudos

Re: Trick mode and Live streaming

Thank you. I'm sorry I really don't know how to convert this into a Boolean attribute...! I know Boolean is true/false, but I just don't know what format I need to do this in this context. I don't see another boolean attribute in the metadata in this function to copy. Is the validstr the part that designates it as a string? What do I replace it with for Boolean?

Here's my code for parse show:

Function parse_show_feed(xml As Object, feed As Object) As Void

showCount = 0
showList = xml.GetChildElements()

for each curShow in showList

'for now, don't process meta info about the feed size
if curShow.GetName() = "resultLength" or curShow.GetName() = "endIndex" then
goto skipitem
endif

item = init_show_feed_item()

'fetch all values from the xml for the current show
item.hdImg = validstr(curShow@hdImg)
item.sdImg = validstr(curShow@sdImg)
item.ContentId = validstr(curShow.contentId.GetText())
item.Title = validstr(curShow.title.GetText())
item.Description = validstr(curShow.description.GetText())
item.ContentType = validstr(curShow.contentType.GetText())
item.Live = validstr(curShow.Live.GetText())
item.ContentQuality = validstr(curShow.contentQuality.GetText())
item.Synopsis = validstr(curShow.synopsis.GetText())
item.Genre = validstr(curShow.genres.GetText())
item.Runtime = validstr(curShow.runtime.GetText())
item.HDBifUrl = validstr(curShow.hdBifUrl.GetText())
item.SDBifUrl = validstr(curShow.sdBifUrl.GetText())
item.StreamFormat = validstr(curShow.streamFormat.GetText())
if item.StreamFormat = "" then 'set default streamFormat to mp4 if doesn't exist in xml
item.StreamFormat = "mp4"
endif

'map xml attributes into screen specific variables
item.ShortDescriptionLine1 = item.Title
item.ShortDescriptionLine2 = item.Description
item.HDPosterUrl = item.hdImg
item.SDPosterUrl = item.sdImg

item.Length = strtoi(item.Runtime)
item.Categories = CreateObject("roArray", 5, true)
item.Categories.Push(item.Genre)
item.Actors = CreateObject("roArray", 5, true)
item.Actors.Push(item.Genre)
item.Description = item.Synopsis

'Set Default screen values for items not in feed
item.HDBranded = false
item.IsHD = false
'item.StarRating = "90"
item.ContentType = "episode"

'media may be at multiple bitrates, so parse an build arrays
for idx = 0 to 4
e = curShow.media[idx]
if e <> invalid then
item.StreamBitrates.Push(strtoi(validstr(e.streamBitrate.GetText())))
item.StreamQualities.Push(validstr(e.streamQuality.GetText()))
item.StreamUrls.Push(validstr(e.streamUrl.GetText()))
endif
next idx

showCount = showCount + 1
feed.Push(item)

skipitem:

next

End Function
0 Kudos
RokuMarkn
Visitor

Re: Trick mode and Live streaming

The easiest to understand would be something like

if validstr(curShow.Live.GetText()) = "true" then
item.Live = true
else
item.Live = false
end if


--Mark
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.