I've logged a bug for the seeking issue in TemporalProxyElement - I'll keep you posted on it.
I don't fully understand the unloading issue you mention. I tried setting a SerialElement on the media player with a SWF (wrapped inside a TemporalProxyElement) followed by a VideoElement, and the SWF got unloaded correctly. Do you encounter this problem when you call 'set media()' on MediaPlayer with the VideoElement? Could you post a smaller code sample that reproduces the unloading issue?
One other thing you might try is to log the value of the 'canLoad' property before you set the new MediaElement. It is what determines whether the MediaPlayer will do a courtesy unload of the previous media element (it should return 'true', but just want to make sure). Alternatively, you can force an unload of the previous element by explicitly calling 'unload' on the LoadTrait as follows:
var loadTrait:LoadTrait = player.media.getTrait(MediaTraitType.LOAD) as LoadTrait;
// you can probably simply ignore the error
Let me know if this helps.
I am sorry that I was not clear. My work around was to do away with the serial composition and load the elements directly into the MediaPlayer
with mediaPlayer.element = mediaArray;
On video elements everything works properly however the second time an image element or SWF element is loaded you can see the original still on the display list.
I will put together a more simple test code.
Thank you for your time
Hello again Vijay
I put togethe a Flash CS4 test application that duplicates the image and swf element unload problem.
You will need to substitute the media though and then update the corresponding const. Click the blank thumbnails to set corisponding _referenceArray position. I am not using serial element in this app though some of that code is in there comented out. This structure was intended to work around the inability to seek by loading video, image and swf elements directly through the MediaPlayerSprite.element = (type)Element method.
Vijay asked me to take a look, and I was able to reproduce the trouble you're reporting. I've filed a bug:
I'll let you know when we get it fixed!
I am not sure what exactly was changed but as of svn commit 13628 SWFElements and ImageElements are unloading properly.
Thank you and the team very much!!! I now have a way forward in my application.
That's great to hear, Greg!
Your report led to the fix of two problems with ParallelDisplayObject (rev. 13557,13558), as well one with LayoutRenderer (rev. 13564). The last one impacted your issue directly, because layout renderer would fail to unstage the display objects belonging to otherwise unloaded media elements.
Thank you for reporting!
I am not sure if this is a new bug related to this issue however when I set a VideoElement, after any other element, that was loaded prior the duration comes up NaN despite it having been loaded and played prior causing autoPlay to fail and thus it is not added to the stage. It did not do this prior. There is a work around: calling play on the duration change event will trigger the display. Dont get me wrong, it is still better than before, I just wanted to let you know about the anomaly.