在没有iframe的情况下嵌入HTML5 YouTube视频? [英] Embed HTML5 YouTube video without iframe?

查看:184
本文介绍了在没有iframe的情况下嵌入HTML5 YouTube视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在不使用iframe的情况下嵌入html5版本的youtube视频?

这里是嵌入不带iFrame:

 < ; float:none; clear:both; margin:2px auto;> < embed src =http://www.youtube.com/v/GlIzuTQGgzs?version=3&amp;hl=zh_CN&amp;rel=0&amp;autohide=1&amp;autoplay=1wmode = transparenttype =application / x-shockwave-flashwidth =100%height =100%allowfullscreen =truetitle =Adobe Flash Player>< / div>  

b

 < iframe width =854height =510src =// www.youtube.com/embed/GlIzuTQGgzsframeborder =0allowfullscreen><< ; / iframe>  



就HTML5而言, code>< object> 标签就像这样(更正):

< object style =宽度:100%; HEIG ht:100%; width:820px;身高:461.25px; float:none;明确:两者; margin:2px auto;data =http://www.youtube.com/embed/GlIzuTQGgzs>< / object>


Is it possible to embed an html5 version of a youtube video without using an iframe?

解决方案

Here is a example of embedding without an iFrame:

<div style="width:100%;height:100%;width: 820px; height: 461.25px; float: none; clear: both; margin: 2px auto;">
  <embed src="http://www.youtube.com/v/GlIzuTQGgzs?version=3&amp;hl=en_US&amp;rel=0&amp;autohide=1&amp;autoplay=1" wmode="transparent" type="application/x-shockwave-flash" width="100%" height="100%" allowfullscreen="true" title="Adobe Flash Player">
</div>

compare to regular iframe "embed" code from YouTube:

<iframe width="854" height="510" src="//www.youtube.com/embed/GlIzuTQGgzs" frameborder="0" allowfullscreen></iframe>

and as far as HTML5 goes, use <object> tag like so (corrected):

<object style="width:100%;height:100%;width: 820px; height: 461.25px; float: none; clear: both; margin: 2px auto;" data="http://www.youtube.com/embed/GlIzuTQGgzs">
</object>

这篇关于在没有iframe的情况下嵌入HTML5 YouTube视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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