0

I am working on video player using video node. My issue is when i press first time fastforward/rewind button during video playing/buffering then button is not working. After pressing 4-6 times fast forward or rewind button is working after that it is working properly but for first time i have to press 4-6 time button then working. My code is...

function setVideo()
    m.InnerVideo = m.top.createChild("InnerVideo")
    inner = createObject("RoSGNode", "ContentNode")
    inner.url = "url..."    
    inner.streamformat = "hls"

    m.innerVideo.visible = true    
    m.innerVideo.content = inner
    m.innerVideo.control = "play"
end function 

Event handler code is...

function onKeyEvent(key as String, press as Boolean) as Boolean
    handled = false

    if press
        if key = "fastforward"
            print "fastforward" 

            handled = true
        end if
    end if

    return handled
end function

Please suggest me what should be issue? Is issue related to video file format or encoding/decoding or others?

Katty
  • 489
  • 6
  • 28
  • Please provide more details, it is not clear what exactly is not working. – Eugene Smoliy Jun 13 '16 at 11:52
  • @ Eugene Smoliy I am printing a simple message like "hello" when anyone press fastforward button but its not working. After pressing 4-6 time this prints message "hello" – Katty Jun 14 '16 at 12:15
  • In this case, where is located "onKeyEvent" function? Make sure it is in Video node, because Video node handles this event and doesn't give it out. – Eugene Smoliy Jun 15 '16 at 12:43

2 Answers2

0

On onKeyEvent Function, you print above of handled = false "?key" value and check which value print in here. and also check "?press" if true then pressed key and false then not pressed. Here the Best way to whatever happening in your onKeyEvent Function. Like below

function onKeyEvent(key as String, press as Boolean) as Boolean

   ? "Key Event is about to execute - key = "key " press = " press 

end function
0

If prints from onKeyEvent are printed after 5th or 6th time maybe You have a problem with focus. It could be that You player is not in the focus at first and then at some point You assign a focus to it. Try to add: m.InnerVideo.setFocus(true) in your setVideo() function. If it does not work check if there is something else that is taking the focus off the m.InnerVideo after setVideo() function is executed.

U.Mitic
  • 744
  • 1
  • 6
  • 14