diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-25 01:12:38 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-07-25 01:12:38 -0400 |
| commit | 8328f39834f042e1808fd8506bbc7c48151703ab (patch) | |
| tree | 1a313e9a1c6790a755926bcef221c5f680537eae /MediaBrowser.Api/Playback/BaseStreamingService.cs | |
| parent | b878dc15375c824da20d1ef793254373a27aeb40 (diff) | |
update behavior with restricted transcoding access
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
| -rw-r--r-- | MediaBrowser.Api/Playback/BaseStreamingService.cs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index f60a106da..ce3691095 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -1669,7 +1669,7 @@ namespace MediaBrowser.Api.Playback RequestedUrl = url, UserAgent = Request.UserAgent }; - + //if ((Request.UserAgent ?? string.Empty).IndexOf("iphone", StringComparison.OrdinalIgnoreCase) != -1 || // (Request.UserAgent ?? string.Empty).IndexOf("ipad", StringComparison.OrdinalIgnoreCase) != -1 || // (Request.UserAgent ?? string.Empty).IndexOf("ipod", StringComparison.OrdinalIgnoreCase) != -1) @@ -1770,6 +1770,19 @@ namespace MediaBrowser.Api.Playback { state.OutputVideoCodec = "copy"; } + else + { + // If the user doesn't have access to transcoding, then force stream copy, regardless of whether it will be compatible or not + var auth = AuthorizationContext.GetAuthorizationInfo(Request); + if (!string.IsNullOrWhiteSpace(auth.UserId)) + { + var user = UserManager.GetUserById(auth.UserId); + if (!user.Policy.EnableVideoPlaybackTranscoding) + { + state.OutputVideoCodec = "copy"; + } + } + } if (state.AudioStream != null && CanStreamCopyAudio(state, state.SupportedAudioCodecs)) { |
