wrav / oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.
MIT License
36 stars 37 forks source link

Width and height params do not work #35

Closed migplay closed 4 years ago

migplay commented 4 years ago

I am adding the width and height params to make the iframe bigger but it does not work. I got oEmbed plugin last version (1.2.4).

Here is my twig code :

{{
entry.resourceLinkEmbed.render({
                params: {
                  width: 1000,
                  height: 500,
                  autoplay: 1,
                  rel: 0,
                  mute: 0,
                  loop: 1,
                  autopause: 1,
                }
              })
}}

Et voici le code iframe en output :

image

Thanks for help.

reganlawton commented 4 years ago

@migswd firstly thanks for submitting an issue.

Now the Param field is used to modify the URL query string not the iframe params. However it seems this isnโ€™t the case for you at all. Do you have cache enabled by chance? The width is normally controlled by CSS HOWEVER I can update the DOM manipulation to support updating the width and height attributes.

migplay commented 4 years ago

Yes I have cache enabled. I switch it off and I see the url with all params now. image

So to modify width and height I should use css or do that ? entry.fieldname.render|replace('width="600"','width="100%"')|raw

That would be great that you update the plugin to take that manipulation in charge yes :)

reganlawton commented 4 years ago

@migswd you now have the option to override the width and height, see v1.2.5. I'll also be opening an issue / feature where I'll add support to override / set / manage all iframe DOM. attributes to allow overriding of attributes and adding missing / custom attributes as most my issues are managing attributes ๐Ÿ˜…

THanks for opening an issue and hope this fixes your edgecase ๐Ÿ‘

migplay commented 4 years ago

Thats great thank you !!

jdsimcoe commented 4 years ago

Hey @reganlawton previously I had two CSS classes on my iFrame that did formatting with. Now, with oEmbed I'm having trouble figuring out how to add these classes via the API. Is there a way to do this?