Your Digital Media Has Never Looked So Good

 
roquoonewbie
Topic Author
Posts: 131
Joined: Wed Dec 21, 2011 1:02 am

roSGScreenEvent never firing?

Tue Sep 11, 2018 3:04 pm

Hello,

I need to detect when someone closes the screen before the channel exits completely.  Per this documentation, it looks like I should be getting an isScreenClosed event.  

https://sdkdocs.roku.com/display/sdkdoc/roSGScreenEvent

But it never arrives.  Does everyone else see the same?  I even checked out some sample channels, such as this one:

https://github.com/rokudev/videoplayer-channel

And yet when I hit the back button, no event is detected. I added the print statement in the snippet below from the Main function, and it is never executed.  Any ideas?

  while(true)
    msg = wait(0, m.port)
        msgType = type(msg)
        Print "we got it!!"
        If msgType = "roSGScreenEvent"Then
      if msg.isScreenClosed() then return
    end if
  end while
end sub
 
roquoonewbie
Topic Author
Posts: 131
Joined: Wed Dec 21, 2011 1:02 am

Re: roSGScreenEvent never firing?

Fri Sep 14, 2018 1:34 pm

Nobody has any input on this?
 
User avatar
RokuNB
Posts: 465
Joined: Fri Mar 31, 2017 2:22 pm

Re: roSGScreenEvent never firing?

Sat Sep 15, 2018 12:56 pm

you will get roSGScreenEvent if the roSgScreen in question was closed by pressing Back button or programmatically. If however Home button was pressed, the app is terminated immediately - currently there is no event hook you can use to detect impending exit. As alternative, you could periodically save state/progress to registry or cloud service.
 
roquoonewbie
Topic Author
Posts: 131
Joined: Wed Dec 21, 2011 1:02 am

Re: roSGScreenEvent never firing?

Sat Sep 15, 2018 1:06 pm

RokuNB, my post was concerning the Back button.  Using the sample, there is no  msg.isScreenClosed() event detected.. It is easily reproduceable using the posted sample and you should see the same. Do you not?

Regarding your Home button statement, why is that the case?  It seems like Roku is going backward with scenegraph.  On the old SDK, if a video was playing and the user pressed the home button, two different events were fired (msg.isPartialResult() and msg.isScreenClosed() ).  Why would Roku remove the ability to detect this event in the scene graph sdk?

How is a channel supposed to send an event to (for example) a mobile controller/casting app to tell it that it is exiting the video play process (so the mobile app can update the play state on it's screen)?  This seems like a critical feature that has been removed...but why?

Who is online

Users browsing this forum: No registered users and 5 guests