diff --git a/source/utils/deviceCapabilities.brs b/source/utils/deviceCapabilities.brs index 2501bd87b..ca5442eab 100644 --- a/source/utils/deviceCapabilities.brs +++ b/source/utils/deviceCapabilities.brs @@ -797,6 +797,35 @@ function getDeviceProfile() as object deviceProfile.CodecProfiles.push(codecProfileArray) end if + ' respect user policy in regards to transcoding permission + enableVideoTranscoding = m.global.session.user.policy.EnableVideoPlaybackTranscoding + enableAudioTranscoding = m.global.session.user.policy.EnableAudioPlaybackTranscoding + + if isValid(enableVideoTranscoding) and isValid(enableAudioTranscoding) + if not enableVideoTranscoding and not enableAudioTranscoding + ' no transcoding allowed + deviceProfile.TranscodingProfiles = [] + else if not enableVideoTranscoding and enableAudioTranscoding + ' no video transcoding allowed + newProfile = [] + for i = 0 to deviceProfile.TranscodingProfiles.count() - 1 + if Lcase(deviceProfile.TranscodingProfiles[i].Type) <> "video" + newProfile.push(deviceProfile.TranscodingProfiles[i]) + end if + end for + deviceProfile.TranscodingProfiles = newProfile + else if enableVideoTranscoding and not enableAudioTranscoding + ' no audio transcoding allowed + newProfile = [] + for i = 0 to deviceProfile.TranscodingProfiles.count() - 1 + if Lcase(deviceProfile.TranscodingProfiles[i].Type) <> "audio" + newProfile.push(deviceProfile.TranscodingProfiles[i]) + end if + end for + deviceProfile.TranscodingProfiles = newProfile + end if + end if + return deviceProfile end function