How can I solve the error I'm still getting from my embedded youtube video? - html

I'm trying to embed a youtube video into one of my certification projects and I made sure to add the "embed" within the url but I'm still getting an error
<iframe id="video" width="444" height="281" src="https://www.youtube.com/embed/gYvoD2RZK1A&t=164s&ab_channel=BLOCKHEAD">Video not available...</iframe>
Open to any input thank you very much

The embed is not working because the first GET is a & and not a ? in the source link. Read more about HTTP Method GET
Here is the embed code for your video at the starting point 2:44.
<iframe id="video" width="444" height="281" src="https://www.youtube.com/embed/gYvoD2RZK1A?start=164" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
If you click the share button under youtube videos and then embed, youtube generates the embed code you need!

Just take away the excess
<iframe id="video" width="444" height="281" src="https://www.youtube.com/embed/gYvoD2RZK1A"></iframe>

Related

How to embed youtube livestream chat based on channel id

I've been trying to do some basic embedding from Yt on my HTML paged, and I got it to display the livestream itself perfectly. The livestream embed references my channel, so if I decide to livestream whenever, I do not have to change the video id every time to do so.
<iframe width="560" height="315" src="https://www.youtube.com/embed/live_stream?channel=UC0F8uoItJ00zVdyJllC-6yA&modestbranding=1&autohide=1&showinfo=0&autoplay=1&mute=1&origin=http://alecharvey.net"
title="YouTube video player" frameborder="0" autoplay=1 allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
Now, the next thing I wanted was to do the same thing but for the livestream's chat. I tried this:
<iframe width="350px" height="500px" src="https://www.youtube.com/live_chat?channel=UC0F8uoItJ00zVdyJllC-6yA;embed_domain=alecharvey.net"></iframe>
but it didnt work. I figured if i replaced the v=VIDEO_ID with channel=CHANNEL_ID that it would reference the a currently-runnning livestream on my channel and embed the chat from that livestream, but I guess I am wrong. Is there a way of doing this? What is the proper syntax? Do I just have to reference the stream itself to get its chat, like from above?
Thank you for any useful/helpful advice
you need to use & instead of ;
From this
https://www.youtube.com/live_chat?channel=UC0F8uoItJ00zVdyJllC-6yA;embed_domain=alecharvey.net
to this
https://www.youtube.com/live_chat?channel=UC0F8uoItJ00zVdyJllC-6yA&embed_domain=alecharvey.net
I hope this helps.

why doesnt my html video work neither if it is a youtube link(like in this case) nor if i use mp4?

i am trying to include a video into my html project, but when i run the code, the video doesnt work. what is the problem?
<video src="https://www.youtube.com/watch?v=rt-2cxAiPJk" controls width="400px"></video>
<video src="https://www.youtube.com/watch?v=5VYb3B1ETlk&t=1s" controls width="400px"></video>
<video src="https://www.youtube.com/watch?v=x_me3xsvDgk&t=1s" controls width="400px"></video>
I think the src is expecting to find a file on your machine, or possibly you can't play a video from a different domain. I'm not sure what the exact requirements are for src but it's probably a domain issue.
YouTube does provide embed code for videos and they use an iframe to make them work. I tested on my machine and with the iframe it works. For your first video it's
<iframe width="857" height="482"
src="https://www.youtube.com/embed/rt-2cxAiPJk"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write;
encrypted-media; gyroscope; picture-in-picture"
allowfullscreen>
</iframe>
You can probably just copy that for every video and change the src.
You can right-click a video on YouTube to get the embed code.

Remove Youtube branding after embedding video in web page?

I've a problem with removing Youtube logos after embedding it inside a Web Page.
I mean this logo
I've already tried with modestbranding=1 and showinfo=0 inside my HTML code with no success. I also need that the video have no buttons, bars or something any user can interact with. My actual code is this:
<iframe id="ytplayer" type="text/html" width="720" height="405" src="https://www.youtube.com/embed/GTLf1lLRdbU cc_load_policy=1&controls=0&disablekb=1&enablejsapi=1&modestbranding=1&iv_load_policy=3&showinfo=0" frameborder="0" allowfullscreen></iframe>
Any solution to my issue? Thank you in advice.
pretty straightforward, this is the code:
<iframe allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="405" src="https://www.youtube.com/embed/GTLf1lLRdbU?enablejsapi=1" width="720" data-gtm-yt-inspected-11424724_51="true" id="59623043"></iframe>

Adding youtube link in html

I tried adding this youtube link into my html code and everytime I try to play the video, it gives me a playback error.
I was just wondering if I am missing any piece of code or if it just internet issues?
Thanks
The code is in the comments because for some reason it is not letting me attach my code in the body.
If you go to that actual video https://www.youtube.com/watch?v=TbDyiwurjwI
and then go to "Share" then "Embed" you'll see the embed code is
<iframe width="560" height="315" src="https://www.youtube.com/embed/TbDyiwurjwI" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
So the iframe URL is https://www.youtube.com/embed/TbDyiwurjwI not http://youtube.com/embed/watch?v=TbDyiwurjwI
I don't know where you got http://youtube.com/embed/watch?v=TbDyiwurjwI from, but you can't just construct URLs and hope they work, the server has to support them.

In the HTML code to embed a YouTube video, what does accelerometer, gyroscope, and picture-in-picture do?

Once you finish uploading a video on Youtube, there is suggested embedding HTML code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/UF8uR6Z6KLc" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
What exactly does the accelerometer, gyroscope, and picture-in-picture do?
According to YouTube Help section:
Picture in Picture - Read Here
Allows you to watch YouTube videos while using other apps on your mobile device.
Gyroscope & Accelerometer
This usually refers to when a user rotates or moves their device around, so I'm guessing this would be for when someone embeds a Virtual Reality or 360degree video?