rsromeo
15 years agoChannel Surfer
STOPPING A SIMULATED PLAYLIST
I have a simulated playlist working but I have an issue. After each video plays, it advances to the next video in the array. that works great. My problem is the close screen event which occurs after each video is played. How can this be controlled so that when a user presses the UP key on remote, it exits the playlist? Right now, the UP key closes the current video screen and then it loops to the next video giving the user no way to exit other than using the Home key or advancing through all the videos in the array. Here's a sample snipet of code I am using:
For each clip in array
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)
video.SetContent(clip)
video.show()
while true
msg = wait(0, video.GetMessagePort())
if msg.isRemoteKeyPressed()
i = msg.GetIndex()
print "Key Pressed - " ; msg.GetIndex()
if (i = 2) then
print "Up pressed"
goto closecanvas
end if
else if msg.isScreenClosed()
print "Screen closed"
exit while
end if
end while
end for
closecanvas:
canvas.close()
For each clip in array
print "Displaying video: "
p = CreateObject("roMessagePort")
video = CreateObject("roVideoScreen")
video.setMessagePort(p)
video.SetContent(clip)
video.show()
while true
msg = wait(0, video.GetMessagePort())
if msg.isRemoteKeyPressed()
i = msg.GetIndex()
print "Key Pressed - " ; msg.GetIndex()
if (i = 2) then
print "Up pressed"
goto closecanvas
end if
else if msg.isScreenClosed()
print "Screen closed"
exit while
end if
end while
end for
closecanvas:
canvas.close()