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
Related
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.
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.
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>
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.
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?