Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events
SOLVED

Extending Embed component!

Avatar

Level 6

I was following this git repo for extending the Embed core component. Extension of the Embed component is possible by providing any of the following: 

  • Custom URL Processor
  • Custom oEmbed Configuration
  • Custom embeddable fragment

The custom oEmbed configuration, I tried adding a new config in Core Components oEmbed client with the following values.

 

vimeo.PNG

 

When I try to enter a URL like https://vimeo.com/76979871 I get a message that this URL is not supported and a 404 response in the network tab for that request.

The request URL: http://localhost:4502/content/project_name/_jcr_content/root/container/container/embed.urlProcessor.json?url=https://vimeo.com/7697987

Did I miss something here, could someone help!

 

Also how can use the custom URL processor for vimeo? 

 

 

 

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi @jezwn,

Could this be the issue?  

Selection_159.png

View solution in original post

3 Replies

Avatar

Correct answer by
Level 10

Hi @jezwn,

Could this be the issue?  

Selection_159.png

Avatar

Level 6

Hi @Theo_Pendle 

That was one thing for sure when I checked now. The other thing was the URL scheme, I changed the scheme from https://vimeo.com/* to https://vimeo.com/.* . I'm quite not sure the significance of this dot.
Thanks

 

Avatar

Level 10

Hi, I'm happy you found the issue the scheme is in regex format, not glob. The dot means "any character" and the star means "0 or more times".

A great site for testing regex expressions is regex101.com

Also: I from a security perspective I recommend being as restrictive as possible to make sure people can't abuse the URL scheme. I don't recommend using the dot wildcard since that would let people link to http://vimeo.com/whatever-they-want for example restrict the pattern to allow only video IDs! I'm on my phone right now so it's hard to write regex but try the website I gave you, it has a validator and all the information about regex syntax.