+ 3
Help.. Regarding source for a video..
How to display YouTube videos or any in video element or in an iframe? I tried many but it says that unable to display because it has set X-frame to sameorigin.??😥😥
21 Respuestas
+ 14
*Updated as second iframe in my code*
Acceptable format:
https://www.youtube.com/embed/AddFileNameXYZ
+ 14
No issues! 👍 Glad to be of help
+ 14
You mean full screen.. Just add this attribute to your iframe, allowfullscreen
<iframe src="https://www.youtube.com/embed/W0LHTWG-UmQ?controls=0&showinfo=0&rel=0&autoplay=1&loop=1&playlist=W0LHTWG-UmQ" frameborder="0" allowfullscreen></iframe>
+ 14
Can you share your code?
+ 13
I believe it doesn't recognize the shorter url.. Youtu.be.
I have stated the acceptable format here and updated the actual one in the code
+ 12
Did you try doing something like this-
<iframe src="https://www.Youtube.com/embed/jtZRe4jCFTU"></iframe>
It works for me!
+ 12
Here you go, used a random image as background https://code.sololearn.com/WXrFz7chZroo/?ref=app
+ 12
+ 6
that error in question means the site has blocked displaying web pages in a iframe(YouTube will not let you visit it in an iframe)
you need to specify the YouTube embed code you can get it easily
go to desktop YouTube website
below your video choose share
select embed code
copy the embed code
now include in your HTML web page
+ 2
One more doubt.. 😜😜
Can we make a video as a background??
+ 2
Background as that of image..
+ 2
@apoorva...??
+ 2
allowfullscreen.., backgroundborder='0' ??
I was asking a video as background.. ☺️
+ 1
Yeah I did.. Didnt work for me..
+ 1
Try this one.. https://youtu.be/lEmGl_vsAGQ
+ 1
That code worked..
Where did you find that link..??
+ 1
Both links seem to be different?.
+ 1
Thanks a lot @apoorva... Finally did it.. 😅😅👍👍