Streaming Video in Flash Builder 4.5 AIR for Android

How do you do it?  When you try to use the VideoDisplay that is built-in for AIR, the documentation pops up and says:
Adobe discourages using VideoDisplay when targeting profiles: mobileDevice.
What are you supposed to use?

can anyone confirm if this example is the best video method for mobile. needs some extra size and position script but does work without warnings!
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark" title="Video" viewActivate="init();">
<fx:Script>
    <![CDATA[
        import mx.core.UIComponent;
        import org.osmf.elements.VideoElement;
    //    import org.osmf.media.MediaPlayer;
        import org.osmf.media.MediaPlayerSprite;
        import org.osmf.media.URLResource;
        //import org.osmf.net.DynamicStreamingItem;
    //    import org.osmf.net.DynamicStreamingResource;
        private function init():void{
            trace('FLVPlayerView data url = '+data.url);
            var mediaPlayerSprite:MediaPlayerSprite = new MediaPlayerSprite();
            var videoElement:VideoElement = new VideoElement();
            var urlResource:URLResource = new URLResource(data.url);
            videoElement.resource = urlResource;
            var uiel:UIComponent = new UIComponent();
            uiel.addChild(mediaPlayerSprite);
            this.addElement(uiel);
            mediaPlayerSprite.media = videoElement;  
    ]]>
</fx:Script>
</s:View>

Similar Messages

  • Flash Professional Help | Publishing AIR for Android applications

    This question was posted in response to the following article: http://helpx.adobe.com/flash/using/publishing-air-android-applications.html

    I think that this is just saying that the display is truncated. When you publish, it still uses the full path.
    Regards,
    Randy Nielsen
    Senior Content and Community Manager
    Adobe Systems Incorporated

  • Flash builder 4.7 air 3.6 new adt compiler

    Hi. Ive been having serious issues when i tried to "Export release build" using air 3.4 and/or air 3.5 on Flash builder 4.7. Goit a lot of nonsense java.lan.nullpinter exceptions and similar errrors.
    When i tried to debug or run, even on device generating the ipa, everything ok. But when i tried to export the project, and it tried to re-compile it, always got absurd java errors.
    Ive tried everything: downgrade the java virtual machine, reinstalling flash builder, air, even windows!!! Nothing worked. Even recovering previous stages of the project where I originally could export it (its even published on the appstore!). No use. The app that was working no problem, now when trying to export returns a lot of javanull pointers or similar crap.
    BUT, when trying to generate the ipa through via command lines  on the ms dos console it works!! So... its obvious the problem was on the adl+java duo.
    Thing is, I updated to the just released AIR 3.6 (not the beta, the release version). It uses .exes(on windows, which is the system im using)  instead of java, so it showed promise.
    I overlayed the air version on the flash builder following this instructions:
    http://forums.adobe.com/message/4797974
    Well, not exaclty, because then flash builder throws a lot of errors and dosent show me the package explorer for instance.
    I made a copy of the AIR folder, but not deleted the content, just copied the new air version files over and substitute the replicas, but kept the originals where no new file substituted them (dont know if im explaining it ok, sorry for my english).
    It worked... except for the damn "Export release build" option. It keeps trying to debug it using java instead of using the new adt. And I cant find how to change that.
    The adt on the other hand is being used ok, as i can check it when I try to run or debug the project targetting a device. Before I could check the command used and now Im not, so Im pretty sure its using the new .exe instead of the java version. But now I dont know how to generate the ipa targetting the app store, for instance via command line using the new adt nor can i do it exporting the project from the flash builder IDE.
    SO...
    is there anyone having similar problems?
    How can I correctly overlay air 3.6 over Flash Builder 4.7 and force it to use the new air adt and adl?
    Anyone tried?
    Thanks in advance folks!!!

    Thanks everyone for your collaboration.
    Hey Nabren, What do you mean by "as well"?
    Just to make it clear. I already followed the instructions here:
    http://helpx.adobe.com/flash-builder/kb/overlay-air-sdk-flash-builder. html
    to overlay the air sdk. And the folder you are pointing me is the ONLY ONE the instructions tell me to replace. BUT when you say "as well" I understand something else have to be done.
    Ill explain the whole process Ive followed and the consequences:
    As I said I replaced the content on the AIRSDK placed in the fodler C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722 (or similar), for the content of the new SDK.
    The result is that flash builder throws me a lot of errors and is unable  to show even the package explorer, for instance or create a mobile project, so I went back to the original AIR folder. No problem there.
    When I was using flash builder 4.6 I overlayed the sdks in this way: made a copy of the last flex SDK (which already had the air sdk inside), and copied the content of the  latest AIR SDK over the current sdk, replacing only new files, keeping those not includded on the air sdk. That way I could keep several flex+air sdks, and could select wich sdk to use for each library/project. Now this doesnt work anymor on flahs builder 4.7.
    So I tried this:
    I made a copy of the AIR sdk under C:\Program Files\Adobe\Adobe Flash Builder 4.7 (64 Bit)\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722 and copied over the new sdk ont he folder overwritting new files,keeping those not included on the new sdk... and this works! Everythings fine. I can debug complex projects on air simulator even launch it on an iphone or ipad...
    BUT it keeps throwing me JAVA errors (null pointer exceptions and things like that) when exporting that makes no sense at all (different errrors without making any change, now no error now another one...).
    More info on the projects provoking this behaviour:
    They are mobile projects (ios mainly). They use several libraries. Some of them come from compiled swcs from flash cs6 (wich contains classes we are using as views). All libraries have been double checked. They are fine. The problems emerge when trying to export targetting the apple store. Weve double checked the provisioning and the certificate. They are correct. In fact, when we try to generate the ipa using adt via command lines on ms-dos it works!
    Weve tried to remake and the rebuild the project class by class, even recreate the flas we are using to generate the swcs to be used as libraries on the project... it only works when the project is almost empty. As soon as some content is added.. bumm! Java errrors all over when trying to export.
    Our main machine is an i7 2.93 Ghz, 8 GB ram, 64 bits. Windows 7 Ultimate 64 bits, using Flash builder 4.7 64 bits and flash cs6 64 bits. But we have checked on other mahines and sme thing happens.
    Doesnt anyone else have these problems? Is there any other way to overlay the air sdk?
    Thanks again.

  • Are Flash Professional Buttons broken in Flash Builder 4.7/AIR 3.4?

    Moved my ActionScript Mobile Project game from Flash Builder 4.6 / AIR 3.2 yesterday to the new release of 4.7 / AIR 3.4. I immediately ran into a problem with Flash Professional Button's working incorrectly. The buttons have linkages in a SWC exported from Flash Professional CS6, which the project has linked. The content of the buttons doesn't seem to matter. It seems to break in different ways visually depending on it's composition (sometimes it loads unreleated bitmap data or displays with a strange transformation). Has anyone else seen this behaviour so far?

    I don't have the time to create a unique project for adobe bug database. So many are having the same issue, I'm shocked that Adobe doesn't know about this already. This discussion that I'm writing in right now was started in december, almost 7 months ago.
    Joseph Labrecque says in his blog that adobe does know of this issue and is working on it, he said that 6 months ago. Is he incorrect?
    Joseph LabrecqueJanuary 4, 2013 at 6:21 pmGood news that Adobe is actively working on a fix for this issue.
    http://inflagrantedelicto.memoryspiral.com/2012/12/flash-builder-4-7-useflashsdk/

  • SWC PNG's invisible when compression is set to JPEG in Flash Builder 4.7/AIR 3.4

    Moved my ActionScript Mobile Project game from Flash Builder 4.6 / AIR 3.2 yesterday to the new release of 4.7 / AIR 3.4. One side effect was that when my PNG's in my assets SWC were set to use JPEG compression instead of PNG, they are invisible at runtime. I haven't found any mention of this when searching so far. I can just use PNG compression for now, but it's nice to have the choice. Anyone else run into this problem?

    I haven't seen this come up, however you might want to give our latest AIR 3.5 build a try (12/11/2012 - AIR 3.5 Runtime and SDK Update).  If it still occurs, could you please open a new bug report on this over at bugbase.adobe.com?  Please post back with the URL so that others affected can add their comments and votes.

  • Flash builder 4.7 AIR 17 compile-abc-64 fail on x32 OS

    Ls,
    Since AIR 16 I cant compile to iOs on my x32 Os (windows vista ultimate)
    On my laptop its fine, uses x64 windows 7.
    Failure because of compile-bc-64.exe not working on x32 (makes sense sure)
    So: Is there a way to not have it use the -64.exe but only the normal compile-abc.exe?
    Flash builder: 4.7
    AIR sdk: latest two 16. & 17
    OS: windows Vista ultimate x32
    Highest regards,
    Mac

    I finally found what probelem i have. Visual studio has corrupted one dll. Flahs is crashing due to my browser in 64bits which has problem. I found that it could be a probleme while installing a .net framework. But unfortunately i can't delete or uninstall this framework, i had no option to uninstall it. I guess the best way is to format my computer. But as i am waiting for a new worksatation dedicated to your tool and zbrush of course(for stage3d is a real improvment), i won't format it now it would take too much time to resintall everything and i would have to do this again when i will received my workstation
    If someone has problem like that there might be a solution(not the best but at least it works)
    To solve my problem as i have to make an app in flash builder. I downloaded the 32 bits version of flash builder 4.7. And i will resintall the 64 bits as soon as i received my workstation.

  • Flash Builder and Adobe AIR: anybody there?

    Hi,
    I've recently posted quite a few posts reporting very serious bugs of both Flash Builder 4.6 and Adobe AIR especially on mobile platforms, and asking about possible fixes and workarounds.
    I would have expected immediate replies by someone at Adobe showing some interest in such blocker bugs that render Flash Builder completely useless, and developing AIR apps for mobile impossible. But there was no reply at all.
    I wonder, are Flash Builder and Adobe AIR being maintained, or have they been abandoned? Because in the latter case I'd rather know it and stop wasting my time using this platform for development.
    thanks
    m.

    I feel your preoccupations, Matteo. I have them too.
    A few days ago, Gartner issued a document, called - as usual for Gartner - "magic quadrant", related to Mobile App Develpment 2012.
    This document explains the situation of the different vendors so one can make an educated choice about the IDE to use for platform-independent mobile things.
    Adobe is well-positioned in this quadrant. However, Gartner (who have talks with vendors before issueing their reports) only referred to PhoneGap when explaining how Adobe addresses mobile app development.
    This is a shame, because FB is powerful and uses ActionScript (which many of us like).
    I have bought FB last year and had fun with it. I don't think it's going to last for long, if I Adobe doesn't show that HTML5 + CSS aren't the only way to go.

  • Flash Builder 4 (not beta) for Air 2

    Hi,
    having worked with the Flash Builder 4 Beta 2 for a while on a project that targets the Air 2 platform, I tried to import my Flex project into the new Flash Builder 4.
    Unfortunately things seem to be handled differently compared to the beta release: Overlaying the Adobe AIR SDK for use with the Flex SDK (http://labs.adobe.com/wiki/index.php/AIR_2:Release_Notes#How_to_overlay_the_Adobe_AIR_SDK_ for_use_with_the_Flex_SDK) does not seem to work, or am I missing something?
    For example, I get error messages like 'Could not resolve <mx:Canvas> to a component implementation.'. OK, I tried what FB would do when I create a new Flex project, and found that the namespace for mx components had changed from xmlns:mx="library://ns.adobe.com/flex/halo" to xmlns:mx="library://ns.adobe.com/flex/mx". But applying this change to my project didn't get me much further....
    Is there a readme for people like me who just want to move from the FB 4 Beta 2 to the new FB 4 with their Air 2 projects??
    Thanks to all of you in advance
    Roland

    1) Make sure you project is pointing to the right SDK after you imported
    2) Make sure that SDK name is in your preferences Flash Builder > Installed Flex SDKs and it points to the right location
    Sounds like you're overlaying AIR 2 over SDK 4.0.0 correct? There was an issue in Beta 2 about this http://blogs.adobe.com/jasonsj/2010/02/workaround_for_using_the_latest_nightly_sdk_40_buil ds_with_flash_builder_beta_2.html. In the final relase of Flash Builder 4, you no longer need to apply this fix.
    If that's not the issue, an easy way to debug is to look at the "Referenced Libraries" in Package Explorer and verify (1) the right SWCs are there and (2) you can expand the SWCs and see all the classes that should be there.
    Jason San Jose
    Software Engineer, Flash Builder

  • Stage Video Using Flash Builder 4.51

    Hi,
    I am using Flash Builder 4.51, and I cannot get StageVideo to run. My machine is capable of playing StageVideo as I tested the Big Buck Bunny example and saw the change when flicking between StageVideo and normal Video.
    Flash Builder shows that the build that I have is 4.5.1.313231. All the tutorial examples I have seen are built using Flex Hero build 18623 which I believe is earlier. So my question is was StageVideo removed somehow when Flash Builder 4.5 and 4.51 were released?
    If it should work on 4.5.1, can anybody give me some tips on what to check or provide some minimal code and instructions to get the expression stage.stageVideos.length to be something different to 0?
    I have changed made sure the wrapper uses wmode="direct", I am using version 11 of the Flash Player, I have a parameter on the compiler for " -swf-version=11".
    When I export the swf from Flash Builder to my web page I still can't get StageVideo to work either locally or on the server.
    I've run out of ideas with this one.
    Any ideas?

    Hi Claudiu
    I'm glad its working for you, that's encouraging.
    I'm just trying to confirm that we are using the same setup. When you say you have installed the eclipse plugin, does that mean you install Flash Builder or are you using the Flex SDK through eclipse? I agree that FP11.2 is not the issue since StageVideo works if I run the Big Buck Bunny example.
    Also, just to confirm we are talking about the same thing, if you create a new project in Flash Builder and put in the following two methods, are you able to get the "str" variable in the second method to show "Available". If so, what additional steps do you take after create project?
    protected function application1_creationCompleteHandler(event:FlexEvent):void
         this.systemManager.stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILAB ILITY, onStageVideoState);
    private function onStageVideoState(event:StageVideoAvailabilityEvent):void
         var str:String = event.availability;

  • AIR for Android video issue

    On Android, in an app that I’ve developed successfully for iOS, I’m seeing this problem:
    There are 5 videos built-into the app. On Samsung phones (S3 and S4), running Android 4.4.2, at the first attempt to play a video there’s sound but no picture. After returning to the video menu and attempting again, video and sound play normally. If a video is stopped and another one is started, initially a frame of the previous video is displayed (for a fraction of a second), then play resumes normally with the chosen video.
    The sound-but-no-video problem does NOT show up on a Nexus 7 running 4.4.3, although the flash-frame problem does.
    I’m publishing with AIR SDK 15 packaging both with and without captive runtime to try to isolate the source of the problem. I’m using <contains video> true </contains video> in the descriptor.
    This feels like AIR-for-Android buggishness. Any confirmation out there? Similar problems? Workarounds?
    I’ve read somewhere that AIR runtime  v.3.3 may solve some video problems on Android, but not sure where to find an archived Android version of AIR that old.

    Well, as it sometimes happens with me, I have spoken too soon. The answer that I marked as ‘correct’ the other day (Colin, are you there?), seems to be not quite the right answer. At least, it doesn’t solve the video problem that I’m having with some, but not all, Android devices.
    After trying Colin’s suggestion – using  if (stage.stageVideos.length != 0) to make sure that a stageVideoAvailabilityEvent hasn’t already fired when I try to play my first StageVideo instance – and getting perfect results in 10 consecutive tries on my Samsung S4 and S3 phones, I figured that was IT.
    Next day, same devices and same code, it DIDN’T work! I pulled hair, issued profanities, hammered on the table. It didn’t matter—I still got a ‘mis-fire’ on the first play of a video whenever (almost whenever) I opened the app. After the first play everything was good – which is the exact problem that I started with many days ago. When I played Colin’s Sesame Street ‘Let’s Get Ready’ app again – the same first-play-of-video problem shows up there too.
    This problem does not show up on Nexus 7  and the Samsung Galaxy 5 Tab. It is a royal p.i.t.a. on Samsung phones, where I need my app to work.
    I created a bare-bones app to reproduce the problem, code below. Just a single class to play a single video with no controls. A few parameters (path to the video, and viewport stuff) are passed in from the document Class. I run it 10 times on my S4. It fails 7 times and plays well 3 times. The 'initialize2()' function never fires, proving that the stageVideos array already exists by the the time the 'initialize1()' function is called.
    I'm pretty sure that this is not a coding problem (because it works well on some Androids and in iOS), but WHAT is it??
    package vidTestSource
      import flash.desktop.NativeApplication;
      import flash.desktop.SystemIdleMode;
      import flash.display.MovieClip;
      import flash.display.Sprite;
      import flash.display.StageAlign;
      import flash.display.StageScaleMode;
      import flash.events.Event;
      import flash.events.NetStatusEvent;
      import flash.events.StageVideoAvailabilityEvent;
      import flash.geom.Rectangle;
      import flash.media.StageVideo;
      import flash.media.Video;
      import flash.media.StageVideoAvailability;
      import flash.net.NetConnection;
      import flash.net.NetStream;
      public class MobileVideosolo extends MovieClip
          public var stream:NetStream ;
          public var video:StageVideo;
          var xx:Number;
          var yy:Number;
          var ww:Number;
          var hh:Number;
          var mymoov:String;
      public function MobileVideosolo(mymoov,xx,yy,ww,hh)
          this.xx = xx;
          this.yy = yy;
          this.ww = ww;
          this.hh = hh;
          this.mymoov = mymoov;
         addEventListener(Event.ADDED_TO_STAGE, onstage);
    function onstage(e)
        if (stage.stageVideos.length != 0)
           initialize1();
         else
          stage.addEventListener(StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, stageVideoState );
    function stageVideoState(e)
           initialize2();
           stage.removeEventListener (StageVideoAvailabilityEvent.STAGE_VIDEO_AVAILABILITY, stageVideoState);
    function initialize1()
          var nc:NetConnection = new NetConnection() ;
          nc.connect(null) ;
          stream = new NetStream(nc) ;
          stream.client = this ;
          video = stage.stageVideos[0] ;
          video.viewPort = new Rectangle(xx,yy,ww,hh) ;
          video.attachNetStream(stream) ;
          stream.play (mymoov) ;
          MovieClip(parent).sVtext.text = "Init 1";
          stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
    function initialize2()
        var nc:NetConnection = new NetConnection() ;
         nc.connect(null) ;
         stream = new NetStream(nc) ;
         stream.client = this ;
         video = stage.stageVideos[0] ;
         video.viewPort = new Rectangle(xx,yy,ww,hh) ;
         video.attachNetStream(stream) ;
         stream.play (mymoov) ;
         MovieClip(parent).sVtext.text = "Init 2";
         stream.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

  • Flash cs5.5 FLVplayback Encoding Problems with Air for Android

    Dear All,
    I'm trying to play flv in my air application by using FLV playback in flash cs5.5.
    I can play flv in the pc but not on the samsung galaxy tab andriod platform.
    if anyone out there has tried out FLV playback with either an Air For Android application, where the FLV files are packaged within the app, or either streaming via normal http//:, any help  would be greatly appreciated.
    Thanks!

    First disable autoplay. It gave errors for me. Try to make the movie play with the play() command.
    to embed the movie in your air bundle, just go to publish settings for your flash project. Then in that screen go to the player settings.
    In the first GENERAL tab you'll see a the bottom that you can add files to your project
    Propably there is allready your .swf and an .xml file in there.
    Using the + icon you can add your video.
    Make sure that your video is in the same directory as your . FLA file and you can use it as is (by name)
    If for example your flashfile is in c:\mytest\mytest.fla and the video in c:\mytest\videos\myvideo.flv , then you will have to load your video as "videos/myvideo.flv" with a FORWARD slash, never use \
    Good luck

  • How can I use a file in flash cs6 that I made in flash cs5.5 air for android

    I have made an app in in air for android in flash cs5.5 air for android, and I want to edit it in cs6 and play it in cs6.
    But if I put Ctrl+Enter I got an error: createWin process failed with error 2: system couldn't find the file. I think the problem is that I'am using air for android 2.6 version in flash cs5.5 and version 3.2 in flash cs6. I have searched the web and found out that you can add older air versions using the sdk manager and I have tried it but first I get the error that the version of the sdk I am trying to install is not valid and after some files that I added to the sdk folder I get this error:Only SDK higher than version 3.4.2540 may be added.
    I there a possible way to update the air for android for an fla or apk? Or how can I let my originally file work fine in flash cs6??

    system couldn't find the file
    If you can´t get a more specific hint why your project can´t compile then I can think of some reasons theis error might occur
    1.You had files included besides the swf, like videos, audio files, xml files, that are not present in the place air expects them to be
    2.somewhere in your createWin functions there is a class import needed that isn`t present in 3.2 anymore, for example some classes or functions from classes that were valid in 2.6 are not any more in 3.2
    3. to achieve better eror logging, allow for debugging in the publishing options and see what specific lines in your code throw the error
    4.any air app needs a cert file, this needs to be created once, if you migrated to e new system it might be you never created that file which air expects to even begin the compiling process
    once you isolate the problem, report back

  • Adobe Flash Builder 4 licence is for one desktop and one laptop, only one at a time run or

    After installing Adobe Flash Builder 4 needed install AIR? Adobe Flex 4 SDK IS ALREADY INCLUDED?
    Adobe Flash Builder 4 licence is for one desktop and one laptop, only one at a time run or...?

    hi,
    Flashbuilder has the ability to create and run Air content from the IDE, to actually usean Air App outside of the IDE you need to install Air.
    Flashbuilder install includes 2 sdks, the 3.5 sdk for 'backward' compatibility with Flexbuilder and for targeting flashplayer 9, the 4.x SDK for Flashbuilder and  targetting flashplayer 10.0 and above.
    As far as fair use is concerned Adobe have had fair use software licensing for a while, single user 2 devices is not a problem, what is not clear is if you can use the software on both devices at the same time.
    David

  • AIR for Android - best video specs?

    Hello everyone,
    I'm trying to develop a custom video player app using the AIR for Android extension in Flash Pro CS5.
    I tried out an FLV and an MP4 video with the most stripped back code snippet, but the video still seemed a bit jerky on my phone. (Samsung Galaxy S)
    // Code
    var video:Video;
    var connect_nc:NetConnection = new NetConnection();
    connect_nc.connect(null);
    var stream_ns:NetStream = new NetStream(connect_nc);
    stream_ns.client = this;
    video = new Video();
    addChild(video);
    video.attachNetStream(stream_ns);
    stream_ns.play("video.flv");
    Would anyone know what the ideal encoding specs are for non-jerky video? Is it something to do with H.264, or perhaps CPU vs GPU? (I tried that too, with no visible difference.) Even with the app running at the appropriate frames per second (in this case, 24fps), the video seemed less than smooth.
    Any comments would be much appreciated!

    Hi [email protected]
    These should help you:
    http://www.adobe.com/devnet/devices/articles/encoding-guidelines-android.html
    http://www.adobe.com/devnet/devices/articles/video-player-optimization.html
    regards Mike

  • Google Maps for Flash in AIR for Android: ~2 minutes to start up

    I have a "Hello World" style AIR for Android app using Flash Builder 4 Burrito/Flex Hero.
    When debugging on device (stock HTC Desire) using Flex version v1.20 of Google Maps for Flash (map_flex_1_20.swc), it takes 1 minute and 50 seconds for the app to startup to display a simple map:Map3D on the home screen. The same app without the map:Map3D object starts in just a few seconds.
    There are no startup delays using the simulator.
    Anyone know what might be causing the severe startup delay when running on device?
    Thanks,
    Stephen

    Hi - yes no problem: I've uploaded a sample app here: http://crackedfrog.com/files/AndroidAIRMap.zip.
    You'll need to add a valid Google Maps API key and corresponding URL back into the maps:Map3D object:
    <maps:Map3D left="0" right="0" top="0" bottom="0"
      xmlns:maps="com.google.maps.*" id="map"
      url=""
      key=""
      sensor="false"/>
    This shows the same behaviour as described above - around 2 minutes to start up when debugging on the device.
    Appreciate any help.
    Thanks,
    Stephen

Maybe you are looking for