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: 
ncognito66
Visitor

Re: Combining Audio and Video...

Okay, let's recap as I'm getting myself confused:

1.) I added the lines in red to the appDetailScreen.brs file:

if msg.GetIndex() = 1
PlayStart = RegRead(showList[showIndex].ContentId)
if PlayStart <> invalid then
showList[showIndex].PlayStart = PlayStart.ToInt()
endif
showVideoScreen(showList[showIndex])
refreshShowDetail(screen,showList,showIndex)
endif
)
refreshShowDetail(screen,showList,showIndex)
else
playaudio(showlist, showindex)
refreshShowDetail(screen,showList,showIndex)
end if
endif

if msg.GetIndex() = 3
endif
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
end if

2.) Then the following to showFeed.brs:

'fetch all values from the xml for the current show
item.hdImg = validstr(curShow@hdImg)
item.sdImg = validstr(curShow@sdImg)
item.ContentId = validstr(curShow.contentId.GetText())
item.Title = validstr(curShow.title.GetText())
item.Description = validstr(curShow.description.GetText())
item.ContentType = validstr(curShow.contentType.GetText())
item.ContentQuality = validstr(curShow.contentQuality.GetText())
item.contentformat = validstr(curShow.contentformat.GetText())
item.audiostreamurl = validstr(curShow.audiostreamurl.GetText())
item.Synopsis = validstr(curShow.synopsis.GetText())
item.Genre = validstr(curShow.genres.GetText())
item.Runtime = validstr(curShow.runtime.GetText())
item.HDBifUrl = validstr(curShow.hdBifUrl.GetText())
item.SDBifUrl = validstr(curShow.sdBifUrl.GetText())
item.StreamFormat = validstr(curShow.streamFormat.GetText())
if item.StreamFormat = "" then 'set default streamFormat to mp3 if doesn't exist in xml
item.StreamFormat = "mp3"
endif

3.) And then this to the top of appVideoScreen.brs:

.streamformat})
port=createobject("romessageport")
audio.SetMessagePort (port)
audio.play()
while true
msg=wait(0,port)
if lcase(type(msg))="roaudioplayerevent" then
if msg.isRequestSucceeded() then
return -1
else if msg.isrequestfailed() then
return -2
end if
end if
end while

end function


4.) And then added the following red lines, and edited the blue (plus my info), in my .xml file:


<item sdImg="http://www.hauntedamericaradio.com/images/somalane.jpg" hdImg="http://www.hauntedamericaradio.com/images/somalane.jpg">
<title>Ghosts of Deadwood</title>
<description></description>
<contentId>10031</contentId>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<contentformat>audio</contentformat>
<streamformat>mp3</streamformat>
<media>
<streamQuality>SD</streamQuality>
<streamBitrate>1500</streamBitrate>
<audiostreamurl>http://www.hauntedamericaradio.com/audio/Episode10.mp3</audiostreamurl>
<streamUrl>http://www.hauntedamericaradio.com/audio/Episode10.mp3</streamUrl>
</media>
<synopsis>David Soma &amp; Kathleen Lane</synopsis>
<genres>Paranormal</genres>
<runtime>7217</runtime>
</item>

anyone see where I went wrong??
Al
Creator, Producer, and Co-Host - Country Dreams radio show
http://www.countrydreamsradio.com
Founder - Independent Country Music Association
http://www.icmanet.com
Station Engineer - WBTN 1370 AM
http://www.wbtnam.org
0 Kudos
RokuJoel
Binge Watcher

Re: Combining Audio and Video...

Shouldn't be a space between setmessageport (port) I think...

Joel
0 Kudos
belltown
Roku Guru

Re: Combining Audio and Video...

"RokuJoel" wrote:
Shouldn't be a space between setmessageport (port) I think...

Joel

I disagree.The space works just fine there.

His problem is he's just not referencing in his code what he has in his XML, as I said earlier. He has references to audiostreamurl when he should be referencing media.audiostreamurl

EDIT:

At least in this case:

item.audiostreamurl = validstr(curShow.audiostreamurl.GetText())


Should be:

item.audiostreamurl = validstr(curShow.media.audiostreamurl.GetText())
0 Kudos
ncognito66
Visitor

Re: Combining Audio and Video...

Thanks Joel. I changed that, but no difference. The audiostreamurl parameter is still empty, which tells me it's not being picked up from the .xml file.

I'm grasping at straws here, but I noticed in the showFeed.brs file this section that sets defaults:

'***********************************************************
' Initialize a ShowFeedItem. This sets the default values
' for everything. The data in the actual feed is sometimes
' sparse, so these will be the default values unless they
' are overridden while parsing the actual game data
'***********************************************************
Function init_show_feed_item() As Object
o = CreateObject("roAssociativeArray")

o.ContentId = ""
o.Title = ""
o.ContentType = ""
o.ContentQuality = ""
o.Synopsis = ""
o.Genre = ""
o.Runtime = ""
o.StreamQualities = CreateObject("roArray", 5, true)
o.StreamBitrates = CreateObject("roArray", 5, true)
o.StreamUrls = CreateObject("roArray", 5, true)

return o
End Function


Do I need to add something here for the new parameters we added??? I can't figure out why it's not picking up the url.
Al
Creator, Producer, and Co-Host - Country Dreams radio show
http://www.countrydreamsradio.com
Founder - Independent Country Music Association
http://www.icmanet.com
Station Engineer - WBTN 1370 AM
http://www.wbtnam.org
0 Kudos
ncognito66
Visitor

Re: Combining Audio and Video...

Belltown...I'm just doing as I'm told (I've been married long enough to do that). 😉

Where should I make those changes you refer to?
Al
Creator, Producer, and Co-Host - Country Dreams radio show
http://www.countrydreamsradio.com
Founder - Independent Country Music Association
http://www.icmanet.com
Station Engineer - WBTN 1370 AM
http://www.wbtnam.org
0 Kudos
belltown
Roku Guru

Re: Combining Audio and Video...

"ncognito66" wrote:
Belltown...I'm just doing as I'm told (I've been married long enough to do that). 😉

Where should I make those changes you refer to?


See the edit to my previous post.
0 Kudos
ncognito66
Visitor

Re: Combining Audio and Video...

YAY!

You da man Belltown...it plays!

Now I have a new problem, it won't stop playing! Even if I back out of that leaf to the parent category, it keeps playing unless I go all the way back to the home screen.
Al
Creator, Producer, and Co-Host - Country Dreams radio show
http://www.countrydreamsradio.com
Founder - Independent Country Music Association
http://www.icmanet.com
Station Engineer - WBTN 1370 AM
http://www.wbtnam.org
0 Kudos
RokuJoel
Binge Watcher

Re: Combining Audio and Video...

"belltown" wrote:

I disagree.The space works just fine there.


Interesting, thanks, I didn't know the syntax was that flexible.

- Joel
0 Kudos
ncognito66
Visitor

Re: Combining Audio and Video...

I'm still locked up. Once I pick and song and it starts playing....it keeps playing when I leave the page and it won't let me pick anything else. Debugger says:

------------
ButtonPressed
ButtonPressed
Note: GC - Found 61 orphaned objects (objects in a circular ref loop).

Is this the problem?
Al
Creator, Producer, and Co-Host - Country Dreams radio show
http://www.countrydreamsradio.com
Founder - Independent Country Music Association
http://www.icmanet.com
Station Engineer - WBTN 1370 AM
http://www.wbtnam.org
0 Kudos
RokuJoel
Binge Watcher

Re: Combining Audio and Video...

When you leave the page, which I assume is your springboard, for some reason, the page is not completely closing, so somewhere you need something like:

screen.close()
return -1



- Joel
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.