update hls subtitles
This commit is contained in:
parent
8cce9d5f6f
commit
75c0371835
|
@ -1554,6 +1554,13 @@ namespace MediaBrowser.Api.Playback
|
|||
{
|
||||
request.TranscodingMaxAudioChannels = int.Parse(val, UsCulture);
|
||||
}
|
||||
else if (i == 28)
|
||||
{
|
||||
if (videoRequest != null)
|
||||
{
|
||||
videoRequest.EnableSubtitlesInManifest = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2126,6 +2133,7 @@ namespace MediaBrowser.Api.Playback
|
|||
{
|
||||
state.VideoRequest.CopyTimestamps = transcodingProfile.CopyTimestamps;
|
||||
state.VideoRequest.ForceLiveStream = transcodingProfile.ForceLiveStream;
|
||||
state.VideoRequest.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -525,10 +525,16 @@ namespace MediaBrowser.Api.Playback.Hls
|
|||
|
||||
var subtitleGroup = subtitleStreams.Count > 0 &&
|
||||
request is GetMasterHlsVideoPlaylist &&
|
||||
(((GetMasterHlsVideoPlaylist)request).SubtitleMethod == SubtitleDeliveryMethod.Hls || ((GetMasterHlsVideoPlaylist)request).EnableSubtitlesInManifest) ?
|
||||
(state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Hls || state.VideoRequest.EnableSubtitlesInManifest) ?
|
||||
"subs" :
|
||||
null;
|
||||
|
||||
// If we're burning in subtitles then don't add additional subs to the manifest
|
||||
if (state.SubtitleStream != null && state.VideoRequest.SubtitleMethod == SubtitleDeliveryMethod.Encode)
|
||||
{
|
||||
subtitleGroup = null;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(subtitleGroup))
|
||||
{
|
||||
AddSubtitles(state, subtitleStreams, builder);
|
||||
|
|
|
@ -452,6 +452,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
playlistItem.VideoCodec = transcodingProfile.VideoCodec;
|
||||
playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps;
|
||||
playlistItem.ForceLiveStream = transcodingProfile.ForceLiveStream;
|
||||
playlistItem.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
|
||||
|
||||
if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels))
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
public bool CopyTimestamps { get; set; }
|
||||
public bool ForceLiveStream { get; set; }
|
||||
public bool EnableSubtitlesInManifest { get; set; }
|
||||
public string[] AudioCodecs { get; set; }
|
||||
|
||||
public int? AudioStreamIndex { get; set; }
|
||||
|
@ -249,6 +250,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty));
|
||||
|
||||
list.Add(new NameValuePair("TranscodingMaxAudioChannels", item.TranscodingMaxAudioChannels.HasValue ? StringHelper.ToStringCultureInvariant(item.TranscodingMaxAudioChannels.Value) : string.Empty));
|
||||
list.Add(new NameValuePair("EnableSubtitlesInManifest", item.EnableSubtitlesInManifest.ToString().ToLower()));
|
||||
|
||||
return list;
|
||||
}
|
||||
|
|
|
@ -38,6 +38,9 @@ namespace MediaBrowser.Model.Dlna
|
|||
[XmlAttribute("forceLiveStream")]
|
||||
public bool ForceLiveStream { get; set; }
|
||||
|
||||
[XmlAttribute("enableSubtitlesInManifest")]
|
||||
public bool EnableSubtitlesInManifest { get; set; }
|
||||
|
||||
[XmlAttribute("maxAudioChannels")]
|
||||
public string MaxAudioChannels { get; set; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user