mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-09-06 11:34:57 +02:00
update hls
This commit is contained in:
parent
d9dcd21c47
commit
25125377e5
3 changed files with 23 additions and 7 deletions
|
@ -1677,7 +1677,7 @@ namespace MediaBrowser.Api.Playback
|
||||||
|
|
||||||
private void TryStreamCopy(StreamState state, VideoStreamRequest videoRequest)
|
private void TryStreamCopy(StreamState state, VideoStreamRequest videoRequest)
|
||||||
{
|
{
|
||||||
if (state.VideoStream != null && CanStreamCopyVideo(videoRequest, state.VideoStream))
|
if (state.VideoStream != null && CanStreamCopyVideo(state))
|
||||||
{
|
{
|
||||||
state.OutputVideoCodec = "copy";
|
state.OutputVideoCodec = "copy";
|
||||||
}
|
}
|
||||||
|
@ -1770,8 +1770,11 @@ namespace MediaBrowser.Api.Playback
|
||||||
state.MediaSource = mediaSource;
|
state.MediaSource = mediaSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual bool CanStreamCopyVideo(VideoStreamRequest request, MediaStream videoStream)
|
protected virtual bool CanStreamCopyVideo(StreamState state)
|
||||||
{
|
{
|
||||||
|
var request = state.VideoRequest;
|
||||||
|
var videoStream = state.VideoStream;
|
||||||
|
|
||||||
if (videoStream.IsInterlaced)
|
if (videoStream.IsInterlaced)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -500,13 +500,20 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
return ResultFactory.GetResult(playlistText, MimeTypes.GetMimeType("playlist.m3u8"), new Dictionary<string, string>());
|
return ResultFactory.GetResult(playlistText, MimeTypes.GetMimeType("playlist.m3u8"), new Dictionary<string, string>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsLiveStream(StreamState state)
|
||||||
|
{
|
||||||
|
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
|
||||||
|
|
||||||
|
return isLiveStream;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetMasterPlaylistFileText(StreamState state, int totalBitrate)
|
private string GetMasterPlaylistFileText(StreamState state, int totalBitrate)
|
||||||
{
|
{
|
||||||
var builder = new StringBuilder();
|
var builder = new StringBuilder();
|
||||||
|
|
||||||
builder.AppendLine("#EXTM3U");
|
builder.AppendLine("#EXTM3U");
|
||||||
|
|
||||||
var isLiveStream = (state.RunTimeTicks ?? 0) == 0;
|
var isLiveStream = IsLiveStream(state);
|
||||||
|
|
||||||
var queryStringIndex = Request.RawUrl.IndexOf('?');
|
var queryStringIndex = Request.RawUrl.IndexOf('?');
|
||||||
var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex);
|
var queryString = queryStringIndex == -1 ? string.Empty : Request.RawUrl.Substring(queryStringIndex);
|
||||||
|
@ -929,10 +936,16 @@ namespace MediaBrowser.Api.Playback.Hls
|
||||||
return isOutputVideo ? ".ts" : ".ts";
|
return isOutputVideo ? ".ts" : ".ts";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CanStreamCopyVideo(VideoStreamRequest request, MediaStream videoStream)
|
protected override bool CanStreamCopyVideo(StreamState state)
|
||||||
{
|
{
|
||||||
return false;
|
var isLiveStream = IsLiveStream(state);
|
||||||
//return base.CanStreamCopyVideo(request, videoStream);
|
|
||||||
|
if (!isLiveStream)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return base.CanStreamCopyVideo(state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -477,7 +477,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
|
|
||||||
var tags = files.Select(s =>
|
var tags = files.Select(s =>
|
||||||
{
|
{
|
||||||
if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1)
|
if (s.IndexOf("require", StringComparison.OrdinalIgnoreCase) == -1 && s.IndexOf("alameda", StringComparison.OrdinalIgnoreCase) == -1)
|
||||||
{
|
{
|
||||||
return string.Format("<script src=\"{0}\" async></script>", s);
|
return string.Format("<script src=\"{0}\" async></script>", s);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue