在 html 中嵌入视频会导致操作取消



我正在尝试将佳能 D 中的 youtube 音乐视频嵌入到我的 html 代码中,但它显示操作被取消。前提是嵌入的代码是直接从 youtube 嵌入代码复制的。

优酷嵌入代码:

    <iframe width="560" height="315" src="//www.youtube.com/embed/EW8XHKqz7Jg" frameborder="0" allowfullscreen></iframe>

有什么想法可以帮助我吗?注意:我使用 dreamweaver CC 嵌入这个,页面中的其余代码是这个

Html Page Code:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Personal Website</title>
<link rel="stylesheet" type="text/css" media="screen" href="WebMe.css">
</head>
<body>
<h1>The Other Side Of Me</h1>
    <div id="mainnav">
    <ul>    
        <li><a class="nav1" href="AboutMe.html">About Me</a></li>
        <li><a class="nav2" href="ShowCase.html">ShowCase</a></li>
        <li><a class="nav3" href="Hobby.html">Hobby</a></li>
        <li><a class="nav4" href="Contact.html">Contact</a></li>
    </ul>   
    </div>
<div id="bio">
        <h2 class="header">Hobby</h2>
        <p class="concenter">One of my hobby is playing music, below is one of my favourite piano piece</p>
        <figure id="showpic"><img src="image/Canon1.png" class="Fleft" width="300" height="500" alt="canon1"/></figure>
        <figure id="showpic"><img src="image/Canon2.png" width="300" height="500" alt="Canon2"/></figure>
        <p class="concenter">Canon in video varies from music sheet</p>
        <iframe width="560" height="315" src="//www.youtube.com/embed/EW8XHKqz7Jg" frameborder="0" allowfullscreen></iframe>
    </div>
</body>
</html>

我想澄清一下,实际上"//"方法将在您正在查看页面的协议上加载外部资源。

如果您在https上

查看自己的网页,它将在https上加载外部URL。

如果您在 http 上加载

您的网页,它将在 http 上加载 youtube。

关于您的实际问题,这篇 stackoverflow 帖子似乎更详细地涵盖了您的问题:Chrome 开发者工具中资源的状态=已取消是什么意思?

我不知道

为什么嵌入会从生成的代码中省略http://部分。它应该是

<iframe width="560" height="315" src="http://www.youtube.com/embed/EW8XHKqz7Jg" frameborder="0" allowfullscreen></iframe>

最新更新