Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
onevoisses
Visitor

Parts of a code I cannot Understand.It works though

here is my appMain.brs file

1 bitrates = [0]
2
3 'Swap the commented values below to play different video clips...
4 'srt = "file://pkg:/source/craigventer.srt" 'doNot Work
5 srt =""
6 ' Big Buck Bunny test stream from Wowza
7 'urls = ["http://ec2-174-129-153-104.compute-1.amazonaws.com:1935/vod/smil:BigBuckBunny.smil/playlist.m3u8"] 'No Work
8 'urls = ["http://184.xxx.xxx.xx9/vod/smil:BigBuckBunny.smil/playlist.m3u8"] 'This External works
9 urls = ["http://myserver:1935/vod/mp4:sample.mp4/playlist.m3u8"] 'My Server Works
10 qualities = ["SD"]
11 streamformat = "hls"
12 'streamformat = "mp4" 'this doesnot work
13 title = "Big Buck Bunny"

Here are the Questions

line 4 srt="file......" donot work and so I had to use srt="" (see line 5).I would like to fix this since it puts a caption on the bottom of the movie (see my debug log also) ?

line 7 the original url of the amazon bucket that comes with the examples do not work,I found the url in line 8 which works and enable me me to better debug my problem.Should the examples be updated for these url?

line 9,11 & 12 I found that I had to use "hls" as the stream format yet this is a vod(video on demand stream) of an mp4 file which is place in the content directory.What impact will this have on a live stream? is it that for all streams format from third party servers to the Roku DVP have to be "hls"?

Now for the stupid question of the day "what does the "smil" stands for in {urls = ["http://184.xxx.xxx.xx9/vod/smil:BigBuckBunny.smil/playlist.m3u8"]} and is it used for streaming live?"


Here is my debuglog
onevoisses@onevoisses:~$ telnet xxx.xxx.xxx.xxx 8085
Trying xxx.xxx.xxx.xxx...
Connected to xxx.xxx.xxx.xxx.
Escape character is '^]'.
0 [homescreen]
roAssociativeArray refcnt= 1 addr=0x5c1b6ad0
roString refcnt= 1 addr=0x5c1dfdb8 [homescreen]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 16 msg: Playback completed.
Closing video screen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 16 msg: Playback completed.
Closing video screen
Screen closed
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5ccfa668
roString refcnt= 1 addr=0x547901d0 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 15 msg: Playback interrupted by user.
Closing video screen
Screen closed
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5cc79b60
roString refcnt= 1 addr=0x5474c060 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
play failed: An unexpected problem (but not server timeout or HTTP error) has been detected.
Closing video screen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
play failed: An unexpected problem (but not server timeout or HTTP error) has been detected.
Closing video screen
*** ERROR compiling /pkg:/source/appMain.brs:
Syntax Error. (compile error &h02) in ...M8IdZ/pkg:/source/appMain.brs(176)
Screen closed
*** ERROR compiling /pkg:/source/appMain.brs:
Syntax Error. (compile error &h02) in ...qcLFB/pkg:/source/appMain.brs(176)
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5d0e1d18
roString refcnt= 1 addr=0x547245d0 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 11 msg: Content contains no playable tracks.
play failed:
Closing video screen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 11 msg: Content contains no playable tracks.
play failed:
Closing video screen
Button pressed: 1 0
Displaying video:
srt = file://pkg:/source/craigventer.srt
Unknown event: 20 msg: Stream started.
Unknown event: 11 msg: Content contains no playable tracks.
play failed:
Closing video screen
Screen closed
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5ccf9dd0
roString refcnt= 1 addr=0x5c2a63d0 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt =
Unknown event: 20 msg: Stream started.
Unknown event: 11 msg: Content contains no playable tracks.
play failed:
Closing video screen
Screen closed
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5c21adb8
roString refcnt= 1 addr=0x54727c80 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt =
Unknown event: 20 msg: Stream started.
Unknown event: 16 msg: Playback completed.
Closing video screen
Screen closed
Leaked bsc instances:
roAssociativeArray refcnt= 1 addr=0x5c274db0
roString refcnt= 1 addr=0x5472b110 [auto-run-dev]
------ Running ------
Type args = roAssociativeArray
Type args.url = Invalid
showSpringboardScreen
Button pressed: 1 0
Displaying video:
srt =
Unknown event: 20 msg: Stream started.
Unknown event: 16 msg: Playback completed.

Closing video screen


my server console logs is attached
Please note that with the parameters above this works but is it the correct way.?

No more coffee Let me go shuteye country for a Vacation of 5hrs.
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
13 REPLIES 13
belltown
Roku Guru

Re: Parts of a code I cannot Understand.It works though

1. Make sure you have the file, craigventer.srt, in the same source directory as your appmain.brs file.
2. Yes, the url, http://ec2-174-129-153-104.compute-1.am ... ylist.m3u8, no longer works and the examples should be updated with a correct url such as, http://en.wikipedia.org/wiki/Synchronized_Multimedia_Integration_Language
0 Kudos
onevoisses
Visitor

Re: Parts of a code I cannot Understand.It works though

Ok so Here is my Problem

I tried this
viewtopic.php?f=34&t=35019&start=0
viewtopic.php?f=34&t=41927&p=284442&hilit=video+player#p284442

And I read this
viewtopic.php?f=34&t=39143

and I know there are people who get the Videoplayer to work with hls but here is what i get when I tried the video player on a live stream

telnet 1st

created feed connection for http://xxx.xxx.xxx.xxx/live.xml
url: http://xxx.xxx.xxx.xxx/live.xml
Request Time: 16
Can't parse feed
list focused | current category = 0

then my xml is

xml file

<item sdImg="http://xxx.xxx.xxx.xxx/images/creat001.jpg" hdImg="http://xxx.xxx.xxx.xxx/images/creat001.jpg">
<title>NASA</title>
<contentId>10001</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<streamFormat>hls</streamFormat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<streamUrl>http://iphoned5.akamai.com.edgesuite.net/mhbarron/nasatv/nasatv_all.m3u8</streamUrl>
</media>
<runtime>1260</runtime>
</item>

when I validate the xml it has no errors
the feed works with both the simplevideoplayer and the customplayer
I have a wowza server and it works to with the simplevideoplayer and the customplayer even with my local live stream

I am using Roku 2 XD with developers version 2.9 and it side loads okay

I also change the StreamBirate to 0 and it still didnot work and my streamFormat is hls so can you tel me why its not parsing on the videoplayer?

and this URL also works http://www.nasa.gov/multimedia/nasatv/N ... c-IPS.m3u8 with the customplayer and simplevideoplayer
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
destruk
Streaming Star

Re: Parts of a code I cannot Understand.It works though

Can't parse XML means there is an issue getting the data from your xml file. Although it passes the xml validator, you might try adding a declaration that it is an XML file at the top. The declaration is optional, but perhaps Roku needs it.

http://www.ibm.com/developerworks/xml/l ... index.html

An example declaration is
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Just a thought...I've never tried sending roku an xml file without it, and don't see issues by including it.

If that's not the problem, then look at your parsing code and see where the message "Can't parse feed" shows up. Then backtrack to determine the issue. Maybe your code is looking for a 'category' tag, and if that is missing it tosses up the message.
0 Kudos
onevoisses
Visitor

Re: Parts of a code I cannot Understand.It works though

Here is the backtrace

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

Current Function:
034: Function showPosterScreen(screen As Object, category As Object) As Integer
035:
036: if validateParam(screen, "roPosterScreen", "showPosterScreen") = false return -1
037: if validateParam(category, "roAssociativeArray", "showPosterScreen") = false return -1
038:
039: m.curCategory = 0
040: m.curShow = 0
041:
042: screen.SetListNames(getCategoryList(category))
043: screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
044: screen.Show()
045:
046: while true
047: msg = wait(0, screen.GetMessagePort())
048: if type(msg) = "roPosterScreenEvent" then
049: print "showPosterScreen | msg = "; msg.GetMessage() " | index = "; msg.GetIndex()
050: if msg.isListFocused() then
051: m.curCategory = msg.GetIndex()
052: m.curShow = 0
053: screen.SetFocusedListItem(m.curShow)
054: screen.SetContentList(getShowsForCategoryItem(category, m.curCategory))
055: print "list focused | current category = "; m.curCategory
056: else if msg.isListItemSelected() then
057: m.curShow = msg.GetIndex()
058: print "list item selected | current show = "; m.curShow
059: m.curShow = displayShowDetailScreen(category, m.curShow)
060: screen.SetFocusedListItem(m.curShow)
061: print "list item updated | new show = "; m.curShow
062: else if msg.isScreenClosed() then
063: return -1
064: end if
065: end If
066: end while
067:
068:
069: End Function
Break in 47
047: msg = wait(0, screen.GetMessagePort())
Backtrace:
Function showposterscreen(screen As <uninitialized>, category As <uninitialized>) As Integer
file/line: /tmp/plugin/GBAAAALtEatE/pkg:/source/appPosterScreen.brs(47)
Function displaycategoryposterscreen(category As <uninitialized>) As
file/line: /tmp/plugin/GBAAAALtEatE/pkg:/source/appHomeScreen.brs(79)
Function showhomescreen(screen As ) As Integer
file/line: /tmp/plugin/GBAAAALtEatE/pkg:/source/appHomeScreen.brs(56)
Function main() As
file/line: /tmp/plugin/GBAAAALtEatE/pkg:/source/appMain.brs(20)

Local Variables:
screen &h0010 bsc:roPosterScreen, refcnt=2
category &h4010 bsc:roAssociativeArray, refcnt=6
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=5
msg &h0000 <uninitialized> val:Uninitialized
BrightScript Debugger>



I notice that its say that I have unitialized variable (screen and category) but that was done in line 034 as a function so isn't it supposed to be available globally.

Should I change this to a sub instead of a function?
Should they be declared in the homescreen rather than the posterscreen?

I hope we get this I have been working on this none stop for the past three days.Passionate about it being solved
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
onevoisses
Visitor

Re: Parts of a code I cannot Understand.It works though

This is ironic,the program runs on every leaf of the category except the live.xml and the syntax are all the same.I even put the hls in another category leaf and it breaks it too.
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
destruk
Streaming Star

Re: Parts of a code I cannot Understand.It works though

Where it says "Can't parse feed"
replace that line of code with STOP
Then you can be right in the parse routine in the debugger and you can print xml to see what it shows you there, and run through the lines manually to figure out what the real issue is.
0 Kudos
destruk
Streaming Star

Re: Parts of a code I cannot Understand.It works though

The real section of code that is failing will look something like this:

Function load_show_feed(conn As Object) As Dynamic
If validateParam(conn, "roAssociativeArray", "load_show_feed")=FALSE Return invalid
Print "url: " + conn.UrlShowFeed
http=NewHttp(conn.UrlShowFeed)
m.Timer.Mark()
rsp=http.GetToStringWithRetry()
Print "Request Time: " + itostr(m.Timer.TotalMilliseconds())
feed=newShowFeed()
xml=CreateObject("roXMLElement")
If Not xml.Parse(rsp)
Print "Can't parse feed"
Return feed
End If
If xml.GetName() <> "feed"
Print "no feed tag found"
Return feed
End If
If islist(xml.GetBody()) = FALSE Then
Print "no feed body found"
Return feed
End If
m.Timer.Mark()
m.ParseShowFeed(xml, feed)
Print "Show Feed Parse Took : " + itostr(m.Timer.TotalMilliseconds())
Return feed
End Function

try replacing that line with stop
and in the debugger try to print rsp and see what shows up
0 Kudos
onevoisses
Visitor

Re: Parts of a code I cannot Understand.It works though

This is what I get.
I tried 7 other alternatives,still cannot see the answer


- Running ------
created feed connection for http://xxx.xxx.xxx.xxx/xml/categories.xml
url: http://xxx.xxx.xxx.xxx/xml/categories.xml
Took: 10ms
Parse Took: 5ms
begin category node parsing
number of categories: 5
ParseCategoryNode: banner_ad
ParseCategoryNode skip: banner_ad
parse returned no child node
ParseCategoryNode: category
category:
categoryLeaf:
ParseCategoryNode: categoryLeaf
categoryLeaf:
ParseCategoryNode: categoryLeaf
added new child node
ParseCategoryNode: category
category: Live Shows | Streaming Live
categoryLeaf: Live []
ParseCategoryNode: categoryLeaf
categoryLeaf:
ParseCategoryNode: categoryLeaf
added new child node
ParseCategoryNode: category
category: On Demand | Past Shows and Events
categoryLeaf: Archives
ParseCategoryNode: categoryLeaf
added new child node
ParseCategoryNode: category
category:
categoryLeaf: Archives
ParseCategoryNode: categoryLeaf
added new child node
Traversing: 29ms
showHomeScreen | msg = | index = 2
showHomeScreen | msg = | index = 1
showHomeScreen | msg = | index = 1
list item selected | index = 1
created feed connection for http://xxx.xxx.xxx.xxx/xml/live.xml
url: http://xxx.xxx.xxx.xxx/xml/live.xml
Request Time: 15
Current Function:
076: Function load_show_feed(conn As Object) As Dynamic
077:
078: if validateParam(conn, "roAssociativeArray", "load_show_feed") = false return invalid
079:
080: print "url: " + conn.UrlShowFeed
081: http = NewHttp(conn.UrlShowFeed)
082:
083: m.Timer.Mark()
084: rsp = http.GetToStringWithRetry()
085: print "Request Time: " + itostr(m.Timer.TotalMilliseconds())
086:
087: feed = newShowFeed()
088: xml=CreateObject("roXMLElement")
089: if not xml.Parse(rsp) then
090: 'print "Can't parse feed"
091: Stop
092: return feed
093: endif
094:
095: if xml.GetName() <> "feed" then
096: print "no feed tag found"
097: return feed
098: endif
099:
100: if islist(xml.GetBody()) = false then
101: print "no feed body found"
102: return feed
103: endif
104:
105: m.Timer.Mark()
106: m.ParseShowFeed(xml, feed)
107: print "Show Feed Parse Took : " + itostr(m.Timer.TotalMilliseconds())
108:
109: return feed
110:
111: End Function
STOP (runtime error &hf7) in ...BeiL/pkg:/source/showFeed.brs(91)

091: Stop
Backtrace:
Function load_show_feed(conn As <uninitialized>) As
file/line: /tmp/plugin/FCAAA...BeiL/pkg:/source/showFeed.brs(92)
Function getshowsforcategoryitem(category As <uninitialized>, item As Integer) As <uninitialized>
file/line: /tmp/plugin/FCAAAA1CBeiL/pkg:/source/appPosterScreen.brs(123)
Function showposterscreen(screen As <uninitialized>, category As <uninitialized>) As Integer
file/line: /tmp/plugin/FCAAAA1CBeiL/pkg:/source/appPosterScreen.brs(43)
Function displaycategoryposterscreen(category As <uninitialized>) As
file/line: /tmp/plugin/FCAAAA1CBeiL/pkg:/source/appHomeScreen.brs(79)
Function showhomescreen(screen As ) As Integer
file/line: /tmp/plugin/FCAAAA1CBeiL/pkg:/source/appHomeScreen.brs(56)
Function main() As
file/line: /tmp/plugin/FCAAAA1CBeiL/pkg:/source/appMain.brs(20)

Local Variables:
conn &h0010 bsc:roAssociativeArray, refcnt=4
global &h0020 rotINTERFACE:ifGlobal
m &h0010 bsc:roAssociativeArray, refcnt=4
http &h0010 bsc:roAssociativeArray, refcnt=1
rsp &h8010 bsc:roString (2.1 was String), refcnt=1
feed &h0010 bsc:roArray, refcnt=1
xml &h0010 bsc:roXMLElement, refcnt=1
BrightScript Debugger>
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
RokuMarkn
Visitor

Re: Parts of a code I cannot Understand.It works though

First thing would be to print rsp to make sure it contains what you think it contains.

--Mark
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.