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']
|
||||
PrimeSlider: typeof import('primevue/slider')['default']
|
||||
PrimeTag: typeof import('primevue/tag')['default']
|
||||
PrimeTextarea: typeof import('primevue/textarea')['default']
|
||||
PrimeToast: typeof import('primevue/toast')['default']
|
||||
PrimeToggleSwitch: typeof import('primevue/toggleswitch')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
|
||||
@@ -39,7 +39,7 @@ export const useChat = createGlobalState(() => {
|
||||
socket.on('disconnect', () => {
|
||||
messages.value = []
|
||||
})
|
||||
}, { immediate: true })
|
||||
}, { immediate: true, flush: 'sync' })
|
||||
|
||||
function sendMessage(message: ChatClientMessage) {
|
||||
if (!signaling.connected.value)
|
||||
|
||||
@@ -13,8 +13,9 @@ export const useDevices = createGlobalState(() => {
|
||||
return navigator.mediaDevices.getDisplayMedia({
|
||||
audio: false,
|
||||
video: {
|
||||
height: { max: 1440 },
|
||||
displaySurface: 'monitor',
|
||||
frameRate: { max: fps },
|
||||
frameRate: { ideal: fps, max: fps },
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -452,14 +452,26 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
if (!track)
|
||||
return
|
||||
|
||||
console.log('codec', device.value.sendRtpCapabilities.codecs)
|
||||
|
||||
await createProducer({
|
||||
track,
|
||||
streamId: 'share',
|
||||
codec: device.value.rtpCapabilities.codecs?.find(
|
||||
c => c.mimeType.toLowerCase() === 'video/AV1',
|
||||
codec: device.value.sendRtpCapabilities.codecs?.find(
|
||||
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: {
|
||||
videoGoogleStartBitrate: 1000,
|
||||
videoGoogleStartBitrate: 2000, // Стартуем с 2 Mbps сразу
|
||||
videoGoogleMaxBitrate: 12000,
|
||||
videoGoogleMinBitrate: 500,
|
||||
},
|
||||
zeroRtpOnPause: true,
|
||||
appData: {
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<!-- </PrimeInputGroupAddon> -->
|
||||
|
||||
<PrimeInputText
|
||||
ref="input"
|
||||
v-model="text"
|
||||
placeholder="Write a message..."
|
||||
fluid
|
||||
@@ -56,13 +57,14 @@
|
||||
@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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useEventBus } from '#imports'
|
||||
import { onStartTyping, unrefElement, useEventListener } from '@vueuse/core'
|
||||
import { format } from 'date-fns'
|
||||
import linkifyStr from 'linkify-string'
|
||||
import { useChat } from '~/composables/use-chat'
|
||||
@@ -78,6 +80,7 @@ const eventBus = useEventBus()
|
||||
const { messages } = chat
|
||||
|
||||
const scrollRef = useTemplateRef('scroll')
|
||||
const inputRef = useTemplateRef('input')
|
||||
const contentRef = computed(() => scrollRef.value?.$refs.content)
|
||||
|
||||
const text = ref('')
|
||||
@@ -118,6 +121,14 @@ function onInputMounted(ref: VNode) {
|
||||
ref.el?.focus()
|
||||
}
|
||||
|
||||
useEventListener(window, 'focus', async (evt) => {
|
||||
unrefElement(inputRef.value)?.focus()
|
||||
})
|
||||
|
||||
onStartTyping(() => {
|
||||
unrefElement(inputRef.value)?.focus()
|
||||
})
|
||||
|
||||
const ARRIVED_STATE_THRESHOLD_PIXELS = 1
|
||||
async function onNewMessage() {
|
||||
if (!contentRef.value)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||
"productName": "Chad",
|
||||
"version": "0.3.0-rc.2",
|
||||
"version": "0.3.0-rc.3",
|
||||
"identifier": "xyz.koptilnya.chad",
|
||||
"build": {
|
||||
"frontendDist": "../.output/public",
|
||||
|
||||
@@ -33,6 +33,15 @@ export const autoConfig: mediasoup.types.RouterOptions = {
|
||||
'x-google-start-bitrate': 1000,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'video',
|
||||
mimeType: 'video/VP9',
|
||||
clockRate: 90000,
|
||||
parameters: {
|
||||
'profile-id': 0,
|
||||
'x-google-start-bitrate': 12000,
|
||||
},
|
||||
},
|
||||
{
|
||||
kind: 'video',
|
||||
mimeType: 'video/VP9',
|
||||
|
||||
@@ -112,6 +112,8 @@ export default async function (io: SocketServer, router: types.Router) {
|
||||
},
|
||||
},
|
||||
],
|
||||
initialAvailableOutgoingBitrate: 8_000_000,
|
||||
maxSctpMessageSize: 262144,
|
||||
enableUdp: true,
|
||||
preferUdp: true,
|
||||
appData: {
|
||||
|
||||
Reference in New Issue
Block a user