0

Hello intelligent programmers here on stack overflow.

I am new to BrightScript with a little knowledge in HTML, however I'm trying to create my own simple Roku Channel for educational purposes, with some text and a submit button to open the Official YouTube Roku Channel so that it immediately goes to my YouTube playlist of my own videos after opening my app.

Basically a redirect to my YouTube playlist using a self created Roku Channel and the official YouTube Roku Channel.

So that when someone opens my channel it opens the official YouTube Roku Channel and then goes directly to my YouTube playlist.

All that I know how to program in brightscript is ....

sub Main()
end sub

but what code would I need to put within the "sub Main() and end sub" code above?

From doing research, I found this similar question here on StackOverflow but it lacked detail of the format of the code, for example how it should look like or the actual code itself.

How do I open another channel from one channel in Roku?

I would much appreciate if I could get help on this by someone.

PS. Also from research I discovered on Roku's developer guide a post on Deep Linking, but it was talking about ads, and I don't want to make an ad, just basically a redirect to open the Official YouTube Roku Channel and go to my YouTube playlist via some sort of link.

Thanks again people!

Carlm3
  • 19
  • 1
  • 3
  • The file I'm referring to in my above post is the Main.brs file. Also would I need to make other files since its just a simple redirect to open my YouTube playlist? – Carlm3 Jul 31 '17 at 23:25

4 Answers4

0

You can't open another channel on a roku device while one channel is currently active. Only one channel can be loaded into the device's memory at a time without first unloading the calling channel first. This would kill the function call in memory if that were even possible. Sorry.

0

Below are API's to open and add youtube channel

http://"+deviceInfo.GetIPAddrs().eth0+":8060/launch/(youtubechannelid)
http://"+deviceInfo.GetIPAddrs().eth0+":8060/install/(youtubechannelid)
Liam
  • 27,717
  • 28
  • 128
  • 190
A.V REDDY
  • 55
  • 6
0

hi you can go to another channel from your own channel but this will not load both channels parallelly. your running channel will we closed and new channel will be loaded, if channel is installed on your device it will automatically open and if it is not installed add channel screen will be open. here is code for this. (write this code in task )

m.app = CreateObject("roAppManager")
    if m.app.IsAppInstalled(m.top.AdChannelID,"") = true

       params = {contentID:""}
       m.app.LaunchApp(m.top.AdChannelID,"",params)
    else

       m.app.ShowChannelStoreSpringboard(m.top.AdChannelID)
    end if

and now run this task and assign channel id to this tasks

    m.OpenOtherChannelTask = createObject("roSGNode", "OpenOtherChannelTask")
    m.OpenOtherChannelTask.AdChannelID = m.channelID
    m.OpenOtherChannelTask.control = "run"

also do not forget to add this in your tasks xml file

<interface > 
    <field id="AdChannelID" type="string"/>
  </interface>
M-Hamza
  • 54
  • 6
-1

Check how to launch third-party channel from your application

deviceInfo = CreateObject("roDeviceInfo")
deviceIP = deviceInfo.GetIPAddrs().eth1
urlString = "http://" + deviceIP + ":8060/launch/12"     
request = CreateObject("roUrlTransfer")
request.SetUrl(urlString)
request.AsyncPostFromString(urlString)
Ashish Mishra
  • 167
  • 2
  • 10