настройки демонстрации экрана
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import type { ChadClient, Consumer, Producer } from '#shared/types'
|
||||
import type { MediaKind, ProducerOptions } from 'mediasoup-client/types'
|
||||
import type { ShareSettings } from '~/components/ShareScreenDialog.vue'
|
||||
import { createSharedComposable } from '@vueuse/core'
|
||||
import * as mediasoupClient from 'mediasoup-client'
|
||||
import { shallowRef } from 'vue'
|
||||
@@ -85,12 +86,11 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
return
|
||||
|
||||
device.value = new mediasoupClient.Device()
|
||||
rtpCapabilities.value = await signaling.socket.value.emitWithAck('getRtpCapabilities')
|
||||
const routerRtpCapabilities = await signaling.socket.value.emitWithAck('getRtpCapabilities')
|
||||
|
||||
await device.value.load({ routerRtpCapabilities: rtpCapabilities.value! })
|
||||
await device.value.load({ routerRtpCapabilities })
|
||||
|
||||
console.log('SERVER RTP CAPABILITIES', rtpCapabilities.value)
|
||||
console.log('СОГЛАСОВАННЫЕ', device.value.rtpCapabilities)
|
||||
rtpCapabilities.value = device.value.rtpCapabilities
|
||||
|
||||
// Send transport
|
||||
{
|
||||
@@ -450,51 +450,30 @@ export const useMediasoup = createSharedComposable(() => {
|
||||
})
|
||||
}
|
||||
|
||||
async function enableShare() {
|
||||
async function enableShare(settings: ShareSettings) {
|
||||
if (shareProducer.value)
|
||||
return
|
||||
|
||||
if (!device.value)
|
||||
return
|
||||
|
||||
const stream = await getShareStream(preferences.shareFps.value)
|
||||
const stream = await getShareStream(settings.fps)
|
||||
|
||||
const track = stream.getVideoTracks()[0]
|
||||
|
||||
if (!track)
|
||||
return
|
||||
|
||||
console.log('settings', track.getSettings())
|
||||
track.contentHint = 'motion'
|
||||
|
||||
await createProducer({
|
||||
track,
|
||||
streamId: 'share',
|
||||
codec: device.value.rtpCapabilities.codecs?.find(
|
||||
c => c.mimeType.toLowerCase() === 'video/h264',
|
||||
),
|
||||
// c => c.mimeType.toLowerCase() === 'video/h264' && c.parameters['profile-level-id'] === '42e01f',
|
||||
// codec: device.value.rtpCapabilities.codecs?.find(
|
||||
// c => c.mimeType.toLowerCase() === 'video/av1',
|
||||
// ),
|
||||
// codec: device.value.rtpCapabilities.codecs?.find(
|
||||
// c => c.mimeType.toLowerCase() === 'video/vp9',
|
||||
// ),
|
||||
// codec: {
|
||||
// kind: 'video',
|
||||
// mimeType: 'video/AV1',
|
||||
// clockRate: 90000,
|
||||
// parameters: {
|
||||
// 'level-idx': 13, // Level 4.1 — 1080p60
|
||||
// 'profile': 0, // Main Profile
|
||||
// 'tier': 0, // Main tier (0) vs High tier (1)
|
||||
// 'x-google-start-bitrate': 8000,
|
||||
// },
|
||||
// },
|
||||
codec: settings.codec,
|
||||
encodings: [
|
||||
{
|
||||
maxBitrate: 120_000_000,
|
||||
maxFramerate: 60,
|
||||
// maxBitrate: 120_000_000,
|
||||
maxFramerate: settings.fps,
|
||||
scalabilityMode: 'L1T1',
|
||||
networkPriority: 'high',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user