18 Replies Latest reply: Nov 14, 2010 12:16 AM by MarioVieira.net RSS

    OSMF with Flex examples

    ttehify

      Hi there,

       

      I'm looking for a Flex flash video player that can be skinned using CSS and was hoping OSMF might be the answer. Somehow, I can't seem to find any examples of it? They all seem to be Flash related.

       

      Thanks

        • 1. Re: OSMF with Flex examples
          ScreenName1710b

          I haven't seen that OSMF has any CSS parsing/skinning capabilities built in, but it does have an example of a FlexUI component:

          MediacontainerUIComponent under apps\samples\framework - you can use that as a base Container for OSMF and build a larger Flex component on top of it.

           

          I think you'd have to construct your own system for reading in CSS, while you can use the Chrome skinning interface (example is the OSMFPlayer under apps\samples\framework) - that only seems to allow for a fixed external fonts. You might be able to pull in an assign different fonts to different assets, but I haven't experimented with that.

           

          -Will

          • 2. Re: OSMF with Flex examples
            ttehify Community Member

            Hi there,

             

            Thanks for your reply! Ouch.. well that's not really gonna work for me. I was hoping that I can use a CSS file to be shared for my Flash players and HTML 5 players. Anyway, I'm having compilation issues when building a simple media player using OSMF and Flex 4.

             

            1. The OSMF.swc bundled with Flex 4 just wasn't able to recognize the MediaPlayerSprite type

            2. I copied the OSMF.swc from the source code and it wouldn't compile my mxml file because the of some signed-digest thing that wasn't found in the catalog. It requested me to compile the file again but I have no idea what to do. I tried compc but am completely lost at what options to use. Please help?

            • 3. Re: OSMF with Flex examples
              ScreenName1710b Community Member

              There is a new OSMF.swc available from Adobe on the OSMF downloads page, do not use the OSMF.swc that is packaged with Flash Builder 4 as it is not the most recent.

               

              I have had the most success in compiling from the raw AS3 source files found in the SVN trunk of the OSMF project, as there are also updated changes in those files as well. However, if you have need for the SWC, then re-compiling it yourself is an option.

               

              Also, make sure that you have added your additional compiler settings for OSMF:

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

               

              FLASH_10_1 set to true is required for HTTP streaming - but all of these settings are required to be present in the compiler build statement.

              -Will

              • 4. Re: OSMF with Flex examples
                ttehify Community Member

                How would I be able to compile from the raw AS 3 source files and integrate it? Specifically, what would a sample command of compiling look like? I'm fairly new to Flex and have only ever compiled mxml files.

                 

                I get an error mentioning that MediaContainer type was not found - would that relate to my library?

                 

                I followed this code but was not able to compile:

                http://www.brooksandrus.com/blog/2010/02/10/osmf-flex-example/

                • 5. Re: OSMF with Flex examples
                  rshin Community Member

                  That example appears to be based on the old version of OSMF. Since then there were API changes that won't complie with OSMF1.0.

                  Have you imported MediaContainerUIComponent and it says no type MediaContainer found?  What version of OSMF.swc or library are you using?

                  Are you using Flex builder (Flash builder)?

                   

                  Ryan

                  • 6. Re: OSMF with Flex examples
                    ScreenName1710b Community Member

                    To get to the compiler in for the "define settings"

                    Click on the Project top folder> Right Click > Properties > Flex Compiler

                    Add the above info to "Additional compiler arguements:" space.

                     

                    Download the OSMF Trunk via SVN to a directory.

                    In the project properties select "Flex Build Path" and under Source Path add that folder.

                     

                    Remove in the Library under flex 4.1 (or whatever SDK) the OSMF.swc (as that will cause a conflict).

                    Make sure you have downloaded the most recent "playerglobal.swc" from AdobeLabs, then you'll want to "Add SWC" and link that swc to you project.

                     

                    Maybe not the best example link because some of the tags aren't closed and seem to be misplaced, could be used with some corrections, but I don't have the time to make them for you.  Highly recommend the the media component above for flex, but it still will require you to add some code to get it to work.


                    -Will

                    • 7. Re: OSMF with Flex examples
                      ttehify Community Member

                      I'm using the command line compiler. I downloaded the swc off of the downloads page linked from the OSMF website. Here's what I do and here's what I get back:

                      I tried to compile it with:

                      mxmlc osmf.mxml

                      and I get back:

                      Error: No signed digest found in catalog.xml of the library, /opt/flex/frameworks/libs/osmf.swc. Compile the library with -create-digest=true and try again

                       

                      Code is shown below

                      <?xml version="1.0"?>

                      <!-- mxml\HellowWorld.mxml -->

                      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="init()">

                          <mx:Script>

                              import flash.display.Sprite;

                              import org.osmf.media.MediaPlayerSprite;

                              import org.osmf.media.URLResource;

                       

                              public function init():void {

                                  var sprite:MediaPlayerSprite = new MediaPlayerSprite();

                                  videoContainer.addChild(sprite);

                       

                                  sprite.resource = new URLResource("http://mediapm.edgesuite.net/strobe/content/test/AFaerysTale_sylviaApostol_640_500_short.f lv");

                              }

                       

                          </mx:Script>

                          <mx:Panel id="panel" title="My Application"

                              paddingTop="10"

                              paddingBottom="10"

                              paddingLeft="10"

                              paddingRight="10"

                          >

                              <mx:UIComponent id="videoContainer"/>

                          </mx:Panel>

                      </mx:Application>

                       

                      • 8. Re: OSMF with Flex examples
                        ttehify Community Member

                        Would there be any chance of doing this through command line?

                         

                        I'm hoping everything will all build and compile on Solaris as well.

                        • 9. Re: OSMF with Flex examples
                          ScreenName1710b Community Member

                          Unfortunately, using the command line compiler isn't a forte of mine, and I'd have to defer to someone else with more experience with it.

                          Basic overview of what I think you'll need to do - add in the "source path" of the osmf source files (-source-path ?), add in the definition statements, (-define CONFIG::DEBUG false etc.).

                           

                          Since there's a bunch of different settings that you'll have to set, then looking up how to build a configuration xml file would probably be best for expediency - that information can be found online with the mxmlc compiler docs.

                           

                          -Will

                          • 10. Re: OSMF with Flex examples
                            rshin Community Member

                            Here's some feeback from Flex folk

                             

                            What build of Flex are you compiling with? Where did you get osmf.swc?

                             

                            The quick solution to your problem is to turn off RSLs by compiling with the  "-static-rsls=true" option.

                             

                            They think that this sounds like rsl so can you try this?

                             

                            Ryan

                            • 11. Re: OSMF with Flex examples
                              Andrian Cucu Adobe Employee

                              You can also try to use an ant task for compiling your project. It might be easier then using the command line directly.

                               

                              Here is a sample build.xml that might get you started:

                              http://sourceforge.net/adobe/smp/svn/LATEST/tree/trunk/

                               

                              It sets the necessary compile options, and builds both the OSMF library and a player that uses it. You can target either 10.0 or 10.1 by changing the properties files.

                               

                              Hope this helps,

                              Andrian

                              • 12. Re: OSMF with Flex examples
                                ttehify Community Member

                                Thanks Ryan.

                                 

                                I got the osmf.swc from http://opensource.adobe.com/wiki/display/osmf/Downloads

                                I used both the source.zip and the the standalone one.

                                 

                                I'd like to try compiling it but I don't know how to. I mean I have tried looking at compc but it looks like I also have to specify every single class I want to compile? Given the amount of classes in the osmf framework, I reckon it would probably take a while for me to find all the ".as" files and specify them. Furthermore, I am unfamiliar with all the other options required so it'd be nice if you can show me how you guys compiled the existing osmf.swc?

                                 

                                Thanks!

                                • 13. Re: OSMF with Flex examples
                                  ttehify Community Member

                                  Thanks! This sounds perfect.. I'll try it out!

                                  • 14. Re: OSMF with Flex examples
                                    ttehify Community Member

                                    Hi Ryan,

                                     

                                    I managed to compile it indeed with that solution. Does this mean that all the related libraries are within the swf?

                                     

                                    The swf file is unfortunately quite large.

                                    • 15. Re: OSMF with Flex examples
                                      daslicht Community Member

                                      Hello,

                                      I am looking for a Flex Player example which can play .f4m files and listen for Cue points.

                                       

                                       

                                      My first try, but I get :

                                       

                                      Error: The specified capability is not currently supported

                                       

                                       

                                       

                                       

                                      <fx:Script>
                                                <![CDATA[
                                                     import mx.events.FlexEvent;
                                                     
                                                     import org.osmf.containers.HTMLMediaContainer;
                                                     import org.osmf.elements.HTMLElement;
                                                     import org.osmf.elements.VideoElement;
                                                     import org.osmf.media.MediaElement;
                                                     import org.osmf.media.MediaPlayer;
                                                     import org.osmf.media.URLResource;
                                                     import org.osmf.metadata.TimelineMetadata;
                                                     
                                                     [Bindable] private var player:MediaPlayer = new MediaPlayer();
                                                     
                                                     [Bindable] private var stream:String = "http://188.194.84.42/vod/September_Drive_by_Lightrocker_1/September_Drive_by_Lightrocker_1.f4m";
                                                     
                                                     //private var embeddedTimelineMetadata:TimelineMetadata;
                                                     
                                                     
                                                     private var media:MediaElement = new VideoElement(new URLResource(stream));
                                                     
                                                     protected function application1_creationCompleteHandler(event:FlexEvent):void
                                                     {
                                                          media = new  VideoElement( new URLResource(stream));
                                                          player.media =  media
                                                          player.play();
                                                     }
                                      
                                                ]]>
                                           </fx:Script>
                                      

                                       

                                      Cheers

                                      Marc

                                      • 16. Re: OSMF with Flex examples
                                        MarioVieira.net Community Member

                                        Hiya,

                                         

                                        I got OSMF 1.5 up for Flex 3 and 4. It's the actual playback and controls, you would be free to add your buttons as you want.

                                        http://blog.mariovieira.net/?p=176

                                         

                                        Hope it helps!

                                        M

                                        • 17. Re: OSMF with Flex examples
                                          daslicht Community Member

                                          What about *.f4m File Playback ?

                                          • 18. Re: OSMF with Flex examples
                                            MarioVieira.net Community Member

                                            just addded this player type

                                            select "flashMediaManifestF4M" for playerType in the OSMFPlayer

                                            http://blog.mariovieira.net/?p=176