From e2500a853e365b9103a635c3a00d070d8e227631 Mon Sep 17 00:00:00 2001 From: Dermot Duffy Date: Mon, 6 Oct 2025 21:25:50 -0700 Subject: [PATCH] fix: Prefer H265 when browser supported (#2200) - Closes #2192 --- src/components/live/providers/go2rtc/video-rtc.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/live/providers/go2rtc/video-rtc.js b/src/components/live/providers/go2rtc/video-rtc.js index ac0a4ca7..269766d4 100644 --- a/src/components/live/providers/go2rtc/video-rtc.js +++ b/src/components/live/providers/go2rtc/video-rtc.js @@ -702,7 +702,11 @@ export class VideoRTC extends HTMLElement { /** @type {MediaStream} */ const stream = video2.srcObject; - if (stream.getVideoTracks().length > 0) rtcPriority += 0x220; + if (stream.getVideoTracks().length > 0) { + // not the best, but a pretty simple way to check a codec + const isH265Supported = this.pc.remoteDescription.sdp.includes('H265/90000'); + rtcPriority += isH265Supported ? 0x240 : 0x220; + } if (stream.getAudioTracks().length > 0) rtcPriority += 0x102; if (this.mseCodecs.indexOf('hvc1.') >= 0) msePriority += 0x230;