firemaple
9 years agoVisitor
Scene Graph Video Player - notificationInterval Not Working
Hi All,
While watching a video I'd like to display the timecode (hh:mm:ss:ff) in a label on the video player while the video is playing. In order to do this I'm observing the "position" field of the scene graph video player (see documentation here). In my code, no matter what I set the "notificationInterval" value to, it only executes my observer function every .5 seconds.
I downloaded the Simple_Grid_and_Video.zip reference code (here) and added the following lines of code to demonstrate the problem
Can anyone offer any insight? I'm sure I'm overlooking something.
Many Thanks in Advance!
While watching a video I'd like to display the timecode (hh:mm:ss:ff) in a label on the video player while the video is playing. In order to do this I'm observing the "position" field of the scene graph video player (see documentation here). In my code, no matter what I set the "notificationInterval" value to, it only executes my observer function every .5 seconds.
I downloaded the Simple_Grid_and_Video.zip reference code (here) and added the following lines of code to demonstrate the problem
' ********** Copyright 2016 Roku Corp. All Rights Reserved. **********
' inits grid screen
' creates all children
' sets all observers
Function Init()
' listen on port 8089
? "[HomeScene] Init"
'main grid screen node
m.GridScreen = m.top.findNode("GridScreen")
'video player node
m.videoPlayer = m.top.findNode("videoPlayer")
'MY ADDED CODE----------------------------------------------
m.videoPlayer.ObserveField("position", "positionChanged")
m.videoPlayer.notificationInterval = 0.1
'-----------------------------------------------------------
'added handler on item selecting event in grid screen
m.top.observeField("rowItemSelected", "OnRowItemSelected")
' loading indicator starts at initializatio of channel
m.loadingIndicator = m.top.findNode("loadingIndicator")
End Function
'MY ADDED CODE----------------------------------------------
Function positionChanged()
? m.videoPlayer.position
End Function
'-----------------------------------------------------------
Can anyone offer any insight? I'm sure I'm overlooking something.
Many Thanks in Advance!