【问题标题】:how to embed YouTube channel URL in php?如何在 php 中嵌入 YouTube 频道 URL?
【发布时间】:2015-12-03 00:25:18
【问题描述】:

我正在尝试在我的 php 页面中嵌入 YouTube 频道 URL。但它给出了以下错误:

拒绝在 a 中显示“https://www.youtube.com/channel/fakecode” 框架,因为它将“X-Frame-Options”设置为“SAMEORIGIN”。

<div id="bgvideo" >
                <div class="container" >
                    <div class="row" >
                        <div class="col-sm-8 col-sm-offset-2">
                            <div class="responsive-video">
                                <iframe width="420" height="315" src="https://www.youtube.com/channel/fakecode" frameborder="0" allowfullscreen></iframe>

                            </div>
                        </div>
                    </div>
                </div>
            </div>

【问题讨论】:

  • header('X-Frame-Options: GOFORIT');尝试将此标头设置为您的 php 文件或刀片文件
  • 请发布您的代码
  • 您为什么要在您的网页中嵌入频道?您是否尝试嵌入视频或播放列表?
  • @MartinBean 是的,我正在尝试嵌入视频或播放列表

标签: php laravel youtube-channels


【解决方案1】:

试试这个

<iframe width="420" height="315" src="https://www.youtube.com/embed/A6XUVjK9W4o" frameborder="0" allowfullscreen></iframe>

【讨论】:

    猜你喜欢
    • 2011-09-16
    • 2012-01-02
    • 2015-10-16
    • 2010-09-29
    • 2019-02-19
    • 2013-04-16
    • 2021-03-08
    • 1970-01-01
    • 2018-04-22
    相关资源
    最近更新 更多