I tried it, but I'm not sure I'm doing it things correctly. Here's my code. I tried setting them to -1, I tried swapping with negative layers, and I tried moving the video up several layers. I don't think the video is getting added to the roImageCanvas. The layers seem to swap successfully (tried mixing them up), but they stay visible because the video seems to just be visible behind the roImageCanvas and not actually added to a layer.
Would you mind taking a look?
Library "v30/bslCore.brs"
Function main( ) as void
'prep for input
codes = bslUniversalControlEventCodes()
port = CreateObject("roMessagePort")
canvas = CreateObject("roImageCanvas")
canvas.SetMessagePort(port)
canvas.show()
player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetPositionNotificationPeriod(1)
player.SetContentList([
{
Stream : { url :"http://video.ted.com/talks/podcast/DavidKelley_2002_480.mp4" }
StreamFormat : "mp4"
}
])
player.SetDestinationRect(canvas.GetCanvasRect())
player.Play()
canvas.setLayer( 1, player )
yPos = 50
bgHeight = 61
bgWidth = 214
stringOffset = 31
imageBox = { Color: "#ff183542", TargetRect: {x: (1280-bgWidth), y: yPos , w: bgWidth, h: bgHeight} }
imageText = { Text: "asdf", TextAttrs: { font: "large", color: "#ffffffff" }, TargetRect: {x: (1280-bgWidth-stringOffset), y: yPos , w: bgWidth-stringOffset, h: bgHeight} }
while(true)
msg = wait(1000, port)
if( msg <> invalid )
if (msg.isRemoteKeyPressed())
print "button press!"
code = msg.GetIndex()
if(code = 6)'OK
canvas.allowUpdates(false)
else if(code = 3) 'Down
print "down!, swap to negs"
canvas.SwapLayers(3,-4)
canvas.SwapLayers(4,-3)
else if(code = 5) 'Right
print "right, render!"
canvas.SetLayer(3, imageBox)
canvas.SetLayer(4, imageText)
else if(code = 4) 'Left
print "left, set to -1!"
canvas.SetLayer(-1, imageText)
canvas.SetLayer(-1, imageBox)
else if(code = 2) 'Up
print "up, swap video!"
canvas.SwapLayers(1,100)
endif
canvas.allowUpdates(true)
canvas.show()
endif
end if
end while
End Function