NOTE: This tutorial is outdated and has been replaced by the Native UI guide. Please refer to this guide for details and usage examples.
  1. It would be great if there is a way to view the videos using native.newVideo() in the simulator. Is there any? Will this be posible soon?


  2. Any chance we might see the option to turn webview bounces off when required?

    i.e.: [[webView.subviews objectAtIndex:0] setBounces:NO]; // ObjC

    Perhaps something more in-line with the existing native.WebPopUp?

    local options = { baseUrl=system.DocumentsDirectory, urlRequest=listener }
    local webView = native.newWebView( 0, 0, 320, 250, options )

    This would be really useful where you want the webview to act more like a scrollable view where upon reaching top/bottom/etc it would simply stop. It would also avoid having folks try to disable it using:

    document.ontouchmove = function(event){

    …and other such less than ideal hacks.

  3. Now we can finally make more complex eBooks and even publish services like WoodWing does. :)

    Next thing should be to use native.newVideo to load the Camera (or just make native.newCamera), where we could finally put out own images in front of it (for Augmented Reality).

    Anyways, good job on that :)

  4. will the newWebView will have –before the end of february– listener function options.urlRequest that will intercept all urlRequest events like the web popup ?

    For a project I need both : moving the webView AND intercept request … This would be great…

  5. Jonathan Beebe says:

    @FREDERIC: You can specify a listener for WebViews and intercept the url via event.url (see the example in the post for information on using WebViews with a listener).

  6. I have a form in a webpopup/webview. Once I submit the form, can the submit button also simultaneously close the webpopup/webview?


    • Jonathan Beebe says:

      @Perry: You can have the submit button take you to a specific URL such as “corona:close”, and then you can detect that url (via event.url) in the webview’s listener function and then close the webView once it detects that URL. There is an example of this in the Web Popup samplecode, but you’d have to port the syntax to be compatible with WebViews of course.

  7. Hi all,

    Great news!

    Just a simple question, any possible way to overlap a png during video playback. I’ve tried, but seems that video always stay at the top of display objects.


  8. @Can
    Until a possible “onComplete” listener feature is added for newVideo(), perhaps just run a standard timer in conjunction with the video. You can even get the video’s overall time using the provided read-only parameter. The timer would, of course, need to be paused/restarted and skipped ahead if you performed these actions to the video, but this is fairly easy with the recently added (few months back) timer APIs “timer.pause” and “timer.resume”. It’s possible that the video and timer ending won’t mesh up to the exact millisecond, but it should be undiscernable to the user.

    I’m just excited that we can now use videos almost as “cutscenes” with text or other elements outside the video content area… even custom buttons and things to manage the video! OK, maybe not other display objects overlaying the video (haven’t actually tried this yet, maybe it IS possible?). Nonetheless, great work and many thanks Ansca!

    Brent Sorrentino
    Ignis Design

  9. Are event listeners working with native.newVideo() ?

    I have tried adding one as the 5th parameter native.newVideo(x,y,w,h, listener) and also with addEventListener( “touch”, listener )

    Events don’t seem to be triggered and being device only hard to debug.

    I have tested the listener code by substituting native.newVideo, with display.NewRect( ) and the code works OK

  10. Hi all,

    Me again, sorry about this, but I would like to know if there is any way to overlay other display objects on top of the video playback, for instance: buttons


  11. Can anyone confirm that this locks up the vide playback after playing the same clip 4 times??? even locks up the full screen video player too…

    Could be something in my code but never had the same issue using the fullscreen video player i.e.

    media.playVideo( name ,system.DocumentsDirectory, false, onComplete )

    if this is a known bug then let me know

  12. Right now, newWebView doesn’t work on devices. 90%-95% of the time it crashes my app. Hopefully they will get working on this as this API is being promoted as a feature.

  13. I’ve seen this question a few times…any way to put a button over the video object?? Also, I’ve tried adding a video object to “scrollView” but doesn’t seem to work…is it possible to drag the video object?

  14. Daily build # 736 includes new options for newVideo() function but no document yet :(

    We need new example of both newWebView() and newVideo() includes all option and metiods.


  15. Anybody have an idea how to add the phase listener to a video object? As Bader said, the new build says it supports it but no documentation. I assumed this:
    video:addEventListener( “video”, whatever)
    but doesn’t work.

  16. According to the native.newVideo() documentation, it supports Android in addition to iOS. I just want to confirm if that is indeed true? I tried running some test on my Android phone, but it just shows a blank black screen. The same code runs on iOS.

    I have been having a hard time figuring out if the problem is that it’s not supported on Android, or incompatible video format on the Android.


  17. I’ve gotten the video listener to work but it only fires once. If i play a video and listen for the “ended” event, it works the first time, but when I play the video a second time the listener isn’t triggered. Is this a known issue?

  18. Is there an example of the webView listener stuff in action. Both the HTML/JS and the listener that does something in corona (like show an alert or something).

    @Jonathan Beebe mentions the syntax needs to change and I was just wondering if there was a full example like the one for webPopup. I have been tying to get it to do something and have so far not been able to get the new webview to listen for my form submits like I was able to do with webPopup.

  19. I developed app in 2012 when Adobe supportes flash for ice cream sandwich Android OS but now when Adobe stopped support for Android Jelly bean . My App would not run my game on samsung note 2 with jelly bean, is there any work around for this i tried both webpopups and webviews

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>