如何在HTML页面上显示YouTube视频? [英] How to display youtube video on HTML page?

查看:200
本文介绍了如何在HTML页面上显示YouTube视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

第一个嵌入的src youtube视频链接是

First embeded src youtube video link is

 <html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title></title>
</head>
 <body>
<div>
    <object width="218" height="137"><param name="movie" value="http://www.youtube.com/v/jpiU5Y8luOQ&hl=en_US&fs=1&"></param>
        <param name="allowFullScreen" value="true"></param>
        <param name="allowscriptaccess" value="always"></param>
        <embed src="http://www.youtube.com/v/jpiU5Y8luOQ&hl=en_US&fs=1&" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="218" height="137">
    </embed>
    </object>
</div>
</body>
</html>

第二个嵌入式src视频链接为

Second embeded src Video link is

 <html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<div>
    <object width="218" height="137"><param name="movie" value="http://www.youtube.com/watch?v=LwkeMx_OJxg&feature=related">
        <param name="allowFullScreen" value="true"></param>
        <param name="allowscriptaccess" value="always"></param>
        <embed src="http://www.youtube.com/watch?v=LwkeMx_OJxg&feature=related" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="218" height="137">
        </embed>
    </object>
</div>
</body>
</html>

第一个HTML鳕鱼在浏览器上显示视频文件,但第二个未显示。由于视频文件类型不同,第二个不能显示吗?请
指导我该怎么做。

The first html cod display video file on browser but the second didn't display. Can't the second one dispaly due to different video file type? Please guide me how to do.

                                            Thanks in advance


推荐答案

在第二个嵌入中,您将对象直接链接到观看页面,这不是有效的视频。您要为它提供一个文本/ html页面,而不是视频。

On the second embed, you're linking the object directly to the watch page, which is not a valid video. You're providing it with a text/html page, not a video.

您可以在第二个IFrame中使用此IFrame,并根据需要调整高度/宽度:

You can use this IFrame for the second one, and adjust the height/width as needed:

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

这篇关于如何在HTML页面上显示YouTube视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆