public LiveTvService(ILogger logger, IMediaEncoder mediaEncoder)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            logger.LogInformation("[TVHclient] LiveTvService()");

            _logger = logger;

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(_logger);
            _htsConnectionHandler.setLiveTvService(this);

            //Added for stream probing
            _mediaEncoder = mediaEncoder;
        }
        public LiveTvService(ILoggerFactory loggerFactory, IMediaEncoder mediaEncoder, IHttpClientFactory httpClientFactory)
        {
            //System.Diagnostics.StackTrace t = new System.Diagnostics.StackTrace();
            _logger = loggerFactory.CreateLogger <LiveTvService>();
            _logger.LogDebug("[TVHclient] LiveTvService()");

            _htsConnectionHandler = HTSConnectionHandler.GetInstance(loggerFactory, httpClientFactory);
            _htsConnectionHandler.setLiveTvService(this);

            {
                var lifeSpan       = TimeSpan.FromSeconds(15); // Revalidate tickets every 15 seconds
                var requestTimeout = TimeSpan.FromSeconds(10); // First request retry after 10 seconds
                var retries        = 2;                        // Number of times to retry getting tickets
                _channelTicketHandler   = new AccessTicketHandler(loggerFactory, _htsConnectionHandler, requestTimeout, retries, lifeSpan, Channel);
                _recordingTicketHandler = new AccessTicketHandler(loggerFactory, _htsConnectionHandler, requestTimeout, retries, lifeSpan, Recording);
            }

            //Added for stream probing
            _mediaEncoder = mediaEncoder;
        }