Problem/Motivation
See #2881849-15: WSOD with media in core:
We're being encouraged to use media entities instead of file fields directly. Blazy supports file fields but not entity reference fields for media entities.
For example, a new site wanting a "gallery" field would have an entity reference field to reference media entities. The field widget can be an entity browser with a number of widgets for selecting existing entities or creating new ones.
The "Blazy" display formatter is currently not available for this field.
Edit: An example of how it's being tackled with Photoswipe: #2977943: Support Media and Entity References
Proposed resolution
Make Blazy depends on Media, and identify deprecation and removal of VEF/VEM.
To reduce unpredictable by-product issues, the future works with core Media expect a brand new site with core Media without VEM or at least a successful migration from VEF/VEM into core Media. If any side issue due to legacy VEM integration, consider sticking to Blazy 8.x-1.x till you have time budget to migrate.
Remaining tasks
TODO. Let's list thing here. If anyone has been more involved than me with core Media recently, please update, and remove this line.
- #3022743: Create a new branch for core Media
- #2994020: Media field formatter
- #3023230: Add a new Blazy Media oEmbed service
- [x] Deprecate any VEF/VEM integration. Were parts of previous commits.
- [x] Add a new base class for all video-related plugins: BlazyMediaFormatterBase
- [x]
Refine, or splitThis appears irrelevant as we have Vanilla option for advanced formatters like Slick, etc. And the Blazy/ Slick image formatter is still there, only deprecated.BlazyMediaFormatterBaseto support just a Media image without remote video, or oEmbed. Like the good old Image field without extra fields. - [x] Finally, remove VEF/VEM integration
prior topost full release (In case a delay with VEM upgrade path, make it post). This is till still kept to allow transitions fromvideo_embed_fieldto media field.
Irrelevant. This is no blocker.
User interface changes
None.
API changes
Few, but BC is still kept:
BlazyManager::getImage() changed into BlazyManager::getBlazy()
Data model changes
None. VEM already provides upgrade path: #2997799: Include upgrade path from video_embed_field to oEmbed
Release notes snippet
None.
Known issues
Core oEmbed has little room to extend/ modify as of this writing. This causes two known immediate issues which require solutions beyond regular JS or CSS overrides, some extra leg:
- [x] Non-responsive video due to iframe within iframe thingies. Clumsily and temporarily fixed at #3022743: Create a new branch for core Media
- [x] Clicking custom play button with media switcher "Image to iframe" will fail. See #3023345: Image to iframe doesn't autoplay oEmbed video
Comments
Comment #2
gausarts commentedLet's close this, unless anything else to do here.
Comment #3
geek-merlinThis is still an issue, copying over the text.
Comment #4
geek-merlinIn #2977943: Support Media and Entity References, the formatter class is used directly and some new conditions and code paths are added. My gut feeling is that it's cleaner to extend the formatter via inheritance, add a common base class or do code reuse in some other way.
I'm not working on this and might when i need it.
Comment #5
gausarts commentedOops! Sorry about this.
We already have initial work to begin with here:
#2994020: Media field formatter
Comment #6
gausarts commentedComment #7
gausarts commentedComment #8
gausarts commentedComment #9
gausarts commentedWe'll make this to track changes for core Media integrations.
Comment #10
gausarts commentedComment #11
gausarts commentedComment #12
gausarts commentedComment #13
gausarts commentedComment #14
gausarts commentedComment #15
gausarts commentedComment #16
gausarts commentedLet's close this as Alpha4 marks it done with core Media:
https://www.drupal.org/project/blazy/releases/8.x-2.0-alpha4
Any side or by-product issue should not hold this from closing. Thanks!