FIX: Add support for multiple TikTok aspect ratios (#20064)

This commit is contained in:
Jan Cernik 2023-01-30 18:12:01 -03:00 committed by GitHub
parent 06ad13b517
commit aecd8b1eff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,7 +23,8 @@ module Onebox
end end
def to_html def to_html
height = oembed_data.thumbnail_width >= oembed_data.thumbnail_height ? 727 : 742 video_height = oembed_data.thumbnail_height < 1024 ? 998 : oembed_data.thumbnail_height
height = (323.0 / 576) * video_height
<<-HTML <<-HTML
<iframe <iframe
@ -34,11 +35,12 @@ module Onebox
seamless="seamless" seamless="seamless"
scrolling="no" scrolling="no"
style=" style="
min-width: 332px; min-width: 323px;
height: #{height}px; height: #{height}px;
border: 4px solid #fff;
border-top: 3px solid #fff; border-top: 3px solid #fff;
border-radius: 9px;
background-color: #fff; background-color: #fff;
border-radius: 9px;
" "
></iframe> ></iframe>
HTML HTML