sdk icon indicating copy to clipboard operation
sdk copied to clipboard

Add a way to pass iframe options

Open Kikobeats opened this issue 4 years ago • 2 comments

The Microlik API iframe query parameter accepts an object, being that the option to be passed in order to customize the iframe dimensions

{
 "maxwidth": 350,
 "maxheight": 200
}

Need to find an affordable way to pass these option from Microlink SDK to Microlink API

Kikobeats avatar Jul 15 '20 16:07 Kikobeats

Hey @Kikobeats, also came here looking for something like this. It has been the only major problem for us while using Microlink, so maybe I can share the problem that we have run into:

When designing for mobile web, or really big screens, we need to be able to control the dimensions while maintaining the aspect ratio or overriding it. So, when previewing videos, like on Youtube or Vimeo: we'd like to default to the aspect ratios that they specify in their oEmbed urls. In those cases, an ability to specify a maxWidth would be great.

Alternatively, do you think for iFrames, there should be a way where the React component takes 100% of the container width and the users just control the container themselves?

Hope this helps!

oyeanuj avatar Jul 15 '20 17:07 oyeanuj

In general, style an iframe is hard.

This issue should be to address at least the possibility to customize iframe options.

That should help you to adapt the response according to your use case, but it isn't a complete solution because the support of these options depends on the provider

Screenshot 2020-07-15 at 19 56 36

Even we implement an affordable way to pass the iframe parameters through Microlink API, a subset of providers will be not support this customization (and that's ok).

I feel if you want to have granular control over this you need to wrap the embed in another higher component order

Kikobeats avatar Jul 15 '20 18:07 Kikobeats