From aecd8b1effa1cdf900830fdc05be8d90a631db66 Mon Sep 17 00:00:00 2001 From: Jan Cernik <66427541+jancernik@users.noreply.github.com> Date: Mon, 30 Jan 2023 18:12:01 -0300 Subject: [PATCH] FIX: Add support for multiple TikTok aspect ratios (#20064) --- lib/onebox/engine/tiktok_onebox.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/onebox/engine/tiktok_onebox.rb b/lib/onebox/engine/tiktok_onebox.rb index 6821c8824c9..d015479c924 100644 --- a/lib/onebox/engine/tiktok_onebox.rb +++ b/lib/onebox/engine/tiktok_onebox.rb @@ -23,7 +23,8 @@ module Onebox end 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