Copy link to clipboard
Copied
I 've developed a code in AS3 that 's worked up to yesterday when I updated my flash player.
Here is the code:
var _textoPrecarga:TextField = new TextField();
_textoPrecarga.textColor=0xEC6E00;
addChild(_textoPrecarga);
var videoEstado:String = "0";
var videoBufferEstado:String = "0";
this.mon_flv.addEventListener(ProgressEvent.PROGRESS,cargandoVideo);
this.mon_flv.addEventListener(VideoEvent.STATE_CHANGE,cambioEstadoVideo);
this.mon_flv.addEventListener(VideoEvent.PLAYHEAD_UPDATE,avanceVideo);
function avanceVideo (event:VideoEvent): void{
videocontrols.timer.text = formatTime(this.mon_flv.playheadTime) + " / " + formatTime(this.mon_flv.totalTime);
// playheadPercentage
}
function cargandoVideo (event:ProgressEvent): void{
var cargado:Number = Math.floor( event.bytesLoaded*100/event.bytesTotal);
if (cargado >= 5){
if (videoEstado!="Cargado") {
videoEstado="Cargado";
videoCargado= true;
Launch();
}
//_textoPrecarga.visible=false;
} else {
if (videoEstado!="Espera") {
videoEstado="Espera";
this.mon_flv.stop();
}
}
_textoPrecarga.text = "Cargando..." + cargado.toString() + " %";
_textoPrecarga.x = (stage.width/2 ) - (_textoPrecarga.width);
_textoPrecarga.y = (stage.height/2) + 100;
_textoPrecarga.autoSize = TextFieldAutoSize.LEFT;
_textoPrecarga.setTextFormat(tf);
}
function cambioEstadoVideo (event:VideoEvent): void{
if (videoEstado=="Cargado") {
if (this.mon_flv.buffering){
_textoPrecarga.visible = true;
_textoPrecarga.text = "Buffering...";
if (videoBufferEstado != "Buffering"){
videoBufferEstado = "Buffering";
}
}else{
_textoPrecarga.text = "";
_textoPrecarga.visible = false;
if (videoBufferEstado == "Buffering"){
videoBufferEstado = "0";
}
}
}
}
//Fin control de Video
this.mon_flv.load(videoActual);
function Launch():void
{
this.mon_flv.play();
}
Can anyone help me.
Copy link to clipboard
Copied
Do you happen to have this hosted anywhere that I can test against? Do you get an error when this code is executed? Finally, could you please open a new bug report on this over at bugbase.adobe.com? Please post back with the URL so that others affected can add their comments and votes.
Thanks,
Chris