Not clear exactly what you mean but have you tried this:
var resource:URLResource = new StreamingURLResource(source, StreamType.LIVE_OR_RECORDED, clipStart);
var mediaElement:MediaElement = mediaFactory.createMediaElement(resource);where clipStart is a Number value of seconds.Thanks,- charles
I'm trying to switch video sources at run time via a addeventlistener. User is able to click on different buttons (essentially thumbnail videos running at the same time) to change the video
this is what i have so far
function switchScn(scnElement:MediaElement, url:String, eventObject:Object):void
time = player.currentTime;
scnlabel.label = time.toString();
var mainUrl = MAIN_PATH;
MAIN_PATH = url;
var resource:URLResource = new StreamingURLResource(MAIN_PATH, StreamType.LIVE_OR_RECORDED, time);
mainElement = mediaFactory.createMediaElement(resource);
What i've done is removed the current mediaelement and then create the a new mediaelement but want to start it at a certain time. so that it seems like its seemless.
above i've added the suggested solution but still not starting at the specified time.
Any one able to help? I just want the user to be able to switch video source during runtime when they click different buttons. each button will change the video being played. each button represents the different scenes.
Trying to make a surviellance viewing system
It takes time for the player to load new streaming media. You will need to pre-load all the media in their own MediaPlayer instance (but make sure that they all use the same NetLoader).
In each of the MediaPlayer instances, you'll need to handle LoadEvent.BYTES_LOADED_CHANGE and LoadEvent.BYTES_TOTAL_CHANGE in order to calculate if and when a media player can play at a certain time. The switching algorithm will have to handle cases where the target media is not ready to be played at the time frame requested. The alternative is to ensure that ALL media can be played at a certain time frame but this increases initial pre-load wait time.
The trick to pre-load media is to initiate MediaPlayer.play() and immediately MediaPlayer.stop(). Otherwise, the players will not trigger progressive downloading.
If it's a streaming resource, you have clipstarttime and clipendtime to help you in scenarios like that.