Reputation: 8053
I want to get rid of you tube play button you see on image, and also this first frame if possible.
I want to use my own play button, and my own first frame as img tag, which actually is already there, and working. But when I run API playVideo() method, then I hide my play button and first frame, and I see (for few moments) that there is youtube play button and youtube first frame which you can see on attached image. And after this few moments it disappears, and shows loading gif.
Upvotes: 4
Views: 10999
Reputation: 1
Add a button for save video
<asp:Button ID="buttonInsert" runat="server" Text="Add video" OnClick="buttonInsert_Click"/>
Take a hidden field for hold the value of image.
<asp:HiddenField ID="VideoId" runat="server" ClientIDMode="Static" />
Write the javascript code as follows to get the image
<script type="text/javascript">
$(document).ready(function () {
$("#buttonInsert").click(function () {
var youtubeid = $("#textBoxScript").val().match(/[\w\-]{11,}/)[0];
$("#VideoId").val("http://i1.ytimg.com/vi/" + youtubeid + "/0.jpg")
});
});
</script>
Save the value of hidden fiels in to database.
protected void buttonInsert_Click(object sender, EventArgs e)
{
try
{
string ThumbnailImage = VideoId.Value;
//save ThumbnailImage into database
//and when you get video list you will get as a image.
//on that image you can also add Play icon
}
catch
{ }
}
Upvotes: 0