videoscreen close w/ update of springboard

once the roVideoScreen closes obviously i have the springboard appDetailScreen.brs in the background. so when the video screen closes the appDetailScreen.brs is still there waiting.

i know its possible, but i cant duplicate how i did it once before, or maybe it was a freak thing not sure.

but what i want is if the video screen closes i need it to refresh the appDetailScreen.brs, so if msg.isScreenClosed() on the videoScreen is where i am assuming it should go there

I see the netflix channel will do it as well once playback is finished it will update and ask to play the next episode etc.

i just dont want to have to go out and then back in to see the changes made on the springboard screen, again it has done it but for the life of me i cant duplicate it for 2 days now

Thanks in advance

A call to SetContent() should refresh the screen without having to exit it.

endless could you elaborate on that some more?

i already have in the springboard screen

screen.AllowUpdates(true)
screen.SetContent(show)
screen.show()

below is how i have the code on the roVideo screen, so can you tell me when this screen closes as you see below.

if msg <> invalid
      if msg.isPartialResult() 
        shouldPlaylistExit = true
      else if msg.isScreenClosed()
        print "Screen closed"

        exit while

so i am a bit confused what i should be putting in the section where the screen closes so it refreshes the page.

What are you wanting to refresh it with? Calling SetContent() on the Springboard again in the isScreenClosed() event of the video screen will refresh the springboard with whatever content you’re passing to SetContent().

i just want to refresh to see the or not see the “resume playing” button

I tried using the setContent and it didnt work. i already tried:

 print "Screen closed"
screen.SetContent(show)
'screen.SetContent(0)
'screen.SetContent()
        exit while

and got nothing but errors, could you show me what i should add and where cause i am obviously not understanding or missing something.

Making your call to SetContent() in the video screen’s event loop will cause problems because the screen variable in that context is your video screen, not your springboard. You should wait to call SetContent() untill you have exited the video screen’s event loop and control has returned to the springboard’s event loop.

“dynamitemedia” wrote:
i just want to refresh to see the or not see the “resume playing” button

I tried using the setContent and it didnt work. i already tried:

 print "Screen closed"
screen.SetContent(show)
'screen.SetContent(0)
'screen.SetContent()
        exit while

and got nothing but errors, could you show me what i should add and where cause i am obviously not understanding or missing something.
Oh, SetContent() won’t affect the buttons. You’d need to do that by redrawing the buttons. There should be .AddButton code somewhere in your code. You’d need to call that again and have it clear the current buttons and re-add the appropriate ones based on the status you want displayed (i.e., “Play” instead of “Resume”). The refreshShowDetail() function in the appDetailsScreen.brs in the videoplayer example does this. You’d just need to change it to conditionally add either a Play or Resume button, instead of just the Resume button as it does now.

There should be .AddButton code somewhere in your code. You’d need to call that again and have it clear the current buttons and re-add the appropriate ones based on the status you want displayed (i.e., “Play” instead of “Resume”). The refreshShowDetail() function in the appDetailsScreen.brs in the videoplayer example does this. You’d just need to change it to conditionally add either a Play or Resume button, instead of just the Resume button as it does now.

i already have the conditional play or resume and thats why i need it to refresh, i have it checking the registry for the last position if its 0 or invalid it doesnt show resume.

i have tried the refreshShowDetail() already as well and all i got was a error about not enough parameters for the function.

i think the problem is i am trying to add these in that section if the screen is closed. could you tell me where i should be calling the code?

could you show me a snipplet please, it would make this much easier. i have shown you what i have now.

quick edit: i also just tried clearing the buttons to see if that would work and i got a error with that as well

As RokuChris noted above, the code needs to be added to the appDetailScreen, no appVideoScreen. In appDetailScreen, your button refresh code should go immediately after the call to showVideoScreen in the wait loop in showDetailScreen. Something along the lines of…

Function showDetailScreen(screen As Object, showList As Object, showIndex as Integer) As Integer
    .
    .
    showVideoScreen(showList[showIndex])
    resetButtons(screen)
    .
    .
End Function

Sub resetButtons(screen)
    screen.ClearButtons()
    If ... Then
        screen.AddButton(1, "resume playing")    
        screen.AddButton(2, "play from beginning")
    Else
        screen.AddButton(2, "play") 
    End If
End Sub

“RokuChris” wrote:
Making your call to SetContent() in the video screen’s event loop will cause problems because the screen variable in that context is your video screen, not your springboard. You should wait to call SetContent() untill you have exited the video screen’s event loop and control has returned to the springboard’s event loop.
so where would you say to do this then chris? im using this example like you showed us here
viewtopic.php?f=34&t=32867

ok excuse me if i am getting confused here…

first my button info is in the refreshShowDetail function, and then that is called in the showDetailScreen function


Function showDetailScreen(screen As Object, showList As Object, showIndex as Integer) As dynamic    
if validateParam(screen, "roSpringboardScreen", "showDetailScreen") = false return -1
if validateParam(showList, "roArray", "showDetailScreen") = false return -1

 refreshShowDetail(screen, showList, showIndex)

is that essentially the same thing? here is refreshShowdetails


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

    if validateParam(screen, "roSpringboardScreen", "refreshShowDetail") = false return -1
    if validateParam(showList, "roArray", "refreshShowDetail") = false return -1
                  show = showList[showIndex] 
                  screen.ClearButtons()
                   screen.AddButton(1, "Play from beginning")			
                   PlayStart = RegRead(showList[showIndex].ContentId)
		      if PlayStart = invalid then              
                  else if PlayStart = "0"                    
 		else
			screen.AddButton(2, "Resume playing")    
		endif
                	screen.AllowUpdates(true)
                	screen.SetContent(show)
                	screen.Show()
End Function

as you see i need the info so i can do this PlayStart = RegRead(showList[showIndex].ContentId)

so when i tried the method you showed me i was having all sorts of issues because i need showList[showIndex].ContentId to check for the last position.

so what do you suggest now?

also that showVideoScreen(showList[showIndex]) was taking me direct to the video and bypassing the video detail screen

been trying several things but i keep getting “not dim’d” errors or something each time

Guys, i tried a few other things and still not working, i think the issue is cause i dont have the content id yet.

thus the dim’d errror. i think i may have to when i click on the poster to enter i need to post something to registry that i can then pull out to do your sub as described endless, or after seeing my code do you see a different way?

If you already have the code in refreshShowDetail, then just call it again immediately after showVideoScreen…

showVideoScreen(showList[showIndex])
refreshShowDetail(screen, showList, showIndex)

Endless, crazy thing is thats how i had it! haha

what was messing it all up was that there was a postRoll ad, and it would write the new position for that and save it, even though it wasn’t the actual “episode.contentId”.

so i had to then add a few things to my video array so i would know it was a ad, then in the area where it would write to the registry i added in a check to see if it was a ad or not. if it was a ad it would do nothing if it wasnt a ad or the main video it would then write to the registry.

i thought something was odd that when watching a preroll and i hit up it would always do what i wanted it to do, but if i watched the post roll it wouldnt. i had assumed incorrectly that it would know it wasn’t the actual video.

it was the hitting up that i for some reason kept missing when trying to duplicate. because i would sit and watch the post roll to be sure that was working correctly!

Thanks guys glad i was actually on the right path to begin with, was just the original code was not made for a simulated playlist