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
8eec9497
Commit
8eec9497
authored
May 09, 2024
by
qlintonger xeno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尝试添加截图标注+12
parent
7958e9a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
anyremote/agora/index.js
+6
-6
No files found.
anyremote/agora/index.js
View file @
8eec9497
...
...
@@ -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
)
{
...
...
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