Beispiel #1
0
        public async Task <int> GetServerPortAsync()
        {
            if (_netStore == null)
            {
                throw new ArgumentException(nameof(_netStore));
            }

            var hlsPort = DefaultServerPort;

            var retrieveConfigurationArgs = new RetrieveConfigurationArgs();

            var result = await _netStore.ExecuteAsync(retrieveConfigurationArgs);

            foreach (var item in result)
            {
                if (item.ComponentConfigType == typeof(StandardsBasedNetStoreServerConfig))
                {
                    var config = new StandardsBasedNetStoreServerConfig();
                    JsonHelper.Populate(item.Json, config);
                    if (config.HttpPort.HasValue)
                    {
                        hlsPort = config.HttpPort.Value;
                    }
                }
            }

            return(hlsPort);
        }
        private async Task <int> GetDashApiPort()
        {
            var streamingPort             = 8585;
            var retrieveConfigurationArgs = new RetrieveConfigurationArgs();

            var result = await HyperStore.ExecuteAsync(retrieveConfigurationArgs);

            foreach (var item in result)
            {
                if (item.ComponentConfigType == typeof(StandardsBasedNetStoreServerConfig))
                {
                    var config = new StandardsBasedNetStoreServerConfig();
                    JsonHelper.Populate(item.Json, config);
                    if (config.HttpsPort.HasValue)
                    {
                        streamingPort = config.HttpsPort.Value;
                    }
                }
            }

            return(streamingPort);
        }