Embed youtube videos - html

I want to put a video on my website using the embed option on youtube.It shows up but when i try to play it appears a text saiyng that the video is restricted on some websites and gives me the option to watch on youtube . I saw that i need to accept some terms of conditions and that includes the youtube API from what i saw .
Is there another way to put a video on a website without the API ? Also i should mention that the website is not on a server.
I'm using this iframe to show the video :
<iframe width="560" height="315" src="https://www.youtube.com/embed/dgV1n57ejCY" frameborder="0" allowfullscreen></iframe>

Related

Why does YouTube Player API show "This video is unavailable." when playing certain videos?

I am testing out some simple HTML5 code in order to play embedded YouTube videos in a browser. However, some videos (almost exclusively music videos) will not play in the browser. Instead, a error message stating "This video is unavailable appears" (as shown here).
This is the HTML code used to display the video:
<iframe width="560" height="315" src="https://www.youtube.com/embed/oGpFcHTxjZs" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
which is the exact code generated by YouTube when selecting their "Embed" option.
The iframe tag does work for some videos, however, as shown here:
<iframe width="560" height="315" src="https://www.youtube.com/embed/jxvPjuREDpE" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>
What is strange is that all types of embedded videos seem to work in an environment such as jsfiddle, but not when loading a separate HTML file into a browser.
A similar issue was asked here: "This video is unavailable" when putting music videos in iFrame , but is only resolved by running an http server, which is a completely new topic to me.
Does anyone know of an HTML/javscript fix to this issue? Thanks in advance.
I recently came across this as well. An interesting thing that I noticed is that the video becomes unavailable if the origin is not http(s).
So try this: create a local file server or upload the html file to somewhere and if you access the file from http protocol, the video will play.

YouTube iFrame automatically opens YouTube app. How can I stop this?

I used the default YouTube iFrame for my website. My users have said that upon entering the web app, it redirects them to youtube. I find this annoying for me and for my users.
Is there any way I can stop this from happening?
Here is the code that is causing the YouTube app to open:
<iframe width="560" height="315" src="https://www.youtube.com/embed/wCtedSNYBLc?rel=0&controls=0&showinfo=0" frameborder="0" allowfullscreen></iframe>
The site this is on can be found here.
You can use "playsinline" parameter to play the video inline instead.

How does a YouTube embedded video incorporate the player design?

I have designed custom video player controls for my HTML5 video. I was wondering how I can have that design incorporated to videos that are also embedded. I took a look at youtube to see how they would do it :
<iframe width="560" height="315" src="//www.youtube.com/embed/V1Q1FFTga8k" frameborder="0"
allowfullscreen></iframe>
This looks like a piece of a cake , but this doesn't show me how the player design was incorporated.
Can someone please explain to me how I can have my video design show on embedded videos.
Note: I am assuming that in order to make an embedded feature for my videos; I would just need the iframe with the set attributes and dynamically putting the url for whichever video is currently playing.

Embedding a Video in PowerPoint

Youtube provided the following code for a video I would like to embed in a presentation:
<iframe width="560" height="315" src="//www.youtube.com/embed/L6gtOVDG68g" frameborder="0" allowfullscreen></iframe>
However, powerpoint keeps giving me the error that it "cannot insert a video from this embed code." Is there an error in the code that youtube provided?
Usually to embed video from YouTube into a slide, it's best to download the YouTube Wizard plug in (here). After you do that there will be an "Insert YouTube video" command on your toolbar.
However, you'd probably be better off downloading the video and embedding it from inside PowerPoint and choosing Insert – > Movie – > Movie from file to put the video into the current slide. That way you don't need connection to the internet.

Embedding YouTube videos?

I have been looking for a way of embedding youtube videos into my site. The website is made of html and the youtube videos should auto-update as I would like to display all the videos on the current account? I know theres ways of embedding one video or playlists but Im not quite sure how to go about embedding everything on a users channel? Any Tips?
Just use the following as the src of an iframe:
http://www.youtube.com/embed/?listType=user_uploads&list=*USERNAME*
For example:
<iframe id="ytplayer" width="640" height="360"
src="http://www.youtube.com/embed/?listType=user_uploads&list=apple"
frameborder="0" allowfullscreen>
You can get info on the parammeters of the player on this link: https://developers.google.com/youtube/player_parameters#Manual_IFrame_Embeds
Scroll a little and you will see the url for user videos.