示例#1
0
        public void CommonSetUp()
        {
            var logger            = new Mock <ILogger <CmafProxyService> >();
            var httpClientFactory = new Mock <IHttpClientFactory>();

            _proxy = new CmafProxyService(logger.Object, httpClientFactory.Object);

            var expectedFolder = "./manifests/cmaf/expected";
            var sourceFolder   = "./manifests/cmaf/source";

            foreach (var path in Directory.GetFiles(expectedFolder))
            {
                var text = File.ReadAllText(path);
                if (string.IsNullOrWhiteSpace(text))
                {
                    throw new System.Exception("A test file is empty: " + expectedFolder + "/" + path);
                }
                var filename = Path.GetFileName(path);
                _expected.Add(filename, text);
            }

            foreach (var path in Directory.GetFiles(sourceFolder))
            {
                var text = File.ReadAllText(path);
                if (string.IsNullOrWhiteSpace(text))
                {
                    throw new System.Exception("A test file is empty: " + sourceFolder + "/" + path);
                }
                var filename = Path.GetFileName(path);
                _manifests.Add(filename, text);
            }
        }
 public CmafProxyController(StreamingTokenHelper streamingTokenHelper,
                            CmafProxyService proxyService,
                            IOptions <LivestreamOptions> options,
                            UrlSigner urlSigner)
 {
     _streamingTokenHelper = streamingTokenHelper;
     _proxyService         = proxyService;
     _urlSigner            = urlSigner;
     _liveOptions          = options.Value;
 }