Skip to content

Commit

Permalink
updating default youtube tag
Browse files Browse the repository at this point in the history
  • Loading branch information
erikaheidi committed May 1, 2023
1 parent 68cc99f commit 232d2f1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/CustomTagParser/YoutubeCustomTagParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ public function getEmbed(string $tag_value): string
{
$stencil = new Stencil($this->tplDir);

return $stencil->applyTemplate('youtube', [ 'tag_value' => $tag_value ]);
return $stencil->applyTemplate('youtube', [
'tag_value' => $tag_value,
'width' => $this->width,
'height' => $this->height
]);
}
}
9 changes: 6 additions & 3 deletions tpl/youtube.tpl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<div class="relative" style="padding-top: 56.25%">
<iframe class="absolute inset-0 w-full h-full" src="https://www.youtube.com/embed/{{ tag_value }}" frameborder="0"></iframe>
</div>
<iframe width="{{ width }}" height="{{ height }}"
src="https://www.youtube.com/embed/{{ tag_value }}"
title="YouTube video player" frameborder="0"
allow="accelerometer; autoplay; clipboard-write;
encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>
</iframe>

0 comments on commit 232d2f1

Please sign in to comment.