diff options
| -rw-r--r-- | MediaBrowser.Model/ApiClient/IConnectionManager.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Model/Dlna/StreamBuilder.cs | 46 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.Internal.nuspec | 4 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Common.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Model.Signed.nuspec | 2 | ||||
| -rw-r--r-- | Nuget/MediaBrowser.Server.Core.nuspec | 4 |
6 files changed, 41 insertions, 25 deletions
diff --git a/MediaBrowser.Model/ApiClient/IConnectionManager.cs b/MediaBrowser.Model/ApiClient/IConnectionManager.cs index 6ff48a044..84a815dfc 100644 --- a/MediaBrowser.Model/ApiClient/IConnectionManager.cs +++ b/MediaBrowser.Model/ApiClient/IConnectionManager.cs @@ -35,7 +35,13 @@ namespace MediaBrowser.Model.ApiClient /// Occurs when [remote logged out]. /// </summary> event EventHandler<EventArgs> RemoteLoggedOut; - + + /// <summary> + /// Gets the device. + /// </summary> + /// <value>The device.</value> + IDevice Device { get; } + /// <summary> /// Gets the connect user. /// </summary> diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs index 51c63b5cb..3f88f9ac0 100644 --- a/MediaBrowser.Model/Dlna/StreamBuilder.cs +++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs @@ -316,12 +316,14 @@ namespace MediaBrowser.Model.Dlna MediaStream videoStream = item.VideoStream; - int? maxBitrateSetting = options.GetMaxBitrate(); + // TODO: This doesn't accout for situation of device being able to handle media bitrate, but wifi connection not fast enough + bool isEligibleForDirectPlay = IsEligibleForDirectPlay(item, options.Profile.MaxStaticBitrate, subtitleStream, options); + bool isEligibleForDirectStream = IsEligibleForDirectPlay(item, options.GetMaxBitrate(), subtitleStream, options); - if (IsEligibleForDirectPlay(item, maxBitrateSetting, subtitleStream, options)) + if (isEligibleForDirectPlay || isEligibleForDirectStream) { // See if it can be direct played - var directPlay = GetVideoDirectPlayProfile(options, options.Profile, item, videoStream, audioStream); + PlayMethod? directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream, isEligibleForDirectPlay, isEligibleForDirectStream); if (directPlay != null) { @@ -416,6 +418,7 @@ namespace MediaBrowser.Model.Dlna playlistItem.AudioBitrate = GetAudioBitrate(playlistItem.TargetAudioChannels, playlistItem.TargetAudioCodec); } + int? maxBitrateSetting = options.GetMaxBitrate(); // Honor max rate if (maxBitrateSetting.HasValue) { @@ -448,11 +451,12 @@ namespace MediaBrowser.Model.Dlna return 128000; } - private PlayMethod? GetVideoDirectPlayProfile(VideoOptions options, - DeviceProfile profile, + private PlayMethod? GetVideoDirectPlayProfile(DeviceProfile profile, MediaSourceInfo mediaSource, MediaStream videoStream, - MediaStream audioStream) + MediaStream audioStream, + bool isEligibleForDirectPlay, + bool isEligibleForDirectStream) { // See if it can be direct played DirectPlayProfile directPlay = null; @@ -571,28 +575,34 @@ namespace MediaBrowser.Model.Dlna } } - if (mediaSource.Protocol == MediaProtocol.Http) + if (isEligibleForDirectPlay) { - if (_localPlayer.CanAccessUrl(mediaSource.Path, mediaSource.RequiredHttpHeaders.Count > 0)) + if (mediaSource.Protocol == MediaProtocol.Http) { - return PlayMethod.DirectPlay; + if (_localPlayer.CanAccessUrl(mediaSource.Path, mediaSource.RequiredHttpHeaders.Count > 0)) + { + return PlayMethod.DirectPlay; + } } - } - else if (mediaSource.Protocol == MediaProtocol.File) - { - if (_localPlayer.CanAccessFile(mediaSource.Path)) + else if (mediaSource.Protocol == MediaProtocol.File) { - return PlayMethod.DirectPlay; + if (_localPlayer.CanAccessFile(mediaSource.Path)) + { + return PlayMethod.DirectPlay; + } } } - if (!mediaSource.SupportsDirectStream) + if (isEligibleForDirectStream) { - return null; + if (mediaSource.SupportsDirectStream) + { + return PlayMethod.DirectStream; + } } - - return PlayMethod.DirectStream; + + return null; } private bool IsEligibleForDirectPlay(MediaSourceInfo item, diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index 395aed067..5ca36d8f8 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.595</version> + <version>3.0.597</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.595" /> + <dependency id="MediaBrowser.Common" version="3.0.597" /> <dependency id="NLog" version="3.2.0.0" /> <dependency id="SimpleInjector" version="2.7.0" /> </dependencies> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index a0838e321..c8ee52f09 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.595</version> + <version>3.0.597</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Model.Signed.nuspec b/Nuget/MediaBrowser.Model.Signed.nuspec index 854ba8353..35aca7ac0 100644 --- a/Nuget/MediaBrowser.Model.Signed.nuspec +++ b/Nuget/MediaBrowser.Model.Signed.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Model.Signed</id> - <version>3.0.595</version> + <version>3.0.597</version> <title>MediaBrowser.Model - Signed Edition</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 76bd7b755..4f2225f8f 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.595</version> + <version>3.0.597</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.595" /> + <dependency id="MediaBrowser.Common" version="3.0.597" /> </dependencies> </metadata> <files> |
