Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
standalone-anyremote
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
qlintonger xeno
standalone-anyremote
Commits
a553b310
Commit
a553b310
authored
May 07, 2024
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
通话数据问题准备修复+6
parent
5dd5a58b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
8 deletions
+39
-8
anyremote/agora/index.js
+9
-1
anyremote/agoraHandle.js
+1
-1
anyremote/index.js
+16
-6
anyremote/plugin.js
+7
-0
src/main.ts
+6
-0
No files found.
anyremote/agora/index.js
View file @
a553b310
...
@@ -20,13 +20,15 @@ export class Agora {
...
@@ -20,13 +20,15 @@ export class Agora {
}
}
AgoraClient
=
null
AgoraClient
=
null
localAp
=
null
localAp
=
null
app
=
null
;
constructor
(
options
)
{
constructor
(
options
,
app
)
{
this
.
notUploadLog
=
options
.
notUploadLog
this
.
notUploadLog
=
options
.
notUploadLog
this
.
logLevel
=
options
.
logLevel
this
.
logLevel
=
options
.
logLevel
this
.
codec
=
options
.
codec
this
.
codec
=
options
.
codec
this
.
mode
=
options
.
mode
this
.
mode
=
options
.
mode
this
.
appId
=
options
.
appId
this
.
appId
=
options
.
appId
this
.
app
=
app
;
this
.
localPlayerId
=
options
.
localPlayerId
this
.
localPlayerId
=
options
.
localPlayerId
this
.
remotePlayerPrefix
=
options
.
remotePlayerPrefix
this
.
remotePlayerPrefix
=
options
.
remotePlayerPrefix
this
.
localAp
=
options
.
localAp
this
.
localAp
=
options
.
localAp
...
@@ -224,12 +226,18 @@ export class Agora {
...
@@ -224,12 +226,18 @@ export class Agora {
const
uidS
=
user
.
uid
.
toString
()
const
uidS
=
user
.
uid
.
toString
()
const
targetUser
=
userStates
.
value
.
onlineContacts
.
find
(
a
=>
a
.
fromID
.
toString
()
===
uidS
);
const
targetUser
=
userStates
.
value
.
onlineContacts
.
find
(
a
=>
a
.
fromID
.
toString
()
===
uidS
);
console
.
log
(
'在线用户加入了频道'
,
targetUser
)
console
.
log
(
'在线用户加入了频道'
,
targetUser
)
if
(
typeof
this
.
app
.
infoCB
===
'function'
)
{
this
.
app
.
infoCB
(
`
${
targetUser
.
fromName
}
加入了会议`
)
}
targetUser
.
callState
=
'calling'
targetUser
.
callState
=
'calling'
})
})
this
.
AgoraClient
.
on
(
'user-left'
,
(
user
)
=>
{
this
.
AgoraClient
.
on
(
'user-left'
,
(
user
)
=>
{
const
uidS
=
user
.
uid
.
toString
()
const
uidS
=
user
.
uid
.
toString
()
const
targetUser
=
userStates
.
value
.
onlineContacts
.
find
(
a
=>
a
.
fromID
.
toString
()
===
uidS
);
const
targetUser
=
userStates
.
value
.
onlineContacts
.
find
(
a
=>
a
.
fromID
.
toString
()
===
uidS
);
console
.
log
(
'在线用户离开了频道'
,
targetUser
)
console
.
log
(
'在线用户离开了频道'
,
targetUser
)
if
(
typeof
this
.
app
.
infoCB
===
'function'
)
{
this
.
app
.
infoCB
(
`
${
targetUser
.
fromName
}
离开了会议`
)
}
})
})
this
.
AgoraClient
.
on
(
'user-published'
,
(
user
,
mediaType
)
=>
{
this
.
AgoraClient
.
on
(
'user-published'
,
(
user
,
mediaType
)
=>
{
console
.
log
(
'检测到远程用户发布媒体'
,
user
,
mediaType
);
console
.
log
(
'检测到远程用户发布媒体'
,
user
,
mediaType
);
...
...
anyremote/agoraHandle.js
View file @
a553b310
...
@@ -38,7 +38,7 @@ export class AgoraHandle {
...
@@ -38,7 +38,7 @@ export class AgoraHandle {
})
{
})
{
this
.
recordConfig
=
recordConfig
this
.
recordConfig
=
recordConfig
this
.
agoraOptions
=
options
;
this
.
agoraOptions
=
options
;
this
.
agoraApp
=
new
Agora
(
options
)
this
.
agoraApp
=
new
Agora
(
options
,
this
.
AnyRemote
)
await
this
.
agoraApp
.
preload
();
await
this
.
agoraApp
.
preload
();
}
}
...
...
anyremote/index.js
View file @
a553b310
import
{
WSInt
}
from
"./ws"
;
import
{
WSInt
}
from
'./ws'
import
{
AgoraHandle
}
from
"./agoraHandle"
;
import
{
AgoraHandle
}
from
'./agoraHandle'
import
{
userStates
}
from
"./states/wsStates"
;
import
{
userStates
}
from
'./states/wsStates'
export
class
AnyRemote
{
export
class
AnyRemote
{
wsInt
=
null
wsInt
=
null
agora
=
null
agora
=
null
infoCB
=
null
warningCB
=
null
errorCB
=
null
configureWS
(
url
,
tabVisibleCB
=
()
=>
true
,
connectionLostCB
=
()
=>
true
,
wsSocketChannelName
=
''
)
{
configureWS
(
url
,
tabVisibleCB
=
()
=>
true
,
connectionLostCB
=
()
=>
true
,
wsSocketChannelName
=
''
)
{
this
.
wsInt
=
new
WSInt
(
url
,
this
.
onMessageGeneral
.
bind
(
this
),
tabVisibleCB
,
connectionLostCB
,
wsSocketChannelName
)
this
.
wsInt
=
new
WSInt
(
url
,
this
.
onMessageGeneral
.
bind
(
this
),
tabVisibleCB
,
connectionLostCB
,
wsSocketChannelName
)
this
.
wsInt
.
connect
()
this
.
wsInt
.
connect
()
}
}
setUpNotificationCB
(
infoCB
,
warningCB
,
errorCB
)
{
this
.
infoCB
=
infoCB
this
.
warningCB
=
warningCB
this
.
errorCB
=
errorCB
}
sendWSFromCall
(
toID
,
msgType
,
msgData
,
channelID
)
{
sendWSFromCall
(
toID
,
msgType
,
msgData
,
channelID
)
{
this
.
wsInt
.
send
({
this
.
wsInt
.
send
({
fromID
:
userStates
.
value
.
currentUserId
,
fromID
:
userStates
.
value
.
currentUserId
,
...
@@ -44,12 +53,12 @@ export class AnyRemote {
...
@@ -44,12 +53,12 @@ export class AnyRemote {
recordStartUrl
:
'https://video.anyremote.cn:8081/recorder/v1/start'
,
recordStartUrl
:
'https://video.anyremote.cn:8081/recorder/v1/start'
,
recordStopUrl
:
'https://video.anyremote.cn:8081/recorder/v1/stop'
recordStopUrl
:
'https://video.anyremote.cn:8081/recorder/v1/stop'
})
{
})
{
this
.
agora
=
new
AgoraHandle
(
this
)
;
this
.
agora
=
new
AgoraHandle
(
this
)
await
this
.
agora
.
configure
(
options
,
recordConfig
)
await
this
.
agora
.
configure
(
options
,
recordConfig
)
}
}
onMessageGeneral
(
data
)
{
onMessageGeneral
(
data
)
{
let
{
msgType
}
=
data
let
{
msgType
}
=
data
if
(
msgType
===
'ForceUpdateOnlineUsers'
)
{
if
(
msgType
===
'ForceUpdateOnlineUsers'
)
{
console
.
log
(
'需要主动拉取在线用户列表'
,
data
)
console
.
log
(
'需要主动拉取在线用户列表'
,
data
)
this
.
sendWSFromCall
(
'0'
,
'GetCompanyUserList'
)
this
.
sendWSFromCall
(
'0'
,
'GetCompanyUserList'
)
...
@@ -65,5 +74,5 @@ export class AnyRemote {
...
@@ -65,5 +74,5 @@ export class AnyRemote {
}
}
export
function
useAnyR
()
{
export
function
useAnyR
()
{
return
inject
(
"AnyR"
)
return
inject
(
'AnyR'
)
}
}
\ No newline at end of file
anyremote/plugin.js
View file @
a553b310
...
@@ -5,6 +5,13 @@ export default {
...
@@ -5,6 +5,13 @@ export default {
install
(
app
,
options
)
{
install
(
app
,
options
)
{
const
anyRemote
=
new
AnyRemote
()
const
anyRemote
=
new
AnyRemote
()
const
{
wsOpts
,
agoraConfig
,
recordConfig
,
wsOpen
}
=
options
const
{
wsOpts
,
agoraConfig
,
recordConfig
,
wsOpen
}
=
options
if
(
options
.
notice
)
{
anyRemote
.
setUpNotificationCB
(
options
.
notice
.
info
,
options
.
notice
.
warning
,
options
.
notice
.
error
)
}
watch
(()
=>
wsOpen
.
value
,
function
(
value
)
{
watch
(()
=>
wsOpen
.
value
,
function
(
value
)
{
console
.
log
(
'value here'
,
value
)
console
.
log
(
'value here'
,
value
)
if
(
value
)
{
if
(
value
)
{
...
...
src/main.ts
View file @
a553b310
...
@@ -7,6 +7,7 @@ import { wsShouldOpen } from 'AnyR/states/coreState.js'
...
@@ -7,6 +7,7 @@ import { wsShouldOpen } from 'AnyR/states/coreState.js'
import
AnyRemotePlugin
from
'AnyR/plugin'
import
AnyRemotePlugin
from
'AnyR/plugin'
import
{
getBrowserDeviceId
}
from
'AnyR/utils/makeSID'
import
{
getBrowserDeviceId
}
from
'AnyR/utils/makeSID'
import
useStore
from
'@/store/user/index'
import
useStore
from
'@/store/user/index'
import
{
Message
}
from
'@arco-design/web-vue'
// import directive from './directive';
// import directive from './directive';
...
@@ -59,6 +60,11 @@ app.use(AnyRemotePlugin, {
...
@@ -59,6 +60,11 @@ app.use(AnyRemotePlugin, {
fileDomain
:
'https://video.anyremote.cn:444'
,
fileDomain
:
'https://video.anyremote.cn:444'
,
recordStartUrl
:
'https://ifar.test.com:3001/recorder/v1/start'
,
recordStartUrl
:
'https://ifar.test.com:3001/recorder/v1/start'
,
recordStopUrl
:
'https://ifar.test.com:3001/recorder/v1/stop'
recordStopUrl
:
'https://ifar.test.com:3001/recorder/v1/stop'
},
notice
:
{
info
:
Message
.
info
,
warning
:
Message
.
warning
,
error
:
Message
.
error
}
}
})
})
// app.use(directive);
// app.use(directive);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment