diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs
index f66363da67..4db70df9c0 100644
--- a/MediaBrowser.Api/Playback/BaseStreamingService.cs
+++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs
@@ -1482,6 +1482,17 @@ namespace MediaBrowser.Api.Playback
videoRequest.CopyTimestamps = string.Equals("true", val, StringComparison.OrdinalIgnoreCase);
}
}
+ else if (i == 25)
+ {
+ if (!string.IsNullOrWhiteSpace(val) && videoRequest != null)
+ {
+ SubtitleDeliveryMethod method;
+ if (Enum.TryParse(val, out method))
+ {
+ videoRequest.SubtitleMethod = method;
+ }
+ }
+ }
}
}
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 4a83615b4d..e3f6e15e20 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -529,7 +529,7 @@ namespace MediaBrowser.Api.Playback.Hls
"subs" :
null;
- AppendPlaylist(builder, playlistUrl, totalBitrate, subtitleGroup);
+ AppendPlaylist(builder, state, playlistUrl, totalBitrate, subtitleGroup);
if (EnableAdaptiveBitrateStreaming(state, isLiveStream))
{
@@ -540,12 +540,12 @@ namespace MediaBrowser.Api.Playback.Hls
var newBitrate = totalBitrate - variation;
var variantUrl = ReplaceBitrate(playlistUrl, requestedVideoBitrate, (requestedVideoBitrate - variation));
- AppendPlaylist(builder, variantUrl, newBitrate, subtitleGroup);
+ AppendPlaylist(builder, state, variantUrl, newBitrate, subtitleGroup);
variation *= 2;
newBitrate = totalBitrate - variation;
variantUrl = ReplaceBitrate(playlistUrl, requestedVideoBitrate, (requestedVideoBitrate - variation));
- AppendPlaylist(builder, variantUrl, newBitrate, subtitleGroup);
+ AppendPlaylist(builder, state, variantUrl, newBitrate, subtitleGroup);
}
if (!string.IsNullOrWhiteSpace(subtitleGroup))
@@ -635,9 +635,15 @@ namespace MediaBrowser.Api.Playback.Hls
//return state.VideoRequest.VideoBitRate.HasValue;
}
- private void AppendPlaylist(StringBuilder builder, string url, int bitrate, string subtitleGroup)
+ private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup)
{
- var header = "#EXT-X-STREAM-INF:BANDWIDTH=" + bitrate.ToString(UsCulture);
+ var header = "#EXT-X-STREAM-INF:BANDWIDTH=" + bitrate.ToString(UsCulture) + ",AVERAGE-BANDWIDTH=" + bitrate.ToString(UsCulture);
+
+ // tvos wants resolution, codecs, framerate
+ //if (state.TargetFramerate.HasValue)
+ //{
+ // header += string.Format(",FRAME-RATE=\"{0}\"", state.TargetFramerate.Value.ToString(CultureInfo.InvariantCulture));
+ //}
if (!string.IsNullOrWhiteSpace(subtitleGroup))
{
@@ -694,6 +700,7 @@ namespace MediaBrowser.Api.Playback.Hls
var builder = new StringBuilder();
builder.AppendLine("#EXTM3U");
+ builder.AppendLine("#EXT-X-PLAYLIST-TYPE:VOD");
builder.AppendLine("#EXT-X-VERSION:3");
builder.AppendLine("#EXT-X-TARGETDURATION:" + Math.Ceiling((segmentLengths.Length > 0 ? segmentLengths.Max() : state.SegmentLength)).ToString(UsCulture));
builder.AppendLine("#EXT-X-MEDIA-SEQUENCE:0");
diff --git a/MediaBrowser.Model/Dlna/StreamBuilder.cs b/MediaBrowser.Model/Dlna/StreamBuilder.cs
index d4ca379c03..665da030d4 100644
--- a/MediaBrowser.Model/Dlna/StreamBuilder.cs
+++ b/MediaBrowser.Model/Dlna/StreamBuilder.cs
@@ -423,7 +423,24 @@ namespace MediaBrowser.Model.Dlna
playlistItem.Container = transcodingProfile.Container;
playlistItem.EstimateContentLength = transcodingProfile.EstimateContentLength;
playlistItem.TranscodeSeekInfo = transcodingProfile.TranscodeSeekInfo;
- playlistItem.AudioCodec = transcodingProfile.AudioCodec.Split(',')[0];
+
+ // TODO: We should probably preserve the full list and sent it tp the server that way
+ string[] supportedAudioCodecs = transcodingProfile.AudioCodec.Split(',');
+ string inputAudioCodec = audioStream == null ? null : audioStream.Codec;
+ foreach (string supportedAudioCodec in supportedAudioCodecs)
+ {
+ if (StringHelper.EqualsIgnoreCase(supportedAudioCodec, inputAudioCodec))
+ {
+ playlistItem.AudioCodec = supportedAudioCodec;
+ break;
+ }
+ }
+
+ if (string.IsNullOrEmpty(playlistItem.AudioCodec))
+ {
+ playlistItem.AudioCodec = supportedAudioCodecs[0];
+ }
+
playlistItem.VideoCodec = transcodingProfile.VideoCodec;
playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps;
playlistItem.SubProtocol = transcodingProfile.Protocol;
@@ -761,7 +778,7 @@ namespace MediaBrowser.Model.Dlna
// Look for an external profile that matches the stream type (text/graphical)
foreach (SubtitleProfile profile in subtitleProfiles)
{
- if (profile.Method != SubtitleDeliveryMethod.External)
+ if (profile.Method != SubtitleDeliveryMethod.External && profile.Method != SubtitleDeliveryMethod.Hls)
{
continue;
}
@@ -771,7 +788,8 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format))
+ if ((profile.Method == SubtitleDeliveryMethod.External && subtitleStream.IsTextSubtitleStream == MediaStream.IsTextFormat(profile.Format)) ||
+ (profile.Method == SubtitleDeliveryMethod.Hls && subtitleStream.IsTextSubtitleStream))
{
bool requiresConversion = !StringHelper.EqualsIgnoreCase(subtitleStream.Codec, profile.Format);
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index 79ee1b5c58..69733cefbc 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -234,7 +234,8 @@ namespace MediaBrowser.Model.Dlna
}
list.Add(new NameValuePair("CopyTimestamps", (item.CopyTimestamps).ToString().ToLower()));
-
+ list.Add(new NameValuePair("SubtitleMethod", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod != SubtitleDeliveryMethod.External ? item.SubtitleDeliveryMethod.ToString() : string.Empty));
+
return list;
}
diff --git a/MediaBrowser.Model/FodyWeavers.xml b/MediaBrowser.Model/FodyWeavers.xml
deleted file mode 100644
index 7369928101..0000000000
--- a/MediaBrowser.Model/FodyWeavers.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj
index fda2402496..2500a27a82 100644
--- a/MediaBrowser.Model/MediaBrowser.Model.csproj
+++ b/MediaBrowser.Model/MediaBrowser.Model.csproj
@@ -14,6 +14,7 @@
v4.5
+ 60e95275
true
@@ -441,7 +442,6 @@
-
@@ -458,13 +458,6 @@
-
-
-
- This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
-
-