• AZ WIKI

    (@voinichgmailcom)


    Your script set dimensions to div like style="width: 1080px; height: 608px;".
    That makes a really ugly black lines like we can see on youtube.
    I would like to make my video responsive and style with something like width: 100%; height: auto;?
    How can I remove the insert action from adding these attributes?

    I tried to something like this, but it didn’t work:

    `add_filter( 'vjs-poster', 'remove_width_attribute', 10 );
    add_filter( 'image_send_to_editor', 'remove_width_attribute', 10 );
    
    function remove_width_attribute( $html ) {
       $html = preg_replace( '/(width|height)="\d*"\s/', "", $html );
       return $html;
    }`

    https://www.ads-software.com/plugins/video-embed-thumbnail-generator/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kyle Gilman

    (@kylegilman)

    Please post a link to a page on your site demonstrating the problem so I can troubleshoot it. It’s not normal behavior for my plugin to add black bars to a video.

    Thread Starter AZ WIKI

    (@voinichgmailcom)

    Thanks for replay.
    Here is a Video post .

    One video is 1091×490 and the second one is 640×480.
    How can I display those videos without black bars?

    Plugin Author Kyle Gilman

    (@kylegilman)

    The Video.js player doesn’t work the same way unstyled video players do so setting the height to auto won’t work. The plugin needs to be told the aspect ratio of the video, otherwise it defaults to 16×9. Since you’re using the Embed Video from URL tab, the plugin doesn’t have as much information about the dimensions of the video as it would if you had the video in the WordPress Media Library. So in this case you’ll need set it manually.

    The Noah’s Ark video is actually 1280×576. I recommend this shortcode:

    [KGVID poster="https://7ru.org/d/m4v/The-Bible-2013-clips/Noahs-Ark.jpg" width="1280" height="576"]https://7ru.org/d/m4v/The-Bible-2013-clips/Noahs-Ark.mp4[/KGVID]

    For the other video

    [KGVID poster="https://7ru.org/v/The-Annunciation-1984/The-Annunciation-1984.jpg" width="640" height="480"]https://7ru.org/v/The-Annunciation-1984/The-Annunciation-1984.mp4[/KGVID]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Remove Width and Height Attributes and make it responsive?’ is closed to new replies.