La duda que tengo es a la hora de poner un reproductor de video. He conseguido que reproduzca y que funciones los botones que considero utiles pero hay algo que no se y no encuentro en ningun sitio, y es que me gustaria que el video se reproduzca solo si presiono al play, no busco que en el momento que abra la pagina se reproduzca automaticamente. Os pongo el código. Agradeceria mucho , si es que esto es posible, que me ayudarais.
Código :
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
miVideo.attachVideo(ns);
ns.play("videoPresentacionOf.flv");
ns.setBufferTime(10);
stream.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferclip._visible = false;
}else{
bufferclip._visible = true;
}
}
var time_interval:Number = setInterval(checkTime, 0, ns);
function checkTime(mi_ns:NetStream) {
var ns_seconds:Number = mi_ns.time;
var minutes:Number = Math.floor(ns_seconds/60);
var seconds = Math.floor(ns_seconds%60);
if (seconds<10) {
seconds = "0" + seconds;
}
timevid_txt.text = "0" + minutes + ":" + seconds;
}
_root.createEmptyMovieClip("vSound",_root.getNextHighestDepth());
vSound.attachAudio(ns);
var so:Sound = new Sound(vSound);
so.setVolume(100);
mute.onRollOver = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("onOver");
}
else {
this.gotoAndStop("muteOver");
}
}
mute.onRollOut = function() {
if(so.getVolume()== 100) {
this.gotoAndStop("on");
}
else {
this.gotoAndStop("mute");
}
}
mute.onRelease = function() {
if(so.getVolume()== 100) {
so.setVolume(0);
this.gotoAndStop("muteOver");
}
else {
so.setVolume(100);
this.gotoAndStop("onOver");
}
}
playButton._visible= false;
playButton.onPress = function() {
ns.pause();
this._visible= false;
pauseButton._visible= true;
}
pauseButton.onPress = function() {
ns.pause();
this._visible= false;
playButton._visible= true;
}
this.createEmptyMovieClip("vFrame",this.getNextHighestDepth());
vFrame.onEnterFrame = videoStatus;
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
}
function videoStatus() {
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
barra.progreso._width = amountLoaded * 422;
barra.scrub._x = ns.time / duration * 407;
}
var scrubInterval;
tube.scrub.onPress = function() {
vFrame.onEnterFrame = scrubit;
this.startDrag(false,0,this._y,410,this._y);
}
tube.scrub.onRelease = tube.scrub.onReleaseOutside = function() {
vFrame.onEnterFrame = videoStatus;
this.stopDrag();
}
function scrubit() {
ns.seek(Math.floor((tube.scrub._x/410)*duration));
}
function pauseIt() {
ns.pause();
if(pauseButton._visible = false){
playButton._visible= true;
}else{
playButton._visible= false;
}
}
function restartIt() {
ns.seek(0);
}[quote]
Muchas gracias. Un saludo y mi mas sincera enhorabuena por el trabajo en esta página.
Blackbee.
[/quote] 