嵌入YouTube视频 - 拒绝显示在一个帧中,因为它将“X-Frame-Options”设置为“SAMEORIGIN” [英] embed youtube video - Refused to display in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'
问题描述
我正在尝试用我从别的地方获得的资源来提供我的django页面。
I am trying to feed my django page with some resource I am getting from somewhere else.
里面的feed,我有一个网页的YouTube视频,如: https://www.youtube.com/watch?v=A6XUVjK9W4o
inside feed, I have youtube videos with url like: https://www.youtube.com/watch?v=A6XUVjK9W4o
一旦我添加到我的页面,视频不会显示:
once I added this into my page, video doesnot show up saying:
拒绝显示 https://www.youtube.com/watch?v= A6XUVjK9W4o '在
框架中,因为它将'X-Frame-Options'设置为'SAMEORIGIN'。
Refused to display 'https://www.youtube.com/watch?v=A6XUVjK9W4o' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.
然后我说,好吧,如果我将 watch
更改为 embed
。然后,YouTube播放器显示,但没有视频,说:
Then I said, well, what if I change watch
to embed
. Then youtube player shows up, but no video, saying:
有没有人有一个线索我该如何工作?
does anyone have a clue how I get this to work?
我以html的形式显示:
I am showing in html like this:
<iframe width="420" height="315"
src="{{vid.yt_url}}">
</iframe>
我已经吞噬了一个小时,没有成功的迹象。我试图追加& output = embed
.. nada ..
I googled almost for an hour, no sign of success. I tried to append &output=embed
.. nada..
推荐答案
p>尝试一下,请
<iframe width="420" height="315" src="https://www.youtube.com/embed/A6XUVjK9W4o" frameborder="0" allowfullscreen></iframe>
这篇关于嵌入YouTube视频 - 拒绝显示在一个帧中,因为它将“X-Frame-Options”设置为“SAMEORIGIN”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!