uarlive
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2013
08:27 PM
Issue with hls and resume buttons
Hello. I am experiencing an issue where the "resume" and "start from the beginning" buttons appear when a live feed has been exited. The buttons behave as expected on mp4 content but I am trying to remove them from live feeds which are supplied through a xml file. Can someone point me in the right direction? Thanks.
appShowFeed.brs
appVideoScreen.brs
appDetail.brs
appShowFeed.brs
'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.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())
item.SwitchingStrategy = validstr(curshow.switchingStrategy.gettext())
if item.StreamFormat = "" then 'set default streamFormat to mp4 if doesn't exist in xml
item.StreamFormat = "mp4"
elseif item.StreamFormat = "hls" then
item.StreamFormat = "hls"
item.SwitchingStrategy="full-adaptation"
endif
appVideoScreen.brs
Function showVideoScreen(showList As Object, showIndex as Integer)
if validateParam(showList, "roArray", "refreshShowDetail") = false return -1
episode = showList[showIndex]
' if (not BillReminder()) then return invalid
' Track(episode["contentId"])
port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.SetPositionNotificationPeriod(30)
screen.SetContent(episode)
screen.Show()
'Uncomment his line to dump the contents of the episode to be played
PrintAA(episode)
while true
msg = wait(0, port)
if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isfullresult()
RegDelete(episode.ContentId)
elseif msg.isRequestFailed() then
showVideoFailureMessage()
'print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
End Function
appDetail.brs
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)
if show.contentformat <> "audio"
screen.ClearButtons()
if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 then
screen.AddButton(1, "Resume Playing")
screen.AddButton(2, "Play from Beginning")
screen.SetStaticRatingEnabled(false)
else
screen.addbutton(2,"Play")
screen.SetStaticRatingEnabled(false)
end if
screen.SetContent(show)
screen.Show()
else
screen.ClearButtons()
if(m.playing = 1) then
if(m.paused = 0) then
screen.AddButton(1, "Pause")
else
screen.AddButton(1, "Resume")
end if
screen.AddButton(3, "Stop")
else
screen.AddButton(2, "Play")
end if
screen.SetContent(show)
screen.SetStaticRatingEnabled(false)
screen.Show()
endif
End Function
4 REPLIES 4
bandal
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2013
06:29 AM
Re: Issue with hls and resume buttons
Try adding refreshShowDetail(screen,showList,showIndex) under the While True line in appDetailScreen.brs under the function showDetailScreen
It may work.
It may work.
uarlive
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2013
03:04 PM
Re: Issue with hls and resume buttons
Thanks. but that didnt work.

RokuMarkn
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2013
03:19 PM
Re: Issue with hls and resume buttons
As far as I can see, you're not treating HLS differently anywhere. You're doing the RegWrite of the video position for both live and VOD, which causes your refreshShowDetail function to create the resume button. If you don't want that behavior, check whether your content is live (or is HLS or whatever condition you want to use) before writing the position to the registry in your event loop.
--Mark
--Mark
uarlive
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2013
06:05 PM
Re: Issue with hls and resume buttons
thanks. that helped. wound up using this.
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)
if show.contentformat <> "audio" and show.streamformat <> "hls"
screen.ClearButtons()
if regread(show.contentid) <> invalid and regread(show.contentid).toint() >=30 then
screen.AddButton(1, "Resume Playing")
screen.AddButton(2, "Play from Beginning")
screen.SetStaticRatingEnabled(false)
else
screen.addbutton(2,"Play")
screen.SetStaticRatingEnabled(false)
end if
screen.SetContent(show)
screen.Show()
else
screen.ClearButtons()
if(m.playing = 1) then
if(m.paused = 0) then
screen.AddButton(1, "Pause")
else
screen.AddButton(1, "Resume")
end if
screen.AddButton(3, "Stop")
else
screen.AddButton(2, "Play")
end if
screen.SetContent(show)
screen.SetStaticRatingEnabled(false)
screen.Show()
endif
End Function