mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-06-14 03:32:00 +08:00
12 lines
439 B
TypeScript
12 lines
439 B
TypeScript
import type { StreamDeviceLostEventData } from '@/types/websocket'
|
|
|
|
const AUDIO_STATE_REASONS = new Set(['audio_device_lost', 'audio_reconnecting'])
|
|
|
|
export function isAudioDeviceLostStateReason(reason: string | null | undefined): boolean {
|
|
return typeof reason === 'string' && AUDIO_STATE_REASONS.has(reason)
|
|
}
|
|
|
|
export function isAudioStreamDeviceLostPayload(data: StreamDeviceLostEventData): boolean {
|
|
return data.kind === 'audio'
|
|
}
|