mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-22 01:54:42 +01:00
add more device options
This commit is contained in:
@@ -21,6 +21,11 @@ namespace MediaBrowser.Model.Devices
|
||||
/// <value>The last name of the user.</value>
|
||||
public string LastUserName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the name of the application.
|
||||
/// </summary>
|
||||
/// <value>The name of the application.</value>
|
||||
public string AppName { get; set; }
|
||||
/// <summary>
|
||||
/// Gets or sets the last user identifier.
|
||||
/// </summary>
|
||||
/// <value>The last user identifier.</value>
|
||||
|
||||
@@ -5,6 +5,7 @@ namespace MediaBrowser.Model.Devices
|
||||
{
|
||||
public string[] EnabledCameraUploadDevices { get; set; }
|
||||
public string CameraUploadPath { get; set; }
|
||||
public bool EnableCameraUploadSubfolders { get; set; }
|
||||
|
||||
public DevicesOptions()
|
||||
{
|
||||
|
||||
@@ -74,6 +74,9 @@ namespace MediaBrowser.Model.Dlna
|
||||
public bool RequiresPlainVideoItems { get; set; }
|
||||
public bool RequiresPlainFolders { get; set; }
|
||||
|
||||
public bool SupportsDirectRemoteContent { get; set; }
|
||||
public bool SupportsCustomHttpHeaders { get; set; }
|
||||
|
||||
public XmlAttribute[] XmlRootAttributes { get; set; }
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -82,7 +82,14 @@ namespace MediaBrowser.Model.Dlna
|
||||
// If that doesn't produce anything, just take the first
|
||||
foreach (StreamInfo i in streams)
|
||||
{
|
||||
if (i.IsDirectStream)
|
||||
if (i.PlayMethod == PlayMethod.DirectPlay)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
}
|
||||
foreach (StreamInfo i in streams)
|
||||
{
|
||||
if (i.PlayMethod == PlayMethod.DirectStream)
|
||||
{
|
||||
return i;
|
||||
}
|
||||
@@ -249,11 +256,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
if (IsEligibleForDirectPlay(item, maxBitrateSetting, subtitleStream, options))
|
||||
{
|
||||
// See if it can be direct played
|
||||
DirectPlayProfile directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream);
|
||||
var directPlay = GetVideoDirectPlayProfile(options.Profile, item, videoStream, audioStream);
|
||||
|
||||
if (directPlay != null)
|
||||
{
|
||||
playlistItem.PlayMethod = PlayMethod.DirectStream;
|
||||
playlistItem.PlayMethod = directPlay.Value;
|
||||
playlistItem.Container = item.Container;
|
||||
|
||||
if (subtitleStream != null)
|
||||
@@ -366,7 +373,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return 128000;
|
||||
}
|
||||
|
||||
private DirectPlayProfile GetVideoDirectPlayProfile(DeviceProfile profile,
|
||||
private PlayMethod? GetVideoDirectPlayProfile(DeviceProfile profile,
|
||||
MediaSourceInfo mediaSource,
|
||||
MediaStream videoStream,
|
||||
MediaStream audioStream)
|
||||
@@ -487,7 +494,21 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
}
|
||||
|
||||
return directPlay;
|
||||
if (mediaSource.Protocol == MediaProtocol.Http)
|
||||
{
|
||||
if (!profile.SupportsDirectRemoteContent)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (mediaSource.RequiredHttpHeaders.Count > 0 && !profile.SupportsCustomHttpHeaders)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return PlayMethod.DirectPlay;
|
||||
}
|
||||
|
||||
return PlayMethod.DirectStream;
|
||||
}
|
||||
|
||||
private bool IsEligibleForDirectPlay(MediaSourceInfo item,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System.Globalization;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Drawing;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
@@ -7,6 +6,7 @@ using MediaBrowser.Model.MediaInfo;
|
||||
using MediaBrowser.Model.Session;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
|
||||
namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
@@ -89,6 +89,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public string ToDlnaUrl(string baseUrl)
|
||||
{
|
||||
if (PlayMethod == PlayMethod.DirectPlay)
|
||||
{
|
||||
return MediaSource.Path;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(baseUrl))
|
||||
{
|
||||
throw new ArgumentNullException(baseUrl);
|
||||
|
||||
Reference in New Issue
Block a user