1 person found this helpful
The defaultDuration property isn't meant to control the duration of playback.
Once the media is loaded, the actual duration is used rather than the defaultDuration.
Sounds like what you want might be subclips instead - something like this?
var resource:StreamingURLResource = new StreamingURLResource(REMOTE_STREAM);
resource.clipStartTime = 10;
resource.clipEndTime = 25;
return new VideoElement(resource);
And now for more than you may want to know about the defaultDuration property:
This property exists in case you want to set the duration for an element before it is loaded.
For example, in a serial composition you might want to play 3 videos, two which are content, and one which is a mid-roll ad.
Each video doesn't get it's duration set until it is loaded - but you want to have a scrubber bar UI element that allows you to move across from beginning of the 1st video to the end of the 3rd video. You don't get the total duration of all 3 videos until they are loaded, which happens "just in time", too late for your scrub bar.
So you can manually set the "defaultDuration" of the video. This manually set duration defines the duration that the element's TimeTrait will expose until the element's content is loaded. By manually pre-assigning a duration to each piece of media, the total composition duration can be calculated. This duration can be used by user interface controls (such as a scrub bar).
Hope that helps!
P.S. Ideas to improve the docs are VERY welcome. Here are the two places we talk about this feature now:
ok, thx for the reply.
I read that in the dev docu after I posted here. Thx for your sample code.
If I add the clipStartTime and clipEndTime to a video in a serial composition. The video dont start at this time and dont end at this time.
These properties only work for streaming content, not progressive. Is that what you're using?
Ah, ok I understand. Im using a progressive video. Its not so important for me, want only to know for my evaluation.