I'm struggling with RAF, SSAI, and the back button. I will be the first to admit that I am confused by how SG handles remote events (for example, why does RAF steal focus and not trigger onKeyPress observers upstream?).
I have implemented stitchedAdhandledEvent in an event loop, inside of a task.
Problem 1:During an ad, if I click the back button I see this debug info:
rafrndr-onKeyEvent() - key: back
rafrndr-onkeyevent() - keycode: 0
and I can see that RAF reports the adexited:true
RAF cur ad > <Component: roAssociativeArray> =
{
adcompleted: false
adexited: true
adindex: 1
adpodindex: 1
evthandled: true
}
However, I must hit the back button
again for my home scene to detect the keypress and close the video. I assume I am supposed to hack an observer upstream to close the video player manually using the information provided by RAF?
Problem 2:
During content, The back button is swallowed completely by RAF. No debug info, nothing. The content just keeps playing as if the button was never pressed. The stitchedAdHandledEvent logs thisRAF cur ad > <Component: roInvalid>
Attempts to fix:
So far I have tried to force focus on the video node using m.videoplayer.setFocus(true) inside of the RAF event loop, but this does not work as expected. The video does indeed close and my logic runs to show the previous screen, but focus is not assigned as expected to some buttons on this screen.Can anyone provide an RAF SSAI example in SeneGraph that illustrates how to make the back button work as expected?