mirror of
				https://github.com/jellyfin/jellyfin.git
				synced 2025-11-04 03:27:21 -05:00 
			
		
		
		
	embed recording button into video player
This commit is contained in:
		
							parent
							
								
									db90483238
								
							
						
					
					
						commit
						c9ee7633ca
					
				@ -52,6 +52,18 @@ namespace Emby.Common.Implementations.Net
 | 
				
			|||||||
            {
 | 
					            {
 | 
				
			||||||
                throw new SocketCreateException(ex.SocketErrorCode.ToString(), ex);
 | 
					                throw new SocketCreateException(ex.SocketErrorCode.ToString(), ex);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					            catch (ArgumentException ex)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (dualMode)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    // Mono for BSD incorrectly throws ArgumentException instead of SocketException
 | 
				
			||||||
 | 
					                    throw new SocketCreateException("AddressFamilyNotSupported", ex);
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    throw;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public ISocket CreateTcpSocket(IpAddressInfo remoteAddress, int remotePort)
 | 
					        public ISocket CreateTcpSocket(IpAddressInfo remoteAddress, int remotePort)
 | 
				
			||||||
 | 
				
			|||||||
@ -110,8 +110,11 @@ namespace MediaBrowser.Api.Playback.Hls
 | 
				
			|||||||
                            throw;
 | 
					                            throw;
 | 
				
			||||||
                        }
 | 
					                        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                        var waitForSegments = state.SegmentLength >= 10 ? 2 : 3;
 | 
					                        var minSegments = state.MinSegments;
 | 
				
			||||||
                        await WaitForMinimumSegmentCount(playlist, waitForSegments, cancellationTokenSource.Token).ConfigureAwait(false);
 | 
					                        if (minSegments > 0)
 | 
				
			||||||
 | 
					                        {
 | 
				
			||||||
 | 
					                            await WaitForMinimumSegmentCount(playlist, minSegments, cancellationTokenSource.Token).ConfigureAwait(false);
 | 
				
			||||||
 | 
					                        }
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                finally
 | 
					                finally
 | 
				
			||||||
 | 
				
			|||||||
@ -42,6 +42,9 @@ namespace MediaBrowser.Api.Playback
 | 
				
			|||||||
        public string LiveStreamId { get; set; }
 | 
					        public string LiveStreamId { get; set; }
 | 
				
			||||||
        public string Tag { get; set; }
 | 
					        public string Tag { get; set; }
 | 
				
			||||||
        public string SegmentContainer { get; set; }
 | 
					        public string SegmentContainer { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int? SegmentLength { get; set; }
 | 
				
			||||||
 | 
					        public int? MinSegments { get; set; }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public class VideoStreamRequest : StreamRequest
 | 
					    public class VideoStreamRequest : StreamRequest
 | 
				
			||||||
 | 
				
			|||||||
@ -60,6 +60,11 @@ namespace MediaBrowser.Api.Playback
 | 
				
			|||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
 | 
					                if (Request.SegmentLength.HasValue)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Request.SegmentLength.Value;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
 | 
					                if (string.Equals(OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    var userAgent = UserAgent ?? string.Empty;
 | 
					                    var userAgent = UserAgent ?? string.Empty;
 | 
				
			||||||
@ -86,6 +91,19 @@ namespace MediaBrowser.Api.Playback
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int MinSegments
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            get
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (Request.MinSegments.HasValue)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    return Request.MinSegments.Value;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                return SegmentLength >= 10 ? 2 : 3;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool IsSegmentedLiveStream
 | 
					        public bool IsSegmentedLiveStream
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            get
 | 
					            get
 | 
				
			||||||
 | 
				
			|||||||
@ -484,6 +484,15 @@ namespace MediaBrowser.Model.Dlna
 | 
				
			|||||||
                playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps;
 | 
					                playlistItem.CopyTimestamps = transcodingProfile.CopyTimestamps;
 | 
				
			||||||
                playlistItem.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
 | 
					                playlistItem.EnableSubtitlesInManifest = transcodingProfile.EnableSubtitlesInManifest;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (transcodingProfile.MinSegments > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    playlistItem.MinSegments = transcodingProfile.MinSegments;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                if (transcodingProfile.SegmentLength > 0)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    playlistItem.SegmentLength = transcodingProfile.SegmentLength;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels))
 | 
					                if (!string.IsNullOrEmpty(transcodingProfile.MaxAudioChannels))
 | 
				
			||||||
                {
 | 
					                {
 | 
				
			||||||
                    int transcodingMaxAudioChannels;
 | 
					                    int transcodingMaxAudioChannels;
 | 
				
			||||||
 | 
				
			|||||||
@ -6,6 +6,7 @@ using MediaBrowser.Model.MediaInfo;
 | 
				
			|||||||
using MediaBrowser.Model.Session;
 | 
					using MediaBrowser.Model.Session;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Globalization;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace MediaBrowser.Model.Dlna
 | 
					namespace MediaBrowser.Model.Dlna
 | 
				
			||||||
@ -37,6 +38,9 @@ namespace MediaBrowser.Model.Dlna
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        public string VideoProfile { get; set; }
 | 
					        public string VideoProfile { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public int? SegmentLength { get; set; }
 | 
				
			||||||
 | 
					        public int? MinSegments { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public bool RequireAvc { get; set; }
 | 
					        public bool RequireAvc { get; set; }
 | 
				
			||||||
        public bool DeInterlace { get; set; }
 | 
					        public bool DeInterlace { get; set; }
 | 
				
			||||||
        public bool RequireNonAnamorphic { get; set; }
 | 
					        public bool RequireNonAnamorphic { get; set; }
 | 
				
			||||||
@ -291,6 +295,16 @@ namespace MediaBrowser.Model.Dlna
 | 
				
			|||||||
            if (!isDlna && isHls)
 | 
					            if (!isDlna && isHls)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                list.Add(new NameValuePair("SegmentContainer", item.Container ?? string.Empty));
 | 
					                list.Add(new NameValuePair("SegmentContainer", item.Container ?? string.Empty));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (item.SegmentLength.HasValue)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    list.Add(new NameValuePair("SegmentLength", item.SegmentLength.Value.ToString(CultureInfo.InvariantCulture)));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                if (item.MinSegments.HasValue)
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
 | 
					                    list.Add(new NameValuePair("MinSegments", item.MinSegments.Value.ToString(CultureInfo.InvariantCulture)));
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            return list;
 | 
					            return list;
 | 
				
			||||||
 | 
				
			|||||||
@ -42,6 +42,12 @@ namespace MediaBrowser.Model.Dlna
 | 
				
			|||||||
        [XmlAttribute("maxAudioChannels")]
 | 
					        [XmlAttribute("maxAudioChannels")]
 | 
				
			||||||
        public string MaxAudioChannels { get; set; }
 | 
					        public string MaxAudioChannels { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [XmlAttribute("minSegments")]
 | 
				
			||||||
 | 
					        public int MinSegments { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        [XmlAttribute("segmentLength")]
 | 
				
			||||||
 | 
					        public int SegmentLength { get; set; }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public List<string> GetAudioCodecs()
 | 
					        public List<string> GetAudioCodecs()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            List<string> list = new List<string>();
 | 
					            List<string> list = new List<string>();
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user