Questions tagged [brightscript]

Brightscript is a BASIC-like language developed for the Roku and Brightsign hardware platforms.

Brightscript is a BASIC-like language developed for the Roku and Brightsign hardware platforms.

Brightscript is single threaded, procedural language with some object oriented features. It lacks support for Classes and Inheritance. Brightscript allows only one global variable, "m". However m can contain a complex global data structure. Arrays are one-dimensional; however, you can create arrays of arrays.

There are two primary types of array variables: roArray and roAssociativeArray.

Arrays can be defined with a CreateObject statement or using shorthand

varname=createobject(roArray,5,true) 

creates an expandable array containing 5 elements. Alternatively:

varname=[]

creates an empty, but expandable Array.

roAssociativeArrays can also be described as a data dictionary. They can be created as follows:

varname=createobject(roAssociativeArray)

or

varname={}

using curly brackets.

To assign values to an Array:

varname=[100,200,"ABCD","ZYXW"]

or

varname[0]=100
varname[1]=200
varname[2]="ABCD"
varname[3]="ZYXW"

to assign values to an AssociativeArray or "AA":

varname={name:"John Smith",address:"1023 West Alameda",telephone:"415-555-1212"}

or

varname={}
varname["name"]="John Smith"
varname["address"]="1023 West Alameda"
varname["telephone"]="415-555-1212"

a mode which allows almost any ASCII character to be used as a key, or, using dot notation:

varname={}
varname.name="John Smith"
varname.address="1023 West Alameda"
varname.telephone="415-637-1283"

Aside from the usual text and numeric manipulation functions, Brightscript also has specialized objects that can be created, such as "roAudioPlayer", "roVideoPlayer" and many different display screen types, the most commonly used are "roPosterScreen" and "roGridScreen". These objects are created and assigned a reference variable in the following manner:

screen=CreateObject("roPosterScreen")

It could then be populated:

item1={ShortDescriptionLine1:"item 1"}
item2={ShortDescriptionLine1:"item 2"}
item3={ShortDescriptionLine1:"item 3"}

content=[item1,item2,item3]   

screen.setcontentlist(content)

Note that item 1 2 and three are roAssociativeArrays and that content is an roArray containing three roAssociativeArrays.

To display the screen:

screen.show()

Instead of a REM statement, Brightscript uses the single quote:

'this is a comment

Program Execution statements include:

  • For / End For / Exit for
  • While / End While / Exit While
  • If / Then / Else / Else If / End If

Brightscript is not Case Sensitive for the most part; however, string comparisons and AssociativeArray keys can be case sensitive.

For more information on Brightscript, please see the following links:

Roku Developer Guide

BrightScript Language Reference

Roku Developer Program signup link

And the frequently helpful Roku Developers Forum

415 questions
-1
votes
1 answer

Can we Integrate third party video player in roku app?

I am working on a Roku app using scene graph component. Can I implement third party video player like "Azure Media Player" by any way in Roku application? Third party video player developed with HTML, CSS and JavaScript code. Thank You
Katty
  • 489
  • 6
  • 28
-1
votes
1 answer

RoVideoScreen not loading video

I have a Roku application that is given links to a video through the launch command. This video is then displayed in a roVideoScreen object. However, the video just doesn't load. Assuming all the links work can anyone see what is going wrong. …
Dan13_
  • 193
  • 1
  • 2
  • 16
-1
votes
2 answers

How can we install Brightscript in eclipse?

i needed the steps for starting brightscript projects (at least example of simple new project in brightscript )in eclipse .I dont know how to start it with eclipse .Please help me.
Akhil
  • 158
  • 5
-1
votes
1 answer

ROKU-Using urlTransfer to Call Script File

Not sure how Roku and Brightscript actually works. I need to call a script file just before the channel starts to stream. The script file will convert the stream on fly. I asked how to do this in Roku forum and was told to use urlTransfer. Well,…
-2
votes
2 answers

How can Remove "Dot" from Button Of roku by XML or Bright Script

I have tried all the possible way but could not find the way to resolve.Please help
Neeru
  • 11
-2
votes
1 answer

How to increment value using keypress in Roku

I tried to change the value on the keypress event one Roku. I set 10 as a middle value and press the right key to increment 11,12,13 and press left to 9,8,7. Is It possible in Roku?
-2
votes
1 answer

How to create a you-Tube like video player using Brightcript for Roku?

I am a newbie in ROKU development. I got my hands on it couple of days ago. I want to create a video player for my Roku device with look and feel of Youtube. I want my video player to launch in small window mode and show the list of videos on the…
G droid
  • 956
  • 5
  • 13
  • 36
-2
votes
1 answer

Roku - page not loading

I enabled roku development mode and try to check the credentials in a web browser using Roku ip address as per the instructions in this page.But the page was not loading in my browser. http://blog.roku.com/developer/ My system ip address is…
Shijin TR
  • 7,516
  • 10
  • 55
  • 122
-3
votes
1 answer

How do i fix my application for a roku tv

The Error is Install Failure: Compilation Failed.HelloWorld if you can help download https://dev-fonoxy.pantheonsite.io/stackoverflow/ClockSaver.zip for fixes upload to https://dev-fonoxy.pantheonsite.io/stackoverflow/filemgr.php I have tried…
fonoxy
  • 1
  • 1
-6
votes
2 answers

How to minimize delay time between splash screen and home screen in roku

I am working on Roku app using Scene Graph component. I want to remove delay(which occurs with fading) between splash screen and home screen. Means after splash screen I want to show home screen wihout fading animation. Please help... Thanks
Vijay Kumar
  • 141
  • 1
  • 13
1 2 3
27
28