Skip to content
This repository has been archived by the owner on Jul 18, 2024. It is now read-only.

Commit

Permalink
add id to event screen updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1k1o committed May 3, 2024
1 parent 7eb40ab commit 17b6493
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/component/internal/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
}

/////////////////////////////
Expand Down
8 changes: 3 additions & 5 deletions src/component/types/messages.ts
Original file line number Diff line number Diff line change
@@ -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'

/////////////////////////////
Expand Down Expand Up @@ -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
}

/////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions src/page/main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 17b6493

Please sign in to comment.