Trying to stop the audio from playing by pressing a remote key in the DeviantArt example in the SDK
original:
audio = CreateObject("roAudioPlayer")
item = CreateObject("roAssociativeArray")
item.Url = "http://www.xxxxx.com/roku/songs/Nightfall.mp3"
item.StreamFormat = "mp3"
audio.AddContent(item)
audio.SetLoop(false)
audio.Play()
changed to:
audio = CreateObject("roAudioPlayer")
port=CreateObject("roMessagePort")
audio.SetMessagePort(port)
item = CreateObject("roAssociativeArray")
item.Url = "http://www.xxxxx.com/roku/songs/Nightfall.mp3"
item.StreamFormat = "mp3"
audio.AddContent(item)
audio.SetLoop(false)
audio.Play()
While True
msg = Wait (0, port)
if msg.isRemoteKeyPressed()
index = msg.GetIndex()
print "Remote button pressed: " + index.tostr()
if index = 10 then'<INFO>
audio.Pause()
end if
end if
end while
It compiles and doesn't error but doesnt do anything. Am i even close? where to look for an example?
thanks
Kinetics Screensavers