1 2 Previous Next 42 Replies Latest reply: Jul 24, 2015 8:55 AM by JorjEade RSS

    Cannot select videos in iOS CameraRoll.browseForImage()

    Bramblethorne Community Member

      Well, obviously, because it's browseFor-Image-, however I -have- to have this functionality for our software and I don't see -any way whatsoever- in the documentation, via CameraRoll or otherwise to open the CameraRoll and filter for Videos.

       

      I can use the camera to take videos.  I can use the camera to take pictures.  I can use the CameraRoll to browse photos already on the device and select one, but I cannot see a way to locate, display, and allow the user to select (and perhaps preview) a video for my software to use.

       

      The ironic thing is that if I use the iOS Camera app and take video (which appears as an entity in the CameraRoll in the 'Photos' app), it uses the first frame of that for the folder preview... i.e., if I browseForImage() from Flex/AIR, when it opens the CameraRoll browser, the top "Folder" in the photo browser (named "Camera Roll") shows as it's icon a thumbnail taken from the first frame of the video I just took using the Camera App.  However, if I enter that folder to see the contents, it shows only photos and not the video from which it displayed the thumbnail.

       

      Any help greatly appreciated.

        • 1. Re: Cannot select videos in iOS CameraRoll.browseForImage()
          J.A. Ames

          I really need this feature also. I opened a bug at bugbase.adobe.com #3308407 a while back (Air 3.3). You can go there and vote for it.

          • 2. Re: Cannot select videos in iOS CameraRoll.browseForImage()
            Bramblethorne Community Member

            Thank you.   Good to have a place to add my voice.  Is the bugbase still valid now that this is in the Apache incubator?   I'm hoping that the recently released v4.9 api addresses this... but as I can't get it to install correctly and find AIR3.5 (which may partially be responsible for the lack and or lack of lack if it was previously responsible for the lack [read it... it makes sense *chuckle*]), I'm unable to evaluate.   The 'installer' only installs v4.8 as of yesterday.

            • 3. Re: Cannot select videos in iOS CameraRoll.browseForImage()
              Andreas Bueler

              We also really need this feature. Does anybody know an ANE that provides this missing functionality?

              • 4. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                Bramblethorne Community Member

                An equally important question would be, "This serious oversight/problem has been repeatedly brought to the attention of the developers/maintainers for a LONG time so why does it seem that there has been absolutely no response to this legitimate and important issue by same?"

                 

                I've seen this topic all over the interwebs with no official response from Adobe or Apache personelle. Even the bugbase ticket by PureFable posted over 6 months has the following 'official' status:

                 

                State Closed Status Deferred Reason EnhancementRequired

                 

                Air 3.3 at the time and now two large revisions later (to 3.5) and still completely silent on the issue.

                • 5. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                  frank_aq Community Member

                  I ran across this post while searching for this functinaliy. Since it seemed like AIR didn't support it I ended up putting together an extension. This should give you access to videos in the camera roll. https://bitbucket.org/lostirc/videoroll

                   

                  It's still a work in progress so please let me know if you find any bugs or have any feature requests.

                  • 6. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                    Bramblethorne Community Member

                    Oh my goodness!   Thank You!  Fantastic!  A little frustrated at the moment... Been trying to get it going for the last 6 hours or so but no matter what I do it won't launch on my iPad and gives the following error:

                     

                    Exception occurred during launch
                    Reason:
                    Error within Debug UI:

                    java.lang.reflect.InvocationTargetException

                     

                    I noticed the following and wondered if it might have something do with the problem:

                     

                    Properties for PictureTools-OnTheMove-MakeIt => Flex Build Path => Native Extensions => VideoRoll.ane
                    This ANE does not support Google Android-device, Desktop(Windows) platforms
                    Extension ID: com.eyecu.ane.ios.videoroll.VideoRoll
                    Minimum AIR Runtime Version: 3.1
                    Signed: Yes
                    Targets  Apple iOS(iPhone-ARM), ApplicationBundling

                     

                    I don't quite understand why the first notification regarding Android-device and Desktop(Windows) would even be there (with a big red error X icon)... Of course it doesn't.  It's not supposed to, and this project is a Flex  Mobile project which should preclude any error checking for Desktop(Windows) and I've disabled the Android profile and commented out everything in the app descriptor related to Android (alas, we do hope to use the same program on both, but I may need to do a separate project with a shared library).

                     

                    That said, my target build device is an iPad 2 (dual-core A5 chip) running iOS6.1 (https://www.apple.com/ipad/ipad-2/specs.html) which, I does use the ARM v7 instruction set:https://en.wikipedia.org/wiki/Apple_A5 I was hoping to find that it did not use ARM and that that might be the cause of my difficulties, but alas.  Might it be that it specifies iPhone but no inclusion of iPad, or is pretty much any iDevice (iPod touch, iPad, iPhone) grouped under the target name 'iPhone'?

                     

                    One additional tidbit I hope is helpful to you but unrelated to my difficulties is that 'video' is mispelled in the code-snippet examples on the bitbucket site

                    1. protected function showVidoeRoll():void {...
                    2. private function handleVideoSelect(e:VideoRollEvent):void { // this will not return a thumbnail or video ByteArray...

                     

                     

                     

                    I wouldn't have noticed it myself if it were not that the addEventListener gets caught by the compiler for trying to access the method handleVideoSelect

                    • 7. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                      Bramblethorne Community Member

                      Oh, also a feature request (since you asked *chuckle*)

                       

                      Might you be willing to integrate this with CameraUI?

                       

                      By integrate I mean that I very much hoped to have the abilities you provide here in being able to get a thumbnail (or better still allow a user to pick the frame they wish to use), to be able to trim the video (hardlimiting is a bonus too), and to be able to add a name for the resource, and you've provided that functionality [natively, no less... Cheers!]  for a video that already exists on the CameraRoll.  I'd very much like to have that functionality available as soon as my user has touched the Use button in the delegated Video app following:

                       

                      camera =  new CameraUI();

                      camera.addEventListener(MediaEvent.COMPLETE, videoMediaEventComplete);

                      camera.addEventListener(Event.CANCEL, cameraCanceled);

                      camera.addEventListener(ErrorEvent.ERROR, cameraError);

                      camera.launch(MediaType.VIDEO);

                       

                      In this situation, I don't believe the video the user has just 'taken' ever makes it to the CameraRoll.   While the resulting MediaPromise is useless for any sort of loading functionality, it does provide the URL to the captured video file which is stored in the tmp directory.

                       

                      It would be fantastic to do the above and for the app immediately be able to provide the same options/functionality to generate a thumbnail, set a name, trim/limit, etc on this file in the temp space, or even better/addition, do it for any video that the app has a valid local url/nativePath+name for.

                       

                      Currently, because I don't want to lose the video that's in the volitile 'tmp' location, I immediately move the file to the ApplicationStorageDirectory, which means "great, I've saved it, but I can do precious little with it."    I cannot get any of the flash.media.Video* portions of the API to work on iOS though they do work on Android (sort of), and as that's a necessary first step to trying to generate thumbnails and otherwise manipulate the video (in a non-Native manner), I'm pretty much at a standstill.  I have the resource but it does me little benefit.

                       

                      * I have to use Video class to try to get a thumbnail, at least initially instead of StageVideo because the docs explicitly state

                       

                      Because the device's hardware displays the video, a StageVideo object is subject to the following constraints compared to a Video object:

                      • For each SWF file, Flash Player limits the number of StageVideo objects that can concurrently display videos to four. However, the actual limit can be lower, depending on device hardware resources. On AIR for TV devices, only one StageVideo object at a time can display a video.
                      • The video timing is not synchronized with the timing of Flash content that the runtime displays.
                      • The video display area can only be a rectangle. You cannot use more advanced display areas, such as elliptical or irregular shapes.
                      • You cannot rotate the video.
                      • You cannot bitmap cache the video or use BitmapData to access it.

                       

                       

                      With that said I think you might see why I'm so very excited and appreciative  for your resource/efforts.  I've lost weeks messing with this stuff and my supervisor has long since run out of patience.   (With that in mind, I'd be very happy if your ANE ends up meeting our needs [and especially if it extends to Android in the future] trying to get our project to pay some sort of licensing fee.)

                       

                      Anyways... Thank you!     

                      • 8. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                        Bramblethorne Community Member

                        *sigh*   No luck with an iPad 1 or an iPod Touch (gen 4), so my hoped for cause/solution seems unlikely (I've no access to an iPhone).

                         

                        I misspoke earlier with regards to the code-snippet(s).  Vidoe occurs in the other snippets as well.  Hope that's helpful.

                         

                        I should add that unlike Flex Build Path => Native Extensions having a red X icon, when looking at the Flex Build Packaging => Apple iOS => Native Extensions there's a green checkmark icon and it allows me to select 'package'.

                         

                        Other possibly useful diagnostic information.

                        1. The code/resources in the ANE do introspect in the editor.  I.e., they will suggest complete partial entries referencing VideoRoll.  (So, success there!)
                        2. If I comment out any reference to the VideoRoll (includes included), the error still occurs (i.e., it's not related to being used, just referenced in the build/compiler/packaging sections of the project properties and in the extensions section of the xxx-app.xml)
                        3. I've not had any luck by switching versions of the AIR SKD to any of the 4 that are on my machine 3.1, 3.4., 3.5, 3.6, or specifying a different version of the player with the compiler arg -swf-version=xx.
                        • 9. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                          frank_aq Community Member

                          Thanks for trying this out. I do have a build not on the repo yet that lets you grab screenshots from any time in the video. Ill be getting that up soon.

                           

                          Thanks for catching the spelling errors, ill fix that later tonight as well.

                           

                          As for the air issue. Is your app descriptor XML targeting air 3.4?

                          • 10. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                            frank_aq Community Member

                            I don't use flash builder but it seems like it might be trying to build this extension for those targets. On the screen with the red x is it possible to remove this extension from that build target? Is your project set up for android as well as desktop?

                             

                            If possible can you post your app.xml? I will take a look tonight

                            • 11. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                              Bramblethorne Community Member

                              Yes indeed.... whenever I changed between one of my SDKs the app descriptor got a touch and polish to match, as did the -swf-version= compiler arg.  I'm hoping my supervisor can bring in an old iPhone.

                              • 12. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                frank_aq Community Member

                                With the errors your posted I wouldn't think it's related to your device. The error is being thrown before it even makes it on.

                                 

                                This extension should work on all devices running iOS 4 or later (though this is untested, I've only tested on an iPhone 4S running the current OS)

                                 

                                I would check through your build settings and make sure you're not compiling the extension for other platforms

                                • 13. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                  Bramblethorne Community Member

                                  Update:   So... one or more of several things I messed with have partially solved my issues.   I'm pretty certain it was a combination of finding and eliminating some odd debug configuration it created when I added (and later removed) a data/service.  I've fixed it a couple of times in the past, but this time I used a 5lb maul and it's finally using bin-debug again.  Stripped all hints of the ANE out of everywhere, and then brought things back in one at a time.  It will successfully compile and install on my iPad.    Alas however, the minute it hits the

                                   

                                  protected function showVideoRoll():void

                                  {

                                      var videoRoll:VideoRoll = VideoRoll.instance; // Acquire an instance

                                      videoRoll.addEventListener(VideoRollEvent.ON_VIDEO_SELECT, handleVideoSelect); // Dispatched on video select

                                      videoRoll.openVideoRoll(); // Open the video roll

                                  }

                                   

                                  the app flat-out crashes.  No errors, no warnings, no debug trace, no soft whimpering, it goes from 'app' to 'springboard icons' in a blink.

                                   

                                  Fun  

                                   

                                  I suspected for a while that allowing the device to update to iOS 6.1.2 might have had some influence, but that was just a security patch for Exchange.

                                   

                                  Cheers.  14 hours is my limit for today.  I'll let  you know if something new and exciting happens after some sleep.   Cheers!     

                                  • 14. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                    frank_aq Community Member

                                    Try using the returnBytes implementation for now. There could be something wrong with the standard call. 

                                    • 15. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                      frank_aq Community Member

                                      I just updated the repo with a new build that supports creating thumbnails from any time durring the video. Next step will be returning miltiple images from an array of times, hope to have that working by the end of the week.

                                       

                                      I also tested openVideoRoll and it seems to be working for me. I'm running this on an iPhone 4S running iOS 6.1.2. If you're still having issues after this update feel free to let me know.

                                      • 16. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                        valley t Community Member

                                        Hi, i have another problem with my own ANE i'm currently developing. The goal is to get all photos in CameraRoll and return them in an array (BitmapData or ByteArray, what's best ?) back

                                        to AIR.

                                        So far i can determine the photo thumbnails and fill them into an array of UIImage's.

                                        But how do i get this array now back to my AIR app ? Until now i have only found examples where the as3 code passes a container (ByteArray or BitmapData) to the C code where the result is filled into it.

                                         

                                        Can someone explain me please what i need to do that the array of thumbs can be returned altogether to the as3 part without passing any container from as3 ?

                                        It must be something similar as in method GetBitmapFromVideoAtTime.

                                         

                                        Thank you!

                                        • 17. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                          Bramblethorne Community Member

                                          Afraid that whenever I execute the function call videoRoll.openVideoRoll(); it crashes so hard that the debugger doesn't even know what to do with itself *chuckle*.  The trace statement immediatly preceeding the call is shown but the one after is ... well... there's no program left  

                                           

                                          I probably need to take this to my debug program where I can strip everything out but the ANE and play with it there, but for the rest of the day I need to show progress elsewhere.  As to thumbnails and returnBytes implementations, while I look forward to that, I'll have to get beyond the video roll open to have something to play with.   

                                           

                                          I wonder if it makes any difference that my CameraRoll has nearly 1,000 images in it (the entire 880 page run of The Order of the Stick webcomic has been the recent 'waste time when you should be working' material).

                                           

                                          You've got me interested to explore ANE development, but they'd kill me if I took the time right now.  (I'm assuming I need to boot back into MacOS and install xcode to do so, and there's just no space on the drive for that fantastically huge dev evironment).

                                           

                                          If I get a chance to play with VideoRoll in my debug provision program I'll report results.  I think it's entirely awesome that you're addressing this rather obvious oversight/lack in the API.

                                          • 18. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                            valley t Community Member

                                            Yeah sure, no problem.

                                            If i make any progress i will post it here or i create an open GitHub repository for the ANE.

                                            And for large CameraRoll's i had the idea to enable a paging mechanism with a total number of returned thumbnails per context request and an offset.

                                            • 19. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                              Bramblethorne Community Member

                                              Hey Valley.  Just to avoid confusion, (because I'm not sure after reading your post... if your post was in response to what I wrote), I wanted to make the distinction that my responses were regarding the VideoRoll ANE that frank_aq is developing.

                                               

                                              I didn't respond to your question (sorry for that), because I'm not certain I understand it.  Part of my confusion might be the use of the word "CameraRoll" and not knowing if you're referring to the Flex CameraRoll class, or if you're referring to the iOS Camera Roll (and possibly in the context of some similar entity in xCode to the Flex CameraRoll class).

                                               

                                              Having not gotten into the realms of developing and ANE, I don't know that I have much to offer with regards to your questions... from a strictly Flex developer aspect though, I'm wondering if an ANE is needed.  Since it sounds like you aren't wanting the graphical elements/interraction of launching/delegating the iOS CameraRoll 'picker/browser', but rather wanting to gain access to the resources in that storage location and create your own picker/browser, could your purpose be achieved using standard File operations instead???  Getting a directory listing and then harvesting information on those files, including reading them in and creating thumbnails?

                                               

                                              I'm not certain if the iOS permissions for Flex allow that access, but I suspect that at least 'read' access is permitted of the location and files that represent the system Camera Roll.

                                               

                                              Haven't explored it though it was one possible way I could have explored to get around the CameraRoll.browseForImage() functionality for videos not being present.

                                               

                                              Sorry if that's more question and less answer.

                                              • 20. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                frank_aq Community Member

                                                Hi Bramblethorne

                                                 

                                                Thanks for helping me test this out, I'm bummed its not working for you. I'm not why the size of your camera roll would cause this issue but it's something worth looking into. If you have access to Xcode would you mind sending me over your crash log? If you need help finding it ping me and I'll help you out.

                                                 

                                                Valley,

                                                You should be able to use code from my extension for getting bitmap data back from iOS. You don't actually return a bitmapdata object from c, you pass one in from as and acquire it on the native side. Feel free to take a look at my code and grab whatever you need.

                                                • 21. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                  valley t Community Member

                                                  Thanks to both of you for your answers!

                                                   

                                                  @Bramblethorne: I'm talking about the iOS CameraRoll, where CameraRoll.browserForImage() is way too bad for me because i only get one photo per selection.

                                                   

                                                  @Frank: That's funny, i found your extension just today and tried it, but my app crashed in method uiImageToBitmapDataWithRef(), probably because of wrong code on my side.

                                                  I need the functionality that your getBitmapFromVideoAtTimes() would perform in a similar way, unfortunately this part is missing in your extension yet. And i need it for the photos from CameraRoll,

                                                  and that's an async procedure, which makes it a little bit more difficult. Therefore the array of BitmapData possibly can only be passed to C after the retrieval of CameraRoll's photos has been finished and as3 has been notified about that.

                                                  What works so far in my ANE is this:

                                                  • After the notification from C code that the photo thumbnails have been loaded and stored as UIImage objects in an array i iterate in as3 over the number of found photos, create in every step a BitmapData object with the dimensions of the thumbnails and pass it to another C method where the image at the passed index is retrieved and drawn to the passed BitmapData
                                                  • This method is called n times (length of the array with found thumbnails)
                                                  • With 83 photos in CameraRoll this takes around 5 seconds on my iPhone 4, therefore not very performant

                                                   

                                                  I will try next

                                                  • If working with ByteArrays instead of BitmapData gives me better performance
                                                  • If i will not be successful when passing 1x the array with n BitmapData (or ByteArray) objects from as3 to C where the complete array of photo thumbs will be processed in one step and written into the passed array objects
                                                  • Working with paging mechanism (i.e. let's say you have 1'000 photos in you CameraRoll) to avoid memory problems

                                                   

                                                  If you have some insights (above all the 2nd step in my ToDo list) i would be very interested in it


                                                  Thank you so far!

                                                  • 22. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                    frank_aq Community Member

                                                    Hey valley,

                                                     

                                                    The crash in uiImageToBitmapDataWithRef seems like you don't have a cashed ui image on the native side

                                                     

                                                    When you made a call to openVideoRollReturnBytes did you pass in true for the last param?

                                                    • 23. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                      valley t Community Member

                                                      Hi Frank,

                                                       

                                                      actually i only took your method uiImageToBitmapDataWithRef() for a test, nothing else. Therefore i also could not set any caching related properties nor use the functionality behind it.

                                                      In the ContextInitializer of the C part i init now

                                                       

                                                      thumbs = [[NSMutableArray alloc] init];

                                                       

                                                      and this array is still there and filled when the requests from as3 are performed after the notification that the retrieval of the photo thumbs has been finished.

                                                       

                                                      I'm curious how ByteArray's will perform.

                                                      • 24. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                        Bramblethorne Community Member

                                                        Hrm...I'd like to help with the Xcode information, but Alas I cannot.  I am on a quad-core iMac 32", but I'm afraid I'm running Windows 7 Enterprise.  I have a small MacOS partition that may or may not have enough room to install XCode, but I know I removed it a while back (because I didn't have a use for it and space was at a premium).

                                                         

                                                        My dev environment is Adobe Flashbuilder 4.7, Flex SDK 4.6.0, AIR 3.6 -swf-version=19 (I don't know w/o looking it up which version of the flashplayer that targets (within AIR)).

                                                         

                                                        If there's a way to harvest useful information, I'm happy to try to find and share it.

                                                         

                                                        I only mentioned the CameraRoll having lots of images as a completely desperate idea for why it might be crashing, but I doubt that's the issue.  I think I'll pull them off just for the sake of making certain that's not causal.  Will let you know.

                                                         

                                                        You've got me really wanting to boot Mac and investigate things from that side, but it's rather intimidating... whole new world.... that and I'm about 4 months behind deadline and I can't bunny-trail to much for the moment as long as I have other objectives to try to complete that have equal priority with this functionality. 

                                                         

                                                        Cheers!   I'm enjoying this... especially because it feels like 'moving forward' instead of just flat out being stuck with an API that just lacks this basic functionality.

                                                         

                                                        On a side note, I am absolutely amazed that such simple necessary functionality is so very overlooked, so poorly executed when it is not overlooked, and so needlessly complicated.  Just playing a video on the local file system (which I haven't been successful at so far in iOS... I've been mildly successful in Android) is an idiotic nightmare of using a bloated networking/streaming system designed for use with their purchased hosting server, when it should be no more complicated than instantiating a video player container, or, grabbing the StageVideo and just giving it a local file location..... and this... this for a video taken ON the system WITH the system camera IN the system video format. *chuckle*   Providing a way to take video by delegating the system camera app, but failing to provide a way to access that video by delegating the system gallery/camera roll app, and to easily harvest a thumbnail just astounds me.  This is 'what a mobile development technology needs to implement 101'.  A mobile media device and a development technology that purports to be Enterprise level...   ah well.. .End Rant.   Thanks for your help!

                                                        • 25. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                          frank_aq Community Member

                                                          Thanks. What iOS device are you trying this on? Ill see if I can harvest

                                                          some older devices and debug this over the weekend.

                                                          • 26. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                            Bramblethorne Community Member

                                                            I've messed with it on iPad2, iPad1, iPod Touch gen4, and an iPhone 3GS.... that was trying to get Flex to accept the ANE and install the app on the devices, which it never did while I was working with all of those devices.  I have since gotten it to install on the iPad2 and that's the one it crashes on.  I haven't since tried the other devices (since the primary goal was just to get the new app containing the ANE to install, at the time).  I can try those as well if you think that might be a determining factor.

                                                            • 27. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                              frank_aq Community Member

                                                              I was able to grab an iPad 2. Ill see what I can find.

                                                              • 28. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                DaveCates Community Member

                                                                what about publishing/saving videos to the camera roll? any ideas on that?

                                                                • 29. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                  frank_aq Community Member

                                                                  Yeah that seems like a good idea. Any way you can supply me with a mobile

                                                                  project that uses the air video apis to record and save?

                                                                  • 30. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                    DaveCates Community Member

                                                                    Air video APIs to record and save?

                                                                     

                                                                    You need to do that yourself as we have

                                                                    • 31. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                      frank_aq Community Member

                                                                      I think the AIR camera API will allow you to capture video from the device

                                                                      camera. Are you using an extension that does this though the native camera

                                                                      screen?

                                                                      • 32. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                        DaveCates Community Member

                                                                        We grab each frame from the camera using the Air Camera API then we're using our custom video ANE to encode to MP4.

                                                                         

                                                                        We now need to save this to the camera roll just like the OS does.

                                                                        • 33. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                          frank_aq Community Member

                                                                          Ah I see. I think in that case you just need to move it to a directory. It

                                                                          seems like you should be able to do it in the extension that creates your

                                                                          mp4

                                                                          • 34. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                            Bramblethorne Community Member

                                                                            ChoosePictureLightbox.mxml

                                                                            <?xml version="1.0" encoding="utf-8"?>

                                                                            <c:LightboxBase xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                                                                                    xmlns:s="library://ns.adobe.com/flex/spark"

                                                                                                                    xmlns:c="components.*"

                                                                                                                    xmlns:as="classes.*"

                                                                                                                    open="openHandler(event)" xmlns:myLibrary="components.myLibrary.*">

                                                                             

                                                                                      <fx:Script>

                                                                                                <![CDATA[

                                                                                                          import flash.media.CameraRoll;

                                                                                                          import flash.media.CameraUI;

                                                                             

                                                                                                          import spark.components.BusyIndicator;

                                                                                                          import spark.events.PopUpEvent;

                                                                             

                                                                            //                              import com.eyecu.ane.ios.videoroll.VideoRoll;

                                                                            //                              import com.eyecu.ane.ios.videoroll.VideoRollEvent;

                                                                             

                                                                             

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var choosePrompt:String = "Choose from one of these sources";

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var cancelButtons:Boolean = true;                    // cancelButton/cancelSpacer

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var buttonsEnabled:Boolean = true;                    // All buttons disabled while timer is running.

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var showStatus:Boolean = true;                              // status message

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var videoCameraActive:Boolean = false;          // status message

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var acquisitionButtons:Boolean = true;          // Camera/Roll/Library buttons

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var busy:Boolean = false;                                        // Busy Indicator

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var libraryOpen:Boolean = false;                              // Show the library chooser

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var bmpData:BitmapData;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var video:Video;

                                                                             

                                                                                                          private var timer:Timer = new Timer(3000,1);

                                                                                                          private var camera:CameraUI;

                                                                                                          private var roll:CameraRoll;

                                                                                                          private var loader:Loader;

                                                                                                          private var mediaPromise:MediaPromise;

                                                                             

                                                                                                          private var data:Object = new Object();

                                                                             

                                                                                                          protected function openHandler(event:Event):void

                                                                                                          {

                                                                                                                    // Reset state for re-entry

                                                                                                                    statusText.text = choosePrompt;

                                                                                                                    busy = false;

                                                                                                                    showStatus = true;

                                                                                                                    acquisitionButtons = true;

                                                                                                                    cancelButtons = true;

                                                                                                          }

                                                                             

                                                                                                          protected function clickButton(which:String):void

                                                                                                          {

                                                                                                                    cancelButtons = acquisitionButtons = false;

                                                                                                                    statusText.text = "";

                                                                                                                    busy = true;

                                                                             

                                                                                                                    switch(which)

                                                                                                                    {

                                                                                                                              case "myLibrary":

                                                                                                                              {

                                                                                                                                        busy = false;

                                                                                                                                        libraryOpen = true;

                                                                                                                                        break;

                                                                                                                              }

                                                                                                                              case "cameraPhoto":

                                                                                                                              {

                                                                                                                                        if (CameraUI.isSupported)

                                                                                                                                        {

                                                                                                                                                  camera = new CameraUI();

                                                                                                                                                  camera.addEventListener(MediaEvent.COMPLETE,          cameraImageEventComplete);

                                                                                                                                                  camera.addEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                                                  camera.addEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                                                                                                  camera.launch(MediaType.IMAGE);

                                                                                                                                        }

                                                                                                                                        else

                                                                                                                                        {

                                                                                                                                                  statusText.text = "Camera not supported on this device.";

                                                                                                                                                  startTimer();

                                                                                                                                        }

                                                                                                                                        break;

                                                                                                                              }

                                                                             

                                                                                                                              case "cameraVideo":

                                                                                                                              {

                                                                                                                                        if(CameraUI.isSupported)

                                                                                                                                        {

                                                                                                                                                  camera = new CameraUI();

                                                                                                                                                  camera.addEventListener(MediaEvent.COMPLETE,          videoMediaEventComplete);

                                                                                                                                                  camera.addEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                                                  camera.addEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                                                                                                  camera.launch(MediaType.VIDEO);

                                                                                                                                        }

                                                                                                                                        else

                                                                                                                                        {

                                                                                                                                                  statusText.text = "Camera not supported on this device.";

                                                                                                                                                  startTimer();

                                                                                                                                        }

                                                                                                                                        break;

                                                                                                                              }

                                                                             

                                                                                                                              case "rollPhoto":

                                                                                                                              {

                                                                                                                                        if (CameraRoll.supportsBrowseForImage)

                                                                                                                                        {

                                                                                                                                                  roll = new CameraRoll();

                                                                                                                                                  roll.addEventListener(MediaEvent.SELECT,          cameraRollEventComplete);

                                                                                                                                                  roll.addEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                                                  roll.addEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                                                                                                  roll.browseForImage();

                                                                                                                                        }

                                                                                                                                        else

                                                                                                                                        {

                                                                                                                                                  statusText.text = "Camera roll not supported on this device.";

                                                                                                                                                  startTimer();

                                                                                                                                        }

                                                                                                                                        break;

                                                                                                                              }

                                                                             

                                                                                                                              case "rollVideo":

                                                                                                                              {

                                                                            //                                                            showVideoRoll();

                                                                                                                                        break;

                                                                                                                              }

                                                                             

                                                                             

                                                                                                                    } // End switch case

                                                                                                          }

                                                                             

                                                                            /*

                                                                                                          protected function showVideoRoll():void

                                                                                                          {

                                                                                                                    trace("ChoosePictureLightbox FUNCTION showVideoRoll()");

                                                                            //                                        var videoRoll:VideoRoll = VideoRoll.instance; // Acquire an instance

                                                                                                                    trace("ChoosePictureLightbox FUNCTION showVideoRoll() instantiated");

                                                                            //                                        videoRoll.addEventListener(VideoRollEvent.ON_VIDEO_SELECT, handleVideoSelect); // Dispatched on video select

                                                                                                                    trace("ChoosePictureLightbox FUNCTION showVideoRoll() addedEventListener");

                                                                            //                                        videoRoll.openVideoRoll(); // Open the video roll

                                                                                                                    trace("ChoosePictureLightbox FUNCTION showVideoRoll() opened");

                                                                                                          }

                                                                             

                                                                             

                                                                                                          private function handleVideoSelect(e:VideoRollEvent):void

                                                                                                          {

                                                                                                                    // this will not return a thumbnail or video ByteArray

                                                                            //                                        var f:File = new File(e.videoUrl); // The location is returned in the event

                                                                            //                                        var ba:ByteArray = new ByteArray(); // Create a ByteArray to load the video into

                                                                            //                                        var fs:FileStream = new FileStream();

                                                                            //                                        fs.open(f, FileMode.READ);

                                                                            //                                        fs.readBytes(ba, 0, fs.bytesAvailable); // Read the video into the BA

                                                                            //                                        fs.close();

                                                                                                          }

                                                                            */

                                                                             

                                                                                                          protected function cameraCanceled(event:Event):void

                                                                                                          {

                                                                                                                    statusText.text = "Camera access canceled by user.";

                                                                                                                    startTimer();

                                                                                                          }

                                                                             

                                                                                                          protected function cameraError(event:ErrorEvent):void

                                                                                                          {

                                                                                                                    statusText.text = "There was an error while trying to use the camera.";

                                                                                                                    startTimer();

                                                                                                          }

                                                                             

                                                                                                          protected function onMediaPromiseLoadError(event:IOErrorEvent):void

                                                                                                          {

                                                                                                                    statusText.text = "There was an error while loading the media.";

                                                                                                                    startTimer();

                                                                                                          }

                                                                             

                                                                                                          protected function videoMediaEventComplete(event:MediaEvent):void

                                                                                                          {

                                                                                                                    statusText.text="Preparing captured video...";

                                                                             

                                                                                                                    camera.removeEventListener(MediaEvent.COMPLETE,                    videoMediaEventComplete);

                                                                                                                    camera.removeEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                    camera.removeEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                             

                                                                                                                    var media:MediaPromise = event.data;

                                                                             

                                                                                                                    data.MediaType = MediaType.VIDEO;

                                                                                                                    data.MediaPromise = media;

                                                                                                                    data.source = "camera video";

                                                                             

                                                                                                                    close(true,data)

                                                                                                          }

                                                                             

                                                                                                          private function initHandler(event:Event):void

                                                                                                          {

                                                                                                                    var loader:Loader = Loader(event.target.loader);

                                                                                                                    var info:LoaderInfo = LoaderInfo(loader.contentLoaderInfo);

                                                                                                                    trace("initHandler: loaderURL=" + info.loaderURL + " url=" + info.url);

                                                                                                          }

                                                                             

                                                                                                          private function ioErrorHandler(event:IOErrorEvent):void

                                                                                                          {

                                                                                                                    trace("ioErrorHandler: " + event);

                                                                                                          }

                                                                             

                                                                             

                                                                                                          protected function cameraImageEventComplete(event:MediaEvent):void

                                                                                                          {

                                                                                                                    data.MediaType = MediaType.IMAGE;

                                                                                                                    data.source = "camera image";

                                                                                                                    camera.removeEventListener(MediaEvent.COMPLETE,                    cameraImageEventComplete);

                                                                                                                    camera.removeEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                    camera.removeEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                             

                                                                                                                    statusText.text = "Loading selected image...";

                                                                                                                    mediaPromise = event.data;

                                                                             

                                                                                                                    loader = new Loader();

                                                                                                                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaderCompleted);

                                                                                                                    loader.addEventListener(IOErrorEvent.IO_ERROR, onMediaPromiseLoadError);

                                                                                                                    loader.loadFilePromise(mediaPromise);

                                                                                                          } // End FUNCTION mediaEventComplete

                                                                             

                                                                                                          protected function cameraRollEventComplete(event:MediaEvent):void

                                                                                                          {

                                                                                                                    data.MediaType = MediaType.IMAGE;

                                                                                                                    data.source = "roll image";

                                                                                                                    roll.removeEventListener(MediaEvent.COMPLETE,          cameraRollEventComplete);

                                                                                                                    roll.removeEventListener(Event.CANCEL,                              cameraCanceled);

                                                                                                                    roll.removeEventListener(ErrorEvent.ERROR,                    cameraError);

                                                                             

                                                                                                                    statusText.text = "Loading selected image...";

                                                                                                                    mediaPromise = event.data;

                                                                             

                                                                                                                    loader = new Loader();

                                                                                                                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaderCompleted);

                                                                                                                    loader.addEventListener(IOErrorEvent.IO_ERROR, onMediaPromiseLoadError);

                                                                                                                    loader.loadFilePromise(mediaPromise);

                                                                                                          } // End FUNCTION mediaEventComplete

                                                                             

                                                                             

                                                                                                          protected function imageLoaderCompleted(event:Event):void

                                                                                                          {

                                                                                                                    var loaderInfo:LoaderInfo = event.target as LoaderInfo;

                                                                                                                    loader.removeEventListener(Event.COMPLETE, imageLoaderCompleted);

                                                                                                                    loader.removeEventListener(IOErrorEvent.IO_ERROR, onMediaPromiseLoadError);

                                                                             

                                                                                                                    bmpData = new BitmapData(loaderInfo.width, loaderInfo.height);

                                                                                                                    bmpData.draw(event.target.content);

                                                                             

                                                                                                                    data.bmpData = bmpData as BitmapData;

                                                                                                                    data.event = event as Event;

                                                                             

                                                                                                                    close(true,data);

                                                                                                          } // End FUNCTION imageLoaderComplete

                                                                             

                                                                             

                                                                                                          private function startTimer():void

                                                                                                          {

                                                                                                                    buttonsEnabled = false;

                                                                                                                    busy = false;

                                                                                                                    timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);

                                                                                                                    timer.start();

                                                                                                          }

                                                                             

                                                                                                          private function timerComplete(event:TimerEvent):void

                                                                                                          {

                                                                                                                    statusText.text = choosePrompt;

                                                                                                                    acquisitionButtons = true;

                                                                                                                    cancelButtons = true;

                                                                                                                    buttonsEnabled = true;

                                                                                                          }

                                                                             

                                                                                                          private function clickLibraryCancelButton(event:Event):void

                                                                                                          {

                                                                                                                    statusText.text="Library access cancelled by user.";

                                                                                                                    startTimer();

                                                                                                                    libraryOpen=false;

                                                                                                          }

                                                                             

                                                                                                ]]>

                                                                                      </fx:Script>

                                                                             

                                                                                      <s:VGroup id="vg" creationComplete="insertIntoContainer(vg)" horizontalAlign="center" verticalAlign="middle" width="100%" height="100%">

                                                                             

                                                                                                <s:Label id="statusText" width="100%" color="#ff3333" fontWeight="bold" fontSize="40" textAlign="center" paddingTop="20" paddingBottom="20" text="{choosePrompt}" visible="{showStatus}" includeInLayout="{showStatus}"/>

                                                                             

                                                                                                <s:VGroup id="myLibraryVGroup" visible="{libraryOpen}" includeInLayout="{libraryOpen}" height="85%" width="90%" horizontalAlign="center">

                                                                                                          <myLibrary:ChooseFromMyLibrary id="myLibraryPanelGroup" visible="{libraryOpen}" includeInLayout="{libraryOpen}" height="90%" width="{myLibraryVGroup.width}"/>

                                                                                                          <s:Button label="Cancel" click="clickLibraryCancelButton(event)" enabled="{buttonsEnabled}"/>

                                                                                                </s:VGroup>

                                                                             

                                                                                                <s:TileGroup id="acquisitionGroup" requestedColumnCount="4" visible="{acquisitionButtons}" includeInLayout="{acquisitionButtons}">

                                                                                                          <s:Button id="takePhotoButton"                              width="220" height="160"          label="Take Photo"                    click="clickButton('cameraPhoto')" icon="@Embed('assets/icons/Digicam.png')" iconPlacement="top" enabled="{buttonsEnabled}"/>

                                                                                                          <s:Button id="cameraRollPhotoButton"          width="220" height="160"          label="Choose Photo"                    click="clickButton('rollPhoto')" icon="@Embed('assets/icons/Photos.png')" iconPlacement="top" enabled="{buttonsEnabled}"/>

                                                                                                          <!--s:Button id="cameraRollVideoButton"          width="220" height="160"          label="Choose Video"                    click="clickButton('rollVideo')" icon="@Embed('assets/icons/FilmStrip.png')" iconPlacement="top" enabled="{buttonsEnabled}"/-->

                                                                                                          <s:Button id="takeVideoButton"                              width="220" height="160"          label="Take Video"                    click="clickButton('cameraVideo')" icon="@Embed('assets/icons/movie-camera-th.png')" iconPlacement="top" enabled="{buttonsEnabled}"/>

                                                                                                          <s:Button id="myLibraryButton"                              width="220" height="160"          label="My Library"                    click="clickButton('myLibrary')" icon="@Embed('assets/icons/folder_images_64.png')" iconPlacement="top" enabled="{buttonsEnabled}"/>

                                                                                                </s:TileGroup>

                                                                             

                                                                                                <s:Group id="videoGroup" visible="{videoCameraActive}" includeInLayout="{videoCameraActive}"/>

                                                                             

                                                                                                <s:BusyIndicator rotationInterval="50" symbolColor="#cd0000" id="busyIndicator" visible="{busy}" includeInLayout="{busy}"/>

                                                                             

                                                                                                <s:Spacer id="cancelSpacer" height="10"          visible="{cancelButtons}" includeInLayout="{cancelButtons}"/>

                                                                                                <s:Button id="cancelButton" label="Cancel" click="close(false)" visible="{cancelButtons}" includeInLayout="{cancelButtons}" enabled="{cancelButtons}"/>

                                                                                      </s:VGroup>

                                                                            </c:LightboxBase>

                                                                             

                                                                            ChoosePictureButton.mxml

                                                                             

                                                                            <?xml version="1.0" encoding="utf-8"?>

                                                                            <s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"

                                                                                                 xmlns:s="library://ns.adobe.com/flex/spark"

                                                                                                 xmlns:g="assets.graphics.*"

                                                                                                 xmlns:c="components.*"

                                                                                                 xmlns:fxg="assets.fxg.*"

                                                                                                 filters="{[bevelFilterUp]}"

                                                                                                 creationComplete="creationCompleteHandler()"

                                                                                                 >

                                                                             

                                                                                      <fx:Declarations>

                                                                                                <s:Fade id="imageButtonsFadeIn"                                                            target="{imageButtonsGroup}"          duration="500"          alphaTo="1"   />

                                                                                                <s:Fade id="imageButtonsFadeOut"                                                  target="{imageButtonsGroup}"          duration="500"          alphaTo="0"   />

                                                                             

                                                                                                <s:BevelFilter id="bevelFilterUp" distance="4" blurX="4" blurY="4" quality="{BitmapFilterQuality.HIGH}"/>

                                                                                      </fx:Declarations>

                                                                             

                                                                             

                                                                                      <fx:Script>

                                                                                                <![CDATA[

                                                                                                          import flash.display.BitmapData;

                                                                                                          import flash.filters.BitmapFilterQuality;

                                                                                                          import flash.media.Video;

                                                                             

                                                                                                          import spark.components.Image;

                                                                                                          import spark.events.PopUpEvent;

                                                                             

                                                                                                          import classes.CustomVideoClient;

                                                                                                          import classes.ImageResizer;

                                                                                                          import classes.ResizeMath;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var buttonScale:Number = 1;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var imageButtonsActive:Boolean = false;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var data:Object;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var selection:Boolean = false;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var thumbBmpData:BitmapData;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var bmpData:BitmapData;

                                                                             

                                                                                                          [Bindable]

                                                                                                          private var busy:Boolean = false;

                                                                             

                                                                                                          private var timer:Timer;

                                                                                                          private var delaySaveTimer:Timer;

                                                                             

                                                                                                          private var choosePictureLightbox:ChoosePictureLightbox;

                                                                                                          private var fileStreamXML:FileStream;

                                                                                                          private var fileStreamImage:FileStream;

                                                                                                          private var fileStreamThumb:FileStream;

                                                                                                          private var libraryThumbBmpData:BitmapData;

                                                                                                          private var xmlFilename:String = "";

                                                                                                          private var mediaType:String = "";

                                                                                                          private var netConnection:NetConnection;

                                                                                                          private var videoFile:File;

                                                                                                          private var video:Video;

                                                                             

                                                                                                          public function getXmlFilename():String

                                                                                                          {

                                                                                                                    return xmlFilename;

                                                                                                          }

                                                                             

                                                                                                          public function getSelection():Boolean

                                                                                                          {

                                                                                                                    return selection;

                                                                                                          }

                                                                             

                                                                                                          public function getMediaType():String

                                                                                                          {

                                                                                                                    return mediaType;

                                                                                                          }

                                                                             

                                                                                                          private function creationCompleteHandler():void

                                                                                                          {

                                                                                                                    buttonScale = (width-(5*10)) / (64+64+48);

                                                                             

                                                                                                                    if(buttonScale > 2)

                                                                                                                    {

                                                                                                                              buttonScale = 2;

                                                                                                                    }

                                                                                                          }

                                                                             

                                                                                                          private function fullscreenImageLightboxClosed(event:PopUpEvent):void

                                                                                                          {

                                                                                                                    busy = false;

                                                                                                                    imageButtonsActive = false;

                                                                                                          }

                                                                             

                                                                                                          private function choosePictureLightboxClosed(event:PopUpEvent):void

                                                                                                          {

                                                                                                                    trace("ChoosePictureButton FUNCTION choosePictureLightboxClosed("+event.data.MediaType+")");

                                                                             

                                                                                                                    imageButtonsActive = false;

                                                                             

                                                                                                                    if(event.commit)

                                                                                                                    {

                                                                                                                              this.data = event.data as Object;

                                                                             

                                                                                                                              filters = new Array();

                                                                                                                              selection = true;

                                                                             

                                                                                                                              switch(data.MediaType)

                                                                                                                              {

                                                                                                                                        case MediaType.VIDEO:

                                                                                                                                        {

                                                                                                                                                  trace("ChoosePictureButton FUNCTION choosePictureLightboxClosed() CASE VIDEO");

                                                                                                                                                  busy = true;

                                                                             

                                                                                                                                                  mediaType = "video";

                                                                             

                                                                                                                                                  var timestamp:String = new Date().getTime().toString();

                                                                             

                                                                                                                                                  statusMessage.text = "Saving Video to Library...";

                                                                             

                                                                                                                                                  var sourceFile:File = new File(data.MediaPromise.file.url);

                                                                             

                                                                                                                                                  var destinationPath:File = File.applicationStorageDirectory.resolvePath("User" +parentApplication.userid);

                                                                             

                                                                                                                                                  if(destinationPath.exists && !destinationPath.isDirectory)

                                                                                                                                                  {

                                                                                                                                                            destinationPath.deleteFile();

                                                                                                                                                  }

                                                                                                                                                  destinationPath.createDirectory();

                                                                             

                                                                                                                                                  destinationPath = destinationPath.resolvePath("Videos");

                                                                             

                                                                                                                                                  if(destinationPath.exists && !destinationPath.isDirectory)

                                                                                                                                                  {

                                                                                                                                                            destinationPath.deleteFile();

                                                                                                                                                  }

                                                                                                                                                  destinationPath.createDirectory();

                                                                             

                                                                                                                                                  videoFile = destinationPath.resolvePath(parentApplication.userid+"Video"+timestamp+".mov");

                                                                             

                                                                                                                                                  trace("ChoosePictureButton FUNCTION choosePictureLightboxClosed() "+sourceFile.url);

                                                                                                                                                  trace("ChoosePictureButton FUNCTION choosePictureLightboxClosed() MOVE VIDEO TO APPSPACE");

                                                                                                                                                  trace("ChoosePictureButton FUNCTION choosePictureLightboxClosed() "+videoFile.url);

                                                                                                                                                  sourceFile.moveTo(videoFile,true);

                                                                             

                                                                                                                                                  // testing w/o moving

                                                                                                                                                  //videoFile = sourceFile;

                                                                             

                                                                                                                                                  playVideoFile();

                                                                             

                                                                                                                                                  xmlFilename = parentApplication.userid+"VideoInfo"+timestamp+".xml";

                                                                             

                                                                                                                                                  var videoXML:XML =

                                                                                                                                                            <video>

                                                                                                                                                                      <userid>{parentApplication.userid}</userid>

                                                                                                                                                                      <description></description>

                                                                                                                                                                      <timestamp>{timestamp}</timestamp>

                                                                                                                                                                      <source>{data.source}</source>

                                                                                                                                                                      <xmlFilename>{xmlFilename}</xmlFilename>

                                                                                                                                                                      <videoFilename>{videoFile.name}</videoFilena me>

                                                                                                                                                            </video>;

                                                                             

                                                                                                                                                  var destinationXMLFile:File  = destinationPath.resolvePath(xmlFilename);

                                                                             

                                                                                                                                                  statusMessage.text = "Saving Video to Library: Info...";

                                                                                                                                                  var fileStreamXML:FileStream = new FileStream();

                                                                                                                                                  fileStreamXML.open(destinationXMLFile, FileMode.WRITE);

                                                                                                                                                  fileStreamXML.writeUTFBytes(videoXML.toXMLString());

                                                                                                                                                  fileStreamXML.close();

                                                                             

                                                                                                                                                  statusMessage.text = "";

                                                                                                                                                  busy = false;

                                                                             

                                                                                                                                                  break;

                                                                                                                                        }

                                                                                                                                        case MediaType.IMAGE:

                                                                                                                                        {

                                                                                                                                                  mediaType = "image";

                                                                                                                                                  this.bmpData = data.bmpData as BitmapData;

                                                                             

                                                                                                                                                  var canvas:BitmapData;

                                                                                                                                                  var rect:Rectangle;

                                                                                                                                                  var pt:Point;

                                                                             

                                                                                                                                                  // Correct non 4:3 proportions by letterboxing if too wide, and pillarboxing if too narrow.

                                                                                                                                                  if(.75* bmpData.width != bmpData.height)

                                                                                                                                                  {

                                                                                                                                                            if(.75*bmpData.width > bmpData.height) // Letterbox

                                                                                                                                                            {

                                                                                                                                                                      canvas = new BitmapData(bmpData.width, .75*bmpData.width, false, 0xff000000);

                                                                                                                                                                      rect = new Rectangle(0, 0, bmpData.width, bmpData.height);

                                                                                                                                                                      pt = new Point(0, ((canvas.height-bmpData.height)/2));

                                                                                                                                                            }

                                                                                                                                                            else // Pillarbox

                                                                                                                                                            {

                                                                                                                                                                      canvas = new BitmapData( ((4*bmpData.height)/3), bmpData.height, false, 0xff000000);

                                                                                                                                                                      rect = new Rectangle(0, 0, bmpData.width, bmpData.height);

                                                                                                                                                                      pt = new Point( ((canvas.width-bmpData.width)/2), 0);

                                                                                                                                                            }

                                                                                                                                                            canvas.copyPixels(bmpData, rect, pt);

                                                                                                                                                            bmpData = ImageResizer.bilinearIterative(canvas, 1024, 768, ResizeMath.METHOD_LETTERBOX , true, 3);

                                                                                                                                                            //var pngEncoder:PngEncoder = new PngEncoder(bmpData,png,true);

                                                                                                                                                  }

                                                                                                                                                  createThumbnail();

                                                                                                                                                  break;

                                                                                                                                        }

                                                                             

                                                                                                                              }

                                                                                                                    }

                                                                                                                    else

                                                                                                                    {

                                                                                                                              filters = new Array(bevelFilterUp);

                                                                                                                    }

                                                                                                                    busy = false;

                                                                                                          }

                                                                             

                                                                                                          private function playVideoFile():void

                                                                                                          {

                                                                                                                    trace("ChoosePictureButton FUNCTION playVideoFile");

                                                                                                                    netConnection = new NetConnection();

                                                                                                                    netConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

                                                                                                                    netConnection.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

                                                                                                                    netConnection.connect(null);

                                                                                                          }

                                                                             

                                                                                                          private function netStatusHandler(event:NetStatusEvent):void

                                                                                                          {

                                                                                                                    trace("ChoosePictureButton FUNCTION netStatusHandler code: "+event.info.code);

                                                                             

                                                                                                                    switch (event.info.code)

                                                                                                                    {

                                                                                                                              case "NetConnection.Connect.Success":

                                                                                                                                        connectStream();

                                                                                                                                        break;

                                                                                                                              case "NetStream.Play.StreamNotFound":

                                                                                                                                        trace("Stream not found: "); // + videoURL);

                                                                                                                                        if(stage.contains(video))

                                                                                                                                        {

                                                                                                                                                  stage.removeChild(video);

                                                                                                                                        }

                                                                                                                                        break;

                                                                                                                    }

                                                                                                          }

                                                                             

                                                                                                          private function securityErrorHandler(event:SecurityErrorEvent):void

                                                                                                          {

                                                                                                                    trace("ChoosePictureButton FUNCTION sercurityErrorHandler");

                                                                                                                    trace("securityErrorHandler: " + event);

                                                                                                          }

                                                                             

                                                                                                          //                              private function onStageVideoState(event:StageVideoAvailabilityEvent):void      

                                                                                                          //                              {      

                                                                                                          //                                        var available:Boolean = (event.availability == StageVideoAvailability.AVAILABLE);      

                                                                                                          //                                        trace("ChoosePictureButton FUNCTION onStageVideoState "+available);

                                                                                                          //                              }

                                                                             

                                                                                                          private function asyncErrorHandler(event:AsyncErrorEvent):void

                                                                                                          {

                                                                                                                    // ignore AsyncErrorEvent events.

                                                                                                          }

                                                                             

                                                                             

                                                                                                          private function connectStream():void

                                                                                                          {

                                                                                                                    // stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, onStageVideoState);

                                                                                                                    trace("ChoosePictureButton FUNCTION connectStream");

                                                                             

                                                                                                                    //          NetConnectionExample.2.as

                                                                                                                    //          You can get metadata using a function, instead of creating a custom class. The following suggestion, provided by Bill Sanders, shows how to edit the NetConnectionExample code above to call metadata within a function. In this case, the object mdata is used to set up the width and height of a video instance video:

                                                                                                                    //          Place the following in the connectStream() functio in the NetConnectionExample code

                                                                                                                    //                    var metaSniffer:Object=new Object(); 

                                                                                                                    //                    stream.client=metaSniffer; //stream is the NetStream instance 

                                                                                                                    //                    metaSniffer.onMetaData=getMeta; 

                                                                                                                    //

                                                                                                                    // Add the following function within the NetConnectionExample class 

                                                                                                                    //                    private function getMeta (mdata:Object):void 

                                                                                                                    //                    { 

                                                                                                                    //                              video.width=mdata.width/2; 

                                                                                                                    //                              video.height=mdata.height/2; 

                                                                                                                    //                    } 

                                                                             

                                                                                                                    var netStream:NetStream = new NetStream(netConnection);

                                                                                                                    netStream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

                                                                                                                    netStream.addEventListener(AsyncErrorEvent.ASYNC_ERROR, asyncErrorHandler);

                                                                                                                    netStream.client = new CustomVideoClient();

                                                                                                                    //netStream.client = this;

                                                                             

                                                                                                                    // var video:StageVideo = stage.stageVideos[0];

                                                                                                                    video = new Video();

                                                                            //                                        video.x = localToGlobal(new Point(pictureButtonGroup.x,pictureButtonGroup.y)).x;

                                                                            //                                        video.y = localToGlobal(new Point(pictureButtonGroup.x,pictureButtonGroup.y)).y;

                                                                            //                                        video.width = width; trace("-------------------------- width: "+width);

                                                                            //                                        video.height = height; trace("-------------------------- height: "+height);

                                                                            //                                        video.scaleX = scaleX; trace("-------------------------- scaleX: "+scaleX);

                                                                            //                                        video.scaleY = scaleY; trace("-------------------------- scaleY: "+scaleY);

                                                                             

                                                                                                                    video.opaqueBackground = "0xcd0000";

                                                                                                                    video.attachNetStream(netStream);

                                                                                                                    trace("ChoosePictureButton FUNCTION connectStream() netstream.play("+videoFile.url+")");

                                                                                                                    trace("ChoosePictureButton FUNCTION connectStream() videoSize:"+videoFile.size);

                                                                            //                                        netStream.play("mp4:"+videoFile.url, 0, -1);

                                                                            //                                        netStream.play("mp4:"+videoFile.url);

                                                                                                                    netStream.play(videoFile.url);

                                                                                                                    stage.addChild(video);

                                                                             

                                                                             

                                                                                                                    //ns.play("mp4:"+destinationFile.nativePath,0,-1);

                                                                                                          }

                                                                             

                                                                                                          protected function createThumbnail():void

                                                                                                          {

                                                                                                                    trace("ChoosePictureButton FUNCTION createThumbnail");

                                                                                                                    thumbBmpData                    = ImageResizer.bilinearIterative(bmpData, borderRect.width, borderRect.height, ResizeMath.METHOD_LETTERBOX , true, 3);

                                                                                                                    libraryThumbBmpData          = ImageResizer.bilinearIterative(bmpData, 320, 240, ResizeMath.METHOD_LETTERBOX , true, 3);

                                                                             

                                                                                                                    statusMessage.text = "Saving Image to Library...";

                                                                                                                    busy = true;

                                                                             

                                                                                                                    // If it's not delayed, the iPad won't draw the thumbnail or upate the status message before pretty much FREEZING while it does File I/O for 20 minutes.

                                                                                                                    if(delaySaveTimer == null)

                                                                                                                    {

                                                                                                                              delaySaveTimer = new Timer(500,1);

                                                                                                                    }

                                                                                                                    delaySaveTimer.addEventListener(TimerEvent.TIMER_COMPLETE, saveImageToLibrary);

                                                                                                                    delaySaveTimer.start();

                                                                                                          }

                                                                             

                                                                                                          protected function saveImageToLibrary(event:Event):void

                                                                                                          {

                                                                                                                    delaySaveTimer.removeEventListener(TimerEvent.TIMER_COMPLETE,saveImag eToLibrary);

                                                                                                                    busy = true;

                                                                             

                                                                                                                    var timestamp:String = new Date().getTime().toString();

                                                                             

                                                                                                                    var destinationPath:File = File.applicationStorageDirectory.resolvePath("User" +parentApplication.userid);

                                                                             

                                                                                                                    if(destinationPath.exists && !destinationPath.isDirectory)

                                                                                                                    {

                                                                                                                              destinationPath.deleteFile();

                                                                                                                    }

                                                                                                                    destinationPath.createDirectory();

                                                                             

                                                                                                                    destinationPath = destinationPath.resolvePath("Photos");

                                                                             

                                                                                                                    if(destinationPath.exists && !destinationPath.isDirectory)

                                                                                                                    {

                                                                                                                              destinationPath.deleteFile();

                                                                                                                    }

                                                                                                                    destinationPath.createDirectory();

                                                                             

                                                                                                                    xmlFilename = parentApplication.userid+"PhotoInfo"+timestamp+".xml";

                                                                             

                                                                                                                    var imageXML:XML =

                                                                                                                              <image>

                                                                                                                                        <userid>{parentApplication.userid}</userid>

                                                                                                                                        <description></description>

                                                                                                                                        <timestamp>{timestamp}</timestamp>

                                                                                                                                        <source>{data.source}</source>

                                                                                                                                        <xmlFilename>{xmlFilename}</xmlFilename>

                                                                                                                                        <imageFilename>{parentApplication.userid+"PhotoImage"+times tamp+".byteArray"}</imageFilename>

                                                                                                                                        <thumbFilename>{parentApplication.userid+"PhotoThumb"+times tamp+".byteArray"}</thumbFilename>

                                                                                                                              </image>;

                                                                             

                                                                                                                    //trace("imageXML.XMLFilename: "+imageXML.xmlFilename);

                                                                                                                    var destinationXMLFile:File   = destinationPath.resolvePath(imageXML.xmlFilename);

                                                                             

                                                                                                                    //trace("ChoosePictureButton -- destinationXMLFile.name -- "+destinationXMLFile.name);

                                                                                                                    statusMessage.text = "Saving Image to Library: Info...";

                                                                                                                    var fileStreamXML:FileStream = new FileStream();

                                                                                                                    fileStreamXML.open(destinationXMLFile, FileMode.WRITE);

                                                                                                                    fileStreamXML.writeUTFBytes(imageXML.toXMLString());

                                                                                                                    fileStreamXML.close();

                                                                                                                    statusMessage.text = "Saving Image to Library: Information...";

                                                                             

                                                                                                                    //                                        trace("destinationXMLFile.name: "+destinationXMLFile.name);

                                                                                                                    var destinationImageFile:File = destinationPath.resolvePath(imageXML.imageFilename);

                                                                                                                    //                                        trace("ChoosePictureButton -- destinationImageFile.name -- "+destinationImageFile.name);

                                                                                                                    statusMessage.text = "Saving Image to Library: Image...";

                                                                             

                                                                                                                    fileStreamImage = new FileStream();

                                                                                                                    fileStreamImage.openAsync(destinationImageFile, FileMode.WRITE);

                                                                                                                    fileStreamImage.addEventListener(IOErrorEvent.IO_ERROR, fileStreamImageIOError);

                                                                                                                    try

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton TRY fileStreamImage.writeBytes()");

                                                                                                                              fileStreamImage.writeBytes(bmpData.getPixels(new Rectangle(0, 0, bmpData.width, bmpData.height)));

                                                                                                                    }

                                                                                                                    catch(e:IOErrorEvent)

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton CATCH IOError: "+e);

                                                                                                                    }

                                                                                                                    finally

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton FINALLY");

                                                                                                                    }

                                                                                                                    fileStreamImage.close();

                                                                             

                                                                                                                    var destinationThumbFile:File = destinationPath.resolvePath(imageXML.thumbFilename);

                                                                                                                    //                                        trace("ChoosePictureButton -- destinationThumbFile.name -- "+destinationThumbFile.name);

                                                                                                                    statusMessage.text = "Saving Image to Library: Image...";

                                                                             

                                                                                                                    fileStreamThumb = new FileStream();

                                                                                                                    fileStreamThumb.open(destinationThumbFile, FileMode.WRITE);

                                                                                                                    fileStreamThumb.addEventListener(IOErrorEvent.IO_ERROR, fileStreamImageIOError);

                                                                                                                    try

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton TRY fileStreamThumb.writeBytes()");

                                                                                                                              fileStreamThumb.writeBytes(libraryThumbBmpData.getPixels(new Rectangle(0, 0, 320, 240)));

                                                                                                                    }

                                                                                                                    catch(e:IOErrorEvent)

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton CATCH IOError: "+e);

                                                                                                                    }

                                                                                                                    finally

                                                                                                                    {

                                                                                                                              //                                                  trace("ChoosePictureButton FINALLY");

                                                                                                                    }

                                                                                                                    fileStreamThumb.close();

                                                                             

                                                                                                                    statusMessage.text = "";

                                                                                                                    busy = false;

                                                                                                          }

                                                                             

                                                                                                          public function getMediaXML():XML

                                                                                                          {

                                                                                                                    var mediaXML:XML =

                                                                                                                              <media>

                                                                                                                                        <mediaXMLFilename>{xmlFilename}</mediaXMLFilename>

                                                                                                                              </media>;

                                                                                                                    mediaXML.@type = mediaType;

                                                                                                                    return mediaXML;

                                                                                                          }

                                                                             

                                                                                                          protected function fileStreamImageIOError(event:Event):void

                                                                                                          {

                                                                                                                    // trace("ChoosePictureButton FUNCTION fileStreamImageIOError");

                                                                                                                    // fileStreamImage.close();

                                                                                                          }

                                                                             

                                                                                                          protected function clickButton(event:MouseEvent):void

                                                                                                          {

                                                                                                                    busy = false;

                                                                             

                                                                                                                    if(selection)

                                                                                                                    {

                                                                                                                              imageButtonsFadeIn.play();

                                                                                                                              startTimer();

                                                                                                                    }

                                                                                                                    else

                                                                                                                    {

                                                                                                                              busy = true;

                                                                             

                                                                             

                                                                                                                              if(choosePictureLightbox == null)

                                                                                                                              {

                                                                                                                                        choosePictureLightbox = new ChoosePictureLightbox();

                                                                                                                                        choosePictureLightbox.id = "choosePictureLightbox";

                                                                                                                              }

                                                                                                                              choosePictureLightbox.addEventListener(PopUpEvent.CLOSE,choosePi ctureLightboxClosed);

                                                                                                                              choosePictureLightbox.open(this,true);

                                                                                                                    }

                                                                                                          }

                                                                             

                                                                                                          private function startTimer():void

                                                                                                          {

                                                                                                                    if(timer == null)

                                                                                                                    {

                                                                                                                              timer = new Timer(6000,1);

                                                                                                                    }

                                                                                                                    timer.addEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);

                                                                                                                    timer.start();

                                                                                                                    imageButtonsActive = true;

                                                                                                          }

                                                                             

                                                                                                          private function timerComplete(event:TimerEvent):void

                                                                                                          {

                                                                                                                    timer.removeEventListener(TimerEvent.TIMER_COMPLETE, timerComplete);

                                                                                                                    imageButtonsFadeOut.play();

                                                                                                                    imageButtonsActive = false;

                                                                                                          }

                                                                             

                                                                                                          protected function clickImageButton(event:MouseEvent, buttonID:String):void

                                                                                                          {

                                                                                                                    busy = true;

                                                                             

                                                                                                                    switch(buttonID)

                                                                                                                    {

                                                                                                                              case "newChoice":

                                                                                                                              {

                                                                                                                                        imageButtonsFadeOut.play();

                                                                                                                                        selection = false;

                                                                                                                                        thumbBmpData = null;

                                                                                                                                        bmpData = null;

                                                                                                                                        clickButton(event);

                                                                                                                                        break;

                                                                                                                              }

                                                                                                                              case "remove":

                                                                                                                              {

                                                                                                                                        imageButtonsFadeOut.play();

                                                                                                                                        selection = false;

                                                                                                                                        thumbBmpData = null;

                                                                                                                                        bmpData = null;

                                                                                                                                        break;

                                                                                                                              }

                                                                                                                              case "playVideo":

                                                                                                                              {

                                                                                                                                        break;

                                                                                                                              }

                                                                                                                              case "fullscreen":

                                                                                                                              {

                                                                                                                                        var fullscreenImageLightbox:FullscreenImageLightbox = new FullscreenImageLightbox();

                                                                                                                                        fullscreenImageLightbox.addEventListener(PopUpEvent.CLOSE,f ullscreenImageLightboxClosed);

                                                                                                                                        fullscreenImageLightbox.open(this,true);

                                                                                                                                        fullscreenImageLightbox.setBmpData(this.bmpData);

                                                                                                                                        break;

                                                                                                                              }

                                                                                                                    }

                                                                                                          }

                                                                             

                                                                                                ]]>

                                                                                      </fx:Script>

                                                                             

                                                                                      <s:Group id="pictureButtonGroup" mask="{cpbMask}" mouseEnabled="false" mouseChildren="false" buttonMode="false">

                                                                                                <s:Rect width="100%" height="100%" radiusX="10" radiusY="10">

                                                                                                          <s:fill>

                                                                                                                    <s:SolidColor color="0xffffff"/>

                                                                                                          </s:fill>

                                                                                                </s:Rect>

                                                                                                <g:CPBBackground id="cpbBackground"  width="{width}" height="{height-6}" mouseEnabled="false" buttonMode="false"/>

                                                                             

                                                                                                <!-- the below is included in this group so they will be masked -->

                                                                                                <s:Image horizontalAlign="center" verticalAlign="middle" id="thumbnail" width="{width}" height="{height}" source="{thumbBmpData}" visible="{selection}" buttonMode="false" mouseEnabled="false"/>

                                                                                                <s:BusyIndicator rotationInterval="50" includeInLayout="{busy}" visible="{busy}" mouseEnabled="false" buttonMode="false" symbolColor="#cd0000" id="busyIndicator" scaleX="1.6" scaleY="1.6" horizontalCenter="0" verticalCenter="0"/>

                                                                                      </s:Group> <!-- end pictureButtonGroup -->

                                                                             

                                                                                      <s:Group id="cpbMask" width="{width}" height="{height}" mouseEnabled="false" buttonMode="false">

                                                                                                <s:Rect width="{width}" height="{height}" radiusX="10" radiusY="10">

                                                                                                          <s:fill>

                                                                                                                    <s:SolidColor color="0x000000" alpha="0"/>

                                                                                                          </s:fill>

                                                                                                          <s:stroke>

                                                                                                                    <s:SolidColorStroke weight="1" color="0x000066"/>

                                                                                                          </s:stroke>

                                                                                                </s:Rect>

                                                                                      </s:Group>

                                                                             

                                                                                      <s:Graphic id="border" left="0" top="0" right="0" bottom="0" click="clickButton(event)" mouseEnabled="{!imageButtonsActive}" buttonMode="{!imageButtonsActive}">

                                                                                                <s:Rect width="{width}" height="{height}" radiusX="10" radiusY="10" id="borderRect">

                                                                                                          <s:fill>

                                                                                                                    <s:SolidColor color="0x000000" alpha="0"/>

                                                                                                          </s:fill>

                                                                                                          <s:stroke>

                                                                                                                    <s:SolidColorStroke weight="1" color="0x000066"/>

                                                                                                          </s:stroke>

                                                                                                </s:Rect>

                                                                                      </s:Graphic>

                                                                             

                                                                                      <s:Label id="statusMessage" width="100%" verticalAlign="middle" verticalCenter="0" textAlign="center" color="#cd0000" text="" mouseEnabled="false" buttonMode="false"/>

                                                                             

                                                                                      <s:Group id="imageButtonsGroup" width="{imageButtonsRect.width}" height="{imageButtonsRect.height}" horizontalCenter="0" verticalCenter="0" alpha="0"

                                                                                                           includeInLayout="{imageButtonsActive}" mouseEnabled="{imageButtonsActive}" buttonMode="{imageButtonsActive}" mouseChildren="{imageButtonsActive}">

                                                                                                <s:Graphic>

                                                                                                          <s:Rect id="imageButtonsRect" width="{imageButtons.width+16}" height="{imageButtons.height+12}" radiusX="12" radiusY="12">

                                                                                                                    <s:fill>

                                                                                                                              <s:SolidColor color="0x000000" alpha=".6"/>

                                                                                                                    </s:fill>

                                                                                                                    <s:stroke>

                                                                                                                              <s:SolidColorStroke weight="1.5" color="0xf1f1f1" alpha=".8"/>

                                                                                                                    </s:stroke>

                                                                                                          </s:Rect>

                                                                                                </s:Graphic>

                                                                             

                                                                                                <s:HGroup id="imageButtons" gap="10" horizontalCenter="0" verticalCenter="0">

                                                                                                          <fxg:ChoosePictureButtonNewChoice64x64          id="newChoice"          scaleX="{buttonScale}" scaleY="{buttonScale}" click="clickImageButton(event,'newChoice')"/>

                                                                                                          <fxg:ChoosePictureButtonRemove48x64                    id="remove"                    scaleX="{buttonScale}" scaleY="{buttonScale}" click="clickImageButton(event,'remove')"/>

                                                                                                          <fxg:ChoosePictureButtonPlayVideo64x64          id="playVideo"          scaleX="{buttonScale}" scaleY="{buttonScale}" click="clickImageButton(event,'playVideo')" visible="{mediaType=='video'}" includeInLayout="{mediaType=='video'}"/>

                                                                                                          <fxg:ChoosePictureButtonFullscreen64x64          id="fullscreen"          scaleX="{buttonScale}" scaleY="{buttonScale}" click="clickImageButton(event,'fullscreen')" visible="{mediaType=='image'}" includeInLayout="{mediaType=='image'}"/>

                                                                                                </s:HGroup> <!-- end imageButtons HGroup -->

                                                                                      </s:Group> <!-- end imageButtonsGroup -->

                                                                             

                                                                            </s:Group>

                                                                            • 35. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                              Bramblethorne Community Member

                                                                              Figured it would be less of a difficulty to find the relevant bits rather than make sense of things stripped out. 

                                                                               

                                                                              ChoosePictureLightbox.mxml uses CameraUI to capture video and retain the file location (which is in temp space).

                                                                              ChoosePictureButton.mxml then uses the File class to move and rename the file.

                                                                               

                                                                              Not sure why folks use an ANE to encode to MP4.  On iPad at least, the file created -is- an mp4 already.

                                                                              • 36. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                                DaveCates Community Member

                                                                                We use an ANE for encoding because we're creating an AR app which uses animations and camera capture combined

                                                                                • 37. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                                  Bramblethorne Community Member

                                                                                  I was under the impression that the mp4 and mov containers support multiple discrete tracks with alpha layer masking and what not.  Seems like it would save you a lot of effort if that's true and you can figure out how to generate your animation track and just add it to the already encoded mp4.  (I may be speaking gibberish here *chuckle*)

                                                                                  • 38. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                                    frank_aq Community Member

                                                                                    I know it's been a little while, work has been a bit crazy.

                                                                                     

                                                                                    I just got around to finshing up support for generating multiple video thumbnails by passing in an array of requested times.

                                                                                     

                                                                                    New ANE is on the repo along with some instructions,

                                                                                    https://bitbucket.org/lostirc/videoroll

                                                                                    • 39. Re: Cannot select videos in iOS CameraRoll.browseForImage()
                                                                                      Bramblethorne Community Member

                                                                                      Hey Frank.  I've not been ignoring you (well, yes, ok, I have, but not because I'm giving up).  I've had to put this 'issue' with my software on a back burner until other pressing issues are resolved.  Still very very hopeful that your ANE will be the salvation of my poor software.

                                                                                      1 2 Previous Next