diff --git a/frontends/ycdl_flask/templates/channel.html b/frontends/ycdl_flask/templates/channel.html index 83d9c26..10dec73 100644 --- a/frontends/ycdl_flask/templates/channel.html +++ b/frontends/ycdl_flask/templates/channel.html @@ -67,6 +67,26 @@ display: none; flex-direction: column; } + +/* +Thank you SimonSimCity +https://stackoverflow.com/a/35153397 +*/ +.video_iframe_holder +{ + position: relative; + width: 100%; + height: 0; + padding-bottom: 56.25%; +} +.video_iframe_holder iframe +{ + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; +} @@ -202,10 +222,10 @@ function toggle_embed_video(video_id) var video_card = document.getElementById("video_card_" + video_id); var show_button = video_card.getElementsByClassName("show_embed_button")[0]; var hide_button = video_card.getElementsByClassName("hide_embed_button")[0]; - var embeds = video_card.getElementsByTagName("iframe"); + var embeds = video_card.getElementsByClassName("video_iframe_holder"); if (embeds.length == 0) { - var html = `` + var html = `
` var embed = html_to_element(html); video_card.appendChild(embed); show_button.classList.add("hidden");