feat(Receiver): Add videoData event to allow users to process video data

This commit is contained in:
Elysia
2024-09-25 19:29:29 +07:00
parent 736b3ff2fb
commit 43d2ea1bc4
4 changed files with 87 additions and 142 deletions

33
typings/index.d.ts vendored
View File

@@ -1083,21 +1083,36 @@ export class VoiceReceiver extends EventEmitter {
public createStream(user: UserResolvable, options?: { mode?: 'opus' | 'pcm'; end?: 'silence' | 'manual' }): Readable;
public on(event: 'debug', listener: (error: Error | string) => void): this;
public on(
event: 'videoData',
listener: (
ssrc: number,
ssrcData: {
userId: Snowflake;
hasVideo: boolean;
},
headerRaw: Buffer,
packetDecrypt: Buffer,
) => void,
): this;
public on(event: string, listener: (...args: any[]) => void): this;
public once(event: 'debug', listener: (error: Error | string) => void): this;
public once(
event: 'videoData',
listener: (
ssrc: number,
ssrcData: {
userId: Snowflake;
hasVideo: boolean;
},
headerRaw: Buffer,
packetDecrypt: Buffer,
) => void,
): this;
public once(event: string, listener: (...args: any[]) => void): this;
}
/*
export class IvfJoinner {
constructor(codec: 'VP8');
public stream: Readable;
public stop(): void;
public createFinalFile(read: Readable, write: Writable): void;
}
*/
export { Collection } from '@discordjs/collection';
export interface CollectorEventTypes<K, V, F extends unknown[] = []> {