Skip to content

Commit 43dc87f

Browse files
committed
fix av build issue
1 parent 6e9ae97 commit 43dc87f

9 files changed

+209
-2
lines changed

src/wfc/av/engine/rcEndReason.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default class RcEndReason {
2+
static REASON_BUSY = 1;
3+
static REASON_TIME_OUT= 2;
4+
static REASON_HANGUP= 3;
5+
static REASON_REJECT= 4;
6+
}

src/wfc/av/engine/rcState.js

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
export default class RCState {
2+
/**
3+
* 远程控制状态,单人视频通话时有效
4+
* 0,idle
5+
* 1,outgoing inviting,发送远程协助邀请
6+
* 2, incoming inviting,收到远程协助邀请
7+
* 3, outgoing request,发出远程控制请求
8+
* 4, incoming request,收到远程控制请求
9+
* 5, connected,远程协助/远程控制中
10+
*/
11+
static STATUS_IDLE = 0;
12+
static STATUS_OUTGOING_INVITE = 1;
13+
static STATUS_INCOMING_INVITE = 2;
14+
static STATUS_OUTGOING_REQUEST = 3;
15+
static STATUS_INCOMING_REQUEST = 4;
16+
static STATUS_CONNECTED = 5;
17+
18+
}

src/wfc/av/internal/engine-conference.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/wfc/av/messages/callStartMessageContent.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export default class CallStartMessageContent extends MessageContent {
5353
ts: this.targetIds,
5454
t: this.targetIds[0],
5555
p: this.pin,
56-
ty: this.sdkType
56+
ty: this.sdkType,
5757
};
5858
payload.binaryContent = wfc.utf8_to_b64(JSON.stringify(obj));
5959

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2020 WildFireChat. All rights reserved.
3+
*/
4+
5+
import MessageContent from '../../messages/messageContent';
6+
import MessageContentType from '../../messages/messageContentType';
7+
import wfc from "../../client/wfc"
8+
9+
export default class RcAcceptInviteMessageContent extends MessageContent {
10+
callId;
11+
12+
constructor(callId) {
13+
super(MessageContentType.VOIP_REMOTE_CONTROL_ACCEPT_INVITE, 0, []);
14+
this.callId = callId;
15+
}
16+
17+
digest() {
18+
return ''
19+
}
20+
21+
encode() {
22+
let payload = super.encode();
23+
payload.content = this.callId;
24+
return payload;
25+
}
26+
27+
decode(payload) {
28+
super.decode(payload);
29+
this.callId = payload.content;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2020 WildFireChat. All rights reserved.
3+
*/
4+
5+
import MessageContent from '../../messages/messageContent';
6+
import MessageContentType from '../../messages/messageContentType';
7+
import wfc from "../../client/wfc"
8+
9+
export default class RcAcceptInviteMessageContent extends MessageContent {
10+
callId;
11+
12+
constructor(callId) {
13+
super(MessageContentType.VOIP_REMOTE_CONTROL_ACCEPT_REQUEST, 0, []);
14+
this.callId = callId;
15+
}
16+
17+
digest() {
18+
return ''
19+
}
20+
21+
encode() {
22+
let payload = super.encode();
23+
payload.content = this.callId;
24+
return payload;
25+
}
26+
27+
decode(payload) {
28+
super.decode(payload);
29+
this.callId = payload.content;
30+
}
31+
}
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2020 WildFireChat. All rights reserved.
3+
*/
4+
5+
import MessageContent from '../../messages/messageContent';
6+
import MessageContentType from '../../messages/messageContentType';
7+
import wfc from "../../client/wfc"
8+
import {_patchToJavaLong, stringValue} from "../../util/longUtil";
9+
10+
export default class RcEndMessageContent extends MessageContent {
11+
callId;
12+
reason; // 1, reject, 2, hangup, 3, timeout, 4, busy
13+
14+
constructor(callId, reason) {
15+
super(MessageContentType.VOIP_REMOTE_CONTROL_END, 0, []);
16+
this.callId = callId;
17+
this.reason = reason;
18+
}
19+
20+
digest() {
21+
return ''
22+
}
23+
24+
encode() {
25+
let payload = super.encode();
26+
payload.content = this.callId;
27+
let obj = {
28+
r: this.reason,
29+
};
30+
payload.binaryContent = wfc.utf8_to_b64(JSON.stringify(obj));
31+
return payload;
32+
}
33+
34+
decode(payload) {
35+
super.decode(payload);
36+
this.callId = payload.content;
37+
if (payload.binaryContent) {
38+
let json = wfc.b64_to_utf8(payload.binaryContent);
39+
let obj = JSON.parse(json);
40+
this.reason = obj.r
41+
}
42+
}
43+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/*
2+
* Copyright (c) 2020 WildFireChat. All rights reserved.
3+
*/
4+
5+
import MessageContent from '../../messages/messageContent';
6+
import MessageContentType from '../../messages/messageContentType';
7+
import wfc from "../../client/wfc"
8+
9+
export default class RCInviteMessageContent extends MessageContent {
10+
callId;
11+
12+
constructor(callId) {
13+
super(MessageContentType.VOIP_REMOTE_CONTROL_INVITE, 0, []);
14+
this.callId = callId;
15+
}
16+
17+
digest() {
18+
return ''
19+
}
20+
21+
encode() {
22+
let payload = super.encode();
23+
payload.content = this.callId;
24+
return payload;
25+
}
26+
27+
decode(payload) {
28+
super.decode(payload);
29+
this.callId = payload.content;
30+
}
31+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/*
2+
* Copyright (c) 2020 WildFireChat. All rights reserved.
3+
*/
4+
5+
import MessageContent from '../../messages/messageContent';
6+
import MessageContentType from '../../messages/messageContentType';
7+
import wfc from "../../client/wfc"
8+
9+
export default class RcRequestMessageContent extends MessageContent {
10+
callId;
11+
pin
12+
targetIds = [];
13+
audioOnly = false;
14+
15+
constructor(callId, pin) {
16+
super(MessageContentType.VOIP_REMOTE_CONTROL_REQUEST, 0, []);
17+
this.callId = callId;
18+
this.pin = pin;
19+
}
20+
21+
digest() {
22+
return ''
23+
}
24+
25+
encode() {
26+
let payload = super.encode();
27+
payload.content = this.callId;
28+
let obj = {
29+
a: this.audioOnly ? 1 : 0,
30+
ts: this.targetIds,
31+
p: this.pin,
32+
}
33+
payload.binaryContent = wfc.utf8_to_b64(JSON.stringify(obj));
34+
return payload;
35+
}
36+
37+
decode(payload) {
38+
super.decode(payload);
39+
this.callId = payload.content;
40+
let json = wfc.b64_to_utf8(payload.binaryContent);
41+
let obj = JSON.parse(json);
42+
43+
this.audioOnly = (obj.a === 1);
44+
this.targetIds = obj.ts
45+
this.pin = obj.p;
46+
}
47+
}

0 commit comments

Comments
 (0)