When using an embedded Soundcloud player in a iframe:
<iframe width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/251273255&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
it stores cookies.
How to embed a Soundcloud player without cookies?
Note: I already tried <iframe ... sandbox> or even sandbox="allow-scripts" as suggested in Recommended method to prevent any content inside iframe from setting cookies but then the player doesn't work.
<iframe sandbox="allow-same-origin allow-scripts allow-popups allow-forms" width="100%" height="300" scrolling="no" frameborder="no" allow="autoplay" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/251273255&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
Please try this sandbox="allow-same-origin allow-scripts allow-popups allow-forms"
This question is similar to:
Disable Cookies Inside A Frame/Iframe
But here is the code you need:
<iframe sandbox="allow-scripts" src="//w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/251273255&color=%23ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false&show_teaser=true&visual=true"></iframe>
This code blocks cookies and allows cache and cache is not cookies. Although similar they are not the same. Here is proof that it takes only cache and not cookies.
Related
My Google Map iframe stops working after adding the sandbox attribute. I tried to embed the map without it and it worked. I'm not sure why and would be happy for help
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d244882.93248659256!2d-96.26493913191504!3d41.29067020779935!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sil!4v1630314849966!5m2!1sen!2sil"
width="550"
height="450"
style="border:0;"
allowfullscreen
loading="lazy"
sandbox="allow-forms allow-modals allow-pointer-lock allow-popups allow-popups-to-escape-sandbox allow-top-navigation"
></iframe>
If I remove the sandbox attribute, it works again.
Google Maps requires, at minimum, allow-scripts:
<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d244882.93248659256!2d-96.26493913191504!3d41.29067020779935!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sen!2sil!4v1630314849966!5m2!1sen!2sil"
width="550"
height="450"
style="border:0;"
allowfullscreen
loading="lazy"
sandbox="allow-scripts"
></iframe>
You can add extra things as you wish. Here's a list I found from Discourse:
sandbox="allow-same-origin allow-scripts allow-forms allow-popups allow-popups-to-escape-sandbox allow-presentation"
But if script execution is blocked, the map is not going to load.
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.
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.
I am trying to insert a iframe on my website, http://freefreemarkets.com, that allows me to insert the website showing what I am selling on eBay.
I have never created an iframe before.
<iframe src="http://www.website.com"></iframe>
And you can edit how you want by adding stuff like:
width="400" height="215" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" etc..
You need to use an iframe, by specifying the src attribute:
<iframe src="http://www.example.com"></iframe>
Some websites doesn't support to be embedded in iframe, be careful.
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>