5 Replies Latest reply on Jun 24, 2011 11:43 PM by Alex_Birchler

    First plugin

    Alex_Birchler Level 1

      Hi

      I am trying to create my first

      plugin have the main project that play a video that I have

      in

      local following the OSMF plugin dev guide tutorial, I want to call a simple plugin, just to know

      if I can load

      it plugin has a variable and I want to call it from the main project, but I cant load that

      plugin Gives me and error.

      the plugin

      is at the same position of the video that I am loading, so I think must load

      it now, following that tutorial, I am trying to load a plugin compiled like

      swf anybody help me?

      I copy here the code of the main project.I repeat,

      is working good, and play the video, if I am not loading the

      plugin

        • 1. Re: First plugin
          Alex_Birchler Level 1

          still no answer?
          I am a noob and sorry for that, but I want to learn
          I explain what I can do now:
          I import a projet like StrobeMediaPlayer 1.5 full and I can modify a lot of things and get some variables that I need
          I can also create a simple player, and I can load a plugin containing some buttons to play, stop, pause and so, but is in swc
          I learned to create a simple swc from flash (that file containing the buttons)
          but:
          If I want to load a simple swf like plugin in my simple player, I cant, and I dont know why
          I want just to read a variable from the plug in and send a variable to the plugin, but I cant
          Is there any example or anyone that can help me?
          I am loading with


             var resource:URLResource = new URLResource("sample.swf");
             // Load the plug-in SWF.
             factory.loadPlugin(resource);
          **
            private function onPluginLoad(event:MediaFactoryEvent):void
            {
             trace("Plugin loaded");
             initPlayer();
            }
            private function onPluginLoadError(event:MediaFactoryEvent):void
            {
             trace("Plugin not loaded");
            
            }

          when I run the project, initplayer() doesnt work
          what I am doing wrong?
          maybe the problem is in the swf?
          is better swc?
          thanx a lot

          • 2. Re: First plugin
            Silviu Vergoti Adobe Employee

            Please use the Plugin developer's guide that you can find in the OSMF documentation - it will help you a lot.

             

            Also, please check the plugin examples that were provided.

             

            To pass values to and from a plugin you will could use metadata.

            1 person found this helpful
            • 3. Re: First plugin
              Alex_Birchler Level 1

              Hi Silviu

              thanks for the answer

              As I wrote I am reading and following a lots of tutorials, and I am learning a lot

              but I cant send or receive any data using metadata.

              Of course, I am doing things wrong

              As I wrote I am noob and still learning.

              Can You write here any sinple example of how to send or receive any data between player and the plugin?

              Thanks a lot

              • 4. Re: First plugin
                Silviu Vergoti Adobe Employee

                You might set resource-level metadata, like this:

                                var metadata:Metadata  = new Metadata();
                                metadata.addValue("key", "value");
                                resource.addMetadataValue("namespace.org",metadata);

                 

                and read it from the plugin with getMetadataValue("namespace.org");

                 

                Does this help?

                • 5. Re: First plugin
                  Alex_Birchler Level 1

                  Thanx a lot

                  I was trying with that but I wrote in wrong way

                  Thanx a lot

                  You save my day