I am trying to use the new native.newVideo() API to do a game intro trailer. I want to have a button that shows which the user can tap to skip the video. Below is a code sample.
The problem I have when running the code is that the button shows up, then is quickly covered by the video. So, the user simply can’t push the button.
Is this a bug, or is it something I am doing wrong?
[code]
– local video = native.newVideo( 0, 0, 320, 480 )
local scale = mMin(display.contentScaleX, display.contentScaleY);
video = native.newVideo (0,0,320,480); – assume 320x480 dimension video
video.xScale = 1 / scale;
video.yScale = 1 / scale;
video:setReferencePoint(display.CenterReferencePoint);
video.x = _W * 0.5;
video.y = _H * 0.5;
video:load( “SampleVideo.m4v”, system.ResourceDirectory )
localGroup:insert (video);
– play the video, and remove it when it finishes (with a bit of buffer on time delay);
video:play();
videoPlayTimer = timer.performWithDelay(video.totalTime*1000 + 500, finishedVideo);
– skip button
local playBtn = ui.newButtonRect{
default = “images/Btn_Play.png”,
over = “images/Btn_Play_Over.png”,
width = 48,
height = 48,
onEvent = onPlayBtnTouch,
id = “playBtn”
}
[/code] [import]uid: 41124 topic_id: 21598 reply_id: 321598[/import]