Can Corona support playing a YouTube video without leaving your app? How would one do this?
I note games such as Wingsuit Stickman do this…
Can Corona support playing a YouTube video without leaving your app? How would one do this?
I note games such as Wingsuit Stickman do this…
See Business App Sample - It demonstrates how this can be done.
You have to use a native.newWebView.
Can I ask a few follow up questions:
a) is there a way to get the video only portion of a youtube video appearing only? (i.e. not the whole website). I’ve tried the url format “http://www.youtube.com/watch?feature=player_embedded&v=zKA7VvYhSCI” and this doesn’t seem to help. I noted the guys on Wingsuit Stickman got this happening somehow…
b) Is there a way to scale the video? say you want to show it across the width of the screen when the device is in portrait mode. So this case the resolution would drop…
(may be easier to transcode the video down to a very compact form and include in the app perhaps…)
I don’t know what software was used to develop Wingsuit Stickman, but if it was done in Objective-C then likely the graphics overlaying it are done outside of the OpenGL canvas and we don’t support that. The webView is a native object and sits on top of any Corona display objects.
We don’t have any direct YouTube support and with a native.newWebView you get whatever HTML you can provide to play it. YouTube generates embed code based on a width your provide to them and its possibly something you can pass on the URL as a get parameter, but you would have to look that up.
Rob
See Business App Sample - It demonstrates how this can be done.
You have to use a native.newWebView.
Can I ask a few follow up questions:
a) is there a way to get the video only portion of a youtube video appearing only? (i.e. not the whole website). I’ve tried the url format “http://www.youtube.com/watch?feature=player_embedded&v=zKA7VvYhSCI” and this doesn’t seem to help. I noted the guys on Wingsuit Stickman got this happening somehow…
b) Is there a way to scale the video? say you want to show it across the width of the screen when the device is in portrait mode. So this case the resolution would drop…
(may be easier to transcode the video down to a very compact form and include in the app perhaps…)
I don’t know what software was used to develop Wingsuit Stickman, but if it was done in Objective-C then likely the graphics overlaying it are done outside of the OpenGL canvas and we don’t support that. The webView is a native object and sits on top of any Corona display objects.
We don’t have any direct YouTube support and with a native.newWebView you get whatever HTML you can provide to play it. YouTube generates embed code based on a width your provide to them and its possibly something you can pass on the URL as a get parameter, but you would have to look that up.
Rob