3 Commits

Author SHA1 Message Date
4d5db12e1b screen sharing
Some checks failed
Deploy / deploy (push) Successful in 35s
Deploy / publish-web (push) Failing after 22s
2025-12-26 17:36:30 +06:00
4f59cbcf65 screen sharing
All checks were successful
Deploy / deploy (push) Successful in 35s
2025-12-26 17:21:59 +06:00
3b3f6b6e40 update 2025-12-26 01:44:16 +06:00
5 changed files with 52 additions and 4 deletions

View File

@@ -6,6 +6,8 @@ export default defineNuxtRouteMiddleware(async (to, from) => {
if (!me.value) { if (!me.value) {
try { try {
setMe(await chadApi('/me', { method: 'GET' })) setMe(await chadApi('/me', { method: 'GET' }))
if (to.meta.auth !== false)
return navigateTo({ name: 'Index' }) return navigateTo({ name: 'Index' })
} }
catch { catch {

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json", "$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
"productName": "chad", "productName": "chad",
"version": "0.2.14", "version": "0.2.15",
"identifier": "xyz.koptilnya.chad", "identifier": "xyz.koptilnya.chad",
"build": { "build": {
"frontendDist": "../.output/public", "frontendDist": "../.output/public",

View File

@@ -25,5 +25,50 @@ export const autoConfig: mediasoup.types.RouterOptions = {
channels: 2, channels: 2,
parameters: { useinbandfec: 1, stereo: 1 }, parameters: { useinbandfec: 1, stereo: 1 },
}, },
{
kind: 'video',
mimeType: 'video/VP8',
clockRate: 90000,
parameters: {
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/VP9',
clockRate: 90000,
parameters: {
'profile-id': 2,
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '4d0032',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/h264',
clockRate: 90000,
parameters: {
'packetization-mode': 1,
'profile-level-id': '42e01f',
'level-asymmetry-allowed': 1,
'x-google-start-bitrate': 1000,
},
},
{
kind: 'video',
mimeType: 'video/AV1',
clockRate: 90000,
parameters: {},
},
], ],
} }

View File

@@ -148,7 +148,7 @@ export default function (io: SocketServer, router: types.Router) {
} }
}) })
socket.on('produce', async ({ transportId, kind, rtpParameters }, cb) => { socket.on('produce', async ({ transportId, kind, rtpParameters, appData }, cb) => {
if (!socket.data.joined) { if (!socket.data.joined) {
consola.error('Peer not joined yet') consola.error('Peer not joined yet')
cb({ error: 'Peer not joined yet' }) cb({ error: 'Peer not joined yet' })
@@ -166,7 +166,7 @@ export default function (io: SocketServer, router: types.Router) {
} }
try { try {
const producer = await transport.produce({ kind, rtpParameters, appData: { socketId: socket.id } }) const producer = await transport.produce({ kind, rtpParameters, appData: { ...appData, socketId: socket.id } })
socket.data.producers.set(producer.id, producer) socket.data.producers.set(producer.id, producer)

View File

@@ -55,6 +55,7 @@ export interface ClientToServerEvents {
transportId: types.WebRtcTransport['id'] transportId: types.WebRtcTransport['id']
kind: types.MediaKind kind: types.MediaKind
rtpParameters: types.RtpParameters rtpParameters: types.RtpParameters
appData: { source: 'share' | string }
}, },
cb: EventCallback<{ id: types.Producer['id'] }> cb: EventCallback<{ id: types.Producer['id'] }>
) => void ) => void