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

    ParallelElement in a series

    kkonrad

      Hi,

       

      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();
      
      serialMedia.addChild(parallelMedia);
      

       

      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
                      videoParent.addChild(mediaContainer); 
                            
                      mediaPlayer = new MediaPlayer();
            
                      startShow();
            
                 }
            
            private function startShow():void
            {
                 introElement = new VideoElement(new URLResource(introPath));
                 introSoundElementP1 = new AudioElement(new URLResource(introAudioPath));
            
                 mediaContainer.addMediaElement(introSoundElementP1);
                 mediaContainer.addMediaElement(outroSoundElementP2);
            
                 introElementP = new ParallelElement();
            
                  introElementP.addChild(introElement);
                  introElementP.addChild(introSoundElementP1);
            }
            
            private function startPlayback():void
            {
                 serialElement = new SerialElement();
            
                 serialElement.addChild(introElementP);      //ERROR!!!
            
                 mediaPlayer.media = serialElement;
            
            }
            

             

            Thanks

            • 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.