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
df073031
Commit
df073031
authored
May 09, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 122.112.146.86:qlintonger/standalone-anyremote
parents
238fbc45
8eec9497
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
34 deletions
+39
-34
anyremote/agora/index.js
+10
-6
src/views/remote/videoCall/videoTools.vue
+29
-28
No files found.
anyremote/agora/index.js
View file @
df073031
...
...
@@ -41,7 +41,7 @@ export class Agora {
console
.
log
(
'开始订阅远端用户'
,
user
,
mediaType
,
foundUser
);
const
remoteUserIdInThisUser
=
this
.
remotePlayerPrefix
+
user
.
uid
;
if
(
mediaType
===
'video'
)
{
user
?.
videoTrack
?.
play
(
remoteUserIdInThisUser
);
user
?.
videoTrack
?.
play
(
remoteUserIdInThisUser
,
{
fit
:
'contain'
,
mirror
:
'false'
}
);
}
if
(
mediaType
===
'audio'
)
{
user
?.
audioTrack
?.
play
();
...
...
@@ -93,7 +93,7 @@ export class Agora {
if
(
canProceed
)
{
console
.
log
(
'创建音视频轨道成功!'
,
this
.
data
.
localTracks
)
if
(
this
.
data
.
localTracks
.
videoTrack
)
{
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'false'
})
}
console
.
log
(
'开始播放本地媒体'
)
await
this
.
AgoraClient
.
publish
(
Object
.
values
(
this
.
data
.
localTracks
));
...
...
@@ -119,7 +119,7 @@ export class Agora {
if
(
v
)
{
try
{
const
screenAudioTrack
=
await
AgoraRTC
.
createScreenVideoTrack
({},
'disable'
);
screenAudioTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
});
screenAudioTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'false'
});
await
this
.
AgoraClient
.
publish
(
screenAudioTrack
);
webrtcStates
.
value
.
currentUsingCameraName
=
''
;
screenAudioTrack
.
on
(
'track-ended'
,
async
()
=>
{
...
...
@@ -141,7 +141,7 @@ export class Agora {
}
else
{
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'false'
})
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
}
}
...
...
@@ -158,7 +158,7 @@ export class Agora {
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'false'
})
}
}
...
...
@@ -171,7 +171,7 @@ export class Agora {
async
forceReplay
(
id
,
vid
)
{
const
foundUser
=
this
.
AgoraClient
.
remoteUsers
.
find
(
i
=>
i
.
uid
.
toString
()
===
id
.
toString
());
console
.
log
(
'强制播放用户'
,
foundUser
)
await
foundUser
?.
videoTrack
?.
play
(
vid
);
await
foundUser
?.
videoTrack
?.
play
(
vid
,
{
fit
:
'contain'
,
mirror
:
'false'
}
);
}
async
switchDeviceForCamera
(
id
)
{
...
...
@@ -226,6 +226,9 @@ export class Agora {
const
uidS
=
user
.
uid
.
toString
()
const
targetUser
=
userStates
.
value
.
onlineContacts
.
find
(
a
=>
a
.
fromID
.
toString
()
===
uidS
);
console
.
log
(
'在线用户加入了频道'
,
targetUser
)
if
(
!
chatChannelState
.
value
.
currentChatters
.
includes
(
targetUser
.
fromID
))
{
chatChannelState
.
value
.
currentChatters
.
push
(
targetUser
.
fromID
)
}
if
(
typeof
this
.
app
.
infoCB
===
'function'
)
{
this
.
app
.
infoCB
(
`
${
targetUser
.
fromName
}
加入了会议`
)
}
...
...
@@ -238,6 +241,7 @@ export class Agora {
if
(
typeof
this
.
app
.
infoCB
===
'function'
)
{
this
.
app
.
infoCB
(
`
${
targetUser
.
fromName
}
离开了会议`
)
}
chatChannelState
.
value
.
currentChatters
=
chatChannelState
.
value
.
currentChatters
.
filter
(
a
=>
a
!==
targetUser
.
fromID
);
})
this
.
AgoraClient
.
on
(
'user-published'
,
(
user
,
mediaType
)
=>
{
console
.
log
(
'检测到远程用户发布媒体'
,
user
,
mediaType
);
...
...
src/views/remote/videoCall/videoTools.vue
View file @
df073031
...
...
@@ -133,42 +133,43 @@ function initialPaintDone(blob: Blob) {
}
function
paintSaved
(
blob
:
any
)
{
AnyR
?.
agora
.
archiveMark
(
blob
,
'temp.png'
)
const
file
=
new
File
([
blob
],
'temp.png'
)
const
params
=
{
apiPwd
:
'Ifar$2_0160_525_Mocp'
,
file
,
requestFrom
:
6
,
uid
:
4
}
alova
// @ts-ignore
.
Post
<
any
>
(
'/admin/uploadMuFile'
,
params
,
{
meta
:
{
isUpload
:
true
}
})
.
then
((
res
)
=>
{
if
(
res
.
code
==
200
)
{
AnyR
?.
agora
.
archiveMark
({
fileUrl
:
res
.
data
.
url
,
fileName
:
res
.
data
.
name
,
fileSize
:
Number
.
parseInt
(
res
.
data
.
size
),
fileType
:
'image'
})
}
})
}
async
function
beforeEndMarkHandle
()
{
if
(
isScreenShotByCurrentUser
.
value
)
{
return
new
Promise
(
function
(
resolve
)
{
Modal
.
warning
({
title
:
'你是截图发起者,退出后将会要求其他用户一同退出,确认?'
,
content
:
()
=>
h
(
'div'
,
{
class
:
'flex w-full items-center justify-center'
},
[
h
(
Button
,
{
size
:
'small'
,
type
:
'primary'
,
status
:
'warning'
,
onClick
:
()
=>
resolve
(
true
)
title
:
'退出确认'
,
content
:
"你是截图发起者,退出后将会要求其他用户一同退出,确认?"
,
okText
:
"确认"
,
cancelText
:
"取消"
,
hideCancel
:
false
,
onOk
()
{
resolve
(
true
)
},
'确定'
),
h
(
Button
,
{
size
:
'small'
,
type
:
'primary'
,
onClick
:
()
=>
resolve
(
false
)
onCancel
()
{
resolve
(
false
)
},
'取消'
)
]
)
})
})
}
...
...
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