Hi
I have below code . In addition to this i want to get Video Url & Video in repeater
C#
using (var yt = new YouTubeService(new BaseClientService.Initializer()
{
ApiKey = "xyz",
}))
{
StringBuilder htmlTable = new StringBuilder();
var searchRequest = yt.Search.List("snippet");
searchRequest.ChannelId = "xyz";
var searchResponse = searchRequest.Execute();
var objResult = searchResponse.Items.ToList();
if (objResult != null)
{
htmlTable.Append("");
htmlTable.Append("ChannelTitleTitleDescriptionPublished");
htmlTable.Append("");
foreach (var colum in objResult)
{
htmlTable.Append("");
htmlTable.Append("" + colum.Snippet.ChannelTitle + "");
htmlTable.Append("" + colum.Snippet.Title + "");
htmlTable.Append("" + colum.Snippet.Description + "");
htmlTable.Append("" + colum.Snippet.PublishedAt + "");
htmlTable.Append("");
}
htmlTable.Append("");
htmlTable.Append("");
PlaceHolderTable.Controls.Add(new Literal { Text = htmlTable.ToString() });
}
}Thanks

Amit MohantyRank #112 · 20K reputationPosted Dec 12, 2022, 2:12 AM EST
Check this
var videoLink = "https://www.youtube.com/watch?v=" + colum.Snippet.ResourceId.VideoId; htmlTable.Append("" + videoLink + "");Amit MohantyRank #112 · 20K reputationPosted Dec 12, 2022, 1:53 AM EST
thy this
htmlTable.Append("Link");Amit MohantyRank #112 · 20K reputationPosted Dec 12, 2022, 1:25 AM EST
For video url try this
htmlTable.Append("" + "https://www.youtube.com/embed/" + colum.Snippet.ResourceId.VideoId + "");Ramco RamcoRank #462 · 5.4K reputationPosted Dec 12, 2022, 1:59 AM EST
Hi Amit
Instead of displaying Link it should display Url as Link.
Thanks
Ramco RamcoRank #462 · 5.4K reputationPosted Dec 12, 2022, 1:32 AM EST
Hi Amit
It is not showing .resourceId. Secondly i want to display it as a link
Thanks