Make YouTube shortcode embeds responsive
Part of T56813
This commit is contained in:
parent
e5b7905a5c
commit
845ba953cb
@ -163,8 +163,11 @@ class YouTube:
|
|||||||
return html_module.escape('{youtube invalid YouTube ID/URL}')
|
return html_module.escape('{youtube invalid YouTube ID/URL}')
|
||||||
|
|
||||||
src = f'https://www.youtube.com/embed/{youtube_id}?rel=0'
|
src = f'https://www.youtube.com/embed/{youtube_id}?rel=0'
|
||||||
html = f'<iframe class="shortcode youtube" width="{width}" height="{height}" src="{src}"' \
|
html = f'<div class="embed-responsive embed-responsive-16by9">' \
|
||||||
f' frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
|
f'<iframe class="shortcode youtube embed-responsive-item"' \
|
||||||
|
f' width="{width}" height="{height}" src="{src}"' \
|
||||||
|
f' frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>' \
|
||||||
|
f'</div>'
|
||||||
return html
|
return html
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user