Skip navigation
Currently Being Moderated

Strobe Media Playback with AIR ?

Aug 17, 2010 8:08 AM

Does anybody know how to  use the Strobe Media Playback Player in an AIR application?

I need to skip all the configuration that comes from flashvars,I tried to modify the source code but it's a headache.

 
Replies
  • Currently Being Moderated
    Aug 17, 2010 9:01 AM   in reply to drumaddict71

    Hi,

     

    Here is a snippet which would load the player in an AIR app:

     

     

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

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

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

       xmlns:mx="library://ns.adobe.com/flex/mx"

       creationComplete ="init(event)">

    <fx:Script>

    <![CDATA[

    import mx.core.UIComponent;

    protected function init(event:Event):void

    {

    var playerInstance:StrobeMediaPlayback = new StrobeMediaPlayback();

    var parameters:Object =

    {

    src:"http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApo stol_640_500_short.flv"

    };

    playerInstance.initialize(parameters, systemManager.stage);

    var ui:UIComponent = new UIComponent();

    ui.addChild(playerInstance as DisplayObject);

    addElement(ui);

    }

    ]]>

    </fx:Script>

    <fx:Declarations>

    <!-- Place non-visual elements (e.g., services, value objects) here -->

    </fx:Declarations>

    </s:WindowedApplication>

     

     

    Unfortunately the control bar will not display since it tries to access the stage property directly. We didn't test AIR integration at all, since this was out of scope for our 1.0 version.

     

    You can try and fix this in the source code. A patch for this would be more then welcome!

     

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 17, 2010 9:33 AM   in reply to Andrian Cucu

    Actually, the control bar is displayed, but it is drawn under the status bar.

     

    Use these settings to see the control bar.

    var parameters:Object =

    {

    src:"http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApo stol_640_500_short.flv"

    , controlBarMode:"floating"

    , controlBarAutoHide:"false"

    };

     

     

    Do you know if there is a way to remove the status bar of the air app?

     

    I hope that the snipets above are enough to get you started.

     

    Cheers,

    Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 18, 2010 6:26 AM   in reply to drumaddict71

    Hi,

     

    You need to turn the CONFIG::LOGGING compile option to false for both your AIR app and the OSMF lib, and you'll get rid of the compile error.

     

    -define CONFIG::LOGGING false -define CONFIG::FLASH_10_1 true

     

     

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 18, 2010 6:56 AM   in reply to drumaddict71

    Yes, the snippet above works for me even though there is small layout issue (which I think that you can fix easily in under one hour once you get it compile and run).

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 19, 2010 11:11 PM   in reply to drumaddict71

    Hi drumaddict71,

     

    Did you manage to get StrobeMediaPlayer player run in an AIR application?

     

    If you still encounter issues with it, please report them here: http://bugs.adobe.com/jira/browse/ST

     

    We'll try to address them as soon as possible. You can also request a sample air application, as an improvement request.

     

    Thank You,

    -Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2010 4:35 AM   in reply to drumaddict71

    Hi,

     

    I published a sample AIR application:

     

    http://smpfmp.appspot.com/SMPAir.air

     

    Here is the zip with the source code of the project: http://smpfmp.appspot.com/SMPAir.zip

     

    Here is the mxml file: http://smpfmp.appspot.com/SMPAir.mxml

     

    The sample loads dynamically the StrobeMediaPlayback.swf.

     

    I commented out the sample code that uses a statically linked StrobeMediaPlayback (the snippet that I used in the posts above). You can use it if you manage to get all the compile options/settings right.

     

    As I wrote previously, the player will use the whole stage size for it's display. Please, log this bug, as well as any other issues and improvement requests.

     

    Let me know if the sample unblocks you.

     

    -Andrian

     

    P. S. If you have ExternalInterface calls it's very likely that you have -define CONFIG::LOGGING true, instead of -define CONFIG::LOGGING false in your compiler options.

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 20, 2010 6:39 AM   in reply to drumaddict71

    Hi drumaddict71,

     

    Here are the steps to make the player use the staticaly linked StrobeMediaPlayer:

     

    1. Reference the OSMF library

    2. Add the source code of the StrobeMediaPlayback to your source path

    3. Add the assets.swc (from StrobeMediaPlayback/assets/) to the compile path

    4. Set the compile settings to -define CONFIG::LOGGING false -define CONFIG::FLASH_10_1 true for both OSMF and your AIR project.

     

    The embed should not be there. I simply did an experiment and forgot to remove that instruction.

     

    hth,

    Andrian

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 10, 2011 5:35 PM   in reply to Andrian Cucu

    Hi Andrian,

    I tried it your way and it just won't work. The StrobeMediaPlayer class cannot be found by Flash Builder. I keep getting the error "1046: Type was not found or was not a compile-time constant" Could you explicit the #2 step (thought it was explicit enough but apparently it is not)..? Thanks a lot

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 11, 2011 3:55 AM   in reply to Andrian Cucu

    Hi Andrian,

    Working on an app for iOS with Flex 4.5.1 and utilizing some of you SMPAir code, i am able to play FLV on an iPad but not any mp4 video (using the OSMF sample videos). Any reasons you know of?

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2011 5:57 AM   in reply to drumaddict71

    Bump!

     

    The comments in the SMP code around fullscreen and StageVideo state that things are not yet finalised --

    and I forgot to ask about AIR/iOS support for SMP during the most recent webinar.

     

    As of Flex 4.5.1 VideoDisplay and VideoPlayer are still marked as "not mobile optimised" -- although dropping in the latest osmf.swc (and removing the SDK's osmf.swc) does let you play H.264 progressive video in the iPad emulator at least.

     

    Can anyone clarify the best approach for a "full-featured" video player for H.264 in a Flex 4.5.1/4.6 app targeting AIR/iOS?

     

    Thank in advance!

    S

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2011 3:51 PM   in reply to Andrian Cucu

    Hi Andrian, tried to use your source and got the dynamic version to play, which worked fine exept that the stage video is not working (The VideoInfoOverlay tells me so). Whats the benefit of using the static version anyways?

    i'm using a sdk mix from 4.5.1 and air 3.0 as seen from http://blogs.cynergysystems.com/2011/09/20/creating-a-custom-flex-4-5- sdk-to-target-flash-11-and-air-3/ and the latest osmf 1.6 version.. 

     

     

    i am using an rtmfp stream, which works fine and as it should when i test it in the setup.html, where it shows that hardware video rendering is active and stagevideo is available

     

    also set the

    OSMFSettings.enableStageVideo = true;

     

    and tried it for the player with

    playerInstance.configuration.enableStageVideo = true;

     

    which didn't seem to work.

    what am i missing? help would be very appreciated

     

    my flash player version is 11.0.1

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 3, 2011 8:53 AM   in reply to smarcus99

    Trying to keep this thread alive..

     

    Here's a link to a blog post that says that setting the swf-version and renderMode is required to achieve H.264 playback via AIR3 on iOS:

    http://www.randytroppmann.com/2011/10/07/air-3-enables-hardware-decodi ng-of-h-264-video-in-ios-apps/

     

    I've tried this using AIR3 on iOS5 using osmf-1.6.1 and Flex 4.5.1's spark:VideoDisplay.

    It works in the emulator but it doesn't work on the device.

    I will report back after testing with a custom build of osmf-trunk and using SMP instead of VideoDisplay.

     

    Would be great to get a definitive statement from Adobe about all this...

     

    TIA

    S

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2011 6:44 AM   in reply to smarcus99

    Hi smarcus,

     

    i am very interested in wether/how you got an AIR3 Project with OSMF to work in the emulator, with hardware video rendering active.. as i fail to even achieve that.. could you by any chance post an example code and describe your project setup? I'd really appreciate the effort!

     

    regards

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2011 7:13 AM   in reply to obirocks

    Here's what I did:

     

    + overlay AIR 3 SDK on Flex SDK 4.5.1 to create a custom SDK

    + update the custom SDK with playerglobal.swc for Flash Player 11

    + create a new mobile application using custom SDK

    + remove osmf.swc from the default libraries in the Flash Builder project

    + set -swf-version=13 in compiler options

    + add a src folder to the project: osmf-trunk/framework/OSMF

    + set the additional compiler options for OSMF

    + set renderMode in the app descriptor to gpu (or direct?)

     

    At this stage, building a really simple AIR app using the spark VideoDisplay class _should_ work.

    I used the AIR sample code linked to above as a starting point and got something that worked in the emulator -- and was excited!

     

    Unfortunately, on the device (iPad2/iOS5), an H.264 clip either crashes the app or just doesn't play.

    A VP6 clip plays audio without video.

     

    I also tried using the SMP player from osmf-trunk/player/.

    Things look good in the emulator -- but either crash or no playback on device.

     

    I don't know whether the issue is that Flex isn't getting along with MediaSurface support in osmf, or that AIR3 on iOS just doesn't work for video yet. Or perhaps both?

     

    I'm now working on other parts of the app while waiting for Flex SDK 4.6 and AIR 3.1.

    Or perhaps someone here can shed some light...

     

    Good luck!

    Steven

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 8, 2011 7:18 AM   in reply to obirocks

    I re-read your question and realised that I didn't answer it! Sorry!

     

    No I never got StageVideo to enable with a standard/non-mobile AIR app either.

    I tried pretty much the setup described in the previous post.

     

    S

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 11, 2011 3:58 AM   in reply to smarcus99

    AIR 3.1 was just released so here's an update!

     

    The SMP info overlay now reports that both hardware decode and stage video are active when running on the iPad!
    Unfortunately video is still not actually visible in a Flex application -- but the audio does play and the app doesn't crash anymore.

    I suspect that a non-Flex app might actually work. Hopefully this will be sorted out in Flex 4.6?

     

    Curiously, SMP on (mac) desktop AIR has regressed.

    In AIR3, hardware decode was enabled but stage video was disabled.

    Now in AIR3.1, neither hardware decode not stage video show as enabled.

    But video and audio do play.

     

    Can anyone shed more light on this?

    S

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 10, 2013 4:54 PM   in reply to smarcus99

    I am using Flex4.9. My Air app (SMP) loads on android. I need help as follows:

     

    1. Screen Size - Even if I click full size video does not change size

    2. Even though i specifically set

     

     

    <uses-permission android:name="android.permission.DISABLE_KEYGUARD"/>

    <uses-permission android:name="android.permission.WAKE_LOCK"/>

     

    Keygurd shuts down video. How do I disable keyguard ?

     

    Thanks,

    V

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points