Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
ncognito66
Level 7

Re: Combining Audio and Video...

I tried adding it to the bottom of the appVideoScreen.brs, which is where I threw the audioplayer code, and now I get a compile error.

Where should I have put it?
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
Level 7

Re: Combining Audio and Video...

Thanks to Belltown, here's a quick hack to make it work:

Replace all the code in appVideoScreen.brs with:

.streamformat})
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
else if lcase(type(msg))="rospringboardscreenevent" then
audio.stop ()
return msg
end if
end while
return Invalid
end function

and replace all the code in appDetailScreen.brs with:


if validateParam(show, "roAssociativeArray", "getPrevShow") = false return -1

return prevIndex
End Function

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
onevoisses
Level 8

Re: Combining Audio and Video...

I too have been trying for so long at this can you help me
I notice that when the player is playing the stream if you press the back button on the remote the screen locks up.I found that there is no index 3 but the index is 0 which is a poster event in the detail screen.

Here is the detail screen

if msg.GetIndex() = 1
' if showlist[showindex].contentformat <> "audio" then
PlayStart = RegRead(showList[showIndex].ContentId)
if PlayStart <> invalid then
showList[showIndex].PlayStart = PlayStart.ToInt()
endif
refreshShowDetail(screen,showList,showIndex)
' showVideoScreen(showList[showIndex])
endif
endif
if msg.GetIndex() = 2
if showlist[showindex].contentformat <> "audio" then
showList[showIndex].PlayStart = 0
showVideoScreen(showList[showIndex])
refreshShowDetail(screen,showList,showIndex)
else msg = playaudio(screen.GetMessagePort(), showlist, showindex)
'else
' refreshShowDetail(screen,showList,showIndex)


if msg <> Invalid then
refreshShowDetail(screen,showList,showIndex)
end if
'refreshShowDetail(screen,showList,showIndex)
endif
'refreshShowDetail(screen,showList,showIndex)
)
endif
print "This Button pressed: "; msg.GetIndex(); " " msg.GetData()
end if

else
print "Unexpected message class: "; type(msg)
end if
end while

return showIndex

End Function


and here is what on the terminal before the back button is pressed
Request Time: 9
Show Feed Parse Took : 8
ButtonPressed
ButtonPressed
Button pressed: 2 0


and this is what is on the terminal after the back button is pressed

Request Time: 9
Show Feed Parse Took : 8
ButtonPressed
ButtonPressed
Button pressed: 2 0
This Button pressed: 0 0


This occur when the stream is playing and you just press the back button or up button twice.
I am thinking that this is because its not refreshing the detail screen or exit properly notice my test in quotes.

Could you tell me how to process that msg at "if msg.getindex()=3"
I tried it at the spots highlighted above the Green it will bring up the poster screen but the video screen is dead and I have to remove the else above it which is necessary to play the video.

Ps. I thought the Msg= invalid would take care of this but since the msg is a poster event the screen is waiting for some action.
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos
onevoisses
Level 8

Re: Combining Audio and Video...

Oops,maybe too much coffee mixed with the good old Rum.

Thanks RokuJoel,You had posted the solution before but I overlook it and after a fresh look its here


"RokuJoel" wrote:
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
Channel: Goaheadmission
O/S : Linux
Home media: MYTHROKUPLAYER With Homerun
0 Kudos