Your Digital Media Has Never Looked So Good

  • 1
  • 4
  • 5
  • 6
  • 7
  • 8
  • 16
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Wed Nov 04, 2015 9:07 am

Concerning video, what are Roku's plan for securing video?

In previous version, I was using :

videoContent.Addheader("reserved-id", "xxxx.."
videoContent.SetCertificatesFile("pkg:/certs/xx.crt")
videoContent.InitClientCertificates()

How can we achieve this with the new API?
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Wed Nov 04, 2015 9:13 am

How would keep persistent data ( i.e. login information ) as roRegistry is not allowed in the Graph components?
 
vjani
Posts: 18
Joined: Thu May 28, 2015 5:56 pm

Re: Beta Scene Graph Components

Wed Nov 04, 2015 11:58 pm

Hello,

I am going through the Scene Graph documentation to figure out whether we can use that for our channel or not. Since the Video roSGNode replaces roVideoPlayer/roVideoScreen, how do I listen for the various events that those components used to throw, such as isStreamStarted/isPlaybackPosition etc? There are no "ObserveOnly" Event fields in the Video documentation, which I can observe using observeField. Is there any example for videoplayer with progressbar that I can refer using the Scene Graph framework?

Thanks,
Vivek
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Thu Nov 05, 2015 7:14 am

Hello Vivek,

You can use the observeField like this :

m.video.ObserveField("state","hlsStatus")
m.video.ObserveField("bufferingStatus", "hlsLoading")

function hlsStatus() as void
   print m.video.state
end function

function hlsLoading() as void
   loading = m.video.bufferingStatus
   print "========="
   print "hlsLoading"
   print loading.percentage
   print loading.isUnderrun
   print "========="
'end function


I did receive an error when the hlsLoading function reached 100% though.
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Thu Nov 05, 2015 12:50 pm

Could Roku post an example with multiple scenes and how to navigate between them? That would be a great start to learning how to use the Scene Graph components. The examples posted seem to show a main.brs with 1 scene creation.

For example, multiples scenes involving :
Marketing scene
Login scene
Video scene
Channel Navigation (EPGGrid) scene

It would cool to see how best to architect this with the new Scene graph components.

When will this go live from Beta?
 
r_fan
Posts: 1
Joined: Thu Nov 05, 2015 11:03 am

Re: Beta Scene Graph Components

Sat Nov 07, 2015 6:21 am

Is the beta firmware still being provided via PM request or is it now just rolling out to the general public in batches?

Just curious as I sent a PM a couple days ago.

Thanks.
 
sudo97
Posts: 46
Joined: Wed Sep 16, 2015 8:43 am

Re: Beta Scene Graph Components

Tue Nov 10, 2015 5:35 am

How about creating one Dialog from another?
Here's my code:
function onKeyEvent(key as string, press as boolean) as boolean
         handled = false
         if (press)
            if(key = "options")
               m.top.dialog = CreateObject("roSGNode", "Dialog")
               m.top.dialog.title = "Settings"
               m.top.dialog.message = "WOWOWOW"
               buttons = ["First", "Second"]
               m.top.dialog.buttons = buttons
               m.top.dialog.ObserveField("buttonSelected", "DialogButtonSelected")
               handled = true
            end if
         end if
         return handled
      end function

      sub DialogButtonSelected()
         if(m.top.dialog.buttonSelected = 0)
            m.top.dialog = CreateObject("roSGNode", "Dialog")
            m.top.dialog.title = "FIRST"
            m.top.dialog.message = "FIRST"
         else
            m.top.dialog = CreateObject("roSGNode", "Dialog")
            m.top.dialog.title = "Second"
            m.top.dialog.message = "second"
         end if
      end sub



After selecting any of buttons my roku stick reboots and telnet gets disconnected. How can I do what I need?
 
mrkjffrsn
Posts: 2
Joined: Tue Oct 07, 2014 1:23 pm

Re: Beta Scene Graph Components

Tue Nov 10, 2015 12:49 pm

Hi Everyone,

I ran into an issue while using the getChild() from a node. It seems to return child nodes which do not exist within the parent node.

Here's an example of what I tried:

MainComponent:

<?xml version="1.0" encoding="utf-8" ?> 

<component name="MainScreen" extends="Scene" >
   
   <script type="text/brightscript" uri="pkg:/components/Managers/FocusManager.brs" />
   
   <children>
      
      <Navigation id="MainNav" />
      
      <CustomLabel id="csLbl" translation="[300, 200]" />
      
   </children>
   
</component>


FocusManager.brs
function init()
   
    ' The below two lines work as expected. Both returns the right nodes within the parent
    m.lbl = m.top.findNode("csLbl")
    m.mainNav = m.top.findNode("MainNav")
   
    ' Returns a node that is not existing in above component
    m.mnNav = m.top.getChild(0)
    ' Returns a node that is called LayerRoot. What is LayerRoot ?
    m.mnlbl = m.top.getChild(1)
   
    m.top.SetFocus(true)
end function


In above example

the Navigation component is a simple component that extends LayoutGroup and CustomLabel is a component that extends Group.

Is there a reason why getChild() would return something that's not a child ? or Am i doing something wrong here.

Any help would be great as I need to find a way to access the children within a parent node through index values.

Thanks,

Mark
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Tue Nov 10, 2015 3:35 pm

I have been trying unsuccessfully to set up a Task to attempt a post request. I am able to retrieve a JSON response from the server with a 200 response. I then assign the return value to a contentNode.

UrlTransfer works successfully and I am able to print out the response in full and parse into a ContentNode
Function http_post_from_string_with_timeout(val As String, seconds as Integer) as String
    timeout% = 1000 * seconds

    str = ""
    m.Http.EnableFreshConnection(true) 'Don't reuse existing connections
    print "url string" + val
    if (m.Http.AsyncPostFromString(val))
        event = wait(timeout%, m.Http.GetPort())
        if type(event) = "roUrlEvent"
            url_status =  "Communication Response Code: " + str(event.GetResponseCode())         
            print "url_status " + url_status
            print "event.GetFailureReason() " + event.GetFailureReason()
            print "event.getString()" + event.GetString()
            print "GetResponseHeaders " event.GetResponseHeaders()
            if ( event.GetResponseCode() <> 200 ) then
            else     'its a good response
                str = event.GetString()
            end if
        elseif event = invalid
            print "2"
            m.Http.AsyncCancel()
        else
            print "3"
        endif
    endif

    return str
End Function


I have set up observers in the main group to watch for the task to complete. The session function never fires and the state only returns an "INIT", never "DONE"
m.connection.observeField("content", "sessionLookup")
m.connection.observeField("state", "stateLookup")
m.connection.functionName = "getContent"
m.connection.control = "RUN"


What could be preventing the observers from never completing or triggering? Has anyone have any ideas why the Task is not allowing to proceed? I am at a standstill and don't know want else to try... Any help would be appreciated.

I am using these helper functions for url transfers : https://github.com/sunlightlabs/roku-wh ... lUtils.brs
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Beta Scene Graph Components

Tue Nov 10, 2015 11:44 pm

edskitter wrote:
What could be preventing the observers from never completing or triggering? Has anyone have any ideas why the Task is not allowing to proceed? I am at a standstill and don't know want else to try... Any help would be appreciated.

You didn't share your "getContent" function, which is where, presumably, you're updating the "content" field. Can you share that and your Task XML definition?

Also, it's worth nothing that the "state" value is actually in lowercase, not uppercase as documented, so you might be overlooking that update, if you're explicitly looking for an uppercase value.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Wed Nov 11, 2015 7:15 am

Task xml.

<?xml version="1.0" encoding="utf-8" ?>
 
<!--********** Copyright 2015 Roku Corp.  All Rights Reserved. **********-->
 
<component name="connection" extends="Task" >
 
<interface>
  <field id="uri" type="string" />
  <field id="content" type="node"/>
  <field id="route" type="string" />
  <field id="accountid" type="string" />
  <field id="accountpassword" type="string" />

</interface>
 
<script type="text/brightscript" >
<![CDATA[
 
sub init()
  'm.top.functionName = "getContent"
end sub
 
sub getContent()
  http_headers = CreateObject("roAssociativeArray")
  http_headers.Content_Type = "application/x-www-form-urlencoded"

  post_string$ = "account_id=" + m.top.accountid + "&account_pin=" + m.top.accountpassword + "&app_version=1.0" + "&serial_number=" + getDeviceESN()

  http = NewHttpJSON(m.top.uri, http_headers)
 
  content = http.PostFromStringWithTimeout(post_string$, 30)

  content = parseJSON(content)
  print content
  contentnode = createObject("RoSGNode","ContentNode") 
  contentnode.telcoid       = content.telco.id
  contentnode.url_sms       = content.telco.url_sms
  contentnode.support       = content.telco.support
  contentnode.account_id    = content.user.account_id
  contentnode.account_pin   = content.user.account_pin
  contentnode.account_state = content.user.account_state

  m.top.content = contentnode
  print "gets here fine"

end sub


For the state observer function, I am just pringting out the

sub stateLookup() 
         
         print "m.connection.state: " + m.connection.state
      end sub


Thanks Endless for looking at this.
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Beta Scene Graph Components

Wed Nov 11, 2015 11:28 am

When I run that, I get state values of "run" and "stop". Never "done", but that might be expected (??). I also correctly get a "sessionLookup" call immediately before the "stop" state, so it seems to be working as expected. Where are you creating and running the connection task? In my test, I kicked it off in init().

One thing to note, which may or may not be related to the issue you're seeing... ContentNode fields are limited to those listed in the Content Meta-Data section of the docs, so even if you do get your sessionLookup callback, you won't be able to retrieve the fields you populated. If you want custom fields, you'll need to create a custom component that extends ContentNode with the additional interface fields.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Wed Nov 11, 2015 12:24 pm

Hello Endless,

Thank your for your response. I initially had the task component being initialized inside a custom node which extended Group. I then moved the Task to the main Scene and like you, received a run and stop, never a DONE status. So progress :D

Saying that, what would you recommend to return so I can use the values application wide? Is extending the ContentNode the best choice in your opinion? I want to be able to work with standard values returned ( sessions, first name, last name etc.) from a login route.

How would you go about extending the ContentNode to use in the main scene?
 
User avatar
TheEndless
** Valued Community Member **
Posts: 9231
Joined: Mon Oct 04, 2004 10:15 am
Location: US
Contact:

Re: Beta Scene Graph Components

Wed Nov 11, 2015 1:11 pm

edskitter wrote:
Hello Endless,

Thank your for your response. I initially had the task component being initialized inside a custom node which extended Group. I then moved the Task to the main Scene and like you, received a run and stop, never a DONE status. So progress :D

Saying that, what would you recommend to return so I can use the values application wide? Is extending the ContentNode the best choice in your opinion? I want to be able to work with standard values returned ( sessions, first name, last name etc.) from a login route.

How would you go about extending the ContentNode to use in the main scene?

I'd probably just return an associative array, or the raw parsed JSON. The only reason to do it as a ContentNode would be if you were needing to pass it to one of the components that requires ContentNodes (e.g., PosterGrid).
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
 
edskitter
Posts: 25
Joined: Fri May 01, 2015 8:15 am

Re: Beta Scene Graph Components

Tue Nov 17, 2015 3:49 pm

How do you secure video with the new component?
  • 1
  • 4
  • 5
  • 6
  • 7
  • 8
  • 16

Who is online

Users browsing this forum: No registered users and 4 guests