Compare commits
3 Commits
v0.3.0-rc.
...
v0.3.0-rc.
| Author | SHA1 | Date | |
|---|---|---|---|
| 5f72ad430e | |||
| 8cc60e1849 | |||
| 0b75148a3f |
1
client/app/components.d.ts
vendored
1
client/app/components.d.ts
vendored
@@ -24,7 +24,6 @@ declare module 'vue' {
|
|||||||
PrimeSelectButton: typeof import('primevue/selectbutton')['default']
|
PrimeSelectButton: typeof import('primevue/selectbutton')['default']
|
||||||
PrimeSlider: typeof import('primevue/slider')['default']
|
PrimeSlider: typeof import('primevue/slider')['default']
|
||||||
PrimeTag: typeof import('primevue/tag')['default']
|
PrimeTag: typeof import('primevue/tag')['default']
|
||||||
PrimeTextarea: typeof import('primevue/textarea')['default']
|
|
||||||
PrimeToast: typeof import('primevue/toast')['default']
|
PrimeToast: typeof import('primevue/toast')['default']
|
||||||
PrimeToggleSwitch: typeof import('primevue/toggleswitch')['default']
|
PrimeToggleSwitch: typeof import('primevue/toggleswitch')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export const useChat = createGlobalState(() => {
|
|||||||
socket.on('disconnect', () => {
|
socket.on('disconnect', () => {
|
||||||
messages.value = []
|
messages.value = []
|
||||||
})
|
})
|
||||||
}, { immediate: true })
|
}, { immediate: true, flush: 'sync' })
|
||||||
|
|
||||||
function sendMessage(message: ChatClientMessage) {
|
function sendMessage(message: ChatClientMessage) {
|
||||||
if (!signaling.connected.value)
|
if (!signaling.connected.value)
|
||||||
|
|||||||
@@ -13,8 +13,9 @@ export const useDevices = createGlobalState(() => {
|
|||||||
return navigator.mediaDevices.getDisplayMedia({
|
return navigator.mediaDevices.getDisplayMedia({
|
||||||
audio: false,
|
audio: false,
|
||||||
video: {
|
video: {
|
||||||
|
height: { max: 1440 },
|
||||||
displaySurface: 'monitor',
|
displaySurface: 'monitor',
|
||||||
frameRate: { max: fps },
|
frameRate: { ideal: fps, max: fps },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -452,14 +452,26 @@ export const useMediasoup = createSharedComposable(() => {
|
|||||||
if (!track)
|
if (!track)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
console.log('codec', device.value.sendRtpCapabilities.codecs)
|
||||||
|
|
||||||
await createProducer({
|
await createProducer({
|
||||||
track,
|
track,
|
||||||
streamId: 'share',
|
streamId: 'share',
|
||||||
codec: device.value.rtpCapabilities.codecs?.find(
|
codec: device.value.sendRtpCapabilities.codecs?.find(
|
||||||
c => c.mimeType.toLowerCase() === 'video/AV1',
|
c => c.mimeType.toLowerCase() === 'video/vp9' && c.parameters?.['profile-id'] === 0,
|
||||||
),
|
),
|
||||||
|
encodings: [
|
||||||
|
{
|
||||||
|
maxBitrate: 12_000_000, // 8 Mbps — для 1080p60 достаточно
|
||||||
|
maxFramerate: 60,
|
||||||
|
scalabilityMode: 'L1T1', // Без SVC слоёв (стабильнее)
|
||||||
|
networkPriority: 'high',
|
||||||
|
},
|
||||||
|
],
|
||||||
codecOptions: {
|
codecOptions: {
|
||||||
videoGoogleStartBitrate: 1000,
|
videoGoogleStartBitrate: 2000, // Стартуем с 2 Mbps сразу
|
||||||
|
videoGoogleMaxBitrate: 12000,
|
||||||
|
videoGoogleMinBitrate: 500,
|
||||||
},
|
},
|
||||||
zeroRtpOnPause: true,
|
zeroRtpOnPause: true,
|
||||||
appData: {
|
appData: {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@
|
|||||||
<!-- </PrimeInputGroupAddon> -->
|
<!-- </PrimeInputGroupAddon> -->
|
||||||
|
|
||||||
<PrimeInputText
|
<PrimeInputText
|
||||||
|
ref="input"
|
||||||
v-model="text"
|
v-model="text"
|
||||||
placeholder="Write a message..."
|
placeholder="Write a message..."
|
||||||
fluid
|
fluid
|
||||||
@@ -56,13 +57,14 @@
|
|||||||
@vue:mounted="onInputMounted"
|
@vue:mounted="onInputMounted"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<PrimeButton class="shrink-0" label="Send" severity="contrast" @click="sendMessage" />
|
<PrimeButton class="shrink-0" label="Send" severity="contrast" :disabled="!text" @click="sendMessage" />
|
||||||
</PrimeInputGroup>
|
</PrimeInputGroup>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useEventBus } from '#imports'
|
import { useEventBus } from '#imports'
|
||||||
|
import { onStartTyping, unrefElement, useEventListener } from '@vueuse/core'
|
||||||
import { format } from 'date-fns'
|
import { format } from 'date-fns'
|
||||||
import linkifyStr from 'linkify-string'
|
import linkifyStr from 'linkify-string'
|
||||||
import { useChat } from '~/composables/use-chat'
|
import { useChat } from '~/composables/use-chat'
|
||||||
@@ -78,6 +80,7 @@ const eventBus = useEventBus()
|
|||||||
const { messages } = chat
|
const { messages } = chat
|
||||||
|
|
||||||
const scrollRef = useTemplateRef('scroll')
|
const scrollRef = useTemplateRef('scroll')
|
||||||
|
const inputRef = useTemplateRef('input')
|
||||||
const contentRef = computed(() => scrollRef.value?.$refs.content)
|
const contentRef = computed(() => scrollRef.value?.$refs.content)
|
||||||
|
|
||||||
const text = ref('')
|
const text = ref('')
|
||||||
@@ -118,6 +121,14 @@ function onInputMounted(ref: VNode) {
|
|||||||
ref.el?.focus()
|
ref.el?.focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
useEventListener(window, 'focus', async (evt) => {
|
||||||
|
unrefElement(inputRef.value)?.focus()
|
||||||
|
})
|
||||||
|
|
||||||
|
onStartTyping(() => {
|
||||||
|
unrefElement(inputRef.value)?.focus()
|
||||||
|
})
|
||||||
|
|
||||||
const ARRIVED_STATE_THRESHOLD_PIXELS = 1
|
const ARRIVED_STATE_THRESHOLD_PIXELS = 1
|
||||||
async function onNewMessage() {
|
async function onNewMessage() {
|
||||||
if (!contentRef.value)
|
if (!contentRef.value)
|
||||||
|
|||||||
@@ -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.3.0-rc.2",
|
"version": "0.3.0-rc.3",
|
||||||
"identifier": "xyz.koptilnya.chad",
|
"identifier": "xyz.koptilnya.chad",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../.output/public",
|
"frontendDist": "../.output/public",
|
||||||
|
|||||||
@@ -33,6 +33,15 @@ export const autoConfig: mediasoup.types.RouterOptions = {
|
|||||||
'x-google-start-bitrate': 1000,
|
'x-google-start-bitrate': 1000,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
kind: 'video',
|
||||||
|
mimeType: 'video/VP9',
|
||||||
|
clockRate: 90000,
|
||||||
|
parameters: {
|
||||||
|
'profile-id': 0,
|
||||||
|
'x-google-start-bitrate': 12000,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
kind: 'video',
|
kind: 'video',
|
||||||
mimeType: 'video/VP9',
|
mimeType: 'video/VP9',
|
||||||
|
|||||||
@@ -112,6 +112,8 @@ export default async function (io: SocketServer, router: types.Router) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
initialAvailableOutgoingBitrate: 8_000_000,
|
||||||
|
maxSctpMessageSize: 262144,
|
||||||
enableUdp: true,
|
enableUdp: true,
|
||||||
preferUdp: true,
|
preferUdp: true,
|
||||||
appData: {
|
appData: {
|
||||||
|
|||||||
Reference in New Issue
Block a user