diff --git a/src/component/internal/messages.ts b/src/component/internal/messages.ts index afb56bf0..5cf4b873 100644 --- a/src/component/internal/messages.ts +++ b/src/component/internal/messages.ts @@ -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 { // 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) } ///////////////////////////// diff --git a/src/component/types/messages.ts b/src/component/types/messages.ts index 91b9ef13..87c3834a 100644 --- a/src/component/types/messages.ts +++ b/src/component/types/messages.ts @@ -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 { // Screen ///////////////////////////// -export interface ScreenSize { - width: number - height: number - rate: number +export interface ScreenSizeUpdate extends ScreenSize { + id?: string } ///////////////////////////// diff --git a/src/page/main.vue b/src/page/main.vue index 8fe063a1..36a09b85 100644 --- a/src/page/main.vue +++ b/src/page/main.vue @@ -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)