插入已有链接的视频
其实文章中插入视频,只需要一个播放器或者一个iframe的标签,然后标签吐出给浏览器渲染即可。
这里给出iframe的示例(链接一定要可以播放),其实代码和上边的差不多
<iframe width="560" height="315" src="https://cloud.tsinghua.edu.cn/f/850e344d8f0740d5be60/" frameborder="0" allowfullscreen></iframe>
两个效果视频:
对于如何获取链接,可以用图库(如果不限制格式的话)
其次可以用优酷视频、腾讯视频上传,建议优酷,会给出直接的链接,并且没有广告(我测试是没广告)(并且在优酷里看是有广告的,骄傲一下先)
给出的代码:
<iframe height=498 width=510 src='https://player.youku.com/embed/XNDgxNjMyODEyMA==' frameborder=0 'allowfullscreen'></iframe>
效果如下:
至于腾讯,上边那个格式太丑,可以换一种,
<iframe frameborder="0" width="100%" height="450" src="http://v.qq.com/iframe/player.html?vid=腾讯视频给出的11为视频ID&" auto=0 allowfullscreen></iframe>
效果如图:
PS:iframe 元素会创建包含另外一个文档的内联框架(即行内框架)。auto=0 函数说明:1为自动播放;0为不自动播放。width="400" height="360″是视频的大小,可根据需要修改。
最后一次更新于2020-08-30
0 条评论