RoTuner API (Use outside of Scene Graph)

How does one use the roTuner API with ifVideoPlayer? I’ve tried to copy the way Content-Metadata is configured in the Scene Graph (SimpleTuner) example but I get a “failed to create media player” error every time. Are there any constraints when using Broadcast video vs streaming? I might have triggered this error by also using SetDestinationRect.

Any help would be greatly appreciated.

Looking into it…

  • Joel

:grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes:

Joel, the “GetNowNextPrograms” method on roProgramGuide also doesn’t exist. I get a BrightScript error. I’m the latest TCL TV firmware (7.1).

Figured out the issue. I can literally just pass the content_metadata value from channel info to ifvideoplayer. Trying to create an AA that looks like the example doesn’t work.

“retrotom” wrote:
Figured out the issue. I can literally just pass the content_metadata value from channel info to ifvideoplayer. Trying to create an AA that looks like the example doesn’t work.
Have you got an example of what you did? I was playing about with the roTuner stuff last week and could only get the Screne Graph stuff to work, and I’ve yet to dive down that path.
I want to guess that you’ve done something like this, but I’m away from the kit to test


  tuner = CreateObject("roTuner")
  if (tuner <> invalid)
    channels = tuner.GetChannelList()
    channelInfo = tuner.GetChannelInfo(channels[0])
    if channelInfo <> invalid
      port = CreateObject("roMessagePort")
      canvas = CreateObject("roImageCanvas")
      canvas.SetMessagePort(port)
      canvas.SetLayer(0, { color: "#00000000", CompositionMode: "Source" })
      canvas.Show()

      player = CreateObject("roVideoPlayer")
      player.SetMessagePort(port)
      player.SetDestinationRect(canvas.GetCanvasRect())
      player.SetContentList(channelInfo.content_metadata)
      player.Play()
      while true
        msg = Wait(0, port)
        if msg.isRemoteKeyPressed()
          index = msg.GetIndex()
          if index = 0 ' <BACK>
            print "Closing video screen"
            player.Stop()
            exit while
          end if
        end if
      end while
    end if
  end if

Your mistake is with this line (I think):


player.SetContentList(channelInfo.content_metadata)

It should be:


player.SetContentList([channelInfo.content_metadata])

To make it into an array.

Thanks retrotom, remote testing appears to work, although I’m not actually in front of the TV to check.
Also wondering if GetNowNextPrograms is actually supported, or a typo is involved in the OS/docs.

I’m hoping it’s just a typo. I’ve had to settle for just calling GetPrograms on each channel from the list. While it mostly works for my needs, I’m not confident this is the best route.

“artesea” wrote:
Also wondering if GetNowNextPrograms is actually supported, or a typo is involved in the OS/docs.
Yes :). FWIW:

BrightScript Debugger> pg = createObject("roProgramGuide") : now = createObject("roDateTime")
BrightScript Debugger> ? pg.getNowNextPrograms("2.4", now)
<Component: roArray> =
[
    <Component: roAssociativeArray>
    <Component: roAssociativeArray>
]

Speaking of which… WTH is roContentMetadata ?!

BrightScript Debugger> ? pg.getNowNextPrograms("2.4", now)[0]
<Component: roAssociativeArray> =
{
    category: 
    content_metadata: <Component: roContentMetadata>
    description: 
    duration: <Component: roDateTime>
    format: <Component: roAssociativeArray>
    id:  330
    name: BUZZR Time Machine
    start_time: <Component: roDateTime>
}

pg.getNowNextPrograms("2.4", now)

Where did that come from?! I only see:

GetNowNextPrograms(channel as String) as Dynamic

-JT

“renojim” wrote:
Where did that come from?!
Yours truly.

[spoiler=Nobody tells me nothin:2hbk5z78][youtube:2hbk5z78]bVEshFviM0g[/youtube:2hbk5z78][/spoiler:2hbk5z78] … but being around Roku for five years has given me a certain… je ne sais quoi in solving mysteries. :twisted:

Well I don’t get “Member function not found”, but I do get roInvalid for every channel. I don’t think this whole roTuner/roProgramGuide has finished baking.

“renojim” wrote:
Well I don’t get “Member function not found”, but I do get roInvalid for every channel. I don’t think this whole roTuner/roProgramGuide has finished baking.
That on a RokuTV ?
And you have let it discover the aerial channels at some point?
And can get list of channels via the API?
And have switched to antenna channel recently?

Yes x4. I get the info about the current program at the bottom of the screen when I change channels, but nothing from roProgramGuide except roInvalid for the two dozen or so channels I can receive.

-JT

Huh!
For me the info appears only after i have been switched to that channel - ditto for the info in http://rokuTV:8060/query/tv-active-channel - initially only shows the channel name but after been tuned to it gets the rest.

5200 (Hisense) 7.2.4101-11 here
See also example under https://sdkdocs.roku.com/display/sdkdoc/roTuner