Any way to omit dimensions, or specify fluid ones?

Using the embed component, we are stuck with whatever dimensions are embedded in the 'html' field, as there may be other sources rather than youtube, and splitting a URL to add /embed/ to a path is prone to error.

Is there any way we can just get the embed link sans dimensions? Maybe even just the embed URL exposed 'kind of like the author_url?'

Hey @mark, thanks for reaching out

What sort of field is author_url in your repo?

The Embed field doesn't have the option to allow you to edit the content of the URL. In this case, you have two options.

  • Paste the embed directly into a Prismic field with the modified URL and then render it as raw HTML:
  • The other option would be to get the iframe from the Embed field and then parse the string to modify the dimensions.

Author_url is a field that prismic parses from the embed link to the creators channel. Since there's 'magic' happening for that, I figured it'd be simple enough to just expose an embed html link that uses 'with=100%' etc, or allows dimensions (or aspect ratio) to be used.

Using an embed to a YouTube video that's 200px wide doesn't really help me.

Ok, I see. In that case, yes, the custom HTML field would be the best option to customize the output of the URL. There isn't a straightforward path to changing Youtube's default settings in the URLs or iframes.

We've had similar discussions about this in the past, here's an example:

I'm trying to use the htmlSerializer, but it doesn't seem to be affecting the output at all...

Ok, I see, so you're trying to parse the Embed from a Rich Text field rather than an Embed field alone.
I'm interested to see how you build your serializer and how you're using it in your Rich text helper component. Maybe the problem comes from the code.

Do you have access to this info?

The fields I'm getting are coming from Prismic's embed component. I can get the iFrame HTML directly by doing, but it has the dimensions baked into the iframe code. If I use I get the URL, but the iFrame has to come from* - not the direct link. I'm not sure how Prismic is using oEmbed to generate that embed code. I just wish there was a field or option to omit or specify fluid values. It seems like an easy thing to do.