private void ChooseStreamingEndpoint_Load(object sender, EventArgs e)
        {
            label.Text = string.Format(label.Text, _asset.Name);

            // SE List
            IStreamingEndpoint BestSE = AssetInfo.GetBestStreamingEndpoint(_context);

            foreach (var se in _context.StreamingEndpoints)
            {
                listBoxSE.Items.Add(new Item(string.Format("{0} ({1}, {2} scale unit{3})", se.Name, se.State, se.ScaleUnits, se.ScaleUnits > 1 ? "s" : string.Empty), se.Id + "|" + se.HostName));
                if (se.Id == BestSE.Id)
                {
                    listBoxSE.SelectedIndex = listBoxSE.Items.Count - 1;
                }
                foreach (var custom in se.CustomHostNames)
                {
                    listBoxSE.Items.Add(new Item(string.Format("{0} ({1}, {2} scale unit{3}) Custom hostname : {4}", se.Name, se.State, se.ScaleUnits, se.ScaleUnits > 1 ? "s" : string.Empty, custom), se.Id + "|" + custom));
                }
            }

            // Filters
            listBoxFilter.Items.Add(new Item("(none)", null));
            // asset filters
            _asset.AssetFilters.ToList().ForEach(f =>
            {
                listBoxFilter.Items.Add(new Item("asset filter : " + f.Name, f.Name));
                if (_filter != null && f.Name == _filter)
                {
                    listBoxFilter.SelectedIndex = listBoxFilter.Items.Count - 1;
                }
            }
                                                 );

            // global filters
            _context.Filters.ToList().ForEach(f =>
            {
                listBoxFilter.Items.Add(new Item("global filter : " + f.Name, f.Name));
                if (_filter != null && f.Name == _filter && listBoxFilter.SelectedIndex < 0) // only if not already selected (asset filter priuority > global filter)
                {
                    listBoxFilter.SelectedIndex = listBoxFilter.Items.Count - 1;
                }
            }
                                              );

            if (listBoxFilter.SelectedIndex < 0)
            {
                listBoxFilter.SelectedIndex = 0;
            }


            if (_playertype == PlayerType.DASHIFRefPlayer || _playertype == PlayerType.DASHLiveAzure)
            {
                radioButtonDASH.Checked = true;
            }
        }
Beispiel #2
0
        private void ChooseStreamingEndpoint_Load(object sender, EventArgs e)
        {
            label.Text = string.Format(label.Text, _asset.Name);

            // SE List
            IStreamingEndpoint BestSE = AssetInfo.GetBestStreamingEndpoint(_context);

            foreach (var se in _context.StreamingEndpoints)
            {
                listBoxSE.Items.Add(new Item(string.Format(AMSExplorer.Properties.Resources.AssetInformation_AssetInformation_Load_012ScaleUnit, se.Name, se.State, StreamingEndpointInformation.ReturnTypeSE(se)), se.Id + "|" + se.HostName));
                if (se.Id == BestSE.Id)
                {
                    listBoxSE.SelectedIndex = listBoxSE.Items.Count - 1;
                }
                foreach (var custom in se.CustomHostNames)
                {
                    listBoxSE.Items.Add(new Item(string.Format(AMSExplorer.Properties.Resources.AssetInformation_AssetInformation_Load_012ScaleUnitCustomHostname3, se.Name, se.State, StreamingEndpointInformation.ReturnTypeSE(se), custom), se.Id + "|" + custom));
                }
            }

            // Filters

            // asset filters
            var afilters      = _asset.AssetFilters.ToList();
            var afiltersnames = afilters.Select(a => a.Name).ToList();

            afilters.ForEach(f =>
            {
                var lvitem = new ListViewItem(new string[] { AMSExplorer.Properties.Resources.ChooseStreamingEndpoint_ChooseStreamingEndpoint_Load_AssetFilter + f.Name, f.Name });
                if (_filter != null && f.Name == _filter)
                {
                    lvitem.Checked = true;
                }
                listViewFilters.Items.Add(lvitem);
            }
                             );

            // global filters
            _context.Filters.ToList().ForEach(f =>
            {
                var lvitem = new ListViewItem(new string[] { AMSExplorer.Properties.Resources.ChooseStreamingEndpoint_ChooseStreamingEndpoint_Load_GlobalFilter + f.Name, f.Name });
                if (_filter != null && f.Name == _filter && listViewFilters.CheckedItems.Count == 0) // only if not already selected (asset filter priority > global filter)
                {
                    lvitem.Checked = true;
                }
                if (afiltersnames.Contains(f.Name)) // global filter with same name than asset filter
                {
                    lvitem.ForeColor = Color.Gray;
                }
                listViewFilters.Items.Add(lvitem);
            }
                                              );


            if (_playertype == PlayerType.DASHIFRefPlayer)
            {
                radioButtonDASHCSF.Checked = true;
            }

            comboBoxBrowser.Items.Add(new Item(AMSExplorer.Properties.Resources.ChooseStreamingEndpoint_ChooseStreamingEndpoint_Load_DefaultBrowser, string.Empty));
            if (_displayBrowserSelection)
            { // let's add the browser options to lplayback the content (IE, Edge, Chrome...)
                if (IsWindows10())
                {
                    comboBoxBrowser.Items.Add(new Item(Constants.BrowserEdge[0], Constants.BrowserEdge[1]));
                }
                comboBoxBrowser.Items.Add(new Item(Constants.BrowserIE[0], Constants.BrowserIE[1]));
                comboBoxBrowser.Items.Add(new Item(Constants.BrowserChrome[0], Constants.BrowserChrome[1]));
                comboBoxBrowser.SelectedIndex = 0;
            }
            comboBoxBrowser.Visible = _displayBrowserSelection;

            UpdatePreviewUrl();
        }
        private void ChooseStreamingEndpoint_Load(object sender, EventArgs e)
        {
            label.Text = string.Format(label.Text, _asset.Name);

            // SE List
            IStreamingEndpoint BestSE = AssetInfo.GetBestStreamingEndpoint(_context);

            foreach (var se in _context.StreamingEndpoints)
            {
                listBoxSE.Items.Add(new Item(string.Format("{0} ({1}, {2} scale unit{3})", se.Name, se.State, se.ScaleUnits, se.ScaleUnits > 1 ? "s" : string.Empty), se.Id + "|" + se.HostName));
                if (se.Id == BestSE.Id)
                {
                    listBoxSE.SelectedIndex = listBoxSE.Items.Count - 1;
                }
                foreach (var custom in se.CustomHostNames)
                {
                    listBoxSE.Items.Add(new Item(string.Format("{0} ({1}, {2} scale unit{3}) Custom hostname : {4}", se.Name, se.State, se.ScaleUnits, se.ScaleUnits > 1 ? "s" : string.Empty, custom), se.Id + "|" + custom));
                }
            }

            // Filters

            // asset filters
            var afilters      = _asset.AssetFilters.ToList();
            var afiltersnames = afilters.Select(a => a.Name).ToList();

            afilters.ForEach(f =>
            {
                var lvitem = new ListViewItem(new string[] { "asset filter : " + f.Name, f.Name });
                if (_filter != null && f.Name == _filter)
                {
                    lvitem.Checked = true;
                }
                listViewFilters.Items.Add(lvitem);
            }
                             );

            // global filters
            _context.Filters.ToList().ForEach(f =>
            {
                var lvitem = new ListViewItem(new string[] { "global filter : " + f.Name, f.Name });
                if (_filter != null && f.Name == _filter && listViewFilters.CheckedItems.Count == 0) // only if not already selected (asset filter priority > global filter)
                {
                    lvitem.Checked = true;
                }
                if (afiltersnames.Contains(f.Name)) // global filter with same name than asset filter
                {
                    lvitem.ForeColor = Color.Gray;
                }
                listViewFilters.Items.Add(lvitem);
            }
                                              );



            if (_playertype == PlayerType.DASHIFRefPlayer || _playertype == PlayerType.DASHLiveAzure)
            {
                radioButtonDASH.Checked = true;
            }

            UpdatePreviewUrl();
        }