First of all, thank you so much for all the time and effort you've put into this class!
I'm trying to replicate the experience of changing channels on a television with my video player and I'm running into an odd quirk. First of all, it seems if I ever attempt to go to a time in my videos when the video isn't playing at that moment the container appears to loose sync with the loaded asset. I say "loose sync" because the PLAY_PROGRESS still indicates that the stream is moving forward but the container doesn't update and there is no sound. I've tried waiting to send the gotoVideoTime call until complete, init, and buffer full and all seem to have the same effect. The only way I can seem to get it work is to build in a delay timer so that the gotoVideoTime call doesn't happen until about 200ms after the video starts playing. Here's a code sample of what I'm talking about:
import com.greensock.loading.*;
import com.greensock.loading.display.*;
import com.greensock.*;
import com.greensock.events.LoaderEvent;
//create a VideoLoader
var video:VideoLoader = new VideoLoader("videos/csi.flv", {name:"CSI", bufferMode:false, container:vidbox, width:400, height:300, scaleMode:"proportionalInside", bgColor:0x000000, autoPlay:false, volume:0.75, requireWithRoot:this.root, estimatedBytes:21093459, onComplete:completeHandler});
video.addEventListener(VideoLoader.PLAY_PROGRESS, updatePlayProgress);
//start loading
video.load();
function completeHandler(event:LoaderEvent):void {
trace("load complete");
video.gotoVideoTime(10,true);
}
function updatePlayProgress(event:LoaderEvent=null):void {
var time:Number = video.videoTime;
var minutes:String = force2Digits(int(time / 60));
var seconds:String = force2Digits(int(time % 60));
trace(minutes+":"+seconds);
}
function force2Digits(value:Number):String {
return (value < 10) ? "0" + String(value) : String(value);
}
if you change the 10 to a 0 in the gotoVideoTime call you can see that it will play just fine. What am I missing here?