9 Replies Latest reply on Aug 26, 2010 8:51 PM by bringrags

    Selecting What Child Of A SerialElement To Play Next

    ionflow

      Is there a smart way to pick which child to play next in a serial element without modifying the internal SerialElementTransitionManager class? I understand the SerialElement by definition just plays elements in sequence, but it would be handy to be able to choose which child to play instead of having to deal with seeking using duration or chapter cuepoints. It seems the seeking fix suggested here (https://bugs.adobe.com/jira/browse/FM-952) is a bit clunky and thought there might be a different workaround that involved just changing the currently playing child and not seeking to a time.

       

      One option I've been playing with is looping through a serial elements children (which I've made all proxy elements) and blocking the PlayTrait of all the children I want to skip over. This doesn't seem to be a very good solution either especially since I'm only able to move forward in time and can't skip backwards.

       

      Thoughts?

        • 1. Re: Selecting What Child Of A SerialElement To Play Next
          ionflow Level 1

          Actually, blocking the PlayTrait does not accomplish what I'm trying to accomplish so disregard that as an option.

           

          Shouldn't blocking certain SerialElement childrens' LoadTrait send the SerialElementTransitionManager to the next child that has the LoadTrait? It appears that the TraitLoader's findOrLoadMediaElementWithTrait function does not cycle through the children of the SerialElement as evident here at about line 76 in TraitLoader.as

           

          for each (var mediaElement:MediaElement in mediaElements)
          {
               var loadTrait:LoadTrait = mediaElement.getTrait(MediaTraitType.LOAD) as LoadTrait;
               if (     mediaElement.hasTrait(traitType)
                    &&     (     loadTrait == null
                          || loadTrait.loadState == LoadState.READY
                         )
                  )
               {
                    // If the next MediaElement has the requested trait (and is loaded),
                    // then we're done.
                    //
                    
                    noSuchTrait = false;
                    
                    dispatchFindOrLoadEvent(mediaElement);
                    break;
               }
          
          

          • 2. Re: Selecting What Child Of A SerialElement To Play Next
            ionflow Level 1

            Still wondering if there is a smart way to pick which child to play next in a serial element without modifying the internal SerialElementTransitionManager class and without using time of subclips?

            • 3. Re: Selecting What Child Of A SerialElement To Play Next
              Francisco Brianezi

              OSMF 1.0

               

              Me too need a solution like that.

              I have five streams in a serialElement.

              I know the total length.

              I want to go (sliderBar) anywhere in them.

              It seems impossible.

               

              Thanks

              • 4. Re: Selecting What Child Of A SerialElement To Play Next
                weizhangstrobe Level 2

                It seems to me that the use case you describe should be handled at player level instead of OSMF level. Serial element, by its design, is meant to play the children in a sequential order. Or maybe I did not get your use case completely. If that is the case, please elaborate your use case and see whether I can give more help.

                 

                 

                -Wei Zhang

                Senior Computer Scientist

                Adobe Systems, Inc.

                weizhang@adobe.com

                • 5. Re: Selecting What Child Of A SerialElement To Play Next
                  ionflow Level 1

                  Wei,

                  Several users have been interested in seeking to a subclip within a serial element. But there is a bug in seeking to subclips by time when that subclip hasn't been loaded: https://bugs.adobe.com/jira/browse/FM-952

                   

                  I understand there are a couple workarounds, but what I'm suggesting is that in addition to seeking to a particular time in the serial element subclip, I'd like to be able to seek to a particular child. Does that make sense?

                   

                  I understand the serial element is meant to be played in sequence, but there are cases where we want to seek to a particular time or seek to the beginning of a particular child. It would just be a more simple way of seeking by not having to deal with time. So I'm looking for a way to seek to children in addition to seeking to time. Both are useful.

                  • 6. Re: Selecting What Child Of A SerialElement To Play Next
                    weizhangstrobe Level 2

                    Hi,

                     

                    I see what you mean. This use case makes a lot of sense to me now. It seems that our current OSMF does not support it and I will bring it up to the team and strongly recommend of coming up with a solution ASAP. Thank you very much for the feedback.

                     

                     

                    -Wei Zhang

                    Senior Computer Scientist

                    Adobe Systems, Inc.

                    weizhang@adobe.com

                    1 person found this helpful
                    • 7. Re: Selecting What Child Of A SerialElement To Play Next
                      ionflow Level 1

                      Thanks Wei,

                      Can anyone suggest a workaround, or a code modification? I'm assuming the alteration would have to be within the SerialElementTransitionManager class, correct? My previous attempt shown above doesn't seem to work.

                      • 8. Re: Selecting What Child Of A SerialElement To Play Next
                        Andrian Cucu Adobe Employee

                        Hi,

                         

                        Can you take a look at this thread: http://forums.adobe.com/message/2517803 ?

                         

                        I can see that a bug reported there got fixed, so you can try to see if it works for you.

                         

                        -Andrian

                        • 9. Re: Selecting What Child Of A SerialElement To Play Next
                          bringrags Level 4

                          Another possible approach here would be to use a custom ProxyElement rather than a SerialElement.  This custom ProxyElement would maintain a list of children (similar to SerialElement), but it would only expose one child (the active child) by setting it as the proxiedElement.  When that child dispatches the "complete" event, then it would change the proxiedElement to the next child.  Unlike with SerialElement, you could choose which child gets set as the next child, and in general have more fine-grained control over the behavior of the children.  We have a simple example of this in the ExamplePlayer sample, called SwitchingProxyElement.

                           

                          That being said, it's important to understand that the advantage of SerialElement is that it was built to handle serial transitions between  elements no matter what set of traits each child element has.  For example,  if you transition from a playable element to a non-playable element, or a  temporal element to a non-temporal element (or vice-versa, or with the various permutations of  these traits), then SerialElement does the right thing.  However, if  your child elements are all playable/temporal, then the transition is  fairly straightforward, and could easily be implemented in a custom  ProxyElement.

                          1 person found this helpful