diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 9d38bb2712..8c6bced1eb 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1316,11 +1316,11 @@ class PlaybackManager { const profiles = deviceProfile.DirectPlayProfiles || []; - return profiles.filter(function (p) { + return profiles.some(function (p) { return p.Type === 'Video' && includesAny((p.Container || '').toLowerCase(), container) && includesAny((p.AudioCodec || '').toLowerCase(), codec); - }).length > 0; + }); } self.setAudioStreamIndex = function (index, player) { diff --git a/src/plugins/htmlVideoPlayer/plugin.js b/src/plugins/htmlVideoPlayer/plugin.js index aaf6b53c76..defd931ae0 100644 --- a/src/plugins/htmlVideoPlayer/plugin.js +++ b/src/plugins/htmlVideoPlayer/plugin.js @@ -617,11 +617,11 @@ function tryRemoveElement(elem) { const profiles = deviceProfile.DirectPlayProfiles || []; - return profiles.filter(function (p) { + return profiles.some(function (p) { return p.Type === 'Video' && includesAny((p.Container || '').toLowerCase(), container) && includesAny((p.AudioCodec || '').toLowerCase(), codec); - }).length > 0; + }); } /**