aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/BaseStreamingService.cs
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-07-27 15:32:07 -0400
committerGitHub <noreply@github.com>2016-07-27 15:32:07 -0400
commit06b0cfb86fec5f1de83080f4fece2513dfa9cf6c (patch)
treeb94e74277d1b64d804acb12c6e4c482452381353 /MediaBrowser.Api/Playback/BaseStreamingService.cs
parentb785e919f375d1b876d2e82e0e377db9b6cfbc71 (diff)
parent897e0566294e854395f61040a8b922c1d0166930 (diff)
Merge pull request #1991 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Api/Playback/BaseStreamingService.cs')
-rw-r--r--MediaBrowser.Api/Playback/BaseStreamingService.cs15
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))
{