craft-embedded-assets icon indicating copy to clipboard operation
craft-embedded-assets copied to clipboard

Updating to Embed 4

Open ttempleton opened this issue 4 years ago • 2 comments

Currently, Embedded Assets uses Embed 3, due to Craft 3's minimum requirement of PHP ~~7.0~~ 7.2.5 (as of Craft 3.6), and Embed 4's minimum requirement of PHP 7.4. Craft 4 will be updating the minimum PHP requirement to 7.4, though, so we'll be able to update Embed for the Craft 4 version.

ttempleton avatar Nov 09 '20 10:11 ttempleton

@ttempleton is there a feature branch that implements Embed 4 that can be dropped in as a fix for Youtube-consent-banner for people that are on php7.4?

toyflish avatar Apr 21 '21 13:04 toyflish

Working on this in the enhancement/embed-4 branch. It's fairly basic at the moment, and most plugin settings and the BeforeCreateAdapterEvent's dispatcherConfig property aren't being used yet (hopefully we'll be able to keep most of them, but some may need to be removed).

Some embedded asset properties from Embed 3 aren't provided by Embed 4, so they won't be available for newly-saved embedded assets (though existing embedded assets with these properties will continue to work). These are:

  • type
  • tags
  • images
  • imageWidth
  • imageHeight
  • providerIcons

ttempleton avatar Dec 02 '21 11:12 ttempleton

Any news on this one? :-)

arifje avatar Dec 01 '23 09:12 arifje

I'd like to start off this comment by acknowledging that it's been a long time since I opened this issue, that this should have been completed a while ago, and I do apologise for that.

Work stalled on this due to some functionality from Embed 3 that was not included in Embed 4 at the time I was actively working on it. I'm unsure if all of that functionality is still missing, but I've had plans to revisit that and figure out what needs to be done e.g. either working on pull requests or forking the Embed project for the functionality we need. I'm unlikely to have time in the next week or two to work on it, but I definitely want to finish it sooner rather than later, and in particular, finish it before we need to start work on upgrades for Craft 5.

ttempleton avatar Dec 01 '23 10:12 ttempleton

Do you happen to have any updates on this? Unfortunately, using Embed v3 causes a dependency error with another plugin I'm using that requires Embed v4.

benfeather avatar Feb 23 '24 02:02 benfeather

Same situation. Please let us know if the upgrade is not possible so we can move on to another solution.

scandella avatar Feb 23 '24 07:02 scandella

I have just released Embedded Assets 4.0.0-beta.1, for Craft 4 (4.7.0 or later), using Embed 4.

I want to firstly point out that this has been released as a beta because I am not currently able to test some plugin settings (e.g. embed.ly/iframely keys) and therefore cannot confirm that they work; and I am also pretty sure that the Google API key setting does not currently work, due to Embed 4 not supporting rich Google embeds as far as I can tell (or, if it does, I have overlooked how to do it). I may need to work on a Google Maps extractor at some point in the future.

It would be very much appreciated if anyone is willing to try out the release and let me know of any issues. If you choose to try it, you should familiarise yourself with the changes in this release, and the properties of BeforeRequestEvent if you were previously using BeforeCreateAdapterEvent. I have tried to make as many Embed 4 settings available to that event as possible; if I have missed anything, please let me know, and I will add it.

I will close this issue now, but if you have any questions about the new release, please let me know here, and if you find a bug, please open a new issue.

ttempleton avatar Feb 28 '24 10:02 ttempleton

I've also just released 5.0.0-beta.1, for Craft 5, with the same usage of Embed 4, and the same caveats as mentioned above with certain plugin settings that I am unable to test.

ttempleton avatar Mar 01 '24 08:03 ttempleton

I've been using the plugin on both a v4 and a demo v5 site for YouTube videos, and it's working well so far. Thank you for updating your plugin, it's an invaluable addition to Craft CMS!

benfeather avatar Mar 04 '24 02:03 benfeather

Twitter/X embeds don't seem work after updating;

#17 {main} {"memory":6936968,"exception":"[object] (Embed\\Http\\NetworkException(code: 47): Maximum (10) redirects followed at /var/www/xxx/cms/vendor/embed/embed/src/Http/CurlDispatcher.php:165)"} 
2024-04-11 15:17:36 [web.INFO] [application] Request context:
$_GET = [
		'p' => 'admin/actions/embeddedassets/actions/preview'
		'showContent' => '1'
		'callback' => 'embeddedassetsbt9f8g5ocde7'
		'url' => 'https://twitter.com/Rhevolver/status/1778271017699291366'
]

Found a related issue; https://github.com/oscarotero/Embed/issues/531

arifje avatar Apr 11 '24 13:04 arifje