roquoonewbie
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018
03:04 PM
roSGScreenEvent never firing?
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?
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
3 REPLIES 3
roquoonewbie
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-14-2018
01:34 PM
Re: roSGScreenEvent never firing?
Nobody has any input on this?
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018
12:56 PM
Re: roSGScreenEvent never firing?
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
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-15-2018
01:06 PM
Re: roSGScreenEvent never firing?
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?
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?