fixes #888 - Support m3u8 subtitle playlists

This commit is contained in:
Luke Pulverenti
2014-08-05 21:09:03 -04:00
parent 3ba6364f25
commit 3ff3d04284
33 changed files with 187 additions and 84 deletions

View File

@@ -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[] { };

View File

@@ -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;
}

View File

@@ -476,6 +476,10 @@ namespace MediaBrowser.Model.Dlna
/// <summary>
/// The external
/// </summary>
External = 2
External = 2,
/// <summary>
/// The HLS
/// </summary>
Hls = 3
}
}

View File

@@ -9,5 +9,8 @@ namespace MediaBrowser.Model.Dlna
[XmlAttribute("protocol")]
public string Protocol { get; set; }
[XmlAttribute("method")]
public SubtitleDeliveryMethod Method { get; set; }
}
}