【发布时间】:2017-10-02 14:26:12
【问题描述】:
您好,我使用 codeigniter 和 bootstrap 开发了一个网站,我在我的管理页面中上传了 youtube url,并使用 iframe 在我的视图页面中获取该 url 并加载该 url。但是当我检查网站时,youtube 视频没有显示,错误显示如下
拒绝在框架中显示“https://www.youtube.com/watch?v=7Ct59FQIbAU”,因为它将“X-Frame-Options”设置为“sameorigin”。 广告:522 GET https://www.youtube.com/watch?v=7Ct59FQIbAU net::ERR_BLOCKED_BY_RESPONSE
当我检查这个网站时,网址显示但视频没有显示..这是该网站的网址www.clicx.in/pixelerror
在我的本地服务器上它的工作
查看代码是
<div class="container">
<div class="row">
<?php foreach($advertisement as $ad) { ?>
<!-- 4:3 aspect ratio -->
<div class="embed-responsive embed-responsive-4by3">
<iframe class="embed-responsive-item" src="<?php echo $ad->url?>"></iframe>
</div>
<?php }?>
</div>
</div>
【问题讨论】:
-
YouTube 只允许将非常具体的 URL 嵌入其他网站。他们会在每个视频页面上为您提供该 URL。
-
@ceejoz 那你的评论......但我不能清楚地理解
标签: php html codeigniter twitter-bootstrap-3 youtube