Skip to content

Commit 4837934

Browse files
Hydroplane72Copilot
andcommitted
Fix false-positive MPEG2/VC-1 direct play on Xbox WebView2
browser.edgeUwp matches the WebView2 Xbox client's user agent (Edg/ + WebView2), which was originally meant for the old EdgeHTML/UWP host that could genuinely hardware-decode MPEG2/VC-1 via Windows Media Foundation. Chromium/WebView2 cannot decode these codecs, so the server was told direct play was supported, causing direct play attempts to fail and fall back to transcoding. Add an xboxOne guard to supportsMpeg2Video() and supportsVc1(), mirroring the existing canPlayAv1() workaround for the same class of WebView2-on-Xbox false positive. Refs jellyfin/jellyfin-xbox#113 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4983aec commit 4837934

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/scripts/browserDeviceProfile.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,20 @@ function testCanPlayTs() {
237237
}
238238

239239
function supportsMpeg2Video() {
240+
if (browser.xboxOne) {
241+
// webview2 on xbox matches the edgeUwp check but cannot actually decode mpeg2
242+
return false;
243+
}
244+
240245
return browser.tizen || browser.web0s || browser.edgeUwp;
241246
}
242247

243248
function supportsVc1(videoTestElement) {
249+
if (browser.xboxOne) {
250+
// webview2 on xbox matches the edgeUwp check but cannot actually decode vc-1
251+
return false;
252+
}
253+
244254
return browser.tizen || browser.web0s || browser.edgeUwp || videoTestElement.canPlayType('video/mp4; codecs="vc-1"').replace(/no/, '');
245255
}
246256

0 commit comments

Comments
 (0)