Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
SpeakEzy_Frontend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Thisara Kavinda
SpeakEzy_Frontend
Commits
cb91def6
Commit
cb91def6
authored
Mar 15, 2024
by
Thisara Kavinda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: not publishing video and audio issue
parent
52f997c5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
17 deletions
+28
-17
src/Components/MeetingGrid/MeetingGrid.tsx
src/Components/MeetingGrid/MeetingGrid.tsx
+24
-17
src/index.css
src/index.css
+4
-0
No files found.
src/Components/MeetingGrid/MeetingGrid.tsx
View file @
cb91def6
...
...
@@ -7,9 +7,8 @@ import {
RemoteUser
,
useLocalCameraTrack
,
useLocalMicrophoneTrack
,
useRTCClient
,
useRemoteUsers
,
use
ClientEvent
,
use
Publish
,
}
from
'
agora-rtc-react
'
const
MeetingGrid
=
()
=>
{
...
...
@@ -18,23 +17,11 @@ const MeetingGrid = () => {
const
isMd
=
useMediaQuery
(
theme
.
breakpoints
.
up
(
'
md
'
))
const
isLg
=
useMediaQuery
(
theme
.
breakpoints
.
up
(
'
lg
'
))
const
agoraEngine
=
useRTCClient
()
const
{
localCameraTrack
}
=
useLocalCameraTrack
()
const
{
localMicrophoneTrack
}
=
useLocalMicrophoneTrack
()
usePublish
([
localMicrophoneTrack
,
localCameraTrack
])
const
remoteUsers
=
useRemoteUsers
()
useClientEvent
(
agoraEngine
,
'
user-joined
'
,
(
user
)
=>
{
console
.
log
(
'
The user
'
,
user
.
uid
,
'
has joined the channel
'
)
})
useClientEvent
(
agoraEngine
,
'
user-left
'
,
(
user
)
=>
{
console
.
log
(
'
The user
'
,
user
.
uid
,
'
has left the channel
'
)
})
useClientEvent
(
agoraEngine
,
'
user-published
'
,
(
user
,
mediaType
)
=>
{
console
.
log
(
'
The user
'
,
user
.
uid
,
'
has published media in the channel
'
)
})
const
gridContainerRef
=
useRef
<
HTMLDivElement
>
(
null
)
const
[
gridContainerHeight
,
setGridContainerHeight
]
=
useState
(
0
)
...
...
@@ -145,6 +132,17 @@ const MeetingGrid = () => {
}
},
[
totalUsers
,
isSm
,
isMd
,
isLg
,
gridContainerHeight
,
numOfItems
])
// const onUserPublish = async (user: IAgoraRTCRemoteUser, mediaType: 'video' | 'audio') => {
// if (mediaType === 'video') {
// const remoteTrack = await agoraEngine.subscribe(user, mediaType)
// remoteTrack.play('remote-video')
// }
// if (mediaType === 'audio') {
// const remoteTrack = await agoraEngine.subscribe(user, mediaType)
// remoteTrack.play()
// }
// }
return
(
<
Box
sx=
{
{
...
...
@@ -175,7 +173,11 @@ const MeetingGrid = () => {
borderRadius
:
'
15px
'
,
}
}
>
<
LocalVideoTrack
track=
{
localCameraTrack
}
play=
{
true
}
/>
<
LocalVideoTrack
track=
{
localCameraTrack
}
play=
{
true
}
style=
{
{
width
:
'
100%
'
,
height
:
'
100%
'
,
borderRadius
:
'
20%
'
}
}
/>
</
Box
>
</
Grid
>
{
remoteUsers
.
map
((
remoteUser
,
index
)
=>
(
...
...
@@ -187,7 +189,12 @@ const MeetingGrid = () => {
borderRadius
:
'
15px
'
,
}
}
>
<
RemoteUser
user=
{
remoteUser
}
playVideo=
{
true
}
playAudio=
{
true
}
/>
<
RemoteUser
user=
{
remoteUser
}
playVideo=
{
true
}
playAudio=
{
true
}
style=
{
{
width
:
'
100%
'
,
height
:
'
100%
'
,
borderRadius
:
'
15px
'
}
}
/>
</
Box
>
</
Grid
>
))
}
...
...
src/index.css
View file @
cb91def6
...
...
@@ -23,3 +23,7 @@ code {
padding
:
0
5%
;
clear
:
both
;
}
video
{
border-radius
:
15px
;
}
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