Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
李勇
/
McuClient
转到一个项目
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
李勇
8 years ago
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1bf079830041dfba066365e41e56125a62c06693
1bf07983
1 parent
c2c10656
1.修改MS和MCU默认选点的逻辑,如果测速失败的时候,默认选择列表中的第一个地址,不再随机选择
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
24 行增加
和
44 行删除
src/EngineEntrance.js
src/GlobalConfig.js
src/apes/ShareApe.js
src/apes/VideoApe.js
src/EngineEntrance.js
查看文件 @
1bf0798
...
...
@@ -58,7 +58,7 @@ export default class MessageEntrance extends Emiter {
constructor
()
{
super
();
//sdk 信息
GlobalConfig
.
sdkVersion
=
"v1.8
2.11.20170829
"
;
GlobalConfig
.
sdkVersion
=
"v1.8
3.2.20170831
"
;
loger
.
warn
(
"sdkVersion:"
+
GlobalConfig
.
sdkVersion
);
//设置
...
...
@@ -1682,6 +1682,9 @@ export default class MessageEntrance extends Emiter {
if
(
GlobalConfig
.
mcuListFinal
&&
GlobalConfig
.
mcuListFinal
.
length
>
0
)
{
//还未开始选点之前随机选择一个
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
mcuListFinal
.
length
);
if
(
!
GlobalConfig
.
MCUServerIP
){
index
=
0
;
}
GlobalConfig
.
MCUServerIP
=
GlobalConfig
.
mcuListFinal
[
index
].
ip
||
""
;
GlobalConfig
.
MCUServerPort
=
GlobalConfig
.
mcuListFinal
[
index
].
port
||
""
;
}
...
...
@@ -1690,6 +1693,9 @@ export default class MessageEntrance extends Emiter {
if
(
GlobalConfig
.
rsPullListFinal
&&
GlobalConfig
.
rsPullListFinal
.
length
>
0
)
{
//还未开始选点之前随机选择一个
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
rsPullListFinal
.
length
);
if
(
!
GlobalConfig
.
RS_RECORD_PLAY_IP
){
index
=
0
;
}
GlobalConfig
.
RS_RECORD_PLAY_IP
=
GlobalConfig
.
rsPullListFinal
[
index
].
ip
||
""
;
GlobalConfig
.
RS_RECORD_PLAY_PORT
=
GlobalConfig
.
rsPullListFinal
[
index
].
port
||
""
;
}
...
...
@@ -1698,6 +1704,9 @@ export default class MessageEntrance extends Emiter {
if
(
GlobalConfig
.
msListFinal
&&
GlobalConfig
.
msListFinal
.
length
>
0
)
{
//还未开始选点之前随机选择一个
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
msListFinal
.
length
);
if
(
!
GlobalConfig
.
MS_PUBLISH_IP
){
index
=
0
;
}
GlobalConfig
.
MS_PUBLISH_IP
=
GlobalConfig
.
msListFinal
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PUBLISH_PORT
=
GlobalConfig
.
msListFinal
[
index
].
port
||
""
;
}
...
...
@@ -1706,6 +1715,9 @@ export default class MessageEntrance extends Emiter {
if
(
GlobalConfig
.
rtmpPullListFinal
&&
GlobalConfig
.
rtmpPullListFinal
.
length
>
0
)
{
// //还未开始选点之前随机选择一个
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
rtmpPullListFinal
.
length
);
if
(
!
GlobalConfig
.
MS_PLAY_RTMP_IP
){
index
=
0
;
}
GlobalConfig
.
MS_PLAY_RTMP_IP
=
GlobalConfig
.
rtmpPullListFinal
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_RTMP_PORT
=
GlobalConfig
.
rtmpPullListFinal
[
index
].
port
||
""
;
}
else
{
...
...
@@ -1718,6 +1730,9 @@ export default class MessageEntrance extends Emiter {
if
(
GlobalConfig
.
hlsPullListFinal
&&
GlobalConfig
.
hlsPullListFinal
.
length
>
0
)
{
//有单独的hls拉流地址
let
index
=
parseInt
(
Math
.
random
()
*
GlobalConfig
.
hlsPullListFinal
.
length
);
if
(
!
GlobalConfig
.
MS_PLAY_HLS_IP
){
index
=
0
;
}
GlobalConfig
.
MS_PLAY_HLS_IP
=
GlobalConfig
.
hlsPullListFinal
[
index
].
ip
||
""
;
GlobalConfig
.
MS_PLAY_HLS_PORT
=
GlobalConfig
.
hlsPullListFinal
[
index
].
port
||
""
;
}
else
{
...
...
src/GlobalConfig.js
查看文件 @
1bf0798
...
...
@@ -3,7 +3,6 @@
* */
import
Loger
from
'Loger'
;
import
ApeConsts
from
"apes/ApeConsts"
;
let
loger
=
Loger
.
getLoger
(
'GlobalConfig'
);
import
EngineUtils
from
'EngineUtils'
;
...
...
@@ -241,31 +240,6 @@ class GlobalConfig {
static
setMsList
(
_data
)
{
if
(
_data
==
null
)
return
;
this
.
msList
=
_data
;
//MSlist列表中的地址需要进行筛选,目前有的站点播流和推流需要分开
/* if (GlobalConfig.siteId == GlobalConfig.siteId_letv) {
this.msList = [];
this.rtmpPullListFinal = [];
this.hlsListFinal = [];
let len = _data.length;
for (let i = 0; i < len; i++) {
let item = _data[i];
if (item && item.ip) {
if (item.ip.indexOf('pull.') >= 0) {
this.rtmpPullListFinal.push(item);
} else if (item.ip.indexOf('lehls.') >= 0) {
this.hlsListFinal.push(item);
} else {
this.msList.push(item);
}
}
}
loger.log("msListAll->", _data);
loger.log("msList->", this.msList);
loger.log("pullList->", this.rtmpPullListFinal);
loger.log("hlsList->", this.hlsListFinal);
} else {
this.msList = _data;
}*/
}
static
getMsList
()
{
return
this
.
msList
;
...
...
src/apes/ShareApe.js
查看文件 @
1bf0798
...
...
@@ -70,30 +70,29 @@ class ShareApe extends Emiter {
// 屏幕共享开始
this
.
shareScreen
.
on
(
ShareScreen
.
SS_START
,
()
=>
{
//调用startShareScreen 成功
console
.
log
(
'屏幕共享开始开启'
);
loger
.
log
(
'屏幕共享开始开启'
);
this
.
_emit
(
MessageTypes
.
PUBLISH_SCREEN_SHARE_SUCCESS
);
})
// 屏幕共享关闭
this
.
shareScreen
.
on
(
ShareScreen
.
SS_STOP
,
()
=>
{
//调用startShareScreen 失败
console
.
log
(
'屏幕共享开启失败'
);
loger
.
log
(
'屏幕共享开启失败'
);
this
.
_emit
(
MessageTypes
.
PUBLISH_SCREEN_SHARE_FAILE
);
})
// 发生错误 -- 无法连接本地服务
this
.
shareScreen
.
on
(
ShareScreen
.
ERROR
,
()
=>
{
console
.
log
(
'无法连接本地服务-ERROR'
);
loger
.
log
(
'无法连接本地服务-ERROR'
);
/* this.isConnect=false;
this._emit(MessageTypes.PUBLISH_SCREEN_SHARE_DISCONNECT);
this.reConnectTimer=setTimeout(()=>{
this.startConnectSocket();
},1400);*/
})
// 服务关闭 这个监听暂时不需要,使用ERROR监听即可
this
.
shareScreen
.
on
(
ShareScreen
.
CLOSE
,
()
=>
{
console
.
log
(
'屏幕共享服务-CLOSE->重连'
);
loger
.
log
(
'屏幕共享服务-CLOSE->重连'
);
//1秒后继续重连
this
.
isConnect
=
false
;
this
.
_emit
(
MessageTypes
.
PUBLISH_SCREEN_SHARE_DISCONNECT
);
...
...
@@ -104,7 +103,7 @@ class ShareApe extends Emiter {
// 服务开启
this
.
shareScreen
.
on
(
ShareScreen
.
OPEN
,
()
=>
{
console
.
log
(
'屏幕共享服务开启-OPEN'
);
loger
.
log
(
'屏幕共享服务开启-OPEN'
);
this
.
isConnect
=
true
;
this
.
_emit
(
MessageTypes
.
PUBLISH_SCREEN_SHARE_CONNECTED
);
//连接成功
...
...
@@ -130,6 +129,7 @@ class ShareApe extends Emiter {
}
else
{
this
.
fullIpPort
=
GlobalConfig
.
websocketProtocol
+
this
.
ip
;
}
loger
.
log
(
"屏幕共享连接:"
,
GlobalConfig
.
isHttps
,
this
.
port
,
GlobalConfig
.
websocketProtocol
,
this
.
fullIpPort
);
if
(
GlobalConfig
.
isHttps
==
true
)
{
//https的时候替换所有80端口
this
.
fullIpPort
=
GlobalConfig
.
replacePort
(
this
.
fullIpPort
,
":80"
,
""
);
...
...
@@ -151,18 +151,9 @@ class ShareApe extends Emiter {
if
(
_result
)
{
this
.
publishUrl
=
_result
.
publishUrl
||
''
;
this
.
streamId
=
_result
.
streamId
||
''
;
/* this.port=_result.port;
if(!this.port){
if(GlobalConfig.isHttps){
this.port= this.defaultWssPort;
}else {
this.port= this.defaultWsPort;
}
}
this.ip=_result.ip||this.defaultIp;*/
}
clearTimeout
(
this
.
reConnectTimer
);
if
(
!
this
.
isConnect
)
{
//还没有连接,需要先连接
this
.
startConnectSocket
()
...
...
src/apes/VideoApe.js
查看文件 @
1bf0798
...
...
@@ -449,7 +449,7 @@ class VideoApe extends Ape {
adapterPdu
.
type
=
pdu
.
RCPDU_REG_ADAPTER
;
adapterPdu
.
item
.
push
(
adapterItemPdu
);
loger
.
log
(
"发送更新VIDEO
.itemIdx=
"
+
tableItemPdu
.
itemIdx
);
loger
.
log
(
"发送更新VIDEO
"
+
tableItemPdu
.
itemIdx
);
this
.
sendUniform
(
adapterPdu
,
true
);
}
...
...
请
注册
或
登录
后发表评论