iOS 第三方浏览器(Chrome/Firefox/Edge/Opera)改走 TS 兼容流:能力声明隐藏原生 HLS,服务端规划 legacy TS 通道,绕开 fMP4 黑屏问题

This commit is contained in:
yvan
2026-09-18 15:08:31 +08:00
parent f2802dcc5f
commit 3f8c29b7e2
2 changed files with 18 additions and 1 deletions
@@ -33,3 +33,17 @@ test('remux requires compatible H.264 profiles and never replaces iOS HLS', () =
limited.MediaSource.isTypeSupported = () => {throw new Error('probe unavailable');};
assert.equal(capabilities(limited, native, {}).remux(), false);
});
test('third-party iOS browsers hide native HLS so the server plans the TS path', () => {
for (const ua of ['iPhone CriOS/154.0.8037.41 Mobile/15E148 Safari/604.1',
'iPhone FxiOS/130.0 Mobile/15E148 Safari/605.1.15',
'iPhone EdgiOS/130.0.1 Mobile/15E148 Safari/605.1.15']) {
const view = capabilities(mse(true), native, {userAgent: ua});
assert.equal(view.describe().nativeHls, false);
assert.equal(view.choose(type), 'hls');
}
const safari = capabilities(mse(true), native, {userAgent: 'iPhone Version/27.0 Mobile/15E148 Safari/604.1'});
assert.equal(safari.describe().nativeHls, true);
const opera = capabilities(mse(true), native, {userAgent: 'iPhone OPT/2.4.0 Mobile/15E148 Safari/605.1.15'});
assert.equal(opera.describe().nativeHls, false);
});