Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

combine sgdex timegrid with video

Hello. I am new to Roku development and I got lost. I am working on SGDEX timeGrid epg example. For days I have been tracing the code and trying to understand how it works. I was able to make some changes.  I added url to json files so each channel and program has its unique URL. I also examined their video example. What I am trying to do is when clicked on a program item on EPG it should open a video with the URL the program has. Following is the onclick function



     sub OnProgramSelected(event as Object)
        print "Entering TimeGridView.brs OnProgramSelected()"
        timeGrid = event.GetRoSGNode() = [timeGrid.channelSelected, timeGrid.programSelected]

        print timeGrid.programSelected
        print timeGrid.channelSelected
        print m.view.content.getChild(0)  'prints the channel
        print m.view.content.getChild(timeGrid.channelSelected).getChild(timeGrid.programSelected) 'prints the program

        myNode = CreateObject("roSGNode", "ContentNode")
        myNode.focusable = false = 1
        myNode.title = "Live Gaming Sample Content 1"
        myNode.URL = "https://some url.." 'I will pass the program url if this test works

        print myNode


        print "Exiting TimeGridView.brs OnProgramSelected()"
    end sub



I took OpenVideoPlayerItem() function completely from SGDEX video example which is as follows:


   function OpenVideoPlayerItem(contentItem as Object) as Object
      ' Create MediaView Object and set its fields
      video = CreateObject("roSGNode", "MediaView")
      video.content = contentItem
      video.isContentList = false
      ' Set it to start playing, it wont begin playback until show() is called
      video.control = "play"
      ' Show the media view"show", {
          view: video
      return video
  end function


When I run the project it gives the following error:

 Interface not a member of BrightScript Component (runtime error &hf3) in pkg:/components/VideoPlayerLogic.brs(36) 036:"show", { 



I do not understand the problem. I don't understand why it does not play and I do not know how to implement it correctly. The funny thing is once it started to play audio only although it gave the same error.

Tags (1)
0 Kudos

Re: combine sgdex timegrid with video

Here you do not maintain in a stack. It means the first view It's a "time grid" not closed and you tried to open a new view it's "video view". and given this error. so, It's not possible to open the view above view in Roku. First, you close the first view before opening another view.

0 Kudos
Level 7

Re: combine sgdex timegrid with video

Hello, I am also new to roku application programming and I would like to know how I add url of live channels to the json file, thanks.

0 Kudos