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
ce9a1d22
Commit
ce9a1d22
authored
May 11, 2024
by
pangchong
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 122.112.146.86:qlintonger/standalone-anyremote
parents
9250279e
daf9d15b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
anyremote/agora/index.js
+4
-4
src/views/remote/videoCall/videoItem.vue
+5
-4
No files found.
anyremote/agora/index.js
View file @
ce9a1d22
...
@@ -93,7 +93,7 @@ export class Agora {
...
@@ -93,7 +93,7 @@ export class Agora {
if
(
canProceed
)
{
if
(
canProceed
)
{
console
.
log
(
'创建音视频轨道成功!'
,
this
.
data
.
localTracks
)
console
.
log
(
'创建音视频轨道成功!'
,
this
.
data
.
localTracks
)
if
(
this
.
data
.
localTracks
.
videoTrack
)
{
if
(
this
.
data
.
localTracks
.
videoTrack
)
{
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
fals
e'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
tru
e'
})
}
}
console
.
log
(
'开始播放本地媒体'
)
console
.
log
(
'开始播放本地媒体'
)
await
this
.
AgoraClient
.
publish
(
Object
.
values
(
this
.
data
.
localTracks
));
await
this
.
AgoraClient
.
publish
(
Object
.
values
(
this
.
data
.
localTracks
));
...
@@ -119,7 +119,7 @@ export class Agora {
...
@@ -119,7 +119,7 @@ export class Agora {
if
(
v
)
{
if
(
v
)
{
try
{
try
{
const
screenAudioTrack
=
await
AgoraRTC
.
createScreenVideoTrack
({},
'disable'
);
const
screenAudioTrack
=
await
AgoraRTC
.
createScreenVideoTrack
({},
'disable'
);
screenAudioTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
fals
e'
});
screenAudioTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
tru
e'
});
await
this
.
AgoraClient
.
publish
(
screenAudioTrack
);
await
this
.
AgoraClient
.
publish
(
screenAudioTrack
);
webrtcStates
.
value
.
currentUsingCameraName
=
''
;
webrtcStates
.
value
.
currentUsingCameraName
=
''
;
screenAudioTrack
.
on
(
'track-ended'
,
async
()
=>
{
screenAudioTrack
.
on
(
'track-ended'
,
async
()
=>
{
...
@@ -141,7 +141,7 @@ export class Agora {
...
@@ -141,7 +141,7 @@ export class Agora {
}
else
{
}
else
{
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
fals
e'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
tru
e'
})
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
}
}
}
}
...
@@ -158,7 +158,7 @@ export class Agora {
...
@@ -158,7 +158,7 @@ export class Agora {
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
this
.
data
.
localTracks
.
videoTrack
=
await
AgoraRTC
.
createCameraVideoTrack
();
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
webrtcStates
.
value
.
currentUsingCameraName
=
this
.
data
.
localTracks
.
videoTrack
.
_deviceName
;
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
await
this
.
AgoraClient
.
publish
(
this
.
data
.
localTracks
.
videoTrack
);
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
fals
e'
})
this
.
data
.
localTracks
.
videoTrack
.
play
(
this
.
localPlayerId
,
{
fit
:
'contain'
,
mirror
:
'
tru
e'
})
}
}
}
}
...
...
src/views/remote/videoCall/videoItem.vue
View file @
ce9a1d22
<
template
>
<
template
>
<div
:id=
"ps.isSelf ? 'LocalVideo' : `RemoteVideo$
{ps.id}`" class="relative h-full video-cont bg-fill-bg1" ref="remoteVideoRef">
<div
:id=
"ps.isSelf ? 'LocalVideo' : `RemoteVideo$
{ps.id}`"
data-self="vc"
class="relative h-full video-cont bg-fill-bg1" ref="remoteVideoRef">
<template
v-if=
"isVideoVisible"
>
<template
v-if=
"isVideoVisible"
>
<div
class=
"absolute flex justify-between items-center p-1 top-0 left-0 w-full z-10"
>
<div
class=
"absolute flex justify-between items-center p-1 top-0 left-0 w-full z-10"
>
<div
class=
"text-xs px-2 rounded-sm leading-5 bg-primary-disable text-primary"
v-if=
"userDataForThis.userCallGroup == 1"
>
<div
class=
"text-xs px-2 rounded-sm leading-5 bg-primary-disable text-primary"
v-if=
"userDataForThis.userCallGroup == 1"
>
...
@@ -80,9 +80,9 @@ const remoteVideoRef = ref()
...
@@ -80,9 +80,9 @@ const remoteVideoRef = ref()
const
isVideoVisible
=
ref
(
false
)
const
isVideoVisible
=
ref
(
false
)
const
checkVideoExists
=
()
=>
{
const
checkVideoExists
=
()
=>
{
const
video
=
remoteVideoRef
.
value
.
querySelector
(
'video'
)
const
video
=
remoteVideoRef
.
value
.
querySelector
(
'video'
)
isVideoVisible
.
value
=
video
?
true
:
false
isVideoVisible
.
value
=
!!
video
}
}
const
observer
=
new
MutationObserver
(
checkVideoExists
)
let
observer
:
any
=
new
MutationObserver
(
checkVideoExists
)
onMounted
(
function
()
{
onMounted
(
function
()
{
if
(
!
ps
.
isSelf
)
{
if
(
!
ps
.
isSelf
)
{
AnyR
?.
agora
.
forceReplay
(
ps
.
id
)
AnyR
?.
agora
.
forceReplay
(
ps
.
id
)
...
@@ -97,10 +97,11 @@ onUpdated(function () {
...
@@ -97,10 +97,11 @@ onUpdated(function () {
})
})
onUnmounted
(()
=>
{
onUnmounted
(()
=>
{
observer
.
disconnect
()
// 停止监听
observer
.
disconnect
()
// 停止监听
observer
=
null
;
})
})
</
script
>
</
script
>
<
style
lang=
"less"
scoped
>
<
style
lang=
"less"
scoped
>
:deep
(
.video-cont
video
)
{
:deep
(
[
data-self
=
'vc'
]
video
),
:deep
(
.agora_video_player
)
{
transform
:
none
!important
;
transform
:
none
!important
;
}
}
</
style
>
</
style
>
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