1 回答

TA貢獻1846條經驗 獲得超7個贊
根據媒體服務過濾文檔,用戶只能通過“name”、“properties.created”和“properties.endTime”過濾“Streaming Locators”。
https://learn.microsoft.com/en-us/azure/media-services/latest/entities-overview#streaming-locators
在您的示例中,您嘗試使用不支持的assetId/assetName 進行過濾。因此 400 Bad request 錯誤。請參閱郵遞員中的詳細錯誤示例
這是使用流式定位器“名稱”標簽的有效過濾示例。
注意:這不是資產標簽
用于使用“名稱”成功過濾流式定位器的 C# 示例
try
{
// GUID need to be specified in single quote. using OData v 3.0
var odataquery = new ODataQuery<StreamingLocator>("name eq '65a1cb0d-ce7c-4470-93ac-fedf66450ea0'");
IPage<StreamingLocator> locators = client.StreamingLocators.List("mediatest", "mymediatestaccount", odataquery);
Console.WriteLine(locators.FirstOrDefault().Name);
Console.WriteLine(locators.FirstOrDefault().StreamingLocatorId);
Console.WriteLine(locators.FirstOrDefault().Id);
ListPathsResponse paths = client.StreamingLocators.ListPaths("mediatest", "mymediatestaccount", locators.FirstOrDefault().Name);
foreach (StreamingPath path in paths.StreamingPaths)
{
UriBuilder uriBuilder = new UriBuilder();
uriBuilder.Scheme = "https";
uriBuilder.Host = "webinars-use2.streaming.media.azure.net";
uriBuilder.Path = path.Paths[0];
Console.WriteLine(uriBuilder.ToString());
}
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
我希望這有幫助。
- 1 回答
- 0 關注
- 97 瀏覽
添加回答
舉報