3 Replies Latest reply on May 19, 2010 6:02 AM by kkonrad

    ParallelElement in a series




      is it possible to play parallel elements in a series by adding a ParallelElement to a SerialElement? I mean I already tried this and it didn't work out. But maybe I used a wrong way.


      parallelMedia = new ParallelElement();
      serialMedia = new SerialElement();


      This way the ParallelElement was just ignored.


      What I want to do is to play two or more medias at the same time but in a series. Any ideas how to realize this with the OSMF?

        • 1. Re: ParallelElement in a series
          bringrags Level 4

          Yes, that should work.  If it's not working for you, please post a code snippet that has all of the MediaElements you're using, and we'll take a look.

          • 2. Re: ParallelElement in a series
            kkonrad Level 1

            It doesn't work for me. What I get is a error when the SerialElement wants to add a ParallelElement as its child:


            Error: LoaderBase unable to handle the given MediaResourceBase
                at org.osmf.traits::LoaderBase/validateLoad()[C:\Dev\osmf\public\trunk\framework\OSMF\org\osmf\traits\LoaderBase.as:238]
                at org.osmf.traits::LoaderBase/load()[C:\Dev\osmf\public\trunk\framework\OSMF\org\osmf\traits\LoaderBase.as:110]
                at org.osmf.traits::LoadTrait/load()[C:\Dev\osmf\public\trunk\framework\OSMF\org\osmf\traits\LoadTrait.as



            My code looks like this:

                private var introElement:VideoElement;
                private var introSoundElementP1:AudioElement;
                private var serialElement:SerialElement;
                private var introElementP:ParallelElement;
                private var mediaContainer:MediaContainer;
                private var mediaPlayer:MediaPlayer;
                 private function init():void
                      mediaContainer = new MediaContainer();
                      //UICompoenent in Flex
                      mediaPlayer = new MediaPlayer();
            private function startShow():void
                 introElement = new VideoElement(new URLResource(introPath));
                 introSoundElementP1 = new AudioElement(new URLResource(introAudioPath));
                 introElementP = new ParallelElement();
            private function startPlayback():void
                 serialElement = new SerialElement();
                 serialElement.addChild(introElementP);      //ERROR!!!
                 mediaPlayer.media = serialElement;



            • 3. Re: ParallelElement in a series
              kkonrad Level 1

              Okay okay, I was screaming to fast


              I checked the MediaRessourceBase class in the API and found my mistake. The audio I was giving is a .OGG file. I thought OSMF supports Ogg Vorbis.