les cuento, tengo un video flv, el cual obviamente por su peso y duracion hago un buffer y cuando finaliza doy la opcion de un replay. Hasta ahi ningun problema, lo que no puedo hacer es que el video, luego que haga el buffer NO haga Autoplay y a su vez aparezca un boton de Play. este es el codigo que estoy usando
Código ActionScript :
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
theVideo.attachVideo(ns);
ns.setBufferTime(20);
ns.onStatus = function(info) {
trace(info.code);
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Start") {
replayClip._visible = false;
}
if(info.code == "NetStream.Play.Stop") {
replayClip._visible = true;
}
}
ns.play("http://www.MYVIDEO.flv");
playButton.onRelease = function() {
ns.pause();
}
rewindButton.onRelease = function() {
ns.seek(0);
}
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 293;
loader.scrub._x = ns.time / duration * 293;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,293,this._y);
}
loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((loader.scrub._x/293)*duration));
}
stop();
alguien sabe como lograrlo??
