Skip to content

Commit

Permalink
fix thumbnail height issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
farhan-shafi committed May 20, 2024
1 parent 9057a39 commit 4caa832
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dist/blocks.build.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => 'b67e39318453157e47d3');
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'react-dom', 'wp-api', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-element', 'wp-hooks', 'wp-i18n', 'wp-keycodes', 'wp-notices', 'wp-primitives', 'wp-url'), 'version' => '50a324a7d3f0a901587d');
2 changes: 1 addition & 1 deletion dist/blocks.build.js
Original file line number Diff line number Diff line change
Expand Up @@ -51097,7 +51097,7 @@ function AdvancedVideoBlock(props) {
origWidth: parseInt(parsedCode[1]),
origHeight: parseInt(parsedCode[2]),
width: Math.min(100, parsedCode[1]),
height: parsedCode[2] * Math.min(200, parsedCode[1]) / parsedCode[1],
height: parsedCode[2],
videoLength: timePeriods.reduce(function (sum, part) {
var multiplier = {
W: 604800,
Expand Down
2 changes: 1 addition & 1 deletion dist/blocks.build.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions src/blocks/advanced-video/components.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,7 @@ export function AdvancedVideoBlock(props) {
"snippet.thumbnails.maxres.height",
get(data.items[0], "snippet.thumbnails.high.height", height),
);

const videoWidth = get(
data.items[0],
"snippet.thumbnails.maxres.width",
Expand All @@ -535,9 +536,7 @@ export function AdvancedVideoBlock(props) {
origWidth: parseInt(parsedCode[1]),
origHeight: parseInt(parsedCode[2]),
width: Math.min(100, parsedCode[1]),
height:
(parsedCode[2] * Math.min(200, parsedCode[1])) /
parsedCode[1],
height: parsedCode[2],
videoLength: timePeriods.reduce((sum, part) => {
let multiplier = {
W: 604800,
Expand Down

0 comments on commit 4caa832

Please sign in to comment.