Unity启动,录制视频没有文件产出
This commit is contained in:
@@ -93,6 +93,24 @@ describe('recording composer', () => {
|
||||
expect(args).not.toContain('libopus');
|
||||
});
|
||||
|
||||
test('falls back to one video segment when input end timestamps are missing', () => {
|
||||
const args = buildFfmpegCompositionArgs({
|
||||
videoInputs: [
|
||||
file('host-video.webm', 'video', 'host', 'host', '2026-06-01T00:00:00.000Z', ''),
|
||||
file('p1-video.webm', 'video', 'p1', 'participant', '2026-06-01T00:00:02.500Z', '')
|
||||
],
|
||||
audioInputs: [],
|
||||
outputPath: 'recordings/room-1/output.webm',
|
||||
format: 'webm'
|
||||
});
|
||||
|
||||
const filter = args[args.indexOf('-filter_complex') + 1];
|
||||
expect(filter).toContain('xstack=inputs=2');
|
||||
expect(filter).toContain('trim=start=0,setpts=PTS-STARTPTS');
|
||||
expect(filter).not.toContain('concat=n=0');
|
||||
expect(args).not.toContain('-t');
|
||||
});
|
||||
|
||||
test('pads late participant tracks to keep the room timeline aligned', () => {
|
||||
const args = buildFfmpegCompositionArgs({
|
||||
videoInputs: [
|
||||
|
||||
@@ -292,3 +292,53 @@ describe('websocket signaling test in private mode', () => {
|
||||
await wsHandler.remove(client);
|
||||
});
|
||||
});
|
||||
|
||||
describe('recording offer validation', () => {
|
||||
let server: WS;
|
||||
let client: WebSocket;
|
||||
const connectionId = "recording-room";
|
||||
|
||||
beforeAll(async () => {
|
||||
wsHandler.reset("private");
|
||||
server = new WS("ws://localhost:1234", { jsonProtocol: true });
|
||||
client = new WebSocket("ws://localhost:1234");
|
||||
await server.connected;
|
||||
await wsHandler.add(client);
|
||||
await wsHandler.onConnect(client, connectionId);
|
||||
await expect(server).toReceiveMessage({
|
||||
type: "connect",
|
||||
connectionId: connectionId,
|
||||
polite: false,
|
||||
role: "host",
|
||||
participantId: anyParticipantId
|
||||
});
|
||||
});
|
||||
|
||||
afterAll(() => {
|
||||
WS.clean();
|
||||
});
|
||||
|
||||
test('rejects recording offers without audio or video media sections', async () => {
|
||||
await wsHandler.onRecordingOffer(client, {
|
||||
recordingId: 'recording-empty-offer',
|
||||
connectionId,
|
||||
sdp: [
|
||||
'v=0',
|
||||
'o=- 25268170 0 IN IP4 0.0.0.0',
|
||||
's=-',
|
||||
't=0 0',
|
||||
'a=group:BUNDLE ',
|
||||
'a=extmap-allow-mixed',
|
||||
'a=msid-semantic:WMS *',
|
||||
''
|
||||
].join('\r\n')
|
||||
});
|
||||
|
||||
await expect(server).toReceiveMessage(expect.objectContaining({
|
||||
from: connectionId,
|
||||
to: "",
|
||||
type: "on-message",
|
||||
data: expect.stringContaining('"status":"no-media-offer"')
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user