add id to event screen updated.

This commit is contained in:
Miroslav Šedivý 2024-05-03 23:18:02 +02:00
parent 7eb40aba81
commit 17b6493832
3 changed files with 8 additions and 10 deletions

View File

@ -36,7 +36,7 @@ export interface NekoEvents {
// room events
['room.control.host']: (hasHost: boolean, hostID?: string) => void
['room.screen.updated']: (width: number, height: number, rate: number) => void
['room.screen.updated']: (width: number, height: number, rate: number, id?: string) => void
['room.clipboard.updated']: (text: string) => void
['room.broadcast.status']: (isActive: boolean, url?: string) => void
@ -278,10 +278,10 @@ export class NekoMessages extends EventEmitter<NekoEvents> {
// Screen Events
/////////////////////////////
protected [EVENT.SCREEN_UPDATED]({ width, height, rate }: message.ScreenSize) {
protected [EVENT.SCREEN_UPDATED]({ width, height, rate, id }: message.ScreenSizeUpdate) {
this._localLog.debug(`EVENT.SCREEN_UPDATED`)
this._state.screen.size = { width, height, rate } // TODO: Vue.Set
this.emit('room.screen.updated', width, height, rate)
this.emit('room.screen.updated', width, height, rate, id)
}
/////////////////////////////

View File

@ -1,5 +1,5 @@
import type { ICEServer } from '../internal/webrtc'
import type { Settings } from './state'
import type { Settings, ScreenSize } from './state'
import type { PeerRequest, PeerVideo, PeerAudio } from './webrtc'
/////////////////////////////
@ -141,10 +141,8 @@ export interface ControlTouch extends Partial<ControlPos> {
// Screen
/////////////////////////////
export interface ScreenSize {
width: number
height: number
rate: number
export interface ScreenSizeUpdate extends ScreenSize {
id?: string
}
/////////////////////////////

View File

@ -496,8 +496,8 @@ onMounted(() => {
neko.value!.events.on('room.control.host', (hasHost: boolean, hostID?: string) => {
console.log('room.control.host', hasHost, hostID)
})
neko.value!.events.on('room.screen.updated', (width: number, height: number, rate: number) => {
console.log('room.screen.updated', width, height, rate)
neko.value!.events.on('room.screen.updated', (width: number, height: number, rate: number, id: string) => {
console.log('room.screen.updated', width, height, rate, 'by', id)
})
neko.value!.events.on('room.clipboard.updated', (text: string) => {
console.log('room.clipboard.updated', text)