7 Replies Latest reply on Jan 13, 2010 5:48 PM by Vijay Ghaskadvi

    Need to seek on a temporal element


      Hello all.


      I have a MediaPlayer with a SerialElement containing Video, SWF and Images.  I can seek on VideoElements but not on TemporalProxyElements.  If I seek to 0 it will go back to the start of the firstelement a TemporalProxyElement but seeking to 10 the duration of the element does nothing. The next element is a VideoElement if I seek to 10 on it the MediaPlayer will go back to the start of it and the end of the TemporalProxyElement.


      Do I need to add this trait to the TemporalProxyElement?


      Thank you


        • 1. Re: Need to seek on a temporal element
          Vijay Ghaskadvi

          Hi Greg,


          TemporalProxyElement automatically adds TemporalProxySeekTrait, so technically you shouldn't have to. Can you post some sample code to reproduce this problem?




          • 2. Re: Need to seek on a temporal element
            gregbown Level 1

            Hi Vijay.


            Thank you for your interest. I am seeking on the MediaPlayer.  It was recomended by bringrags. I have also tried seeking on the SerialElement too though. I should mention the video are progressive playback. I have not tried using FMS.


            _serialElement = new SerialElement();


            var temporalSWFElement:TemporalProxyElement = new TemporalProxyElement(10,new SWFElement(new SWFLoader(), new URLResource(new URL(_assetDisplayArray[contentNum][1]))));


            var videoElement:VideoElement = new VideoElement(new NetLoader(), new URLResource(new URL(_assetDisplayArray[contentNum][1])));


            view.mediaContainer.mediaPlayer.element = _serialElement;




            files attached. The application is quite large so I only included the related classes.


            The application is designed to load 5 media elements with the associated thumbnails.  I need the ability to auto play through all 5 elements and seek to any one element. I need tracking on all events as well. I am frustrated that there is no direct access to seek by child index or even a way to know the index.

            I tried the metadata.addFacet method as mentioned in this thread http://forums.adobe.com/thread/543958?tstart=0 . The events fire internally but I am unable to recieve them no matter where the listener is placed. I too am about to write a custom serial element or do away with it all together.

            Thank you again for your time


            • 3. Re: Need to seek on a temporal element
              Vijay Ghaskadvi Level 1

              Hmm, looks like a bug. I tried your sample and noticed some unexpected behavior. Let me dig a bit deeper and get back to you.



              • 4. Re: Need to seek on a temporal element
                gregbown Level 1

                Hello again.


                I added a preload function as in the ExamplePlayer included in the framework. I reworked it more to my style though.


                        private function preload(mediaElement:MediaElement, videoElement:VideoElement):void {
                            _loadTrait = videoElement.getTrait(MediaTraitType.LOAD) as LoadTrait;
                            _loadTrait.addEventListener(LoadEvent.LOAD_STATE_CHANGE, function(event:LoadEvent):void {
                                if (event.loadState == LoadState.READY){
                                    _loadTrait.removeEventListener(LoadEvent.LOAD_STATE_CHANGE, function():void{});
                                    _playTrait = mediaElement.getTrait(MediaTraitType.PLAY) as PlayTrait;


                This seemed to help with seeking as long as I was on a VideoElement however if I seek to a frame exactly at the end of a VideoElement the SerialElement immediately seeks to the last temporal element even if I was between VideoElements. What is even more weird is that the currentTime on TimeEvent displays correctly as if the VideoElement was playing. The temporal element that loaded would have had a time approximately 300 seconds later. It continued for the ten seconds that the temporal element was to play as if the VideoElements got deleted? hmm. should I add a bug or did you already do that?


                Thanks again


                • 5. Re: Need to seek on a temporal element
                  bringrags Level 4

                  Sounds like a bug, can you file?  Thanks!

                  • 6. Re: Need to seek on a temporal element
                    gregbown Level 1

                    Hello again.


                    I put together a smaller CS4 application that reproduces this issue.  You will need to substitute the media and update the corrisponding const.

                    It wraps the video and temporal elements in a serial element then assigns the serial element like so MediaPlayerSprite.element = serialElement


                    seek fails on myMediaPlayerSprite.mediaPlayer.seek(time)


                    if I seek on the serial element I can only seek within the current element on display even though all elements are contained within that serial element.

                    The code for this is comented out.


                    Ignore the commented out code in there for loading the elements individually without the serial element.


                    I am using the svn trunk code but release .8 had the same issues.


                    I hope this is helpfull. Thank you again.


                    • 7. Re: Need to seek on a temporal element
                      Vijay Ghaskadvi Level 1

                      I have filed bug

                      https://bugs.adobe.com/jira/browse/FM-329 that captures the root problem.