ayuda con reproductor en flash
-
buenas, necesito su ayuda, estoy armando un reproductor de aac para colocarlo en una web, tengo un problema para mi, muy raro, cuando tengo abierto el adobe flash, editando el player, pruebo la pelicula y funciona correctamente. cierro el programa y abro el swf y no reproduce el streaming, que puede ser??
ese es mi codigo:
function initialize()
{
_root.connect.streamStr.text="stream";//Poner Tu Radio (Tu Ip)
_root.connect.connectStr.text="rtmp://xxxxxxxxxxxx:xxxx/live";//Modificar RTMP si es necesario
_root.connect.connectButton.onPress = _root.doConnect;
_root.connect.connectButton2.onPress = _root.doConnect;
doConnect();
enablePlayControls(false);
metaDataValues.title = "";
metaDataValues.genre = "";
metaDataValues.name = "";
metaDataValues.url = "";
metaDataValues.bitrate = "";
metaDataValues.formato = "";
trace (System.capabilities.version);
}
function updateMetaData()
{
var _loc7 = "";
var _loc6 = "";
var _loc4 = "";
var _loc2 = "";
var _loc5 = "";
var _loc1 = "";
if (metaDataValues.title != "")
{
_loc2 = _loc2 + ("Canción: " + metaDataValues.title + "\n");
}
if (metaDataValues.genre != "")
{
_loc6 = _loc6 + ("Genero: " + metaDataValues.genre + "\n");
}
if (metaDataValues.name != "")
{
_loc5 = _loc5 + ("En Controles: " + metaDataValues.name + "\n");
}
if (metaDataValues.bitrate != "")
{
_loc4 = _loc4 + ("Bibrate: " + metaDataValues.bitrate + "Kbps\n");
}
if (metaDataValues.url != "")
{
metaStrUrl = metaStrUrl + ("URL: " + metaDataValues.url + "\n");
}
if (metaDataValues.formato == "audio/aacp")
{
_loc1 = _loc1 + "Stream AAC+\n";
}
if (metaDataValues.formato == "audio/mpeg")
{
_loc1 = _loc1 + "Stream MP3\n";
}
metaDataText.text = _loc7;
Cancion.html = true;
Cancion.htmlText = _loc2;
Bitrate.html = true;
Bitrate.htmlText = _loc4;
Genero.html = true;
Genero.htmlText = _loc6;
Estacion.html = true;
Estacion.htmlText = _loc5;
Cancion.html = true;
Cancion.htmlText = _loc2;
Formato.html = true;
Formato.htmlText = _loc1;
if (metaDataValues.formato == "")
{
var _loc3 = "";
_loc3 = "OFF LINE\n";
Offline.html = true;
Offline.htmlText = _loc3;
}
}
function doConnect()
{
if (nc == null)
{
nc = new NetConnection();
nc.onStatus = function (infoObject)
{
trace ("nc: " + infoObject.code + " (" + infoObject.description + ")");
if (infoObject.code == "NetConnection.Connect.Success")
{
playShoutcast();
}
snd = new Sound();
snd.loadSound("", true);
if (infoObject.code == "NetConnection.Connect.Failed")
{
snd.setVolume(100);
var _loc2 = "";
_loc2 = "Stream Apagado\n";
Online.html = true;
Online.htmlText = _loc2;
}
else
{
snd.setVolume(0);
}
};
nc.connect(_root.connect.connectStr.text);
_root.connect.connectButton.label = "Stop";
enablePlayControls(true);
}
else
{
if (nsPlay != null)
{
nsPlay.attachVideo(null);
nsPlay.attachAudio(null);
}
nsPlay = null;
nc.close();
nc = null;
metaDataValues.title = "";
metaDataValues.genre = "";
metaDataValues.name = "";
metaDataValues.url = "";
metaDataValues.bitrate = "";
metaDataValues["content-type"] = "";
updateMetaData();
enablePlayControls(false);
_root.connect.connectButton.label = "Play";
snd = new Sound();
}
}
function enablePlayControls(isEnable)
{
}
function playShoutcast()
{
nsPlay = new NetStream(nc);
nsPlay.onStatus = function (infoObject)
{
trace ("nsPlay: " + infoObject.code + " (" + infoObject.description + ")");
};
nsPlay.onHeaderData = function (infoObject)
{
trace ("onHeaderData");
for (var _loc2 in infoObject)
{
trace (" " + _loc2 + " = " + infoObject[_loc2]);
}
if (infoObject["icy-genre"] != undefined)
{
metaDataValues.genre = infoObject["icy-genre"];
}
if (infoObject["icy-name"] != undefined)
{
metaDataValues.name = infoObject["icy-name"];
}
if (infoObject["icy-br"] != undefined)
{
metaDataValues.bitrate = infoObject["icy-br"];
}
if (infoObject["content-type"] != undefined)
{
metaDataValues.formato = infoObject["content-type"];
}
updateMetaData();
};
nsPlay.onMetaData = function (infoObject)
{
trace ("onMetaData");
for (var _loc2 in infoObject)
{
trace (" " + _loc2 + " = " + infoObject[_loc2]);
}
if (infoObject.StreamTitle != undefined)
{
metaDataValues.title = infoObject.StreamTitle;
}
if (infoObject.StreamUrl != undefined)
{
metaDataValues.url = infoObject.StreamUrl;
}
updateMetaData();
};
nsPlay.setBufferTime(1);
nsPlay.play(_root.connect.streamStr.text);
soundRemote.attachAudio(nsPlay);
var miMenu = new ContextMenu();
miMenu.hideBuiltInItems();
_root.menu = miMenu;
var i1 = new ContextMenuItem("Created by Robnei", trace, true, false);
miMenu.customItems[1] = i1;
var i2 = new ContextMenuItem("Created by Robnei", trace, true, false);
miMenu.customItems[2] = i2;
}
a;
b >= undefined > "c" || 0(false);
fscommand("allowscale", "false");
song = new Sound();
song.attachSound("meinSound");
song.start(0, 999);
var nc = null;
var nsPlay = null;
var metaDataValues = new Array();
trace (_root.puerto);
trace (_root.rtmp);
trace (_root.autoplay);
var server = "aac";
var metaStrErrores = "";
if (rtmp == "" || puerto == "")
{
metaStrErrores = "ERROR: puerto, rtmp server no definido!!!\n";
}
Errores.html = true;
Errores.htmlText = metaStrErrores;
Stage.align = "TL";
Stage.scaleMode = "noScale";
initialize();Última edición por nachodiezojeda; 15/05/2012 a las 14:34
