update the signature, when connect to server, parse the response.

pull/133/head
winlin 11 years ago
parent cb55f23363
commit 632255f08f

@ -90,7 +90,7 @@ function srs_get_player_width() { return srs_get_player_modal() - 30; }
function srs_get_player_height() { return srs_get_player_width() * 9 / 19; }
// to query the swf anti cache.
function srs_get_version_code() { return "1.0"; }
function srs_get_version_code() { return "1.1"; }
/**
* initialize the page.

@ -293,6 +293,18 @@ package
this.media_conn.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void {
trace ("NetConnection: code=" + evt.info.code);
if (evt.info.hasOwnProperty("data") && evt.info.data) {
// for context menu
var customItems:Array = [new ContextMenuItem("SrsPlayer")];
if (evt.info.data.hasOwnProperty("srs_server")) {
customItems.push(new ContextMenuItem("Server: " + evt.info.data.srs_server));
}
if (evt.info.data.hasOwnProperty("srs_contributor")) {
customItems.push(new ContextMenuItem("Contributor: " + evt.info.data.srs_contributor));
}
contextMenu.customItems = customItems;
}
// TODO: FIXME: failed event.
if (evt.info.code != "NetConnection.Connect.Success") {
return;

@ -14,6 +14,7 @@ package
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.ui.ContextMenu;
import flash.ui.ContextMenuItem;
import flash.utils.setTimeout;
public class srs_publisher extends Sprite
@ -159,6 +160,18 @@ package
this.media_conn.addEventListener(NetStatusEvent.NET_STATUS, function(evt:NetStatusEvent):void {
trace ("NetConnection: code=" + evt.info.code);
if (evt.info.hasOwnProperty("data") && evt.info.data) {
// for context menu
var customItems:Array = [new ContextMenuItem("SrsPlayer")];
if (evt.info.data.hasOwnProperty("srs_server")) {
customItems.push(new ContextMenuItem("Server: " + evt.info.data.srs_server));
}
if (evt.info.data.hasOwnProperty("srs_contributor")) {
customItems.push(new ContextMenuItem("Contributor: " + evt.info.data.srs_contributor));
}
contextMenu.customItems = customItems;
}
// TODO: FIXME: failed event.
if (evt.info.code != "NetConnection.Connect.Success") {
return;

@ -595,7 +595,7 @@ int SrsRtmp::response_connect_app(SrsRequest* req)
pkt->info->set("data", data);
data->set("srs_version", new SrsAmf0String(RTMP_SIG_FMS_VER));
data->set("srs_server", new SrsAmf0String(RTMP_SIG_SRS_NAME));
data->set("srs_server", new SrsAmf0String(RTMP_SIG_SRS_KEY" "RTMP_SIG_SRS_VERSION" ("RTMP_SIG_SRS_URL_SHORT")"));
data->set("srs_license", new SrsAmf0String(RTMP_SIG_SRS_LICENSE));
data->set("srs_role", new SrsAmf0String(RTMP_SIG_SRS_ROLE));
data->set("srs_url", new SrsAmf0String(RTMP_SIG_SRS_URL));
@ -603,6 +603,7 @@ int SrsRtmp::response_connect_app(SrsRequest* req)
data->set("srs_site", new SrsAmf0String(RTMP_SIG_SRS_WEB));
data->set("srs_email", new SrsAmf0String(RTMP_SIG_SRS_EMAIL));
data->set("srs_copyright", new SrsAmf0String(RTMP_SIG_SRS_COPYRIGHT));
data->set("srs_contributor", new SrsAmf0String(RTMP_SIG_SRS_CONTRIBUTOR));
msg->set_packet(pkt, 0);

Loading…
Cancel
Save