• hello,
    i want to make a specific height and width of the video player in the posts.
    there is any way to do that for all the players? like somthing in css?
    now, im using the wordpress built in player and the jw player.
    there is somthing to do?

Viewing 1 replies (of 1 total)
  • Hi ron regev,

    For the built in WordPress players, it’s usually an embed code that WordPress inserts. They’re shortcodes in other words. And you can customize the width and height by adding the appropriate parameters to the shortcode.

    There’s more about embeds here on the Codex and this is an example of a youtube video I inserted with the WordPress player when viewed on the text-editor’s “text” tab, not “visual”.

    [embed width="123" height="456"]https://www.youtube.com/watch?v=dQw4w9WgXcQ[/embed]

    Since the embeds are iframes, you won’t be able to change much via the Css although you can try with !important ( I wouldn’t advise this for future maintenance ), hence why I recommend taking advantage of the shortcodes.

    It looks like someone on that external tutorial had some luck just setting a max-width 100% on the Css instead. I’d say that’s a better bet than using !important.

    It also looks like there’s a way to set the widths via PHP as well. There’s an external tutorial on how to do it but it’s basically like this in your functions.php file:

    if ( ! isset( $content_width ) ) $content_width = 600;

    Hope that helps!

Viewing 1 replies (of 1 total)
  • The topic ‘there is any way to control the video size in the posts?’ is closed to new replies.