Video Embed Not Displaying Correctly

This topic contains 6 replies, has 2 voices, and was last updated by  Jeff Adams 5 years, 10 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #484763

    Jeff Adams
    Free User
    Post count: 1780

    It used to be that this wasn’t a problem. If I did an “embed” instead of using the URL then the dimensions of the iframe were ignored. Here’s an example of the code. I’ve already corrected it on the listing. I’m sure there’s more with this problem though. There’s advantaged to using embed. 1.) someone may just do it because they think they it will work so ideally it would work 2.) I think embedding may work better for playlists and/or only showing certain videos and not videos from other channels, I could be wrong but I recall something like that. This is the code I used in V1 that wasn’t a problem until V2:

    <iframe width=”560″ height=”315″ src=”https://www.youtube.com/embed/gxInpsAunO4?rel=0″ frameborder=”0″ allow=”autoplay; encrypted-media” allowfullscreen></iframe>

    Attached is an image of what the embed looks like on the listing. It didn’t used to squish videos like this.

    Is this something that can be fixed? If so how? If not I’ll have to find and change all the listings with this issue. And, I’ll have to figure out a way to prevent it from happening, like making sure the add listing page doesn’t use the word embed anywhere. Because on YouTube for example, embed code is called embed and that’s where this came from.

    #484765

    Jeff Adams
    Free User
    Post count: 1780
    This reply has been marked as private.
    #484795

    Alex Rollin
    Moderator
    Post count: 27815

    No, there isn’t a way to auto-fix it if someone enters a weird/incorrect dimension.

    https://wpgeodirectory.com/docs-v2/places/custom/#textarea

    Tip: Try instructing your users with the “Field Description” that they should simply “Use the simple URL, as opposed to an iFrame or oEmbed like: https://www.youtube.com/watch?v=jX38T-ZmATI”

    #485155

    Jeff Adams
    Free User
    Post count: 1780

    Thanks Alex, but apparently you don’t understand the problem. Nothing about what I’m telling you is “weird” or “incorrect”. Here’s why:

    Go to a video on YouTube and click “share”. The first option is “embed”. The embed automatically defaults to those dimensions that you call weird. This was not a problem in GD V1. V2 breaks this somehow presumably causing every listing in every GD site that used this embed code to show videos all crazy squished.

    There’s nothing weird about 560 by 315, that is a stand ratio for video.

    The attached images show what I am talking about. Yes, I can try to instruct people to only use the share link and not use the embed code. But, that may not prevent it from happening, doesn’t fix all the listings that used embed, and takes away the benefit from using embed (because if I recall correctly there was some in regard to either playlists and/or showing channel videos instead of random videos). And embed gives more options (e.g. player controls, privacy…) than the link.

    #485224

    Alex Rollin
    Moderator
    Post count: 27815

    We continue to improve and change GDV2 and some of the changes may involve a time of transition and adjustment and I think that applies to this issue.

    It is recommended that site visitors do not use embed code because it removes control from the site owner for the style and presentation of the videos. Many additional 3rd party plugins are available for working with oEmbed, and GD is relying on WP functionality built into WP core.

    If users submit iframes (embed code), then the video is not handled with the WP built in embed functions and there may be conflicts in styles that result in poor presentation of the video.

    In this case I can provide an example of CSS that could be applied to at least make sure that the video container is ‘expanded’ to fill the area, but, this is only a stop-gap in moving towards oEmbed handling which is engaged by entering the media URL only.

    
    
    
    .geodir_post_meta iframe {
        max-width: 100%;
        position: absolute;
        height: 100%;
        width: 100%;
    }
    
    #485981

    Jeff Adams
    Free User
    Post count: 1780

    I tried this CSS for a different reason, to see if it would help with embedding code into the description. There’s an option to allow embed for the custom field description. This did not help.

    Then I tried to see if your CSS would help with the original reason you shared it, embed code for video field. This had disastrous effects, see image.

    I have a lot of listings on this site. It’s going to take a long time to go through each one to find if it was embedded or just a link and change accordingly. This is just another thing holding me back from using this site, these plugins, man, I’ve lost so much time. I wish I could just get to a point where I could actually use GD. For years now I’ve been trying and I’m constantly held back 🙁

    #485987

    Jeff Adams
    Free User
    Post count: 1780
    This reply has been marked as private.
Viewing 7 posts - 1 through 7 (of 7 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount