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

roVideoScreen problem with dual audio

Here is my code that I am using now does not work where double audio


Sub playVideoMovies(episode As Object)

port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")
screen.SetMessagePort(port)
screen.SetCertificatesFile("common:/certs/ca-bundle.crt")
screen.InitClientCertificates()

vid_to_play = episode

vid_to_play = {
Stream: { url: episode.StreamUrl }
StreamFormat: "mkv"
StreamBitrates: "0"
Title: episode.Title
SubtitleUrl: episode.SubtitleUrl
PlayStart: episode.PlayStart
AudioFormat: "dolby-digital"
}

screen.SetLoop(true)
screen.SetPositionNotificationPeriod(1)
screen.SetContent(vid_to_play)
doCerts(screen)
screen.Show()


while (true)
msg = wait(250, port)

if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isPlaybackPosition() then
'print "Play position: "; msg.GetIndex(); " " msg.GetData()
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
elseif msg.isFullResult() then
RegWrite(episode.ContentId, "0")
exit while
elseif msg.isPartialResult()
print "Video playback was interrupted: "; msg.GetType()
exit while
else if msg.isRequestFailed()
print "request failed – error: "; msg.GetIndex();" – "; msg.GetMessage()
exit while
else if msg.isRequestInterrupted()
print "request failed – error: "; msg.GetIndex();" – "; msg.GetMessage()
else
print "Unexpected event type: "; msg.GetType()
end if
else
'print "Unexpected message class: "; type(msg)
end if

end while

End Sub
Our system http://www.rokumanager.com
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.