html : iframe not showing content in html - html

I want to show a youtube video in html 4. For that, I am using iframe. But the content of iframe is not showing.
<iframe frameborder="1" width="420" height="345" src="https://www.youtube.com/watch?v=C8kSrkz8Hz8"></iframe>
FYI: I am using Firefox 29.0 and Chrome 35.0. Both browsers are showing the same result.

Change your src with //www.youtube.com/embed/C8kSrkz8Hz8
your code shoud look like this
<iframe frameborder="1" width="420" height="345" src="//www.youtube.com/embed/C8kSrkz8Hz8"></iframe>
Find code under each video on youtoube at Share menu.

When you try to put the whole YouTube page into an iframe, it sends a HTTP header called X-Frame-Options with the SAMEORIGIN value, which tells the browser, that the page can only be displayed in a frame on the same origin as the page itself.
You should use the provided embed code (you can find it below every YouTube video), which is also an iframe, but with a different URL. It will only show the player.
In this case, the embed code would be:
<iframe width="560" height="315" src="//www.youtube.com/embed/C8kSrkz8Hz8" frameborder="0" allowfullscreen></iframe>

replace you Iframe with this one. this works for you.
<iframe width="640" height="390" src="//www.youtube.com/embed/C8kSrkz8Hz8" frameborder="0" allowfullscreen></iframe>
missing attributes are: frameborder="0", allowfullscreen

You should change the youtube URL to remove the "s" so it looks like this:
<iframe width="420" height="345" src="//www.youtube.com/embed/C8kSrkz8Hz8" frameborder="1" allowfullscreen></iframe>
You should also be able to embed a youtube video from the page. Please see the screenshot attached:

I tried it this way and worked for me. Changing your src="https://www.youtube.com/embed/C8kSrkz8Hz8"
following the other parameters.

Related

How to reformat a video so it can be seen in an html webpage using <iframe>?

I am using the tag and some youtube videos show up but the specific video I want isn't in the correct format.
This is the tag with a random video (is working).
<iframe width="420" height="315"
src="https://www.youtube.com/embed/XGSy3_Czz8k">
</iframe>
This is with the video I want (not working).
<iframe width="420" height="315"
src="https://www.youtube.com/watch?v=9fJEFi3ccwI">
</iframe>
Can someone please help me reformat?
I wonder if you simply mean re-format the video URL?
Try as :
<iframe width="420" height="315"
src="https://www.youtube.com/embed/9fJEFi3ccwI">
</iframe>
Let me know if this works how you wanted?

Embed videos from Youtube, Vimeo, etc

I want to embed videos on my site, but I don't want to keep videos on my server. I want something like an iframe, but I want to be capable to use links from any source, not just from youtube or vimeo. What can I do?
<iframe width="560" height="349" src="https://www.youtube.com/embed/FM7MFYoylVs?enablejsapi=1&playsinline=1&controls=0" frameborder="0" allowfullscreen id="video"></iframe>
Here is what i've tried but that's not what I need.:(
I think iframe should be your best choice, But as iframe is not what you need , you can also have a look at object
<html>
<body>
<iframe src="http://www.youtube.com/embed/W7qWa52k-nE"
width="560" height="315" frameborder="0" allowfullscreen></iframe>
<object data="http://www.youtube.com/embed/W7qWa52k-nE"
width="560" height="315"></object>
<object data="http://player.vimeo.com/video/214414572"
width="561" height="316" frameborder="0" webkitAllowFullScreen mozallowfullscreen
allowFullScreen></object>
</body>
</html>
support to vimeo videos depents on the target as vimeo videos are flash. so if you display a vimeo video using iframe or object then as long as device is supported, it will show the video
It is possible to have your own iframe and then embed the required iframe or src as required.
So you would have a MASTER iframe that when loaded will hold the youtube iframe inside. And you can do the same with each option that you are requiring. Just set your iframe size to match the others.

iframe: Not able to run youtube videos on my html page

I am new to HTML and when I am trying to embed a youtube video in my html page using iframe tag, then it is getting embedded very well. Please see code below:
<iframe width="420" height="320" src="https://youtube.com/embed/FiMl6n64bTg"></iframe>
But when i am trying to run that video in my html page then it is showing
The video contains content from multi screen media. It is restricted from playback in certain sites. Watch on Youtube..
How can i run youtube video in my html page without this error/issue.
Thanks in advance!!!!
Try this
<iframe title="YouTube video player" class="youtube-player" type="text/html"
width="420" height="320" src="https://youtube.com/embed/FiMl6n64bTg"
frameborder="0" allowFullScreen></iframe>

Embed YouTube video - Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN' [duplicate]

This question already has answers here:
Embedding youtube video "Refused to display document because display forbidden by X-Frame-Options"
(10 answers)
Closed 5 years ago.
I am trying to feed my Django page with some resource I am getting from somewhere else.
Inside the feed, I have YouTube videos with URL like: https://www.youtube.com/watch?v=A6XUVjK9W4o
Once I added this into my page, the video does not show up, saying:
Refused to display 'https://www.youtube.com/watch?v=A6XUVjK9W4o' in a
frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
Then I said, well, what if I change watch to embed. Then YouTube player shows up, but no video, saying:
How can I get this to work?
I am showing it in HTML like this:
<iframe width="420" height="315"
src="{{vid.yt_url}}">
</iframe>
I googled almost for an hour, but no sign of success. I tried to append &output=embed - nada...
You must ensure the URL contains embed rather watch as the /embed endpoint allows outside requests, whereas the /watch endpoint does not.
<iframe width="420" height="315" src="https://www.youtube.com/embed/A6XUVjK9W4o" frameborder="0" allowfullscreen></iframe>
The YouTube URL in src must have and use the embed endpoint instead of watch, so for instance let’s say you want to embed this YouTube video: https://www.youtube.com/watch?v=P6N9782MzFQ (browser's URL).
You should use the embed endpoint, so the URL now should be something like https://www.youtube.com/embed/P6N9782MzFQ. Use this value as the URL in the src attribute inside the iframe tag in your HTML code, for example:
<iframe width="853" height="480" src="https://www.youtube.com/embed/P6N9782MzFQ" frameborder="0" allowfullscreen ng-show="showvideo"></iframe>
So just replace https://www.youtube.com/watch?v= with https://www.youtube.com/embed/ and of course check for your video's ID. In this sample, my video ID is P6N9782MzFQ.
You only need to copy <iframe> from the YouTube Embed section (click on SHARE below the video and then EMBED and copy the entire iframe).
If embed no longer works for you, try with /v instead:
<iframe width="420" height="315" src="https://www.youtube.com/v/A6XUVjK9W4o" frameborder="0" allowfullscreen></iframe>
Along with the embed, I also had to install the Google Cast extension in my browser.
<iframe width="1280" height="720" src="https://www.youtube.com/embed/4u856utdR94" frameborder="0" allowfullscreen></iframe>

Can I VEVO video embed autoplay?

I have searched high and low for any VEVO documentation, but there does not seems to be some.
Can VEVO video embeds be instructed to autoplay?
I have guessed several parameters like the one below.
<iframe width="575" height="324" src="http://cache.vevo.com/m/html/embed.html?video=GBA320903400" frameborder="0" autoplay="1" allowfullscreen></iframe>
I believe this is possible by adding "&autoplay=1" to the iframe URL.
<iframe width="575" height="324" src="http://cache.vevo.com/m/html/embed.html?video=GBA320903400&autoplay=1" frameborder="0" allowfullscreen></iframe>
you can iframe the embed player url, utm content none will hide the vevo logo and skip the ads showing in the player embed code.
now you will need to find the autostop enable...
<iframe width='480' height='270' src='http://www.vevo.com/watch/GBA320903400?utm_medium=embed_player&utm_content=none' frameborder='0' allowfullscreen scrolling='No'></iframe>