This is a continuation of the discussion from the API page. http://developer.anscamobile.com/reference/index/nativenewvideo [import]uid: 7559 topic_id: 24290 reply_id: 324290[/import]
Hi all,
I will post this question for 3rd time as no one has answered before.
I would like to know if there is any possibility (example code also) to put any display object on top (overlap) of the video display object, let’s say a button, sprite, vector graphic, etc.?
I’ve made some tests and seems that video takes always the top layer of display objects on the screen by hidding other objects even when they are inserted on the screen afterwards.
Thanks!
Flavio
PS: May be this time I have a better chance… [import]uid: 3022 topic_id: 24290 reply_id: 98143[/import]
All native object sit on top of Corona Display objects (OpenGL). It’s not possible to display any other object on top of a native object (video, webview, textbox, textfield, etc.). [import]uid: 7559 topic_id: 24290 reply_id: 98144[/import]
Hi Tom,
I tried the code posted in the original discussion. I build it and tried it in my Iphone 4S, once the app is opens it plays the video right immediately.
Few things:
-
What’s the difference of this native.newVideo to media.playVideo?
-
I also notice that there’s no video control that pops out when you touch the screen.
-
Could you please post a working sample that has a pause, play, rewind or forward and cancel feature?
I’m a complete new to corona and programming so any help would greatly be appreciated.
Thanks much. [import]uid: 123095 topic_id: 24290 reply_id: 100012[/import]
Hy.
First is: i make a native video box, and front this box i create a RoundedRect. The video alpha is 0.5, the rect alpha is 0.7, and it is working perfectly.
2nd: the question! How can i loop the video? the same format like an audio is not working for me.
Th situation is like i wrote above, when i want to restart te video /continously/ i have to make a timer with a same timing what long is the video. When it’s end, remove the video, create again, and start to play (if i simply play again, then nothing, this is why i must to remove) After the re-creation, it will front of the RoundedRect object. If i take RoundedRect:toFront then: nothing, still is under the video.
Any ideas?
Thanks. [import]uid: 62896 topic_id: 24290 reply_id: 102144[/import]
Does this version of playing video not support controls? This is a huge improvement over the old API but this basic feature is needed to make any kind of video player plausible. thanks! [import]uid: 6317 topic_id: 24290 reply_id: 110789[/import]
I get a black screen in the Simulator when using this. I’m using the example code and loading my own video, but I get nothing.
Does this work in the Simulator? I’m using Version 2012.840 (2012.06.19)
Also I’m in Trial, as I’m evaluating this for our ebook needs at the moment. We have existing video, so our needs heavily depend on this function.
Thanks,
-Jerome- [import]uid: 49037 topic_id: 24290 reply_id: 116437[/import]
Please Assist.
It seems there is an issue with the… height and width properties of native.newvideo()
I have a button for a native.newVideo() player that changes the video size to fill/full the screen. This seems to work visually but does not actually change the value returned by video.width. Even odder is that setting video.width seems to be a percentage of what I set and so the video gets progressively larger or smaller with each click.
All I am really trying to do is full screen the video and then return it to the original size at a later time.
The code below sets the video size to 160 x 120 but you will see each time it is called it seems to get smaller and smaller. Shouldn’t it just stay at the size I specified no matter how many times I push the button?
Here is some sample code that exhibits this odd behavior. How can I get around this given what I am trying to accomplish as I can’t seem to get the video back to an initial size.
[code]
local iter = 1
local videoWText = display.newText( “video.width” , 200, 10, “Helvetica-Bold”, 36 )
local videoHText = display.newText( “video.height” , 200, 40, “Helvetica-Bold”, 36 )
local video = native.newVideo( 0, 0, 320, 240 )
video.x = display.contentWidth / 2
video.y = display.contentHeight / 2
local function videoListener( event )
print( "Event phase: " … event.phase )
if event.errorCode then
native.showAlert( “Error!”, event.errorMessage, { “OK” } )
else
videoWText.text = iter … ") video.width: " … video.width
videoHText.text = iter … ") video.height: " … video.height
end
end
video:load( “http://www.coronalabs.com/links/video/Corona-iPhone.m4v”, media.RemoteSource )
video:addEventListener( “video”, videoListener )
video:play()
local function onTap( event )
iter = iter + 1
video.width = 160
video.height = 120
videoWText.text = iter … ") video.width: " … video.width
videoHText.text = iter … ") video.height: " … video.height
end
Runtime:addEventListener( “tap”, onTap );
[/code] [import]uid: 42745 topic_id: 24290 reply_id: 120770[/import]
Please Assist.
It seems there is an issue with the… height and width properties of native.newvideo()
I have a button for a native.newVideo() player that changes the video size to fill/full the screen. This seems to work visually but does not actually change the value returned by video.width. Even odder is that setting video.width seems to be a percentage of what I set and so the video gets progressively larger or smaller with each click.
All I am really trying to do is full screen the video and then return it to the original size at a later time.
The code below sets the video size to 160 x 120 but you will see each time it is called it seems to get smaller and smaller. Shouldn’t it just stay at the size I specified no matter how many times I push the button?
Here is some sample code that exhibits this odd behavior. How can I get around this given what I am trying to accomplish as I can’t seem to get the video back to an initial size.
[code]
local iter = 1
local videoWText = display.newText( “video.width” , 200, 10, “Helvetica-Bold”, 36 )
local videoHText = display.newText( “video.height” , 200, 40, “Helvetica-Bold”, 36 )
local video = native.newVideo( 0, 0, 320, 240 )
video.x = display.contentWidth / 2
video.y = display.contentHeight / 2
local function videoListener( event )
print( "Event phase: " … event.phase )
if event.errorCode then
native.showAlert( “Error!”, event.errorMessage, { “OK” } )
else
videoWText.text = iter … ") video.width: " … video.width
videoHText.text = iter … ") video.height: " … video.height
end
end
video:load( “http://www.coronalabs.com/links/video/Corona-iPhone.m4v”, media.RemoteSource )
video:addEventListener( “video”, videoListener )
video:play()
local function onTap( event )
iter = iter + 1
video.width = 160
video.height = 120
videoWText.text = iter … ") video.width: " … video.width
videoHText.text = iter … ") video.height: " … video.height
end
Runtime:addEventListener( “tap”, onTap );
[/code] [import]uid: 42745 topic_id: 24290 reply_id: 120770[/import]
Hello, does anyone knows if this funcion ( native.newVideo ) will be available for Android soon? [import]uid: 151631 topic_id: 24290 reply_id: 126107[/import]
We don’t have a time-frame for native.newVideo for Android. We have some other Android features we are adding first. [import]uid: 7559 topic_id: 24290 reply_id: 126164[/import]
Hello, does anyone knows if this funcion ( native.newVideo ) will be available for Android soon? [import]uid: 151631 topic_id: 24290 reply_id: 126107[/import]
Thank you very much for your answer have a nice day. [import]uid: 151631 topic_id: 24290 reply_id: 126359[/import]
We don’t have a time-frame for native.newVideo for Android. We have some other Android features we are adding first. [import]uid: 7559 topic_id: 24290 reply_id: 126164[/import]
Thank you very much for your answer have a nice day. [import]uid: 151631 topic_id: 24290 reply_id: 126359[/import]
Hi,
Is there any way to create custom mp4 player with native.newVideo ?
To overlay newVideo with my own controls…
Cheers,
Zsolt [import]uid: 126421 topic_id: 24290 reply_id: 132104[/import]
You can’t overlay any Corona display object over native objects. To add custom controls, you would need create a video player smaller than the screen and add your controls outside of the player. [import]uid: 7559 topic_id: 24290 reply_id: 132193[/import]
Hi,
Is there any way to create custom mp4 player with native.newVideo ?
To overlay newVideo with my own controls…
Cheers,
Zsolt [import]uid: 126421 topic_id: 24290 reply_id: 132104[/import]
You can’t overlay any Corona display object over native objects. To add custom controls, you would need create a video player smaller than the screen and add your controls outside of the player. [import]uid: 7559 topic_id: 24290 reply_id: 132193[/import]
c.caso wrote:
“Hello, does anyone knows if this funcion ( native.newVideo ) will be available for Android soon?”
Tom wrote:
“We don’t have a time-frame for native.newVideo for Android. We have some other Android features we are adding first.”
Any news about when this feature will be available? With the media.playVideo() function, before the video starts a black screen flashes. Thank you! [import]uid: 160132 topic_id: 24290 reply_id: 133674[/import]