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
付智勇
7 years ago
3
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2a1f6481ccfbc7b3b653d403ac14a7221ee76584
2a1f6481
1 parent
e846f00a
master
...
20171113
nows
revert-2a1f6481
ws
隐藏空白字符变更
内嵌
并排对比
正在显示
1 个修改的文件
包含
37 行增加
和
16 行删除
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
util/Agora_Recording_SDK_for_Linux_FULL/samples/shellUtil.js
查看文件 @
2a1f648
...
...
@@ -3,7 +3,11 @@ const recordInfo =require( '../../../model/RecordInfoModel');
const
recordStatus
=
require
(
'../../../model/RecordStatusModel'
)
const
uuid
=
require
(
'../../UuidUtil'
);
const
moment
=
require
(
'moment'
)
const
WebSocket
=
require
(
'ws'
);
const
ws
=
new
WebSocket
(
'ws://115.29.208.81:5000'
,
{
perMessageDeflate
:
false
});
function
shell
(){
...
...
@@ -11,24 +15,40 @@ function shell(){
shell
.
prototype
.
Recording
=
async
(
appId
,
uid
,
channel
,
channelKey
,
body
)
=>
{
// return new Promise((resolve, reject) =>{
try
{
body
.
id
=
uuid
.
db32
()
body
.
createTime
=
new
Date
().
getTime
();
var
channelInfo
=
await
recordStatus
.
findOne
({
where
:{
channel
:
channel
}});
let
r
=
await
recordInfo
.
create
(
body
);
if
(
channelInfo
){
if
(
body
.
status
==
2
){
var
channelInfo
=
await
recordStatus
.
update
({
status
:
3
},{
where
:{
channel
:
channel
}});
}
else
if
(
channelInfo
==
3
){
var
channelInfo
=
await
recordStatus
.
update
({
status
:
1
},{
where
:{
channel
:
channel
}});
}
else
{
throw
false
;
}
}
else
if
(
body
.
status
==
0
){
throw
false
;
}
else
{
var
channelInfo
=
await
recordStatus
.
create
({
id
:
uuid
.
db32
(),
channel
:
channel
,
status
:
body
.
status
});
// var channelInfo = await recordStatus.findOne({where:{channel:channel}});
//let r = await recordInfo.create(body);
var
json
=
{
"type"
:
"START"
,
"appid"
:
body
.
appId
,
"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(channelInfo){
// if(body.status == 2){
// var channelInfo = await recordStatus.update({status:3},{where:{channel:channel}});
// }else if(channelInfo == 3){
// var channelInfo = await recordStatus.update({status:1},{where:{channel:channel}});
// }else {
// throw false ;
// }
// }else if(body.status == 0){
// throw false ;
// }else{
// var channelInfo = await recordStatus.create({id:uuid.db32(),channel:channel,status:body.status});
// }
let
shell
=
`
cd
/
netWorkSchool
/
Agora_Recording_SDK_for_Linux_FULL
/
samples
/
&&
.
/
Recorder_local
`
+
`
--
appId
`
+
appId
+
//` --uid ` +uid +
...
...
@@ -36,11 +56,12 @@ shell.prototype.Recording =async(appId,uid,channel,channelKey,body)=>{
//`--recordFileRootDir /netWorkSchool/Agora_Recording_SDK_for_Linux_FULL/samples ` +
//` --channelKey ` + channelKey +
" --appliteDir \`pwd\`/../bin"
;
console
.
log
(
shell
)
//
console.log(shell)
await
callfile
.
exec
(
shell
)
//
await callfile.exec(shell)
return
true
}
catch
(
error
)
{
throw
error
}
...
...
蒋利兵
@jlb
7 years ago
mentioned in commit
c4ae7b69
蒋利兵
@jlb
7 years ago
mentioned in merge request
!1
蒋利兵
@jlb
7 years ago
mentioned in commit
39ee3474
请
注册
或
登录
后发表评论