Youtube video not getting played on html website - html

I have uploaded three videos on my youtube channel, however, when I'm trying to put those three videos on my HTML website, among those videos one gets played, and the other two videos show the thumbnail but when I try to play it shows that the video is unavailable. I've attached the embedded code for that video.
<iframe width="100%" height="228" src="https://www.youtube.com/embed/U5jhsfVzcAk" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
It would be great if someone can suggest something on this!

This video is blocked in embeded mode. Try with this Casey Neistat video id : bzE-IMaegzQ it will work.
Here's the Google's policy : https://support.google.com/youtube/answer/6301625?hl=en

The autoplay policy was changed recently.
here is a post describing the options:
YouTube Autoplay not working

Related

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.

How to embed a video in MailChimp?

I am new to HTML/CSS basics and am trying to embed a video in MailChimp but I met a problem.
When I used the code block in MailChimp to embed a YouTube video like this:
<iframe width="560" height="315" src="https://www.youtube.com/embed/ABRwvcAtRNk" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
it showed on the screen. However, when I previewed the email, the video just wouldn't show up.
I wonder where the problem is and how I can embed a video using MailChimp.
Thank you so much!!!
<iframe> are usually not well supported in email clients. It looks like Mailchimp has a specific Video content block to insert videos in emails: https://mailchimp.com/en/help/add-video-to-a-campaign/

How to configure my html to play videos youtube?

I'm a newbie in HTML ... I'm trying to do my best ;)
I want to add an youtube video, to do that I've added this piece of code:
<iframe width="560" height="315" src="https://www.youtube.com/embed/BLABLA" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
it works ... but, the video never plays... loading loading ... and loading
I'm under eclipse, so I tried to play the video in the Web Browser editor.
I tried to play another video (without "embed" in the url, but a classical url) and same ... loading loading ...
I've filled the network connection in the Preferences to bypass my proxy
Maybe the youtube subscription blocks the video??
Another idea ?
Many thanks
Christelle

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?

Autoplay next video in embedded YouTube player

There is an Autoplay feature on YouTube which plays the next recommended video.
How do I go about enabling this in an embedded YouTube player?
The YouTube API here explains an autoplay function but this isn't the same. The feature they describe is automatically playing the video as soon as the web page is loaded.
Is there any way to implement the Autoplay feature found on YouTube in an embedded video frame?
as i understand the idea is to have the same behaviour using embedded youtube (YouTube Iframe-API) as using the normal youtube.com with autoplay set to true.
the only way i found so far is to fetch a videoId through an api call as described here: https://stackoverflow.com/a/19732072/10956686
and then use player.loadVideoById() after PlayerState.ENDED event is fired.
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.ENDED && !done) {
player.loadVideoById(myFetchedNextVideoId);
}
}
but this could lead to a lot of API quota usage.
As per the options listed in the youtube api reference page https://developers.google.com/youtube/iframe_api_reference
there aren't any specific option to enable that feature you are looking for.
But, You can achieve this through other approach to make the embedded youtube video player to play the next video automatically.
for that, you have to embed a video from playlist instead of embedding a video directly
<iframe width="727" height="409" src="https://www.youtube.com/embed/NTM4kxNjAIY?list=PLelK7aEMtfK2wpv7tv472alrDpNwO_0jw" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
<iframe width="727" height="409" src="https://www.youtube.com/embed/211t6r12XPQ" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen>
</iframe>
Maybe this is AI or UI copy link to some website