Hi,

Blazy adds a new field formatter for the Entity reference field when referencing a media entity.
However, it doesn't add a field formatter for rendering oEmbed field directly.

It would be great if a Blazy field formatter is added for the Text (plain) field type when using oEmbed content widget.

The idea is that Blazy can work with oEmbed rendering directly.

Here's an illustration:

Comments

Mohammed J. Razem created an issue. See original summary.

mohammed j. razem’s picture

Issue summary: View changes
gausarts’s picture

I had the same idea at early dev of 2.x, too. I abandoned it for reasons: we already have a working media formatter, and couldn't afford the time to manage potential ramification due to nested Blazy formatters.

The same decision was also reflected at D7 Blazy. I removed Blazy formatters from file entity displays.

However I am happy to get this in if you or anyone else are interested, with patches. Thanks!

rajab natshah’s picture

Nice idea

We could have a filter protection on nesting Blazy formatter selection in view modes

- View mode for a field in Node/Entity ( with entity reference field to media )

  • Do not allow to use Node Blazy formatter, if any field in the view mode is using the blazy formatter in the media display mode.
  • Allow to use Node Blazy formatter, if no fields in the media type is using any blazy formatter ( oembed content with blazy)

Is this the only requirement at this time?

gausarts’s picture

Sorry, I couldn't verify more, but sounds like a good direction. Thank you!

gausarts’s picture

Status: Active » Needs review
StatusFileSize
new12.99 KB

Recently I worked with Embed and CKEditor #3054032: Blazy breaks in ckeditor, and wanted to lazyload the video embedded in CKEditor.
My initial worry with some ramification due to potential conflicts with nested Blazy formatters were proven wrong.

Attached is the initial attempt to make Blazy present at Media display level.

This may require the latest DEV, not sure if applicable to RCs.
The actual working file is BlazyOEmbedFormatter.php, however due to attempts to re-use similar lines, few files are updated.

I didn't test it locally, so I will attend any issue I am not aware of after seeing what the test bot says.
If you have any suggestions or improvements, I will be happy to incorporate them while I can. Thanks!

gausarts’s picture

StatusFileSize
new27.47 KB

A few additional changes:

  • Added minor fixes.
  • Added blazy.preview.css to disable interactive elements such as (remote| file) video within CKEditor iframe.
  • Added third party formatter settings for simple overrides such as file video.
gausarts’s picture

StatusFileSize
new27.6 KB

Doh DRUPAL_ROOT.

  • gausarts committed e5210d9 on 8.x-2.x
    - Added minor fixes.
    - Added blazy.preview.css to disable interactive...
gausarts’s picture

Status: Needs review » Fixed

Let's get the ball rolling. Improvements are very much welcome and may follow as always.

Committed for wider feedback. Feel free to re-open if any (side) issue. Thank you all!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.