问题描述
我正计划执行以下操作,以使用frontmatter将youtube视频嵌入grav网站(当前页面仅使用frontmatter,标记文件中没有条目):
rows:
-
title: XYZ
description: 'Something'
description_position: left
image: image.JPG
name: video
-
title: IJK
description: 'Something'
description_position: right
html: '<iframe width="560" height="315" src="https://www.youtube.com/embed/somevideo" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>'
这不起作用。 Grav并没有说这不是有效的前提,但也没有创建iframe。有没有办法在前端使用html inline在YouTube上嵌入视频而没有插件?
解决方法
您可以使用下面的代码
<//iframe style="position:center;bottom:0px;left:0px;height:100%;width:100%" src="https://www.youtube.com/embed/-5wpm-gesOY" frameborder="0" allowfullscreen></iframe>
(// 不使用)
干得好