mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-14 11:40:42 +01:00
Add MediaStreamProtocol enum (#10153)
* Add MediaStreamProtocol enum * Add default handling for enum during deserialization --------- Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
@@ -36,7 +36,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
public string? Container { get; set; }
|
||||
|
||||
public string? SubProtocol { get; set; }
|
||||
public MediaStreamProtocol SubProtocol { get; set; }
|
||||
|
||||
public long StartPositionTicks { get; set; }
|
||||
|
||||
@@ -670,7 +670,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
if (MediaType == DlnaProfileType.Audio)
|
||||
{
|
||||
if (string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase))
|
||||
if (SubProtocol == MediaStreamProtocol.Hls)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/audio/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
|
||||
}
|
||||
@@ -678,7 +678,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/audio/{1}/stream{2}?{3}", baseUrl, ItemId, extension, queryString);
|
||||
}
|
||||
|
||||
if (string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase))
|
||||
if (SubProtocol == MediaStreamProtocol.Hls)
|
||||
{
|
||||
return string.Format(CultureInfo.InvariantCulture, "{0}/videos/{1}/master.m3u8?{2}", baseUrl, ItemId, queryString);
|
||||
}
|
||||
@@ -716,9 +716,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
long startPositionTicks = item.StartPositionTicks;
|
||||
|
||||
var isHls = string.Equals(item.SubProtocol, "hls", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (isHls)
|
||||
if (item.SubProtocol == MediaStreamProtocol.Hls)
|
||||
{
|
||||
list.Add(new NameValuePair("StartTimeTicks", string.Empty));
|
||||
}
|
||||
@@ -780,7 +778,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
|
||||
list.Add(new NameValuePair("SubtitleCodec", item.SubtitleStreamIndex.HasValue && item.SubtitleDeliveryMethod == SubtitleDeliveryMethod.Embed ? subtitleCodecs : string.Empty));
|
||||
|
||||
if (isHls)
|
||||
if (item.SubProtocol == MediaStreamProtocol.Hls)
|
||||
{
|
||||
list.Add(new NameValuePair("SegmentContainer", item.Container ?? string.Empty));
|
||||
|
||||
@@ -831,7 +829,7 @@ namespace MediaBrowser.Model.Dlna
|
||||
var list = new List<SubtitleStreamInfo>();
|
||||
|
||||
// HLS will preserve timestamps so we can just grab the full subtitle stream
|
||||
long startPositionTicks = string.Equals(SubProtocol, "hls", StringComparison.OrdinalIgnoreCase)
|
||||
long startPositionTicks = SubProtocol == MediaStreamProtocol.Hls
|
||||
? 0
|
||||
: (PlayMethod == PlayMethod.Transcode && !CopyTimestamps ? StartPositionTicks : 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user