Toggle navigation
Toggle navigation
此项目
正在载入...
Sign in
付智勇
/
koa2_Sequelize_project
转到一个项目
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
付智勇
2017-11-15 08:35:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
df3c01164d4d2704ee2f9f7131838294da427dd7
df3c0116
1 parent
2a1f6481
ws 重新开始链接添加
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
31 行增加
和
12 行删除
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
查看文件 @
df3c011
...
...
@@ -5,9 +5,8 @@ const uuid = require('../../UuidUtil');
const
moment
=
require
(
'moment'
)
const
WebSocket
=
require
(
'ws'
);
const
ws
=
new
WebSocket
(
'ws://115.29.208.81:5000'
,
{
perMessageDeflate
:
false
});
var
ws
=
new
WebSocket
(
'ws://123.56.204.132:5000'
,
{
});
function
shell
(){
...
...
@@ -27,15 +26,36 @@ shell.prototype.Recording =async(appId,uid,channel,channelKey,body)=>{
"channel_key"
:
body
.
channelKey
,
"channel"
:
body
.
channel
}
if
(
body
.
status
==
1
){
console
.
log
(
'START'
,
json
)
ws
.
send
(
JSON
.
stringify
(
json
))
}
else
if
(
body
.
status
==
2
){
json
.
type
=
'STOP'
console
.
log
(
'STOP'
,
json
)
ws
.
send
(
JSON
.
stringify
(
json
))
if
(
ws
.
readyState
==
3
){
ws
=
new
WebSocket
(
'ws://123.56.204.132:5000'
,
{
});
if
(
body
.
status
==
1
){
console
.
log
(
'START'
,
json
)
setTimeout
(
function
()
{
console
.
log
(
ws
.
readyState
)
ws
.
send
(
JSON
.
stringify
(
json
))
},
20
);
}
else
if
(
body
.
status
==
2
){
json
.
type
=
'STOP'
setTimeout
(
function
()
{
console
.
log
(
ws
.
readyState
)
ws
.
send
(
JSON
.
stringify
(
json
))
},
20
);
}
}
else
{
if
(
body
.
status
==
1
){
console
.
log
(
'START'
,
json
)
ws
.
send
(
JSON
.
stringify
(
json
))
}
else
if
(
body
.
status
==
2
){
json
.
type
=
'STOP'
ws
.
on
(
'open'
,
function
open
()
{
ws
.
send
(
JSON
.
stringify
(
json
))
});
}
}
ws
.
on
(
'close'
,
function
close
()
{
console
.
log
(
'disconnected'
);
});
// if(channelInfo){
// if(body.status == 2){
// var channelInfo = await recordStatus.update({status:3},{where:{channel:channel}});
...
...
@@ -61,7 +81,6 @@ shell.prototype.Recording =async(appId,uid,channel,channelKey,body)=>{
// await callfile.exec(shell)
return
true
}
catch
(
error
)
{
throw
error
}
...
...
请
注册
或
登录
后发表评论