Responsive YouTube videos
This commit is contained in:
parent
54ddebbe81
commit
346e11b486
|
@ -9,3 +9,16 @@ main
|
|||
|
||||
img
|
||||
@extend .img-responsive
|
||||
|
||||
.embed-container
|
||||
padding: 56.25% 0 0
|
||||
position: relative
|
||||
width: 100%
|
||||
|
||||
iframe,
|
||||
embed
|
||||
height: 100%
|
||||
left: 0
|
||||
position: absolute
|
||||
top: 0
|
||||
width: 100%
|
||||
|
|
|
@ -30,7 +30,9 @@ class YouTubeExtension extends Twig_Extension
|
|||
public function embedCode($videoId)
|
||||
{
|
||||
return sprintf(
|
||||
'<iframe width="560" height="315" src="https://www.youtube.com/embed/%s" frameborder="0" allowfullscreen></iframe>',
|
||||
'<div class="embed-container">
|
||||
<iframe src="https://www.youtube.com/embed/%s" frameborder="0" allowfullscreen></iframe>
|
||||
</div>',
|
||||
$videoId
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue