Add native Cast integration

This commit is contained in:
2026-05-05 12:41:31 +00:00
parent 1f5ab6802d
commit c052a5aec2
13 changed files with 1113 additions and 37 deletions
+24
View File
@@ -0,0 +1,24 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import { createCastDiscoveryDescriptor } from '../../ts/integrations/cast/index.js';
tap.test('matches Google Cast mDNS records', async () => {
const descriptor = createCastDiscoveryDescriptor();
const matcher = descriptor.getMatchers()[0];
const result = await matcher.matches({
type: '_googlecast._tcp.local.',
name: 'Living Room TV._googlecast._tcp.local.',
host: 'living-room-tv.local',
port: 8009,
txt: {
id: '1234567890abcdef1234567890abcdef',
fn: 'Living Room TV',
md: 'Chromecast',
},
}, {});
expect(result.matched).toBeTrue();
expect(result.candidate?.host).toEqual('living-room-tv.local');
expect(result.candidate?.port).toEqual(8009);
expect(result.normalizedDeviceId).toEqual('1234567890abcdef1234567890abcdef');
});
export default tap.start();