UIWebView & VideoPlayer ANE v1.3.3 Update

Version 1.3.3 of iOS UIWebView & VideoPlayer native extension for Adobe AIR is now available. Changes are as below:

  • Improve performance of underlying communication between web view to as3
  • Added UIWebViewErrorEvent, listen to UIWebViewErrorEvent.ERROR to get error events of the web view eg. browsers error like time out, cannot open page, etc.
  • Remove some configurations for Windows compilation error
  • Pingback: UIWebView & VideoPlayer ANE v1.3.3 Update | Adobe Flash Platform | Scoop.it

  • Pingback: UIWebView & VideoPlayer ANE v1.3.3 Update | Flex Mobile | Scoop.it

  • Pingback: UIWebView & VideoPlayer ANE v1.3.3 Update | Everything about Flash | Scoop.it

  • Pingback: UIWebView & VideoPlayer ANE v1.3.3 Update « eaflash

  • Pingback: UIWebView & VideoPlayer ANE v1.3.3 Update | skeddio | Scoop.it

  • William Owens

    Just tried the latest ANE in combination with Milkman Games GoViral ANE. The Flash file generates an error. It appears both ANEs use the objective-c reachability.o class. Your previous ANE ran fine. Is there any way you can check if reachability.o is already initialized?

    • http://darkredz.com/ Leng Sheng Hong

      Just turn hideAneSymbols to yes when you compile

      • William Owens

        How do I do that from Flash Professional?

        • http://darkredz.com/ Leng Sheng Hong

          Not quite sure with Flash Pro. It’s available in ADT commandline and Flash builder.

  • Michael

    Hi Leng,

    I’m having trouble displaying a concatenated string in the UIWebView.loadURL. It functions properly with a basic string like “http://www.google.com.au”. An example string would be “http://maps.google.com/maps?saddr=-37.7961,144.9779&daddr=857 Dandenong Road, Malvern East”

    This works properly in flash.media.StageWebView

    • Michael

      Ah, never mind, I just needed to fill in the spaces.

  • http://www.facebook.com/francisco.lucas1 Fran Lucas

    Hello, I wanted to know if I will read your extension safari cookies in my application, Thanks

    • http://darkredz.com/ Leng Sheng Hong

      You can use evalJs() method in UIWebView to read cookies. eg. trace( webview.evalJs(‘return document.cookie’) )

      • http://www.facebook.com/francisco.lucas1 Fran Lucas

        thanks for answering, but I do not understand ‘return document.cookie’, if I can help it would be of great help, greetings

        • http://darkredz.com/ Leng Sheng Hong

          Hi fran, it will work as it is a standard javascript :)

  • Michael

    Hi Leng,

    I’m loading a PDF with loadAppBundleAsset(). How could I print this document? Or is this something you could easily add with a later update?

  • jimmyo

    Hi Leng – I am considering purchasing your UIWebView ANE. Would you know the following: If I have an html5 video playing in the UIWebView and I resize the rectangle that defines its size, will the video keep playing? Thank you. Jim

    • http://darkredz.com/ Leng Sheng Hong

      yes resizing the viewport is like resizing your browser window on desktop, video will keep playing.

  • jimmyo

    Thanks Leng. How about AirPlay? If I have a video playing in an ANE UIWebView can that video be sent to Apple TV via AirPlay?

    • http://darkredz.com/ Leng Sheng Hong

      if you have appletv on the same network, the airplay icon will appear

  • http://twitter.com/miguelgarcia7 Miguel A Garcia

    Is there any way to print a PDF? I’m using the load() function to load an external PDF.

    • http://darkredz.com/ Leng Sheng Hong

      Hi, printing is out of scope of the UIWebView features, however i am working on a proper ANE for printing in ios

  • The-Builder

    Hi Leng. I ran into a issue while using iOS NativeUtils to unzip some files. https://github.com/memeller/iOSNativeUtilities
    After using it UIWebView stops recieving events. I’m guessing there must be some sort of conflict, maybe you got an idea?

    • http://darkredz.com/ Leng Sheng Hong

      No I have no idea as I never use NativeUtils before though mixing with some other ANE like social and alerts ane works. Can you provide me what did you do with UIWebView and what do you mean stop receiving events? Any code examples? maybe you can paste it at pastebin or gist.

      • pengsuiwan

        Hi,Leng. I am your fans from china. I asked some question about UIwebview-ANE a few days ago. And I thought that i can do the same work just like you, packing the ANE via ADT. But you know, it’s not so easy for me cause i am not good at Objective-C. I learned that you have made contribution to many Tech-Area: Php, Adobe, Flex….etc.I have no money to pay for it in recent, but i just want to use it for doing some experiment. Could you give me a free version.
        I’ll do appreciate your help. And welcome to china again. Thank you again.(pengsuiwan@gmail.com)

        • http://darkredz.com/ Leng Sheng Hong

          why not if it’s for educational/experiment purpose

      • The-Builder

        Hi Leng, i did a lot od debugging to determine the reason for the problem, and it was caused by a new NativeUtils and unzipping the files. After i had done this, UIWebView would not recieve the events like:
        UIWebViewEvent.LOCATION_CHANGE
        UIWebViewEvent.FINISH_LOAD
        UIWebViewEvent.JS_TRIGGER_AS3

        It doesn’t matter if it’s an already existing webview, or if i create a new WebView. Could NativeUtils hijack/prevent the events somehow?

        • http://darkredz.com/ Leng Sheng Hong

          What is the exact methods you use for UIWebView and NativeUtils unzip? I can help look into nativeutils source code and see how it hijack the events

        • http://darkredz.com/ Leng Sheng Hong

          Also, it can be an error in nativeutils, can you try after the unzip, create another nativeutils unzip action and see if nativeutils work.

  • Ross

    Hi Leng. I implemented your VideoPlayer in my iOS AIR app today, but am running into an issue with no audio. Any thoughts? I’ve tried multiple .mp4 files including the one included in your demo. Please help. Thank you.

    • Ross

      Ok. After researching, it appears as though the audio session isn’t configured correctly within your extension. The ringer switch on the iPhone is silencing the audio of the video if set to vibrate. Is it possible to implement a fix for this?

  • zaxwerks

    Hi,

    was wondering is it possible to embed youtube video? all i have is the embed like such as this (http://youtu.be/LOruZ4EcQz8) and this link variable might change from time to time, and i need to pass it a long to the ANE.

    thanks! :)

    • http://darkredz.com/ Leng Sheng Hong

      sure, you can write your HTML to embed youtube (see youtube iFrame embed options) and use evalJs() in webview to call your js function, passing in the video ID to the youtube iframe player. You can modify the html from this tutorial http://darkredz.com/auto-playing-youtube-iframe-html5-player-in-uiwebview-ane/

      • zaxwerks

        hi again, i’m still not catching this, are you suggesting that i use evalJs to modify HTML template (based on your tutorial) or to call another function to generate the HTML?

        can you give me some simple code? thanks in advance.

        • http://darkredz.com/ Leng Sheng Hong

          Basically you have to write javascript in your HTML to accept a video parameter, kinda like this HTML: http://pastebin.com/QgVmhCUB

          and in as3 you call nativewebview.callJsFunc(“setVid”, {id: “LOruZ4EcQz8″}) after the HTML is loaded (UIWebViewEvent.FINISH_LOAD)

          • zaxwerks

            ah oki – thanks! – will ask my colleague (who handle the purchasing) to get the ANE

  • jimmyo

    Hi – I am using your UIWebView that I bought a few weeks ago. So far so good but I have run into one issue. My AIR app is set to ‘full screen’ so that the info line at the top of the iPad (with the time and charging status) does NOTshow. When I allow the user to go to full screen in the webview, then rotate the device, then back to non-full-screen … there is a blank section at the top of the screen exactly where the info line would be if I was not using ‘full screen’. I hope this explains my problem. Any ideas on how to fix? Thanks. Jim

    • http://darkredz.com/ Leng Sheng Hong

      Hi this is unfortunately a bug in Air, and it happens too if using stagewebview. AIR doesn’t seem to catch the video player fullscreen. I think the only way to solve this is to listen for video exit fullscreen event and set AIR stage back to fullscreen

      • jimmyo

        Thank you for the quick response. I was just thinking what you said might be the solution. But how do you set the AIR stage back to fullscreen? (I only know how to set it to full screen in the -app.xml file.)

        • http://darkredz.com/ Leng Sheng Hong

          using as3 stage.displayState = StageDisplayState.FULL_SCREEN

          • jimmyo

            That doesn’t help. Interestingly the stage.displayState remains in FULL_SCREEN_INTERACTIVE the whole time – before uiwebview goes to full screen, during it, after the rotate, then after it is shrunk back. I think I will have to listen for the exitfullscreen event and then reposition things to where they should be.

          • http://darkredz.com/ Leng Sheng Hong

            Ah right, i recall someone asked me the same issue and in the end you have to call your own “refresh” to update the Air display list and do appropriate UI position/resizing based on the stage.

          • jimmyo

            how do you listen for video screen going fullscreen? I thought I had seen an event in the uiwebview documentation but there is nothing there like that. thanks.

          • jimmyo

            I solved it. I listen for event.resize and if Capabilities.screenResolutionY does not equal stage.stageWidth then I set stage.displayState = StageDisplayState.FULL_SCREEN

  • zaxwerks

    Hi again, i already tested your ane, and i want to combine it with starling framework, i got stumbled into the stage properties.

    do you happen to know the solutions?

    thanks

    • http://darkredz.com/ Leng Sheng Hong

      unsure what you need. I guess you want Starling.handleLostContext = true; ?

  • jimmyo

    Hi – Your ANE is working very well. Excellent work. I am using UIWebView to play a video from YouTube. Is there a way to have it continue to play the audio part of that video when the app is in the background? I have set UIBackgroundModes audio to true .

    • http://darkredz.com/ Leng Sheng Hong

      hi i don’t think it’s possible even with hacks it will be rejected from Apple since it’s not a music app.

      • jimmyo

        My app is a music app (it plays music in your uiwebview ane), so I believe it will be approved if I can get it to work. Do you know a hack to get it to keep playing? I have been using an ANE to set the audiosession properly.

        • http://darkredz.com/ Leng Sheng Hong

          you can do it with tag Video cannot be played in background. The hack would be to strip out audio part of the video into mp3 and play the exact time on the audio file when your app goes to background.

        • http://darkredz.com/ Leng Sheng Hong

          Alternatively, you can use the videoplayer class and load the mp3 it can also be played in the background. Video files(mp4 & equivalent) will never work in background.

  • http://www.facebook.com/isbiceanu.adrian Adrian Isbiceanu

    Hi, the shopping card is not working. Please fix, I want to buy the ane :)

    • http://darkredz.com/ Leng Sheng Hong

      HI Adrian, it’s working fine now!

      • http://www.facebook.com/isbiceanu.adrian Adrian Isbiceanu

        Thanks

  • http://www.facebook.com/isbiceanu.adrian Adrian Isbiceanu

    Is there any way to have just a fullscreen video player. I want to start the video (in full screen) when user clicks a button and when they click done go back to my app. I tried setting it to start in fullscreen but its still show the button to exit from fullscreen

    • http://darkredz.com/ Leng Sheng Hong

      You can use initAndLoad and pass in the parameter true for launch in fullscreen. eg: playerFs.initAndLoad(“abc.mp4″, “video/mp4″, true, true, true, true);

      • http://www.facebook.com/isbiceanu.adrian Adrian Isbiceanu

        Thank you for your great support.

    • http://darkredz.com/ Leng Sheng Hong

      Fullscreen video will always have the controls. If you want a plain video without any controls, try making your app a fullscreen app and use makeFullSizePlayer() to scale it up to fit stage size. However you would need to add your own button to exit the mode. See WebViewVideoPlayerDemo for the file FullSizeVideoView.mxml

  • Vino

    Can I use netstream as input for video?

    • http://darkredz.com/ Leng Sheng Hong

      That’s not possible with native ios

      • Vino

        Can I play video byte array in native?