Forum Discussion
Mavzu
2 years agoNewbie
How do you handle focus and give it back to custom player controls. observing focusedChild from "view" node and it becomes invalid. No problem if i give invalid for view.
PriApocalypse
2 years agoBinge Watcher
Hi Mavzu I've observed the ads state callback that you know if it's starting and ad. If it begins to you can give the focus back to your player but notice if you are navigating around keep in mind RAF does not permit that since it will grab/force the focus to the RAF container.
Verify if you can find github samples about SetTrackingCallback which I've used here: RAF.SetTrackingCallback(customCallback) because I didn't see this as a part of official documentation but it's have being used by the community and worked fine for me.
sub customCallback(obj = invalid as Dynamic, evtType = invalid as Dynamic, ctx = invalid as Dynamic)
if ctx.type = "Start"
print "Set the focus back to the video node!"
video = getVideoNode()
video.setFocus(true)
end if
' You can monitor others states here and also identify ad errors
end sub