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: 
newchannel
Roku Guru

simplevideoplayer to play mp3 question

I have the simplevideoplayer. I added a streamurl and then zipped and sideloaded. My sideload says Compilation Failed.

Not sure what I am doing wrong. Is there something else I need to change? I edited the appmain and went down to line 175 I believe and just changed the stream url.

Goal is to load a channel with one screen and play an audio stream.
http://www.victoryNOWfilmsandtv.com
0 Kudos
15 REPLIES 15
RokuMarkn
Visitor

Re: simplevideoplayer to play mp3 question

What is the error message in the debugger?

--Mark
0 Kudos
newchannel
Roku Guru

Re: simplevideoplayer to play mp3 question

It's showing this :

*** ERROR compiling /pkg:/source/appMain.BRS:
Syntax Error. (compile error &h02) in ...JpvsL/pkg:/source/appMain.BRS(175)

But I don't see a syntax error

This is what I have for the mp3 stream:

'Swap the commented values below to play different video clips...
<streamUrl>http://xxx.xxx.xx.xx:8000/</streamUrl>
qualities = ["SD"]
StreamFormat = "mp3"
title = "Craig Venter Synthetic Life"
srt = ""
http://www.victoryNOWfilmsandtv.com
0 Kudos
newchannel
Roku Guru

Re: simplevideoplayer to play mp3 question

I know the stream url works because I have it playing on one of my channels which uses xml on a server.

I started testing the simplevideoplayer to play mp3 stream because I need a package that has only one screen when channel opens and I want it all to be included in the package with no external xml on server.

Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
belltown
Roku Guru

Re: simplevideoplayer to play mp3 question

If you have:


<streamUrl>http://xxx.xxx.xx.xx:8000/</streamUrl>


in your .brs file, then that's where the syntax error is. That's Xml, not BrightScript.

Also, please use "code" tags when you're posting code. It makes it easier to see what's actually code and what isn't.

In any case, you can't just change the stream format from mp4 to mp3 and expect to play it using an roVideoScreen; you need to use the roAudioPlayer component.

I believe you had the same question two years ago: http://forums.roku.com/viewtopic.php?f=34&t=50154

And here's the answer I gave then: http://forums.roku.com/viewtopic.php?f=34&t=51192&start=0
0 Kudos
newchannel
Roku Guru

Re: simplevideoplayer to play mp3 question

I have the videoplayer example working from a long time ago.

I was tinkering with the simplevideoplayer example to see if I could get an mp3 stream to play audio because I like the way it opens up to only one screen.

Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
belltown
Roku Guru

Re: simplevideoplayer to play mp3 question

"newchannel" wrote:
Goal is to load a channel with one screen and play an audio stream.


The easiest way to do that is to use the 'audioapp' example code. In AudioApp.brs, change CreateCategories() so it only sets up one poster item (the NPR stream), then change Npr.brs to use your own mp3 stream. Note, the NPR stream in the Roku example code doesn't work any more, so if you want to test their example code and your stream doesn't seem to work, another working stream you could try is: http://wbur-sc.streamguys.com/wbur.mp3
0 Kudos
newchannel
Roku Guru

Re: simplevideoplayer to play mp3 question

belltown,

Thank you. I added the stream you provided and it plays. Now working on seeing how to change out the other categories so I only have one screen and no categories.

Then I'll test the radio stream I have.
http://www.victoryNOWfilmsandtv.com
0 Kudos
newchannel
Roku Guru

Re: simplevideoplayer to play mp3 question

I have my stream working, thank you belltower. audioapp a lot better choice.

I was able to comment out the other categories.

When the channel opens it opens up to the one screen with npr logo and then click once to go to the poster with the play button.

Is it possible to bypass the extra click and have it go straight to the poster with the play button?

Thank you
http://www.victoryNOWfilmsandtv.com
0 Kudos
belltown
Roku Guru

Re: simplevideoplayer to play mp3 question

In AudioApp.brs, change Main() to:

Sub Main()
print "Entering Main"
SetMainAppIsRunning()

' Set up the basic color scheme
SetTheme()

' Create a list of audio programs to put in the selection screen
Categories = CreateCategories()

' Display the first category
Categories.PosterItems[0].Process("Categories")

print "Exiting Main"
End Sub
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.