dan_shneider
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-04-2017
10:51 AM
Register to player events and showing videos
Hey. 2 un-related question.
#1: How do I get events when the player loaded, play, pause, seeked and so on?
I understand i need to register a port object to a roVideoPlayer and wait on a loop for event messages, but I must be doing something wrong.
Need some info how to do it and when/where in the app life cycle.
#2: your support until now was amazing so I am now able to fully communicate with our server. and get the videos info.
How, and when, do I add them to a list of of items I have on screen?
Thanks a lot,
Dan
EDIT for issue #2: I now have a a task xml file that does all the communication work, and passes the data in a callback to the VideoGridScene.
But still, how do I add them to a list of of items I have on screen?
(#1 is still a question.)
#1: How do I get events when the player loaded, play, pause, seeked and so on?
I understand i need to register a port object to a roVideoPlayer and wait on a loop for event messages, but I must be doing something wrong.
Need some info how to do it and when/where in the app life cycle.
#2: your support until now was amazing so I am now able to fully communicate with our server. and get the videos info.
How, and when, do I add them to a list of of items I have on screen?
Thanks a lot,
Dan
EDIT for issue #2: I now have a a task xml file that does all the communication work, and passes the data in a callback to the VideoGridScene.
But still, how do I add them to a list of of items I have on screen?
(#1 is still a question.)
1 REPLY 1
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2017
01:24 PM
Re: Register to player events and showing videos
If you're using Scene Graph you won't be using roVideoPlayer, you'll be using a Video component.
Set up a field observer for any of the Video node fields you wish to observe, e.g:
in init():
define your observer function:
There are other fields you may want to observe as well: errorCode, errorMsg, bufferingStatus, etc., etc.
Set up a field observer for any of the Video node fields you wish to observe, e.g:
in init():
m.videoNode = m.top.findNode("myVideoNode")
m.videoNode.ObserveField("state", "onState")
define your observer function:
sub onState()
print "Video state: "; m.videoNode.state
end sub
There are other fields you may want to observe as well: errorCode, errorMsg, bufferingStatus, etc., etc.