From 4c9119d4b467c473bce5c61fbde513d7dd57a77a Mon Sep 17 00:00:00 2001 From: Brissot Date: Fri, 1 May 2020 16:56:01 -0400 Subject: [PATCH] Made an webm AV1 profile to fix issue where AV1 would transcode instead of direct play even if the browser supports decoding AV1. --- src/scripts/browserdeviceprofile.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/scripts/browserdeviceprofile.js b/src/scripts/browserdeviceprofile.js index a269498dd0..ddbd30abe3 100644 --- a/src/scripts/browserdeviceprofile.js +++ b/src/scripts/browserdeviceprofile.js @@ -334,6 +334,7 @@ define(['browser'], function (browser) { var canPlayVp8 = videoTestElement.canPlayType('video/webm; codecs="vp8"').replace(/no/, ''); var canPlayVp9 = videoTestElement.canPlayType('video/webm; codecs="vp9"').replace(/no/, ''); + var canPlayAv1 = videoTestElement.canPlayType('video/webm; codecs="av1"').replace(/no/, ''); var webmAudioCodecs = ['vorbis']; var canPlayMkv = testCanPlayMkv(videoTestElement); @@ -592,6 +593,15 @@ define(['browser'], function (browser) { }); } + if (canPlayAv1) { + profile.DirectPlayProfiles.push({ + Container: 'webm', + Type: 'Video', + AudioCodec: webmAudioCodecs.join(','), + VideoCodec: 'AV1' + }); + } + profile.TranscodingProfiles = []; var hlsBreakOnNonKeyFrames = browser.iOS || browser.osx || browser.edge || !canPlayNativeHls() ? true : false;