mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-05-25 18:16:56 +01:00
fixes #888 - Support m3u8 subtitle playlists
This commit is contained in:
@@ -90,8 +90,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
public CodecProfile[] CodecProfiles { get; set; }
|
||||
public ResponseProfile[] ResponseProfiles { get; set; }
|
||||
|
||||
public SubtitleProfile[] SoftSubtitleProfiles { get; set; }
|
||||
public SubtitleProfile[] ExternalSubtitleProfiles { get; set; }
|
||||
public SubtitleProfile[] SubtitleProfiles { get; set; }
|
||||
|
||||
public DeviceProfile()
|
||||
{
|
||||
@@ -100,9 +99,6 @@ namespace MediaBrowser.Model.Dlna
|
||||
ResponseProfiles = new ResponseProfile[] { };
|
||||
CodecProfiles = new CodecProfile[] { };
|
||||
ContainerProfiles = new ContainerProfile[] { };
|
||||
|
||||
SoftSubtitleProfiles = new SubtitleProfile[] { };
|
||||
ExternalSubtitleProfiles = new SubtitleProfile[] { };
|
||||
|
||||
XmlRootAttributes = new XmlAttribute[] { };
|
||||
|
||||
|
||||
@@ -518,7 +518,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
{
|
||||
// See if the device can retrieve the subtitles externally
|
||||
bool supportsSubsExternally = options.Context == EncodingContext.Streaming &&
|
||||
ContainsSubtitleFormat(options.Profile.ExternalSubtitleProfiles, _serverTextSubtitleOutputs);
|
||||
ContainsSubtitleFormat(options.Profile.SubtitleProfiles, SubtitleDeliveryMethod.External, _serverTextSubtitleOutputs);
|
||||
|
||||
if (supportsSubsExternally)
|
||||
{
|
||||
@@ -526,7 +526,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
}
|
||||
|
||||
// See if the device can retrieve the subtitles externally
|
||||
bool supportsEmbedded = ContainsSubtitleFormat(options.Profile.SoftSubtitleProfiles, _serverTextSubtitleOutputs);
|
||||
bool supportsEmbedded = ContainsSubtitleFormat(options.Profile.SubtitleProfiles, SubtitleDeliveryMethod.Embed, _serverTextSubtitleOutputs);
|
||||
|
||||
if (supportsEmbedded)
|
||||
{
|
||||
@@ -547,11 +547,11 @@ namespace MediaBrowser.Model.Dlna
|
||||
return codec;
|
||||
}
|
||||
|
||||
private bool ContainsSubtitleFormat(SubtitleProfile[] profiles, string[] formats)
|
||||
private bool ContainsSubtitleFormat(SubtitleProfile[] profiles, SubtitleDeliveryMethod method, string[] formats)
|
||||
{
|
||||
foreach (SubtitleProfile profile in profiles)
|
||||
{
|
||||
if (ListHelper.ContainsIgnoreCase(formats, profile.Format))
|
||||
if (method == profile.Method && ListHelper.ContainsIgnoreCase(formats, profile.Format))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -476,6 +476,10 @@ namespace MediaBrowser.Model.Dlna
|
||||
/// <summary>
|
||||
/// The external
|
||||
/// </summary>
|
||||
External = 2
|
||||
External = 2,
|
||||
/// <summary>
|
||||
/// The HLS
|
||||
/// </summary>
|
||||
Hls = 3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,5 +9,8 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
[XmlAttribute("protocol")]
|
||||
public string Protocol { get; set; }
|
||||
|
||||
[XmlAttribute("method")]
|
||||
public SubtitleDeliveryMethod Method { get; set; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user