为什么嵌入来自youtube的视频在我的本地主机上工作,而不是在C盘中
eg: http://localhost/test/test.html (embedded video works )
file:///C:/Users/AUser%20name/Desktop/test/test.html (embedded video does not work)
Run Code Online (Sandbox Code Playgroud)
这是嵌入视频的代码片段
<object width="560" height="315"><param name="movie" value="//www.youtube.com/v/0l-
7IGRsORI?hl=en_US&version=3"></param><param name="allowFullScreen" value="true">
</param><param name="allowscriptaccess" value="always"></param><embed
src="//www.youtube.com/v/0l-7IGRsORI?hl=en_US&version=3" type="application/x-
shockwave-flash" width="560" height="315" allowscriptaccess="always"
allowfullscreen="true"></embed></object>
Run Code Online (Sandbox Code Playgroud)
因为您//在url的开头使用,这意味着您继承了当前使用的协议.在你的主人那是http://(好的),但在你的C驱动器它是file://(坏).
所以只需使用http://而不是//:
<object width="560" height="315">
<!-- See: value="http://.. -->
<param name="movie" value="http://www.youtube.com/v/0l-7IGRsORI?hl=en_US&version=3"></param>
<param name="allowFullScreen" value="true"></param>
<param name="allowscriptaccess" value="always"></param>
<!-- See: src="http://.. -->
<embed src="http://www.youtube.com/v/0l-7IGRsORI?hl=en_US&version=3" type="application/x-shockwave-flash" width="560" height="315" allowscriptaccess="always" allowfullscreen="true"></embed>
</object>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3882 次 |
| 最近记录: |