Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use Dynamic Channel from JSON URL #2

Open
rkaartikeyan opened this issue Feb 26, 2017 · 1 comment
Open

How to use Dynamic Channel from JSON URL #2

rkaartikeyan opened this issue Feb 26, 2017 · 1 comment

Comments

@rkaartikeyan
Copy link

rkaartikeyan commented Feb 26, 2017

Hi,

I have JSON URL with Channels Ex: http://mytv.com/json.php

and i have coded in my config.brs like bellow

Function loadConfig() as Object
    channels = []
	request = CreateObject("roUrlTransfer")
	port = CreateObject("roMessagePort")
    request.SetMessagePort(port)
    request.SetUrl("http://mytv.com/json.php")
    jsonString = request.GetToString()
	
	json = ParseJSON(jsonString)
	for each channel in json.channels
		 
		arrayElement = {
			Title: channel.Title
			streamFormat: channel.streamFormat
			Logo: channel.Logo
			Stream: channel.Stream
		}
		
		channels.push(arrayElement)
	end for
	
    return channels
End Function

But i am getting Following error in Console

------ Running dev 'MultiLive' main ------
BRIGHTSCRIPT: ERROR: roUrlTransfer: class PLUGIN|MARKUP on thread RENDER: pkg:/components/Config.brs(6)
BRIGHTSCRIPT: ERROR: roMessagePort: Trying to construct a message port on a non-plugin thread: pkg:/components/Config.brs(7)

BrightScript Micro Debugger.
Enter any BrightScript statement, debug commands, or HELP.

Suspending threads...
Thread selected:  1*   pkg:/components/Config.brs(8)           request.SetMessagePort(port)

Current Function:
004:  Function loadConfig() as Object
005:      channels = []
006:    request = CreateObject("roUrlTransfer")
007:    port = CreateObject("roMessagePort")
008:*     request.SetMessagePort(port)
009:      request.SetUrl("http://mytv.com/json.php")
010:      jsonString = request.GetToString()
011:

Please help me to resolve this. thanks.

@yousufsk
Copy link

i am also getting same issue pls help me out guys....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants