|
|
@ -412,10 +412,12 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
user.Policy.EnableAudioPlaybackTranscoding);
|
|
|
|
user.Policy.EnableAudioPlaybackTranscoding);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Beginning of Playback Determination: Attempt DirectPlay first
|
|
|
|
if (mediaSource.SupportsDirectPlay)
|
|
|
|
if (mediaSource.SupportsDirectPlay)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mediaSource.IsRemote && forceDirectPlayRemoteMediaSource)
|
|
|
|
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
mediaSource.SupportsDirectPlay = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -461,6 +463,12 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (mediaSource.SupportsDirectStream)
|
|
|
|
if (mediaSource.SupportsDirectStream)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mediaSource.SupportsDirectStream = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
options.MaxBitrate = GetMaxBitrate(maxBitrate, user);
|
|
|
|
options.MaxBitrate = GetMaxBitrate(maxBitrate, user);
|
|
|
|
|
|
|
|
|
|
|
@ -494,6 +502,7 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
|
|
|
|
SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (mediaSource.SupportsTranscoding)
|
|
|
|
if (mediaSource.SupportsTranscoding)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -504,6 +513,27 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
? streamBuilder.BuildAudioItem(options)
|
|
|
|
? streamBuilder.BuildAudioItem(options)
|
|
|
|
: streamBuilder.BuildVideoItem(options);
|
|
|
|
: streamBuilder.BuildVideoItem(options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mediaSource.IsRemote && user.Policy.ForceRemoteSourceTranscoding)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (streamInfo != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
streamInfo.PlaySessionId = playSessionId;
|
|
|
|
|
|
|
|
streamInfo.StartPositionTicks = startTimeTicks;
|
|
|
|
|
|
|
|
mediaSource.TranscodingUrl = streamInfo.ToUrl("-", auth.Token).TrimStart('-');
|
|
|
|
|
|
|
|
mediaSource.TranscodingUrl += "&allowVideoStreamCopy=false";
|
|
|
|
|
|
|
|
if (!allowAudioStreamCopy)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mediaSource.TranscodingUrl += "&allowAudioStreamCopy=false";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mediaSource.TranscodingContainer = streamInfo.Container;
|
|
|
|
|
|
|
|
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do this after the above so that StartPositionTicks is set
|
|
|
|
|
|
|
|
SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
if (streamInfo != null)
|
|
|
|
if (streamInfo != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
streamInfo.PlaySessionId = playSessionId;
|
|
|
|
streamInfo.PlaySessionId = playSessionId;
|
|
|
@ -517,6 +547,13 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mediaSource.TranscodingUrl += "&allowVideoStreamCopy=false";
|
|
|
|
mediaSource.TranscodingUrl += "&allowVideoStreamCopy=false";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!allowAudioStreamCopy)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mediaSource.TranscodingUrl += "&allowAudioStreamCopy=false";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mediaSource.TranscodingContainer = streamInfo.Container;
|
|
|
|
|
|
|
|
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!allowAudioStreamCopy)
|
|
|
|
if (!allowAudioStreamCopy)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -525,12 +562,12 @@ namespace MediaBrowser.Api.Playback
|
|
|
|
|
|
|
|
|
|
|
|
mediaSource.TranscodingContainer = streamInfo.Container;
|
|
|
|
mediaSource.TranscodingContainer = streamInfo.Container;
|
|
|
|
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;
|
|
|
|
mediaSource.TranscodingSubProtocol = streamInfo.SubProtocol;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Do this after the above so that StartPositionTicks is set
|
|
|
|
// Do this after the above so that StartPositionTicks is set
|
|
|
|
SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
|
|
|
|
SetDeviceSpecificSubtitleInfo(streamInfo, mediaSource, auth.Token);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var attachment in mediaSource.MediaAttachments)
|
|
|
|
foreach (var attachment in mediaSource.MediaAttachments)
|
|
|
|
{
|
|
|
|
{
|
|
|
|