How can I hide the YouTube play button on a video?

I want to get rid of you if you see an image on the screen, and perhaps this first frame.

enter image description here

I want to use my own play button and my own first frame as an img tag that actually already exists and works. But when I run the playVideo () API method, I hide my play button and the first frame, and I see (for a few moments) that there is a youtube play button and the first YouTube frame that you can see in the attached image. And after a few seconds it disappears and shows the gif loading.

+4
source share
2 answers

I believe this is not possible. Thus, the only way to hide the Play button is to place a video image above the video that can be retrieved from YouTube. See this link .

+3
source

Add button to save video

<asp:Button ID="buttonInsert" runat="server" Text="Add video" OnClick="buttonInsert_Click"/> 

Take the hidden field to hold the image value.

 <asp:HiddenField ID="VideoId" runat="server" ClientIDMode="Static" /> 

Enter javascript code as follows to get 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 settings in the 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 { } } 
0
source

Source: https://habr.com/ru/post/1396955/


All Articles