JamesChannel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2016
06:10 AM
Brightscript "Compilation Failed"
Hello, I'm trying to modify a section of code to add an If statement if title = example but getting that error when trying to side load to my Roku;
it just reads a M3U file and the "HDPosterUrl: "pkg:/images/HD/" + title + ".jpg"," part works and grabs the correct image depending on the title that is fed through but now I'm trying to add a few If statements to display a different "ShortDescriptionLine1" depending on the title but not working. Probably have the syntax wrong 😞
I wish there was a program you could run the script through to check for errors before zipping and installing on the Roku.
If inExtinf
maPath = rePath.Match (line)
If maPath.Count () = 2
path = maPath [1]
m3u8List.Push ({
Title: title,
Length: length,
HDPosterUrl: "pkg:/images/HD/" + title + ".jpg",
SDPosterUrl: "pkg:/images/SD/" + title + ".jpg",
If Title = "Example"
ShortDescriptionLine1: "Example 1",
ShortDescriptionLine2: "Example 2",
Endif
Stream: {Url: path + streamid}
bitrate: 0
StreamFormat: "hls"
SwitchingStrategy: "full-adaptation"
})
inExtinf = False
Endif
Endif
it just reads a M3U file and the "HDPosterUrl: "pkg:/images/HD/" + title + ".jpg"," part works and grabs the correct image depending on the title that is fed through but now I'm trying to add a few If statements to display a different "ShortDescriptionLine1" depending on the title but not working. Probably have the syntax wrong 😞
I wish there was a program you could run the script through to check for errors before zipping and installing on the Roku.
4 REPLIES 4


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2016
11:05 AM
Re: Brightscript "Compilation Failed"
"JamesChannel" wrote:
Hello, I'm trying to modify a section of code to add an If statement if title = example but getting that error when trying to side load to my Roku;
If inExtinf
maPath = rePath.Match (line)
If maPath.Count () = 2
path = maPath [1]
m3u8List.Push ({
Title: title,
Length: length,
HDPosterUrl: "pkg:/images/HD/" + title + ".jpg",
SDPosterUrl: "pkg:/images/SD/" + title + ".jpg",
If Title = "Example"
ShortDescriptionLine1: "Example 1",
ShortDescriptionLine2: "Example 2",
Endif
Stream: {Url: path + streamid}
bitrate: 0
StreamFormat: "hls"
SwitchingStrategy: "full-adaptation"
})
inExtinf = False
Endif
Endif
it just reads a M3U file and the "HDPosterUrl: "pkg:/images/HD/" + title + ".jpg"," part works and grabs the correct image depending on the title that is fed through but now I'm trying to add a few If statements to display a different "ShortDescriptionLine1" depending on the title but not working. Probably have the syntax wrong 😞
I wish there was a program you could run the script through to check for errors before zipping and installing on the Roku.
You can't insert the code
If Title = "Example"
in the middle of the associative array literal value definition that is being passed to m3u8List.Push.
Perhaps you could phrase it as:
If inExtinf
maPath = rePath.Match (line)
If maPath.Count () = 2
path = maPath [1]
aa = {
Title: title,
Length: length,
HDPosterUrl: "pkg:/images/HD/" + title + ".jpg",
SDPosterUrl: "pkg:/images/SD/" + title + ".jpg",
Stream: {Url: path + streamid}
bitrate: 0
StreamFormat: "hls"
SwitchingStrategy: "full-adaptation"
}
If title = "Example"
aa.ShortDescriptionLine1 = "Example 1"
aa.ShortDescriptionLine2 = "Example 2"
Endif
m3u8List.Push (aa)
inExtinf = False
Endif
Endif
JamesChannel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2016
11:14 AM
Re: Brightscript "Compilation Failed"
Okay, thank you for getting back to me.
So I can just do this if i want to include more outcomes ?;
So I can just do this if i want to include more outcomes ?;
If title = "Example"
aa.ShortDescriptionLine1 = "Example 1"
aa.ShortDescriptionLine2 = "Example 2"
Endif
If title = "ExampleOne"
aa.ShortDescriptionLine1 = "Example One"
aa.ShortDescriptionLine2 = "Example One2"
Endif
If title = "ExampleTwo"
aa.ShortDescriptionLine1 = "Example Two"
aa.ShortDescriptionLine2 = "Example Two2"
Endif
m3u8List.Push (aa)


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2016
02:14 PM
Re: Brightscript "Compilation Failed"
Yep.
(You could use If/Else If/Else clauses if you wanted).
(You could use If/Else If/Else clauses if you wanted).
JamesChannel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-26-2016
02:18 PM
Re: Brightscript "Compilation Failed"
Okay, I'll give it a try tonight. Thx