Hola!
hice un video player y funciona bien con el URL definido.... pero lo k kiero es k cargue el video dinamicamente con php desde una base de datos... los codigos en el player son estos:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(10);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
}
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
}
if(info.code == "NetStream.Play.Stop") {
ns.seek(0);
this.stop;
}
}
theVideo.attachVideo(ns);
ns.play(URL_DEL_VIDEO);
rewindButton.onRelease = function() {
ns.seek(0);
}
playButton.onRelease = function() {
ns.pause();
}
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 * 401.6;
loader.scrub._x = ns.time / duration * 401.6;
}
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,0,this._y,401,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/401) *duration));
}
alguna idea??