Support » Plugin: WP YouTube Lyte » Videos with different aspect ratios on one website

  • Resolved codifex


    I maintain a website containing many videos from YouTube which have different aspect ratios. In the plugin’s settings I only see one option to set the aspect ratio, which affects all videos on the website.

    Is there any way to set the aspect ratio on a per-video basis? Some of the videos are old and have rather odd aspect ratios. Thank you in advance.

Viewing 1 replies (of 1 total)
  • Plugin Author Optimizing Matters


    you would have to do so using LYTE’s API;

    function lyte_change_ratio($settingsArray) {
    	$settingsArray['ratioClass'] = " fourthree";
    	return $settingsArray;

    alternatively you could get the full LYTE “template” before injection in the_content. suppose you have a video with youtube id VuWc6JZWo6Q in 4:3 but your default size is a 16:9

    function lyte_change_ratio( $template ) {
        if ( strpos( $template, 'VuWc6JZWo6Q' ) !== false ) {
            $template = str_replace( '"lyte-wrapper"', '"lyte-wrapper fourthree"', $template );
        return $template;

    hope this helps,

Viewing 1 replies (of 1 total)
  • The topic ‘Videos with different aspect ratios on one website’ is closed to new replies.