1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

for bug #87, response the server SrsId to flash.

This commit is contained in:
winlin 2014-05-27 15:34:55 +08:00
parent d74921e1ab
commit 5ff1ce7cba
9 changed files with 83 additions and 33 deletions

View file

@ -134,6 +134,25 @@ package
flash.external.ExternalInterface.call(this.js_on_publisher_warn, this.js_id, code);
}
// srs infos
private var srs_server:String = null;
private var srs_primary_authors:String = null;
private var srs_id:String = null;
private function update_context_items():void {
// for context menu
var customItems:Array = [new ContextMenuItem("SrsPlayer")];
if (srs_server != null) {
customItems.push(new ContextMenuItem("Server: " + srs_server));
}
if (srs_primary_authors != null) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + srs_primary_authors));
}
if (srs_id != null) {
customItems.push(new ContextMenuItem("SrsId: " + srs_id));
}
contextMenu.customItems = customItems;
}
/**
* publish stream to server.
* @param url a string indicates the rtmp url to publish.
@ -187,15 +206,16 @@ package
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));
srs_server = evt.info.data.srs_server;
}
if (evt.info.data.hasOwnProperty("srs_primary_authors")) {
customItems.push(new ContextMenuItem("PrimaryAuthors: " + evt.info.data.srs_primary_authors));
srs_primary_authors = evt.info.data.srs_primary_authors;
}
contextMenu.customItems = customItems;
if (evt.info.data.hasOwnProperty("srs_id")) {
srs_id = evt.info.data.srs_id;
}
update_context_items();
}
if (evt.info.code == "NetConnection.Connect.Closed") {