diff --git a/trunk/research/players/js/srs.page.js b/trunk/research/players/js/srs.page.js index 042b6a119..5b690c1ca 100755 --- a/trunk/research/players/js/srs.page.js +++ b/trunk/research/players/js/srs.page.js @@ -3,7 +3,7 @@ ////////////////////////////////////////////////////////////////////////////////// // to query the swf anti cache. -function srs_get_version_code() { return "1.20"; } +function srs_get_version_code() { return "1.21"; } /** * player specified size. diff --git a/trunk/research/players/srs_bwt/release/srs_bwt.swf b/trunk/research/players/srs_bwt/release/srs_bwt.swf index 6b68b051a..f035aa6ff 100755 Binary files a/trunk/research/players/srs_bwt/release/srs_bwt.swf and b/trunk/research/players/srs_bwt/release/srs_bwt.swf differ diff --git a/trunk/research/players/srs_bwt/src/srs_bwt.as b/trunk/research/players/srs_bwt/src/srs_bwt.as index bb12e965d..2a671faf9 100755 --- a/trunk/research/players/srs_bwt/src/srs_bwt.as +++ b/trunk/research/players/srs_bwt/src/srs_bwt.as @@ -132,21 +132,41 @@ package elapTimer.restart(); } } + + // 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; + } // get NetConnection NetStatusEvent public function onStatus(evt:NetStatusEvent) : void{ trace(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(); } switch(evt.info.code){ diff --git a/trunk/research/players/srs_player/release/srs_player.swf b/trunk/research/players/srs_player/release/srs_player.swf index 159bcf354..3402953c9 100755 Binary files a/trunk/research/players/srs_player/release/srs_player.swf and b/trunk/research/players/srs_player/release/srs_player.swf differ diff --git a/trunk/research/players/srs_player/src/srs_player.as b/trunk/research/players/srs_player/src/srs_player.as index 9640f387e..781917176 100755 --- a/trunk/research/players/srs_player/src/srs_player.as +++ b/trunk/research/players/srs_player/src/srs_player.as @@ -143,29 +143,17 @@ package private function system_on_metadata(metadata:Object):void { this.media_metadata = metadata; - if (metadata.hasOwnProperty("server")) { - // for context menu - var customItems:Array = [new ContextMenuItem("SrsPlayer")]; - if (metadata.hasOwnProperty("server")) { - customItems.push(new ContextMenuItem("Server: " + metadata.server)); - } - if (metadata.hasOwnProperty("contributor")) { - customItems.push(new ContextMenuItem("Contributor: " + metadata.contributor)); - } - contextMenu.customItems = customItems; - } - // for js. var obj:Object = __get_video_size_object(); obj.server = 'srs'; obj.contributor = 'winlin'; - if (metadata.hasOwnProperty("server")) { - obj.server = metadata.server; + if (srs_server != null) { + obj.server = srs_server; } - if (metadata.hasOwnProperty("contributor")) { - obj.contributor = metadata.contributor; + if (srs_primary_authors != null) { + obj.contributor = srs_primary_authors; } var code:int = flash.external.ExternalInterface.call(js_on_player_metadata, js_id, obj); @@ -277,6 +265,25 @@ package } } + // 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; + } + /** * function for js to call: to play the stream. stop then play. * @param url, the rtmp/http url to play. @@ -300,15 +307,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(); } // TODO: FIXME: failed event. diff --git a/trunk/research/players/srs_publisher/release/srs_publisher.swf b/trunk/research/players/srs_publisher/release/srs_publisher.swf index 1b232ce48..149e179c3 100755 Binary files a/trunk/research/players/srs_publisher/release/srs_publisher.swf and b/trunk/research/players/srs_publisher/release/srs_publisher.swf differ diff --git a/trunk/research/players/srs_publisher/src/srs_publisher.as b/trunk/research/players/srs_publisher/src/srs_publisher.as index 87d34bddc..e3a14392b 100755 --- a/trunk/research/players/srs_publisher/src/srs_publisher.as +++ b/trunk/research/players/srs_publisher/src/srs_publisher.as @@ -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") { diff --git a/trunk/src/core/srs_core.hpp b/trunk/src/core/srs_core.hpp index 78e86518c..241fc9b13 100644 --- a/trunk/src/core/srs_core.hpp +++ b/trunk/src/core/srs_core.hpp @@ -31,7 +31,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // current release version #define VERSION_MAJOR "0" #define VERSION_MINOR "9" -#define VERSION_REVISION "117" +#define VERSION_REVISION "118" #define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION // server info. #define RTMP_SIG_SRS_KEY "SRS" diff --git a/trunk/src/rtmp/srs_protocol_rtmp.cpp b/trunk/src/rtmp/srs_protocol_rtmp.cpp index 30ab1eb86..d830dbc18 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp.cpp +++ b/trunk/src/rtmp/srs_protocol_rtmp.cpp @@ -866,6 +866,8 @@ int SrsRtmpServer::response_connect_app(SrsRequest *req, const char* server_ip) if (server_ip) { data->set("srs_server_ip", SrsAmf0Any::str(server_ip)); } + // for edge to directly get the id of client. + data->set("srs_id", SrsAmf0Any::number(_srs_context->get_id())); if ((ret = protocol->send_and_free_packet(pkt, 0)) != ERROR_SUCCESS) { srs_error("send connect app response message failed. ret=%d", ret);