• Resolved fleety88

    (@fleety88)


    Hi, looking for some help.
    I’m using a theme that uses WP Bakery and am using short codes to call videos from the media hub.
    When i add the short code into an WPbakery raw html element(block)
    the pre-load looks like this How it looks
    This would be fine if it wasn’t a 9:16 video (all videos on this site are 9:16
    When the video is played, presto player loads the correct size and functions as expected. plays correct aspect ratio

    Is there a way i can get the initial view to load 9:19 with the correct dimension?
    Many thanks!

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @fleety88

    You can try setting the aspect ratio for your video using the following code snippet.

    add_action(‘wp_footer’, function () { ?>
    <script>
    jQuery(function() {
    if (!wp || !wp.hooks) return;
    wp.hooks.addFilter(‘presto.playerSettings’, ‘pp-set-aspect-ratio’, function(settings) {
    settings.ratio = ‘9:19’;
    return settings;
    });
    });
    </script>
    <?php });

    You need to add this function to the child theme’s functions.php. As of now, the Aspect ratio is set to 9:19, you can also set it according to your needs.

    I hope that helps. Please let us know if you have other questions.

    Thread Starter fleety88

    (@fleety88)

    Thanks for the fast response!
    I pasted the snippet into the functions.php of my child theme as suggested and i got a critical error.
    Is there a different way i can approach this?

    Hello @fleety88

    That is unusual since we used that code many times.

    How about your WP Bakery is there a way or settings they can change the aspect ratio?

    If not, try this again –

    add_action(‘wp_footer’, function () { ?>
    <script>
    jQuery(function() {
    if (!wp || !wp.hooks) return;
    wp.hooks.addFilter(‘presto.playerSettings’, ‘pp-set-aspect-ratio’, function(settings) {
    settings.ratio = ’16:9′;
    return settings;
    });
    });
    </script>
    <?php });

    Make sure to have no spaces or additional characters added.

    I hope that helps. Please let us know how it goes.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Player loads incorrect size on page before playing’ is closed to new replies.