Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
胡斌
/
srs
转到一个项目
Toggle navigation
项目
群组
代码片段
帮助
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
winlin
2014-05-27 15:34:55 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
5ff1ce7cba2c1f9f6f51453f2e9136cf0b0485c4
5ff1ce7c
1 parent
d74921e1
for bug #87, response the server SrsId to flash.
显示空白字符变更
内嵌
并排对比
正在显示
9 个修改的文件
包含
83 行增加
和
33 行删除
trunk/research/players/js/srs.page.js
trunk/research/players/srs_bwt/release/srs_bwt.swf
trunk/research/players/srs_bwt/src/srs_bwt.as
trunk/research/players/srs_player/release/srs_player.swf
trunk/research/players/srs_player/src/srs_player.as
trunk/research/players/srs_publisher/release/srs_publisher.swf
trunk/research/players/srs_publisher/src/srs_publisher.as
trunk/src/core/srs_core.hpp
trunk/src/rtmp/srs_protocol_rtmp.cpp
trunk/research/players/js/srs.page.js
查看文件 @
5ff1ce7
...
...
@@ -3,7 +3,7 @@
//////////////////////////////////////////////////////////////////////////////////
// to query the swf anti cache.
function
srs_get_version_code
()
{
return
"1.2
0
"
;
}
function
srs_get_version_code
()
{
return
"1.2
1
"
;
}
/**
* player specified size.
...
...
trunk/research/players/srs_bwt/release/srs_bwt.swf
查看文件 @
5ff1ce7
不能预览此文件类型
trunk/research/players/srs_bwt/src/srs_bwt.as
查看文件 @
5ff1ce7
...
...
@@ -133,20 +133,40 @@ 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
;
}
// 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
){
...
...
trunk/research/players/srs_player/release/srs_player.swf
查看文件 @
5ff1ce7
不能预览此文件类型
trunk/research/players/srs_player/src/srs_player.as
查看文件 @
5ff1ce7
...
...
@@ -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.
...
...
trunk/research/players/srs_publisher/release/srs_publisher.swf
查看文件 @
5ff1ce7
不能预览此文件类型
trunk/research/players/srs_publisher/src/srs_publisher.as
查看文件 @
5ff1ce7
...
...
@@ -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"
)
{
...
...
trunk/src/core/srs_core.hpp
查看文件 @
5ff1ce7
...
...
@@ -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 "11
7
"
#define VERSION_REVISION "11
8
"
#define RTMP_SIG_SRS_VERSION VERSION_MAJOR"."VERSION_MINOR"."VERSION_REVISION
// server info.
#define RTMP_SIG_SRS_KEY "SRS"
...
...
trunk/src/rtmp/srs_protocol_rtmp.cpp
查看文件 @
5ff1ce7
...
...
@@ -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
);
...
...
请
注册
或
登录
后发表评论