Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions web/tests/e2e/hlsRecovery.browser.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,19 +248,24 @@ it.each(['exhausted','networkExhausted','unrecoverable','native'])(
},
);

it.each(['exhausted','unrecoverable','native'])(
it.each(['exhausted','networkExhausted','unrecoverable','native'])(
'%s recovery reports failure without fallback when go2rtc is enabled',async branch=>{
const {browser,page}=await openPlayer({enabled:true,nativePlayer:branch==='native'});
try {
if(branch==='native') await page.locator('video').dispatchEvent('error');
else await page.evaluate(value=>window.emitFatal(value==='exhausted'?'media':'other',value==='exhausted'?4:1),branch);
else await page.evaluate(value=>window.emitFatal(
value==='exhausted'?'media':value==='networkExhausted'?'network':'other',
value==='exhausted'||value==='networkExhausted'?4:1,
),branch);
expect(await page.evaluate(()=>window.errors)).toEqual([]);
await page.waitForFunction(()=>window.failures.length>0);
// The error overlay may fetch the latest recording for its last-frame
// image; only manifest requests indicate an HLS transport fallback.
expect(await page.evaluate(()=>window.requests.map(r=>r.url).filter(url=>url.includes('.m3u8'))))
.toEqual(['/go2rtc/api/stream.m3u8?src=fixture%20camera&mp4=flac']);
expect(await page.evaluate(()=>window.failures[0])).toBe(branch==='unrecoverable'?'fixture fatal':'live.go2rtcHlsFailedRetry');
expect(await page.evaluate(()=>window.failures[0])).toBe(
branch==='unrecoverable'||branch==='networkExhausted'?'fixture fatal':'live.go2rtcHlsFailedRetry',
);
} finally {await browser.close();}
},
);
Expand Down
Loading