diff options
Diffstat (limited to 'Jellyfin.Api')
5 files changed, 24 insertions, 4 deletions
diff --git a/Jellyfin.Api/Controllers/MediaInfoController.cs b/Jellyfin.Api/Controllers/MediaInfoController.cs index bc52be184..f22ac0b73 100644 --- a/Jellyfin.Api/Controllers/MediaInfoController.cs +++ b/Jellyfin.Api/Controllers/MediaInfoController.cs @@ -209,6 +209,7 @@ public class MediaInfoController : BaseJellyfinApiController enableTranscoding.Value, allowVideoStreamCopy.Value, allowAudioStreamCopy.Value, + playbackInfoDto?.AlwaysBurnInSubtitleWhenTranscoding ?? false, Request.HttpContext.GetNormalizedRemoteIP()); } @@ -236,7 +237,8 @@ public class MediaInfoController : BaseJellyfinApiController StartTimeTicks = startTimeTicks, SubtitleStreamIndex = subtitleStreamIndex, UserId = userId ?? Guid.Empty, - OpenToken = mediaSource.OpenToken + OpenToken = mediaSource.OpenToken, + AlwaysBurnInSubtitleWhenTranscoding = playbackInfoDto?.AlwaysBurnInSubtitleWhenTranscoding ?? false }).ConfigureAwait(false); info.MediaSources = new[] { openStreamResult.MediaSource }; @@ -261,6 +263,7 @@ public class MediaInfoController : BaseJellyfinApiController /// <param name="openLiveStreamDto">The open live stream dto.</param> /// <param name="enableDirectPlay">Whether to enable direct play. Default: true.</param> /// <param name="enableDirectStream">Whether to enable direct stream. Default: true.</param> + /// <param name="alwaysBurnInSubtitleWhenTranscoding">Always burn-in subtitle when transcoding.</param> /// <response code="200">Media source opened.</response> /// <returns>A <see cref="Task"/> containing a <see cref="LiveStreamResponse"/>.</returns> [HttpPost("LiveStreams/Open")] @@ -277,7 +280,8 @@ public class MediaInfoController : BaseJellyfinApiController [FromQuery] Guid? itemId, [FromBody] OpenLiveStreamDto? openLiveStreamDto, [FromQuery] bool? enableDirectPlay, - [FromQuery] bool? enableDirectStream) + [FromQuery] bool? enableDirectStream, + [FromQuery] bool? alwaysBurnInSubtitleWhenTranscoding) { userId ??= openLiveStreamDto?.UserId; userId = RequestHelpers.GetUserId(User, userId); @@ -295,7 +299,8 @@ public class MediaInfoController : BaseJellyfinApiController DeviceProfile = openLiveStreamDto?.DeviceProfile, EnableDirectPlay = enableDirectPlay ?? openLiveStreamDto?.EnableDirectPlay ?? true, EnableDirectStream = enableDirectStream ?? openLiveStreamDto?.EnableDirectStream ?? true, - DirectPlayProtocols = openLiveStreamDto?.DirectPlayProtocols ?? new[] { MediaProtocol.Http } + DirectPlayProtocols = openLiveStreamDto?.DirectPlayProtocols ?? new[] { MediaProtocol.Http }, + AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding ?? openLiveStreamDto?.AlwaysBurnInSubtitleWhenTranscoding ?? false }; return await _mediaInfoHelper.OpenMediaSource(HttpContext, request).ConfigureAwait(false); } diff --git a/Jellyfin.Api/Controllers/UniversalAudioController.cs b/Jellyfin.Api/Controllers/UniversalAudioController.cs index fe7353496..41c4886d4 100644 --- a/Jellyfin.Api/Controllers/UniversalAudioController.cs +++ b/Jellyfin.Api/Controllers/UniversalAudioController.cs @@ -160,6 +160,7 @@ public class UniversalAudioController : BaseJellyfinApiController true, true, true, + false, Request.HttpContext.GetNormalizedRemoteIP()); } diff --git a/Jellyfin.Api/Helpers/MediaInfoHelper.cs b/Jellyfin.Api/Helpers/MediaInfoHelper.cs index 9bda27031..5050cab41 100644 --- a/Jellyfin.Api/Helpers/MediaInfoHelper.cs +++ b/Jellyfin.Api/Helpers/MediaInfoHelper.cs @@ -156,6 +156,7 @@ public class MediaInfoHelper /// <param name="enableTranscoding">Enable transcoding.</param> /// <param name="allowVideoStreamCopy">Allow video stream copy.</param> /// <param name="allowAudioStreamCopy">Allow audio stream copy.</param> + /// <param name="alwaysBurnInSubtitleWhenTranscoding">Always burn-in subtitle when transcoding.</param> /// <param name="ipAddress">Requesting IP address.</param> public void SetDeviceSpecificData( BaseItem item, @@ -175,6 +176,7 @@ public class MediaInfoHelper bool enableTranscoding, bool allowVideoStreamCopy, bool allowAudioStreamCopy, + bool alwaysBurnInSubtitleWhenTranscoding, IPAddress ipAddress) { var streamBuilder = new StreamBuilder(_mediaEncoder, _logger); @@ -188,7 +190,8 @@ public class MediaInfoHelper Profile = profile, MaxAudioChannels = maxAudioChannels, AllowAudioStreamCopy = allowAudioStreamCopy, - AllowVideoStreamCopy = allowVideoStreamCopy + AllowVideoStreamCopy = allowVideoStreamCopy, + AlwaysBurnInSubtitleWhenTranscoding = alwaysBurnInSubtitleWhenTranscoding, }; if (string.Equals(mediaSourceId, mediaSource.Id, StringComparison.OrdinalIgnoreCase)) @@ -420,6 +423,7 @@ public class MediaInfoHelper true, true, true, + request.AlwaysBurnInSubtitleWhenTranscoding, httpContext.GetNormalizedRemoteIP()); } else diff --git a/Jellyfin.Api/Models/MediaInfoDtos/OpenLiveStreamDto.cs b/Jellyfin.Api/Models/MediaInfoDtos/OpenLiveStreamDto.cs index 53104988f..978e99b35 100644 --- a/Jellyfin.Api/Models/MediaInfoDtos/OpenLiveStreamDto.cs +++ b/Jellyfin.Api/Models/MediaInfoDtos/OpenLiveStreamDto.cs @@ -66,6 +66,11 @@ public class OpenLiveStreamDto public bool? EnableDirectStream { get; set; } /// <summary> + /// Gets or sets a value indicating whether always burn in subtitles when transcoding. + /// </summary> + public bool? AlwaysBurnInSubtitleWhenTranscoding { get; set; } + + /// <summary> /// Gets or sets the device profile. /// </summary> public DeviceProfile? DeviceProfile { get; set; } diff --git a/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs b/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs index 9e12ddde6..82f603ca1 100644 --- a/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs +++ b/Jellyfin.Api/Models/MediaInfoDtos/PlaybackInfoDto.cs @@ -82,4 +82,9 @@ public class PlaybackInfoDto /// Gets or sets a value indicating whether to auto open the live stream. /// </summary> public bool? AutoOpenLiveStream { get; set; } + + /// <summary> + /// Gets or sets a value indicating whether always burn in subtitles when transcoding. + /// </summary> + public bool? AlwaysBurnInSubtitleWhenTranscoding { get; set; } } |
