private void PlaybackAsset() { if (checkBoxPreviewStream.Checked && checkBoxTrimming.Checked) { IAsset myAsset = _selectedAssets.FirstOrDefault(); Uri myuri = AssetInfo.GetValidOnDemandURI(myAsset); if (myuri == null) { try { _tempLocator = null; _tempLocator = AssetInfo.CreatedTemporaryOnDemandLocator(myAsset); myuri = AssetInfo.GetValidOnDemandURI(myAsset); } catch { } } if (myuri != null) { string myurl = AssetInfo.DoPlayBackWithStreamingEndpoint(typeplayer: PlayerType.AzureMediaPlayerFrame, Urlstr: AssetInfo.RW(myuri, https: true).ToString(), DoNotRewriteURL: true, context: _context, formatamp: AzureMediaPlayerFormats.Auto, technology: AzureMediaPlayerTechnologies.Auto, launchbrowser: false, UISelectSEFiltersAndProtocols: false, mainForm: _mainform); webBrowserPreview.Url = new Uri(myurl); } } else { webBrowserPreview.Url = null; } }
private void PlaybackAsset() { if (checkBoxPreviewStream.Checked && checkBoxTrimming.Checked) { IAsset myAsset = _selectedAssets.FirstOrDefault(); Uri myuri = AssetInfo.GetValidOnDemandURI(myAsset); if (myuri == null) { _tempLocator = AssetInfo.CreatedTemporaryOnDemandLocator(myAsset); myuri = AssetInfo.GetValidOnDemandURI(myAsset); } if (myuri != null) { string myurl = AssetInfo.DoPlayBackWithBestStreamingEndpoint(typeplayer: PlayerType.AzureMediaPlayerFrame, Urlstr: myuri.ToString(), DoNotRewriteURL: true, context: _context, formatamp: AzureMediaPlayerFormats.Auto, technology: AzureMediaPlayerTechnologies.Auto, launchbrowser: false); // string myurl = "http://nab2015-dev.azurewebsites.net/#/channels/LiveChannelStreamDemo/program-schedule/112485dc-2d26-422b-99e9-56240f6d70da // webBrowserPreview2.Url = new Uri(myurl); //string myurl = "http://whatsmyuseragent.com/"; //string myurl = "http://*****:*****@"C:\Users\xpouyat\Documents\visual studio 2013\Projects\dynamic_registerEvents.htm"); } } else { webBrowserPreview2.Url = null; } }
private void ExportAssetExcel(IAsset asset, Excel.Worksheet xlWorkSheet, int row, bool detailed, bool localtime) { xlWorkSheet.Cells[row, 1] = asset.Name; xlWorkSheet.Cells[row, 2] = asset.Id; xlWorkSheet.Cells[row, 3] = localtime ? asset.LastModified.ToLocalTime() : asset.LastModified; xlWorkSheet.Cells[row, 4] = AssetInfo.GetAssetType(asset); xlWorkSheet.Cells[row, 5] = AssetInfo.GetSize(asset); var url = AssetInfo.GetValidOnDemandURI(asset); xlWorkSheet.Cells[row, 6] = url != null?url.ToString() : string.Empty; if (localtime) { xlWorkSheet.Cells[row, 7] = asset.Locators.Any() ? (DateTime?)asset.Locators.Max(l => l.ExpirationDateTime).ToLocalTime() : null; } else { xlWorkSheet.Cells[row, 7] = asset.Locators.Any() ? (DateTime?)asset.Locators.Max(l => l.ExpirationDateTime) : null; } if (detailed) { xlWorkSheet.Cells[row, 8] = asset.AlternateId; xlWorkSheet.Cells[row, 9] = asset.StorageAccount.Name; var streamingloc = asset.Locators.Where(l => l.Type == LocatorType.OnDemandOrigin); xlWorkSheet.Cells[row, 10] = streamingloc.Count(); if (localtime) { xlWorkSheet.Cells[row, 11] = streamingloc.Any() ? (DateTime?)streamingloc.Min(l => l.ExpirationDateTime).ToLocalTime() : null; xlWorkSheet.Cells[row, 12] = streamingloc.Any() ? (DateTime?)streamingloc.Max(l => l.ExpirationDateTime).ToLocalTime() : null; } else { xlWorkSheet.Cells[row, 11] = streamingloc.Any() ? (DateTime?)streamingloc.Min(l => l.ExpirationDateTime) : null; xlWorkSheet.Cells[row, 12] = streamingloc.Any() ? (DateTime?)streamingloc.Max(l => l.ExpirationDateTime) : null; } var sasloc = asset.Locators.Where(l => l.Type == LocatorType.Sas); xlWorkSheet.Cells[row, 13] = sasloc.Count(); if (localtime) { xlWorkSheet.Cells[row, 14] = sasloc.Any() ? (DateTime?)sasloc.Min(l => l.ExpirationDateTime).ToLocalTime() : null; xlWorkSheet.Cells[row, 15] = sasloc.Any() ? (DateTime?)sasloc.Max(l => l.ExpirationDateTime).ToLocalTime() : null; } else { xlWorkSheet.Cells[row, 14] = sasloc.Any() ? (DateTime?)sasloc.Min(l => l.ExpirationDateTime) : null; xlWorkSheet.Cells[row, 15] = sasloc.Any() ? (DateTime?)sasloc.Max(l => l.ExpirationDateTime) : null; } xlWorkSheet.Cells[row, 16] = asset.GetEncryptionState(AssetDeliveryProtocol.SmoothStreaming | AssetDeliveryProtocol.HLS | AssetDeliveryProtocol.Dash).ToString(); } }
private void PlaybackAsset() { if (checkBoxPreviewStream.Checked && checkBoxTrimming.Checked && _tempStreamingLocator != null) { Asset myAsset = _selectedAssets.FirstOrDefault(); Uri myuri = AssetInfo.GetValidOnDemandURI(myAsset, _amsClientV3, _tempStreamingLocator.Name); if (myuri != null) { string myurl = AssetInfo.DoPlayBackWithStreamingEndpoint(typeplayer: PlayerType.AzureMediaPlayerFrame, path: AssetInfo.RW(myuri, https: true).ToString(), DoNotRewriteURL: true, client: _amsClientV3, formatamp: AzureMediaPlayerFormats.Auto, technology: AzureMediaPlayerTechnologies.Auto, launchbrowser: false, UISelectSEFiltersAndProtocols: false, mainForm: _mainform); webBrowserPreview.Url = new Uri(myurl); } else { webBrowserPreview.Url = null; } } else { webBrowserPreview.Url = null; } }