Search code examples
rokubrightscript

How to lauch another channel(B) from current channel(A) in ROKU


  1. Show all channels
  2. Clicking on channel takes the user to channel if installed
  3. If not installed, allow the user to install.

    if IsChannelIstalled(channelID) then ECP_Command(“launch/channelID?contentID=deep_link_param) else ECP_Command(“install/channelID?contentID=deep_link_param) end if

Many thanks in advance!!!


Solution

  • Here is a function that might help you:

    sub launchChannel(channelId as String, params = "" as String)
        urlTransfer = createObject("roURLTransfer")
        ipAddress = createObject("roDeviceInfo").getIPAddrs().eth0
    
        url = "http://" + ipAddress + ":8060/launch/" + channelId
    
        if params.len() > 0
            url = url + "?" + params
        end if
    
        urlTransfer.setURL(url)
        urlTransfer.postFromString("")
    end sub
    

    For more info check External Control Guide.