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
2013-12-23 11:05:34 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
46eb1ebd6bb85a7391992a5adcb23e1b4177c9e3
46eb1ebd
1 parent
116129d1
refine the srs js player and publisher, add private object
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
11 行增加
和
3 行删除
trunk/research/players/js/srs.js
trunk/research/players/srs_chat.html
trunk/research/players/js/srs.js
查看文件 @
46eb1eb
...
...
@@ -427,8 +427,10 @@ function srs_publiser_get_codec(
* @param container the html container id.
* @param width a float value specifies the width of player.
* @param height a float value specifies the height of player.
* @param private_object [optional] an object that used as private object,
* for example, the logic chat object which owner this player.
*/
function
SrsPlayer
(
container
,
width
,
height
)
{
function
SrsPlayer
(
container
,
width
,
height
,
private_object
)
{
if
(
!
SrsPlayer
.
__id
)
{
SrsPlayer
.
__id
=
100
;
}
...
...
@@ -438,6 +440,7 @@ function SrsPlayer(container, width, height) {
SrsPlayer
.
__players
.
push
(
this
);
this
.
private_object
=
private_object
;
this
.
container
=
container
;
this
.
width
=
width
;
this
.
height
=
height
;
...
...
@@ -611,8 +614,10 @@ function __srs_on_player_timer(id, time, buffer_length) {
* @param container the html container id.
* @param width a float value specifies the width of publisher.
* @param height a float value specifies the height of publisher.
* @param private_object [optional] an object that used as private object,
* for example, the logic chat object which owner this publisher.
*/
function
SrsPublisher
(
container
,
width
,
height
)
{
function
SrsPublisher
(
container
,
width
,
height
,
private_object
)
{
if
(
!
SrsPublisher
.
__id
)
{
SrsPublisher
.
__id
=
100
;
}
...
...
@@ -622,6 +627,7 @@ function SrsPublisher(container, width, height) {
SrsPublisher
.
__publishers
.
push
(
this
);
this
.
private_object
=
private_object
;
this
.
container
=
container
;
this
.
width
=
width
;
this
.
height
=
height
;
...
...
trunk/research/players/srs_chat.html
查看文件 @
46eb1eb
...
...
@@ -184,7 +184,9 @@
// if previous exists, ignore, only add new here.
var
previous_chat
=
get_previous_chat_user
(
previous_chats
,
chat
.
id
);
if
(
previous_chat
)
{
// update reference.
chat
.
player
=
previous_chat
.
player
;
chat
.
player
.
private_object
=
chat
;
continue
;
}
...
...
@@ -209,7 +211,7 @@
if
(
!
no_play
)
{
// start the realtime player.
var
_player
=
new
SrsPlayer
(
"rp_raw_"
+
chat
.
id
,
600
,
300
);
var
_player
=
new
SrsPlayer
(
"rp_raw_"
+
chat
.
id
,
600
,
300
,
chat
);
_player
.
on_player_ready
=
function
()
{
this
.
set_bt
(
0.5
);
this
.
set_fs
(
"screen"
,
100
);
...
...
请
注册
或
登录
后发表评论